Fixed a bug #16229 MySQL/InnoDB uses full explicit table locks
in trigger processing. Take a InnoDB table lock only if user has explicitly
requested a table lock. Added some additional comments to store_lock() and
external_lock(). Added test cases for a bug. Fixed some code style errors.
Fix for BUG#11704: "Found locks from different thread" warnings:
The source of warnings was this scenario in OPTIMIZE:
thr1: lock table with TL_WRITE_ONLY (InnoDB converts lock to
TL_WRITE_ALLOW_WRITE)
thr2: (UPDATE command) obtains a TL_WRITE_ALLOW_WRITE lock
thr1: call mysql_lock_abort(). This function sets type of thr'1 lock
to TL_WRITE_ONLY
thr2: try to release thr2's lock. See two locks: TL_WRITE_ONLY,
TL_WRITE_ALLOW_WRITE and produce a warning.
The fix: Make InnoDB not to convert TL_WRITE_ONLY locks to
TL_WRITE_ALLOW_WRITE in OPTIMIZE TABLE.
Do not pad VARBINARY or BINARY columns. (Bug #14189)
innodb.test, innodb.result: Add test cases for foreign key constraints
between VARBINARY and BINARY columns, and between VARCHAR BINARY and
CHAR BINARY columns.
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE
when trying to change the length of a VARBINARY column
that refers to or is referenced by a BINARY column. BINARY
columns are no longer padded on comparison, and thus they
cannot be padded on storage either.
Work around Bug #12071: Do not call os_file_create_tmpfile() at runtime.
Instead, create all tempfiles at startup and guard access to them with
mutexes.