Fix a bug: InnoDB could in a crash recovery print a big false corruption warning if the first page of an ibdata file was 'recreated' in the buffer pool; this could happen, for example, if a table was dropped, and the page used later
Push the patch of Jan Lindstrom: better comments
ha_innodb.cc:
Partial fix for Bug #12263 : we let InnoDB always to perform a rollback on the trx object if MySQL closes a connection; but we do print a warning to the .err log if an InnoDB transaction was active; we may remove that print later, since the situation really is not a bug; MySQL just is not aware that some cursor operation started an InnoDB transaction
data files. Previously, writes were flushed until the doublewrite
buffer was created. That would be too slow on systems where
os_file_flush() [or fsync(2)] is slow. (Bug #12125)
cursors for InnoDB. The idea of the patch is that if MySQL requests
a consistent read view, we open one when open a cursor, set is as the
active view to a transaction when fetch from the cursor, and close
together with cursor close. This patch is associated to bugs #11813,
#11832, and #11833. Contains after review fixes.
Since UNLOCK TABLES will commit the transaction (and thus release
all InnoDB locks held by it), it is unnecessary to release the
user-requested table locks separately.
Enforce maximum char_length of UTF-8 data (Bug #10409).
Pad UTF-8 variable-length CHAR columns with 0x20.
Pad UCS2 CHAR columns with 0x0020 (Bug #10511).
Fix a problem in crash recovery of .ibd files on Windows if the user used lower_case_table_names=0 or 2; the directory scan in crash recovery forgot to put all paths to lower case, so that the tablespace name would be consistent with the internal data dictionary of InnoDB; remember that InnoDB puts internally all database names and table names to lower case on Windows, regardless of the value of lower_case_table_names
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
cmp_dtuple_rec_with_match(): Move condition outside loop.
Reduce the number of comparisons per iteration.
mtr0mtr.c:
mtr_memo_slot_release(): Add a UNIV_LIKELY hint.
Simplify the preprocessor magic.
buf0buf.c:
buf_page_optimistic_get_func(): Add UNIV_UNLIKELY hints.
Introduce an exit_func label to remove duplicated error exits.
Add UNIV_UNLIKELY hint.
lock0lock.c:
Correct the prototypes of lock_deadlock_recursive() and
lock_deadlock_occurs().
data0data.c:
dtuple_convert_big_rec(): Add UNIV_UNLIKELY hint.
ha_innodb.cc:
ha_innobase::write_row(): Correct the type of 'mode'.
most InnoDB threads are not terminated properly and the buffer pool is not flushed
to disk. Still no committed transaction is lost as we flush the logs to disk.
InnoDB does crash recovery at startup after this shutdown.
Using this shutdown in testsuite (mysql-test-run --mysqld=--innodb_fast_shutdown=2) saved 3 minutes (13% of total time).
Add fault tolerance in the scan of .ibd files at a crash recovery; formerly a single failure of readdir_get_next caused the rest of the directory to be skipped
At the shutdown, write the latest lsn only to the first pages of the ibdata files of the system tablespace, NOT to the .ibd files; writing to tens of thousands .ibd files can take minutes
Do not test the value of err if the lock operation was skipped because innodb_logs_unsafe_for_binlog was TRUE; though this did not cause any bugs visible to the user, because err is inited to DB_SUCCESS at the start of the function row_search_for_mysql()
Gluh's SESSION/GLOBAL for @variables fix in sql_yacc.yy and
Bar's well_formed_len() changes in ndb code
did not make it and should be re-applied manually
between two server instances at server shutdown/startup.
This conflict on advisory locks appears to be the result of a bug
in the operating system; these locks should be released when the
files are closed, but somehow that does not always happen
immediately in Linux. (Bug #9381)
Add diagnostic code to track assertion failure in ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED); the failure happened in OPTIMIZE TABLE, and in 4.0.24 in some other context
Fix Bug #9526 in 5.0: MySQL ENUM and SET columns are internally actually unsigned integer types; we must take care that old tables still treat ENUM and SET (incorrectly) as a character string, while new created tables treat it correctly as an unsigned integer
If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277)
If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277)
Change the sorting order of TEXT columns in InnoDB: pad with spaces at the end in comparisons; we MUST UPDATE the MySQL MANUAL to warn about the need to rebuild tables (also MyISAM) in certain cases in an upgrade to 5.0.3; TODO: study what complications the missing DATA_BINARY_TYPE flag in InnoDB < 4.0.14 causes: we would compare then also BLOBs with space padding, not just TEXT
Revert the change to the space padding of BLOB and TEXT in comparisons; we cannot change the sorting order, because that would make old tables to appear corrupt; better to change LIKE 'a%' processing in MySQL, so that the lower end of the search interval would be 'a', not 'a '
Fix that 'a' LIKE 'a%' was not true for an InnoDB BLOB or TEXT type column prefix index search: InnoDB assumed that the BLOB and TEXT should not be padded with space in comparisons; this bug is also in 4.1; it may have worked in 4.1 because MySQL may have asked there for strings >= 'a', while in 5.0 it asks for strings >= 'a '
Fix a crash in a simple search with a key: the dtype->len of a true VARCHAR is the payload maximum len in bytes: it does not include the 2 bytes MySQL uses to store the string length
ha_innodb.cc:
Fix a crash in true VARCHARs in test-innodb: we passed a wrong pointer to the column conversion in an UPDATE
rowid_order_innodb.result, ps_3innodb.result, innodb.result, endspace.result:
Edit InnoDB test results to reflect the arrival of true VARCHARs
Add a settable session variable innodb_support_xa; setting it to 0 can save up to 10 % of CPU time and 150 bytes of space in each undo log
trx0trx.h, trx0undo.c, trx0trx.c, trx0roll.c:
Enable XA if innodb_support_xa is not set to 0; make prepare to do log fsync's according to innodb_flush_log_at_trx_commit
instead of SYS_TABLES.MIX_LEN, because the latter was not
initialized to zero in old MySQL 3.23 releases. This will break
existing MySQL/InnoDB 5.0.3-bk databases for which
SHOW TABLE STATUS displays Row_format=Compact.
which is always false. In a very fast InnoDB shutdown, we just ensure that
no more transactions are running, flush InnoDB log, signal InnoDB threads to die,
and then return from InnoDB (from innobase_end()) without waiting for those threads
to actually die. I have tested on a 4CPU machine that even with --innodb_flush_log_at_trx_commit=0,
this optimized InnoDB very fast shutdown loses no committed transactions. Patch pre-approved by Heikki.
dict_load_table(): Remove the check for row_format=compact for now,
because the flag bit we used (high-order bit of mix_len)
has not been zero for at least two customers.