Released on 2 Nov 2006
MySQL 4.1.22 Changelog

End of Product Lifecycle. Active development and support for MySQL Database Server versions 3.23, 4.0, and 4.1 has ended. For details, see Please consider upgrading to a recent version. Further updates to the content of this manual will be minimal. All formats of this manual will continue to be available until 31 Dec 2010.

This is a bugfix release for the MySQL 4.1 release family.

This section documents all changes and bug fixes that have been applied since the last official MySQL release. If you would like to receive more fine-grained and personalized update alerts about fixes that are relevant to the version and features you use, please consider subscribing to MySQL Enterprise (a commercial MySQL offering). For more details, please see (

Functionality Added or Changed

  • The LOAD DATA FROM MASTER and LOAD TABLE FROM MASTER statements are deprecated. See Section, “LOAD DATA FROM MASTER Syntax”, for recommended alternatives. (Bug #9125, Bug #20596, Bug #14399, Bug #12187, Bug #15025, Bug #18822)

  • The mysqld man page has been reclassified from volume 1 to volume 8. (Bug #21220)

  • MySQL did not properly do stack dumps on x86_64 and i386/NPTL systems. (Note that the initial fix for this problem was discovered not to be correct. Further work on the problem was undertaken only for MySQL 5.1 and up. See Bug #31891.) (Bug #21250)

  • A warning now is issued if the client attempts to set the sql_log_off variable without the SUPER privilege. (Bug #16180)

Bugs Fixed

  • Packaging; MySQL Cluster: The ndb_mgm program was included in both the MySQL-ndb-tools and MySQL-ndb-management RPM packages, resulting in a conflict if both were installed. Now ndb_mgm is included only in MySQL-ndb-tools. (Bug #21058)

  • MySQL Cluster: When inserting a row into an NDB table with a duplicate value for a nonprimary unique key, the error issued would reference the wrong key. (Bug #21072)

  • MySQL Cluster: In some situations with a high disk-load, writing of the redo log could hang, causing a crash with the error message GCP STOP detected. (Bug #20904)

  • MySQL Cluster: Multiple node restarts in rapid succession could cause a system restart to fail , or induce a race condition. (Bug #22892, Bug #23210)

  • MySQL Cluster: The output for the --help option used with NDB executable programs (such as ndbd, ndb_mgm, ndb_restore, ndb_config, and others mentioned in Section 15.4, “MySQL Cluster Programs”) referred to the Ndb.cfg file, instead of to my.cnf. (Bug #21585)

  • MySQL Cluster: and ndb_error_reporter were missing from RPM packages. (Bug #20426)

  • MySQL Cluster: The failure of a unique index read due to an invalid schema version could be handled incorrectly in some cases, leading to unpredictable results. (Bug #21384)

  • MySQL Cluster: The ndb_mgm management client did not set the exit status on errors, always returning 0 instead. (Bug #21530)

  • MySQL Cluster: Under some circumstances, local checkpointing would hang, keeping any unstarted nodes from being started. (Bug #20895)

  • MySQL Cluster: Setting TransactionDeadlockDetectionTimeout to a value greater than 12000 would cause scans to deadlock, time out, fail to release scan records, until the cluster ran out of scan records and stopped processing. (Bug #21800)

  • MySQL Cluster: Some queries involving joins on very large NDB tables could crash the MySQL server. (Bug #21059)

  • MySQL Cluster: A partial rollback could lead to node restart failures. (Bug #21536)

  • MySQL Cluster: If a node restart could not be performed from the REDO log, no node takeover took place. This could cause partitions to be left empty during a system restart. (Bug #22893)

  • MySQL Cluster: The script did not account for TEXT and BLOB column values correctly. (Bug #21204)

  • MySQL Cluster: Attempting to create an NDB table on a MySQL with an existing non-Cluster table with the same name in the same database could result in data loss or corruption. MySQL now issues a warning when a SHOW TABLES or other statement causing table discovery finds such a table. (Bug #21378)

  • MySQL Cluster: INSERT ... ON DUPLICATE KEY UPDATE on an NDB table could lead to deadlocks and memory leaks. (Bug #23200)

  • MySQL Cluster: The server provided a nondescriptive error message when encountering a fatally corrupted REDO log. (Bug #21615)

  • MySQL Cluster: ndb_restore did not always make clear that it had recovered successfully from temporary errors while restoring a cluster backup. (Bug #19651)

  • MySQL Cluster: Cluster logs were not rotated following the first rotation cycle. (Bug #21345)

  • MySQL Cluster: When the redo buffer ran out of space, a Pointer too large error was raised and the cluster could become unusable until restarted with --initial. (Bug #20892)

  • MySQL Cluster: Backup of a cluster failed if there were any tables with 128 or more columns. (Bug #23502)

  • MySQL Cluster: A problem with takeover during a system restart caused ordered indexes to be rebuilt incorrectly. (Bug #15303)

  • MySQL Cluster: In some cases where SELECT COUNT(*) from an NDB table should have yielded an error, MAX_INT was returned instead. (Bug #19914)

  • MySQL Cluster: (NDB API): Attempting to read a nonexistent tuple using Commit mode for NdbTransaction::execute() caused node failures. (Bug #22672)

  • MySQL Cluster: SELECT ... FOR UPDATE failed to lock the selected rows. (Bug #18184)

  • MySQL Cluster: The node recovery algorithm was missing a version check for tables in the ALTER_TABLE_COMMITTED state (as opposed to the TABLE_ADD_COMMITTED state, which has the version check). This could cause inconsistent schemas across nodes following node recovery. (Bug #21756)

  • MySQL Cluster: In a cluster with more than 2 replicas, a manual restart of one of the data nodes could fail and cause the other nodes in the same node group to shut down. (Bug #21213)

  • MySQL Cluster: The server failed with a nondescriptive error message when out of data memory. (Bug #18475)

  • Using ALTER TABLE to add an ENUM column with an enumeration value containing 0xFF caused the name of the first table column to be lost. (Bug #20922)

  • SUBSTRING() results sometimes were stored improperly into a temporary table when multi-byte character sets were used. (Bug #20204)

  • mysql_install_db incorrectly had an empty first line. (Bug #20721)

  • The optimizer could produce an incorrect result after AND with collations such as latin1_german2_ci, utf8_czech_ci, and utf8_lithuanian_ci. (Bug #9509)

  • If a column definition contained a character set declaration, but a DEFAULT value began with an introducer, the introducer character set was used as the column character set. (Bug #20695)

  • User names have a maximum length of 16 characters (even if they contain multi-byte characters), but were being truncated to 16 bytes. (Bug #20393)

  • PROCEDURE ANALYSE() returned incorrect values of M FLOAT(M, D) and DOUBLE(M, D). (Bug #20305)

  • For a MyISAM table with a FULLTEXT index, compression with myisampack or a check with myisamchk after compression resulted in table corruption. (Bug #19702)

  • A query using WHERE column = constant OR column IS NULL did not return consistent results on successive invocations. The column in each part of the WHERE clause could be either the same column, or two different columns, for the effect to be observed. (Bug #21019)

  • mysqld --flush failed to flush MyISAM table changes to disk following an UPDATE statement for which no updated column had an index. (Bug #20060)

  • For TIME_FORMAT(), the %H and %k format specifiers can return values larger than two digits (if the hour is greater than 99), but for some query results that contained three-character hours, column values were truncated. (Bug #19844)

  • A subquery that uses an index for both the WHERE and ORDER BY clauses produced an empty result. (Bug #21180)

  • Some Linux-x86_64-icc packages (of previous releases) mistakenly contained 32-bit binaries. Only ICC builds are affected, not gcc builds. Solaris and FreeBSD x86_64 builds are not affected. (Bug #22238)

  • Redundant binary log LAST_INSERT_ID events could be generated; LAST_INSERT_ID(expr) did not return the value of expr; LAST_INSERT_ID() could return the value generated by the current statement if the call occurred after value generation, as in:


    (Bug #21726)

  • A query that used GROUP BY and an ALL or ANY quantified subquery in a HAVING clause could trigger an assertion failure. (Bug #21853)

  • EXPORT_SET() did not accept arguments with coercible character sets. (Bug #21531)

  • The source distribution failed to compile when configured with the --without-geometry option. (Bug #12991)

  • For INSERT ... ON DUPLICATE KEY UPDATE, use of VALUES(col_name) within the UPDATE clause sometimes was handled incorrectly. (Bug #21555)

  • When using tables containing VARCHAR columns created under MySQL 4.1 with a 5.0 or later server, for some queries the metadata sent to the client could have an empty column name. (Bug #14897)

  • Incorporated portability fixes into the definition of __attribute__ in my_global.h. (Bug #2717)

  • Under heavy load (executing more than 1024 simultaneous complex queries), a problem in the code that handles internal temporary tables could lead to writing beyond allocated space and memory corruption. (Bug #21206)

  • The --collation-server server option was being ignored. With the fix, if you choose a nondefault character set with --character-set-server, you should also use --collation-server to specify the collation. (Bug #15276)

  • On Mac OS X, zero-byte read() or write() calls to an SMB-mounted file system could return a nonstandard return value, leading to data corruption. Now such calls are avoided. (Bug #12620)

  • LIKE searches failed for indexed utf8 character columns. (Bug #20471)

  • The MD5(), SHA1(), and ENCRYPT() functions should return a binary string, but the result sometimes was converted to the character set of the argument. MAKE_SET() and EXPORT_SET() now use the correct character set for their default separators, resulting in consistent result strings which can be coerced according to normal character set rules. (Bug #20536)

  • Certain malformed INSERT statements could crash the mysql client. (Bug #21142)

  • Entries in the slow query log could have an incorrect Rows_examined value. (Bug #12240)

  • The result for CAST() when casting a value to UNSIGNED was limited to the maximum signed BIGINT value (9223372036854775808), rather than the maximum unsigned value (18446744073709551615). (Bug #8663)

  • Using the extended syntax for TRIM()—that is, TRIM(... FROM ...)—in a SELECT statement defining a view caused an invalid syntax error when selecting from the view. (Bug #17526)

  • OPTIMIZE TABLE with myisam_repair_threads > 1 could result in MyISAM table corruption. (Bug #8283)

  • WITH ROLLUP could group unequal values. (Bug #20825)

  • REPAIR TABLE ... USE_FRM could cause a server crash or hang when used for a MyISAM table in a database other than the default database. (Bug #22562)

  • Insufficient memory (myisam_sort_buffer_size) could cause a server crash for several operations on MyISAM tables: repair table, create index by sort, repair by sort, parallel repair, bulk insert. (Bug #23175)

  • Execution of a prepared statement that uses an IN subquery with aggregate functions in the HAVING clause could cause a server crash. (Bug #22085)

  • The myisam_stats_method variable was mishandled when set from an option file or on the command line. (Bug #21054)

  • Using ANY with nontable subqueries such as SELECT 1 yielded incorrect results under certain circumstances due to incorrect application of MIN()/MAX() optimization. (Bug #16302)

  • For cross-database multiple-table UPDATE statements, a user with all privileges for the default database could update tables in another database for which the user did not have UPDATE privileges. (Bug #7391)

  • Adding ORDER BY to a SELECT DISTINCT(expr) query could produce incorrect results. (Bug #21456)

  • COUNT(*) queries with ORDER BY and LIMIT could return the wrong result.


    This problem was introduced by the fix for Bug #9676, which limited the rows stored in a temporary table to the LIMIT clause. This optimization is not applicable to nongroup queries with aggregate functions. The current fix disables the optimization in such cases.

    (Bug #21787)

  • Conversion of TIMESTAMP values between UTC and the local time zone resulted in some values having the year 2069 rather than 1969. (Bug #16327)

  • DELETE IGNORE could hang for foreign key parent deletes. (Bug #18819)

  • A query using WHERE NOT (column < ANY (subquery)) yielded a different result from the same query using the same column and subquery with WHERE (column > ANY (subquery)). (Bug #20975)

  • Creating a TEMPORARY table with the same name as an existing table that was locked by another client could result in a lock conflict for DROP TEMPORARY TABLE because the server unnecessarily tried to acquire a name lock. (Bug #21096)

  • FROM_UNIXTIME() did not accept arguments up to POWER(2,31)-1, which it had previously. (Bug #9191)

  • libmysqld returned TEXT columns to the client as number of bytes, not number of characters (which can be different for multi-byte character sets). (Bug #19983)

  • A literal string in a GROUP BY clause could be interpreted as a column name. (Bug #14019)

  • The --with-collation option was not honored for client connections. (Bug #7192)

  • A patch fixing the omission of leading zeros in dates in MySQL 4.1.21 was reverted.

    References: The patch for the following bug was reverted: Bug #16377.

  • Multiple invocations of the REVERSE() function could return different results. (Bug #18243)

  • Within a prepared statement, SELECT (COUNT(*) = 1) (or similar use of other aggregate functions) did not return the correct result for statement re-execution. (Bug #21354)

  • Running SHOW MASTER LOGS at the same time as binary log files were being switched would cause mysqld to hang. (Bug #21965)

  • For multiple-table UPDATE statements, storage engines were not notified of duplicate-key errors. (Bug #21381)

  • A subquery in the WHERE clause of the outer query and using IN and GROUP BY returned an incorrect result. (Bug #16255)

  • A server or network failure with an open client connection would cause the client to hang even though the server was no longer available.

    As a result of this change, the MYSQL_OPT_READ_TIMEOUT and MYSQL_OPT_WRITE_TIMEOUT options for mysql_options() now apply to TCP/IP connections on all platforms. Previously, they applied only to Windows. (Bug #9678)

  • DELETE with WHERE condition on a BTREE-indexed column for a MEMORY table deleted only the first matched row. (Bug #9719)

  • Using aggregate functions in subqueries yielded incorrect results under certain circumstances due to incorrect application of MIN()/MAX() optimization. (Bug #20792)

  • Deleting entries from a large MyISAM index could cause index corruption when it needed to shrink. Deletes from an index can happen when a record is deleted, when a key changes and must be moved, and when a key must be un-inserted because of a duplicate key. This can also happen in REPAIR TABLE when a duplicate key is found and in myisamchk when sorting the records by an index. (Bug #22384)

  • For an ENUM column that used the ucs2 character set, using ALTER TABLE to modify the column definition caused the default value to be lost. (Bug #20108)

  • The server returns a more informative error message when it attempts to open a MERGE table that has been defined to use non-MyISAM tables. (Bug #10974)

  • libmysqld produced some warnings to stderr which could not be silenced. These warnings now are suppressed. (Bug #13717)

  • Character set collation was ignored in GROUP BY clauses. (Bug #20709)

  • Use of the join cache in favor of an index for ORDER BY operations could cause incorrect result sorting. (Bug #17212)

  • The optimizer sometimes mishandled R-tree indexes for GEOMETRY data types, resulting in a server crash. (Bug #21888)

  • Views could not be updated within a stored function or trigger. (Bug #17591)

  • Setting myisam_repair_threads caused any repair operation on a MyISAM table to fail to update the cardinality of indexes, instead making them always equal to 1. (Bug #18874)

  • Table aliases in multiple-table DELETE statements sometimes were not resolved. (Bug #21392)

  • Parallel builds occasionally failed on Solaris. (Bug #16282)

  • On 64-bit systems, use of the cp1250 character set with a primary key column in a LIKE clause caused a server crash for patterns having letters in the range 128..255. (Bug #19741)

  • The use of WHERE col_name IS NULL in SELECT statements reset the value of LAST_INSERT_ID() to zero. (Bug #14553)

  • For table-format output, mysql did not always calculate columns widths correctly for columns containing multi-byte characters in the column name or contents. (Bug #17939)

  • The build process incorrectly tried to overwrite sql/lex_hash.h. This caused the build to fail when using a shadow link tree pointing to original sources that were owned by another account. (Bug #18888)

  • Selecting from a MERGE table could result in a server crash if the underlying tables had fewer indexes than the MERGE table itself. (Bug #21617, Bug #22937)

  • character_set_results can be NULL to signify no conversion, but some code did not check for NULL, resulting in a server crash. (Bug #21913)

  • Using > ALL with subqueries that return no rows yielded incorrect results under certain circumstances due to incorrect application of MIN()/MAX() optimization. (Bug #18503)

  • For InnoDB tables, the server could crash when executing NOT IN(...) subqueries. (Bug #21077)

  • Under certain circumstances, AVG(key_val) returned a value but MAX(key_val) returned an empty set due to incorrect application of MIN()/MAX() optimization. (Bug #20954)

  • In the package of pre-built time zone tables that is available for download at, the tables now explicitly use the utf8 character set so that they work the same way regardless of the system character set value. (Bug #21208)

  • Queries containing a subquery that used aggregate functions could return incorrect results. (Bug #16792)