Fix bug: if a primary key contains more than one column, then MySQL seems to do fetch next even for a unique search condition: this in turn caused unnecessary locking which did not agree what the InnoDB manual promised
Fix bug: if the user created a prefix column key on a fixed length char column, then InnoDB claimed in CHECK TABLE that the table is corrupt
dict0dict.c:
Fix bug 1151: if the user created a prefix column primary key on a fixed length char column, then InnoDB crashed in a simple SELECT
Merge
trx0trx.c:
Print more info about a trx in SHOW INNODB status; try to find the bug reported by Plaxo
buf0buf.c:
Check that page log sequence numbers are not in the future
log0recv.c, log0log.c:
Fixed a bug: if you used big BLOBs, and your log files were relatively small, InnoDB could in a big BLOB operation temporarily write over the log produced AFTER the latest checkpoint. If InnoDB would crash at that moment, then the crash recovery would fail, because InnoDB would not be able to scan the log even up to the latest checkpoint. Starting from this version, InnoDB tries to ensure the latest checkpoint is young enough. If that is not possible, InnoDB prints a warning to the .err log
Fix bug: if there was a 'record too long' error in an insert, InnoDB forgot to free reserved file space extents; they were only freed in mysqld restart
Fix bug reported by Dyego Souza do Carmo: if a row becomes too long, > 8000 bytes, in an update, then InnoDB simply removes the clustered index record and does not report of table handler error 139
Put back a 50 millisecond sleep in too high concurrency situations which I removed in the previous push; count also such sleeping threads to the InnoDB queue in SHOW INNODB STATUS
Fix a benign bug introduced in 4.0.14: InnoDB could complain 'Error: trying to declare trx to enter InnoDB' if several threads tried to init the auto-inc counter for the same table at the same time; in theory, the bug could even lead to a hang of the server, but that shuld be extremely improbable
A cosmetic change: set trx id to zero at creation so that SHOW INNODB STATUS does not print a random value for the id of a transaction object for which the transaction has never been started yet (for example, running SHOW INNODB STATUS as the first command from a mysql prompt printed a random id for the trx object associated with the session itself running the SHOW INNODB STATUS command)
In background loop run purge to completion before doing other background operations: it does not make sense to flush buffer pool pages if they are soon modified again by purge
trx0purge.c:
Increase purge_sys->n_pages_handled for every undo log we purge, even if that log would be only a hundred bytes: that way we get the purge batches of 20 pages to set a fresh purge view (limit) more often, and we can reduce the number of old row versions purge has to look at when it decides if it can remove some delete-marked index record
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
os0sync.h, os0sync.c:
Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be
In ORDER BY MySQL seems to set the key read flag also in the case where the primary key contains only a prefix of a column - not the whole column; to prevent potential bugs retrieve the whole column if the index contains a prefix of it
Fix bug: InnoDB could print that it cannot find a clustered index record if an update undo, purge, and a consistent read coincided, in rare cases it might also have returned a wrong row in a query
Cleanup
ha_innodb.cc, data0type.h:
Make sure non-latin1 users can downgrade from 4.0.14 to an earlier version if they have not created DATA_BLOB column prefix indexes
Merge InnoDB-4.0.14: SAVEPOINT now implemented; InnoDB now accepts also column prefix keys; crashing bug in ON UPDATE CASCADE fixed; page checksum formula fixed
Release all event semaphores at shutdown also in Windows
srv0start.c, srv0srv.c:
make test sometimes failed because lock timeout thread exited without decrementing the InnoDB thread counter
When calculating the buf pool dirty pages ratio, add also free pages to the LRU list length: no need to active flushing if there are lots of free pages in the buffer pool
Search first only 10 % of the LRU list for a replaceable block before doing an LRU flush; enable again flushing of close pages also in a flush list (checkpointing) flush
trx0trx.c:
Add forgotten return value (it was not used anywhere, fortunately)
ha_innodb.h, mysql_priv.h:
Move declaration of srv_buf_pool_max_modified_pct to ha_innodb.h and enclose it to denote it is a C variable, not C++
Let InnoDB to skip writing of pages from the doublewrite buffer if innodb_force_recovery=6; normally, if the page is corrupt AND the corresponding page in the doublewrite buffer is also corrupt, InnoDB calls exit(1)