Remove accidenatlly committed debug printfs when query cache is used
sql_update.cc, sql_load.cc, sql_insert.cc, sql_delete.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
Remove code never actually used in IGNORE; InnoDB just rolls back the latest row insert or update on a duplicate key error and leaves it for MySQL to decide whether to ignore the error
Make ANALYZE TABLE to update index cardinality and other statistics also for an InnoDB table; note that the estimates are based on 10 random dives, not on an exhaustive read of the table
Prevent crash if MySQL calls rnd_end WITOUT calling rnd_init first: only restore active_index if it the old value was pushed in rnd_init
Initialize active_index to a sensible value: prevent crash if we restore it to the original value after an table scan
Make InnoDB to restore old active_index value after a table scan: MySQL may assume that a scan does NOT change active_index; this partially fixes bug 241 of UPDATE ... ORDER BY ... but it still remains that MySQL actually ignores the ORDER BY for both MyISAM and InnoDB tables
log0recv.c:
Use fflush to make sure report of a corrupt log record is printed to .err log before mysqld crashes
Fix bug: MySQL could erroneously return Empty set if InnoDB estimated index range size to 0 records though the range was not empty; MySQL also failed to do the next-key locking in the case of an empty index range
Remove (already commented out) code about storing the latest relay log pos info to InnoDB: we will probably use only the master log pos info when we restart a slave after a crash
Prepare for 5.x where HA_READ_PREFIX_LAST may pass only a few first bytes of the last field in a key value
ha_innodb.cc:
In 4.0 always assume HA_READ_PREFIX_LAST passes a complete-field prefix of a key value; LIKE queries use a padding trick
Fix potential bug: if MySQL calls store_lock with the TL_IGNORE argument in the middle of query processing, then InnoDB select_lock_type could be reset to LOCK_NONE in a wrong place
Call pthread_mutex_destroy() on not used mutex.
Changed comments in .h and .c files from // -> /* */
Added detection of mutex on which one didn't call pthread_mutex_destroy()
Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression"
Added optimisation for ORDER BY NULL
Temporary fix to make the new client/server protocol to work: fetch all columns in an index, even if not needed by the SELECT statement; Monty has to fix the parser to tell InnoDB what to fetch