# Functionality Added or Changed* MySQL no longer uses the default OpenSSL compression. # Bugs Fixed* Performance; InnoDB: Performance was improved for operations on tables with many rows that were deleted but not yet purged. The speedup applies mainly to workloads that perform bulk deletes, or updates to the primary key columns, and where the system is busy enough to experience purge lag.* Performance; InnoDB: The DROP TABLE statement for a table using compression could be slower than necessary, causing a stall for several seconds. MySQL was unnecessarily decompressing pages in the buffer pool related to the table as part of the DROP operation. * Incompatible Change; Partitioning: Changes in the KEY partitioning hashing functions used with numeric, date and time, ENUM, and SET columns in MySQL 5.5 makes tables using partitioning or subpartitioning by KEY on any of the affected column types and created on a MySQL 5.5 or later server incompatible with a MySQL 5.1 server. This is because the partition IDs as calculated by a MySQL 5.5 or later server almost certainly differ from those calculated by a MySQL 5.1 server for the same table definition and data as a result of the changes in these functions.* The principal changes in the KEY partitioning implementation in MySQL 5.5 resulting in this issue were as follows: - The hash function used for numeric and date and time columns changed from binary to character-based. - The base used for hashing of ENUM and SET columns changed from latin1 ci characters to binary.- The fix involves adding the capability in MySQL 5.5 and later to choose which type of hashing to use for KEY partitioning, which is implemented with a new ALGORITHM extension to the PARTITION BY KEY option for CREATE TABLE and ALTER TABLE. Specifying PARTITION BY KEY ALGORITHM=1 ([columns]) causes the server to use the hashing functions as implemented in MySQL 5.1; using ALGORITHM=2 causes the server to use the hashing functions from MySQL 5.5 and later. ALGORITHM=2 is the default. Using the appropriate value for ALGORITHM, you can perform any of the following tasks:> Create KEY partitioned tables in MySQL 5.5 and later that are compatible with MySQL 5.1, using CREATE TABLE ... PARTITION BY KEY ALGORITHM=1 (...).> Downgrade KEY partitioned tables that were created in MySQL 5.5 or later to become compatible with MySQL 5.1, using ALTER TABLE ... PARTITION BY KEY ALGORITHM=1 (...).> Upgrade KEY partitioned tables originally created in MySQL 5.1 to use hashing as in MySQL 5.5 and later, using ALTER TABLE ... PARTITION BY KEY ALGORITHM=2 (...).- Important: After such tables are upgraded, they cannot be used any longer with MySQL 5.1 unless they are first downgraded again using ALTER TABLE ... PARTITION BY KEY ALGORITHM=1 (...) on a MySQL server supporting this option.* Important Note; Replication: It was possible to replicate from a table to a same-named view using statement-based logging, while using row-based logging instead led to a failure on the slave. Now the target object type is checked prior to performing any DML, and an error is given if the target on the slave is not actually a table. This is true regardless of the binary logging format in use. * InnoDB: For InnoDB tables, if a PRIMARY KEY on a VARCHAR column (or prefix) was empty, index page compression could fail. * InnoDB: For debug builds, InnoDB status exporting was subject to a race condition that could cause a server exit. * InnoDB: RENAME TABLE would result in a hang due to a MySQL mutex acquisition deadlock. * InnoDB: Internal read operations could be misclassified as synchronous when they were actually asynchronous. When the I/O requests returned sooner than expected, threads could be scheduled inefficiently. This issue mainly affected read-ahead requests, and thus had relatively little impact on I/O performed by user queries. * InnoDB: An improper call to abort() by InnoDB could result in a server exit. * InnoDB: If the MySQL server halted at a precise moment when a purge operation was being applied from the change buffer, the operation could be incorrectly performed again during the next restart. A workaround was to set the configuration option innodb_change_buffering=changes, to turn off change buffering for purge operations. * InnoDB: Arithmetic underflow during page compression for CREATE TABLE on an InnoDB table could cause a server exit. * InnoDB: If the server was started with the skip-innodb option, or InnoDB otherwise failed to start, query any of these Information Schema tables would cause a severe error:- INNODB_BUFFER_PAGE- INNODB_BUFFER_PAGE_LRU- INNODB_BUFFER_POOL_STATS* InnoDB: When printing out long semaphore wait diagnostics, sync_array_cell_print() ran into a segmentation violation (SEGV) caused by a race condition. This fix addresses the race condition by allowing the cell to be freed while it is being printed. * InnoDB: Killing a query caused an InnoDB assertion failure when the same table (cursor) instance was used again. This is the result of a regression error introduced. The fix introduced a check to handle kill signals for long running queries but the cursor was not restored to the proper state. * InnoDB: The length of internally generated foreign key names was not checked. If internally generated foreign key names were over the 64 character limit, this resulted in invalid DDL from SHOW CREATE TABLE. This fix checks the length of internally generated foreign key names and reports an error message if the limit is exceeded. * Partitioning: A query on a table partitioned by range and using TO_DAYS() as a partitioing function always included the first partition of the table when pruning. This happened regardless of the range employed in the BETWEEN clause of such a query. * Partitioning: Execution of ALTER TABLE ... DROP PARTITION against a view caused the server to crash, rather than fail with an error as expected. * Replication: A zero-length name for a user variable (such as @``) was incorrectly considered to be a sign of data or network corruption when reading from the binary log. * Replication: Using the --replicate-* options (see Replication Slave Options and Variables) could in some cases lead to a memory leak on the slave. * Replication: Backtick (`) characters were not always handled correctly in internally generated SQL statements, which could sometimes lead to errors on the slave. * Replication: It was possible in certain cases—immediately after detecting an EOF in the dump thread read event loop, and before deciding whether to change to a new binary log file—for new events to be written to the binary log before this decision was made. If log rotation occurred at this time, any events that occurred following EOF detection were dropped, resulting in loss of data. Now in such cases, steps are taken to make sure that all events are processed before allowing the log rotation to take place. * SHOW ENGINE PERFORMANCE_SCHEMA STATUS could report incorrect memory-allocation values when the correct values exceeded 4GB. * A long database name in a GRANT statement could cause the server to exit. * On Linux, a race condition involving epoll() could cause the thread pool plugin to miss events. This was most likely on systems with greater than 16 cores. * The server could exit if a prepared statement attempted to create a table using the name of an existing view while an SQL handler was opened. * Incorrect results were returned if a query contained a subquery in an IN clause which contained an XOR operation in the WHERE clause. * For upgrade operations, RPM packages produced unnecessary errors about being unable to access .err files. * Invocation of the range optimizer for a NULL select caused the server to exit. * yaSSL did not perform proper padding checks, but instead examined only the last byte of plaintext and used it to determine how many bytes to remove. * With the thread pool plugin enabled, large numbers of connections could lead to a Valgrind panic or failure of clients to be able to connect. * The initial test database contained a dummy.bak file that prevented DROP DATABASE from working. This file is no longer included. Also, a db.opt file is now included that contains these lines:- default-character-set=latin1- default-collation=latin1_swedish_ci* Setting a system variable to DEFAULT could cause the server to exit. * Issuing a PREPARE statement using certain combinations of stored functions and user variables caused the server to exit. * Contention in the thread pool during kill processing could lead to a Valgrind panic. * When a client program loses the connection to the MySQL server or if the server begins a shutdown after the client has executed mysql_stmt_prepare(), the next mysql_stmt_prepare() returns an error (as expected) but subsequent mysql_stmt_execute() calls crash the client. * SHOW COLUMNS on a view defined as a UNION of Geometry columns could cause the server to exit. * A LIKE pattern with too many '%' wildcards could cause a segmentation fault. * SET var_name = VALUES(col_name) could cause the server to exit. This syntax is now prohibited because in SET context there is no column name and the statement returns ER_BAD_FIELD_ERROR. * The COM_CHANGE_USER command in the client/server protocol did not properly use the character set number in the command packet, leading to incorrect character set conversion of other values in the packet. * Subqueries with OUTER JOIN could return incorrect results if the subquery referred to a column from another SELECT. * On Microsoft Windows, the MSI package would now allow a license switch (community to or from the commercial edition) when the switched MySQL Server versions were identical. * mysql_install_db did not escape '_' in the host name for statements written to the grant tables.* An out-of-memory condition could occur while handling an out-of-memory error, leading to recursion in error handling.* The optimizer used loose index scan for some queries for which this access method is inapplicable.* If a dump file contained a view with one character set and collation defined on a view with a different character set and collation, attempts to restore the dump file failed with an “illegal mix of collations” error. * The REPLACE() function produced incorrect results when a user variable was supplied as an argument and the operation was performed on multiple rows. * UNION ALL on BLOB columns could produce incorrect results. * View access in low memory conditions could raise a debugging assertion. * Setting max_connections to a value less than the current number of open connections caused the server to exit. * Incorrect metadata could be produced for columns returned from some views. * For debug builds, some queries with SELECT ... FROM DUAL nested subqueries raised an assertion. * If the server was started without a --datadir option, SHOW VARIABLES could show an empty value for the datadir system variable.* CMake did not check whether the system zlib had certain functions required for MySQL, resulting in build errors. Now it checks and falls back to the bundled zlib if the functions are missing.