SQL layer support part #2. The main idea is:
employ this optimization only when the query is using just one table.
(the scope is too limited but the goal is to get sysbench to work).
Make UPDATE, DELETE, and SELECT codepaths check that the query has just
one table before the optimization is employed.
Also: in DELETE code, the start_operations_batch/end_operations_batch
were in the "Direct DELETE" branch. I think it's a mistake as InnoDB
doesn't use Direct DELETE optimization.
Removed the calls from there and added them to the regular DELETE codepath.
- For update operation, InnoDB uses separate mtr for the following:
1) searching the key in primary key leaf page, stores the position
2) exclusive lock the primary key leaf page
3) Allocate the undo log page, write the undo log record
4) Modify the PRIMARY KEY index change
InnoDB should use the single mtr for the all above conditions.
A cleanup for MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
Changing the error messages in a statement like this:
CREATE DATABASE db1
COLLATE utf8mb4_bin
CHARACTER SET utf8mb4
CHARACTER SET latin1;
from
COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'latin1'
to a more expected:
Conflicting declarations: 'CHARACTER SET utf8mb4' and 'CHARACTER SET latin1'
In order to do this:
- Adding a new type TYPE_CHARACTER_SET_COLLATE_EXACT into
Lex_exact_charset_extended_collation_attrs_st
- Removing m_had_charset_exact from its descendant class
Lex_extended_charset_extended_collation_attrs_st
Additional cleanup:
- Changing methods in Lex_exact_charset_extended_collation_attrs_st
set_charset(), set_charset_collate_default(), set_charset_collate_binary()
to get Lex_exact_charset instead CHARSET_INFO as a parameter,
to guarantee that the argument is only CHARACTER SET and does not have
any COLLATE clauses yet. This change is not directly related to
the error message change.
Main patch MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
Also fixes
MDEV-27782 Wrong columns when using table level `CHARACTER SET utf8mb4 COLLATE DEFAULT`
MDEV-28644 Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4