Fun with Bugs #46 – On Some Bugs I’ve Reported During the Year of 2016

It’s time to summarize the year of 2016. As a kind of a weird summary, in this post I’d like to share a list of MySQL bug reports I’ve created in 2016 that are still remaining “Verified” today:Bug #79831 – “Unexpected error message on crash-safe slave with max_relay_log_size set”. According to Umesh this is not repeatable with 5.7. The fact that I’ve reported the bug on January 4 probably means I was working at that time. I should not repeat this mistake again next year.Bug #80067 – “Index on BIT column is NOT used when column name only is used in WHERE clause”. People say the same problem happens with INT and, what may be even less expected, BOOLEAN columns.Bug #80424 – “EXPLAIN output depends on binlog_format setting”. Who could expect that?Bug #80619 – “Allow slave to filter replication events based on GTID”. In this feature request I’ve suggested to implement filtering by GTID pattern, so that we can skip all events originating from specific master on some slave in a complex replication chain.Bug #82127 – “Deadlock with 3 concurrent DELETEs by UNIQUE key”. It’s clear that manual is not even close to explaining how the locks are really set “by design” in this weird case. See comments in MDEV-10962 for some explanations. Nobody from Oracle event tried to really explain how things are designed to work.Bug #82212 – “mysqlbinlog can produce events larger than max_allowed_packet for mysql”. This happens for encoded row-based events. There should be some way to take this overhead into account while creating binary log, IMHO.Bug #83024 – “Internals manual does not explain COM_SLEEP in details”. One day you’ll see Sleep for some 17 seconds logged into the slow query log, and may start to wonder why…Bug #83248 – “Partition pruning is not working with LEFT JOIN”. You may find some interesting related ideas in MDEV-10946.Bug #83640 – “Locks set by DELETE statement on already deleted record”. This case shows that design of locking in InnoDB does produce really weird outcomes sometimes. This is not about “missing manual”, this is about extra lock set that is absolutely NOT needed (a gap X lock on a record in the secondary unique index is set when the same transaction transaction already has the next key lock on it). As a side note, I keep finding, explaining and reporting weird or undocumented details in InnoDB locking for years, still my talk about InnoDB locks was not accepted by Oracle once again for OOW in 2016. What do I know about the subject and who even cares about those locks… Bug #83708 – “uint expression is used for the value that is passed as my_off_t for DDL log”. I was really shocked by this finding. I assumed that all uint vs unsigned long long improper casts are already found. It seems I was mistaking.Bug #83912 – “Time spent sleeping before entering InnoDB is not measured/reported separately”. The use case that led me to reporting this bug is way more interesting than the fact that some wait is not instrumented in performance_schema. You may see more related bug reports from me next year.Bug #83950 – “LOAD DATA INFILE fails with an escape character followed by a multi-byte one”. This single bug (and related bugs and stories) were original topic for issue #46 of my “Fun With Bugs” series. I was not able to write everything I want properly over last 3 weeks, but trust me: it’s a great story, of “Let’s Make America Great Again” style. With the goal for LOAD DATA to behave exactly as INSERT when wrong utf8 data are inserted, Oracle changed the way LOAD DATA works back and forth, with the last change (back) happened in 5.7.17: “Incompatible Change: A change made in MySQL 5.7.8 for handling of multibyte character sets by LOAD DATA was reverted due to the replication incompatibility (Bug #24487120, Bug #82641)”I just can not keep up with all the related fun people have in replication environments thanks to these ongoing changes… It’s incredible.Bug #84004 – “Manual misses details on MDL locks set and released for online ALTER TABLE”. Nothing new: locks in MySQL are not properly/completely documented, metadata locks included. yes, they are documented better now, after 11+ years of my continuous efforts (of a kind), but we are “not there yet”. I am still waiting for a job offer to join MySQL Documentation Team, by the way :)Bug #84173 – “mysqld_safe –no-defaults & silently does NOT work any more”. Recent MySQL 5.7.17 release had not only given us new Group Replication plugin and introduced incompatible changes. In a hope to fix security issues it comes with pure regression – for the first time in last 11 years mysqld_safe –no-defaults stopped working for me! By the way, mysqld_safe is still NOT safe in a sense that 5.7.17 tried to enforce, and one day (really soon) you will find out why.Bug #84185 – “Not all “Statements writing to a table with an auto-increment…” are unsafe”. If you do something like DELETE FROM `table` WHERE some_col IN (SELECT some_id FROM `other_table`) where `table` has auto_increment column, why should anyone care about it? We do not generate the value, we delete rows… This bug report was actually created by Hartmut Holzgraefe and test case comes from Elena Stepanova (see MDEV-10170). I want to take this opportunity to thank them and other colleagues from MariaDB for their hard work and cooperation during the year of 2016. Thanks to Umesh (who processed most of my bug reports),  Sinisa Milivojevic and Miguel Solorzano for their verifications of my bug reports this year.In conclusion I should say that, no matter how pointless you may consider this activity, I still suggest you to report each and every problem that you have with MySQL and can not understand after reading the manual, as a public MySQL bug. Now, re-read my 4 years old post on this topic and have a Happy and Fruitful New Year 2017!

Fun with Bugs #43 – Bugs Fixed in MySQL 5.7.13

For some reason I do not see numerous public announcements about recent MySQL 5.7.13 release, even though it happened a couple of days ago formally. Maybe that’s because we do not have any really “big” new features in this release (new ->> operator for introduced though for those who, unlike me, care about JSON). Still there are many fixes for bugs previously reported by Community (or Oracle engineers, but still in public bugs database), and I’d like to discuss some of them.Let me start with the bug that was NOT fixed though, Bug #81093, “mysqld_multi not included in mysql-community-server package”, reported by Georgi Iovchev and verified by Umesh. For this bug we had not got any fix, but explanation of this kind:”On platforms for which systemd support is installed, systemd has the capability of managing multiple MySQL instances. For details, see Configuring Multiple MySQL Instances Using systemd. Consequently, mysqld_multi and mysqld_multi.server are not installed because they are unnecessary.”I still think that removing familiar scripts like mysqld_safe or mysqld_multi from systems where they are not used by default to start services upon OS startup is a mistake that has to be corrected.I’d like to highlight Bug #80299, “DEFAULT is not deterministic and should not be allowed in generated columns”, also. It was reported by Roy Lyseng and verified by Umesh.The fix is not those bug’s synopsis suggested. Instead, ALTER TABLE operations that change the definition of a column now cause a table rebuild if any generated column expression uses DEFAULT().Now let’s concentrate on InnoDB bugs fixed:Bug #80898 – “Replication stops after transaction is rolled back asynchronously in master”. It was reported by Debarun Banerjee (who probably works on group replication feature in Oracle). I wonder how this fix may influence Galera-based cluster, especially PXC 5.7 from Percona that may become available as GA some day. Something to check later.Bug #80772 – “Excessive memory used in memory/innodb/os0file starting 5.7.8”. This regression bug was reported by Morgan Tocker and verified by Umesh.Bug #80761 – “Server crashed in mutex_create due to invalid option”. It was reported by Allen Lai. It’s not clear who could verify it, but the problem is fixed now.Bug #80708 – “Problem importing encrypted tablespace”. It was reported by my former colleague Sergei Glushchenko from Percona and verified by Umesh.Bug #80669 – “Failing assert: fil_space_get(table->space) != __null in line 724”, was also reported by Percona employee and great, hard working QA engineer, Ramesh Sivaraman. As most of the bugs from Community, it was immediately (in 44 minutes!) verified by Umesh.Bug #80667 – “innobase_get_computed_value(dtuple_t const*, dict_v_col_t const*, dict_index_t c”. It was reported based on failing test case runs by Viswanatham Gudipati, who works for Oracle. Bug #80327 – “InnoDB: Failing assertion: !(rec_get_info_bits(rec2, comp) & 0x10UL)”, was reported by Erlend Dahl from Oracle based on numerous failures of innodb_gis.rtree_purge test. I am really happy to see Oracle engineers reporting test failures in public, even when they happen to 5.8 (a three that we, Community, may not have access to at the moment). This is exactly what I was fighting for since I started this blog in 2012.Bug #80261 – “Invalid InnoDB FTS Doc ID during INSERT”. This bug was reported by Monty Solomon and promptly verified by Umesh. The bug is fixed, but release notes do not mention it explicitly. There are bugs even in release notes, we should live with that.Bug #80182 – “Unsupported extension error for new features while ‘create table like'”. This bug was reported by yet another great QA engineer and my former colleague in Percona, Shahriyar Rzayev. As usual, it was promptly verified by Umesh.Bug #79330 – “DROP TABLESPACE fails for missing general tablespace *.ibd file”, was reported by Daniel Price who works for Oracle and verified by Marko Mäkelä.Bug #78761 – “Unexpected deadlock with innodb_autoinc_lock_mode=0”. It was reported by Yiftach Kaplan and verified by Miguel Solorzano.Bug #77011 – Hanging “System Lock” when executing “flush table … for export”, was reported by Vincent Meng and verified by Umesh. It is also fixed in MySQL 5.6.31.Now let’s proceed with replication bugs that were fixed:Bug #78999 – “Injected query log events do not set explicit_defaults_ts, read it on applying”, was reported by great Laurynas Biveinis from Percona and verified by Umesh. It was a regression introduced by the fix for Bug #72794.Bug #78995 – “Binlog_sender::read_event may access freed event buffer”. Yet another bug reported by Laurynas Biveinis and immediately verified by Umesh. Percona engineers did a great QA job while working on Percona Server 5.7 GA release, and we see that Oracle fixes their bugs reported back then…Bug #78467 – “mysqldump –dump-slave does not work with multi-source”. It was reported by Sven Sandberg. I think that bugs of this kind should not even appear with proper design for new features and, in any case, they have to be fixed before GA release, so that it is at least feature complete. But what do I know…Bug #77496 – “Replication position lost after crash on MTS configured slave”. It was reported by Simon Mudd almost a year ago for MySQL 5.6, but is fixed only recently (also in 5.6.31). The bug was verified by Umesh. Honestly, I am scared with numerous problems we still see in new replication features that appeared in MySQL 5.6, and thinking about Oracle’s group replication development on top of that makes me scared even more. It will be us, Support engineers, and poor production DBAs who are forced to deal with numerous features not working well together or breaking usual work habits here and there… There we not so many bugs reported in public that were fixed in other areas. I’d like to highlight the following:Bug #78512 – “/var/log/mysqld.log has incorrect permissions after installing server from repo”, Bug #81390 – “mariadb galera not replaced with community packages during upgrade on fc24”, and Bug #79377 – “service start failed to create database if it doesn’t exists(ubuntu1510)”. They were all reported by Ramana Yeruva who seem to work for Oracle.Bug #81139 – “Missing break statement in mysql_read_default_options()”. It was reported by Georgi Kodinov from Oracle.Bug #81014 – “DELETE from joined tables with WHERE using derived table fails with error 1093”. This regression bug in optimizer was reported by Jim Parks, who seem to work for Oracle.Bug #80935 – “Dev library header files not on default include path”. It was reported by Lars Tangvald who works for Oracle.Bug #80748 – “mysql5.6 does not build on solaris12”. This bug was reported by Tor Didriksen from Oracle. Fixed in MySQL 5.6.31 also. I have to check if this fix really help my builds on OpenIndiana VM one day…Bug #80526 – “LEFT OUTER JOIN returns incorrect results on the outer side”. It was reported by Attila Rózsár and verified by Miguel Solorzano. Bug #80461 – “Accessing uninitialized memory inside strings/decimal.c ull2dec line ~1071”. This bug was reported by Sergey Sprogis and verified by Umesh.Bug #80451 – “mysqld –initialize does not support the keyring_file_data option”. It was reported and verified by Jesper Krogh from Oracle.Bug #80333 – “Valgrind: Conditional jump or move in Rewriter::do_refresh”, was reported by Roel Van de Paar from Percona and verified by Umesh.Bug #80231 – “Column name in having, which is contained in select list ‘*’, produces error”, was reported by Su Dylan and formally verified by Sinisa Milivojevic.Bug #80089 – “Memory leak from open files limit”, was reported by Manuel Ung and verified by Umesh. This bug is also fixed in MySQL 5.6.31.Bug #79591 – “select distinct not returning distinct rows in 5.7…”. This regression bug was reported by Shane Bester and probably verified (and fixed) by Øystein Grøvlen.Bug #79396 – “null pointer dereference”, was reported by Павел Гусев and verified by Sinisa Milivojevic. It is fixed in MySQL 5.6.31 also. It would be nice to see Oracle using AppChecker static analyzer for MySQL code…Bug #78254 – “After running mysql_upgrade proxies_priv user columns are not updated to 32”. It was reported by Robert Gołębiowski and verified by Umesh well before 5.7 became GA, but fixed only recently. I really wonder from prevented fixing this bug in 5.7.9…Bug #74977 – “Cryptic error when failing to unload a dynamic library”, was reported by  Martin Hansson back in 2014 and fixed only recently (also in MySQL 5.6.31). Bug #74636 – “mysqld_multi misleading when my_print_defaults is not found”, was reported by Andrii Nikitin from Oracle back in 2014 and fixed also in MySQL 5.6.31 recently.Bug #72230 – “Undesirable MySQL yum repo packaging dependencies”. Yet another bug reported by Simon Mudd more than 2 years ago and verified by Umesh. it is fixed only in 5.7.13.The last but not the least, Bug #71783, “mysqldump silently quits when it encounters an error.”, was reported by Shane Bester in 2014, and was recently fixed in MySQL 5.7.13 and 5.6.31.             To summarize, there are many bug fixes of all kinds in MySQL 5.7.13. Tomorrow I’ll surely try to build it from sources on all VMs and platforms I have.What I consider suspicious is the fact that aside from Oracle engineers, my former Percona colleagues (who had released their own versions of Percona Server and Xtrabackup based on MySQL 5.7) and few well known community members like Simon Mudd, there are very few bug reports from Community users for MySQL 5.7 that are fixed. Not sure what it means…

TEL/電話+86 13764045638
QQ 47079569