Since ClickHouse does not support unquoted utf-8 strings but MySQL does.
Instead of fixing Lexer to recognize utf-8 chars as TokenType::BareWord,
suggesting to quote all unrecognized tokens before applying any DDL.
Actual parsing and validating the syntax will be done by particular Parser.
If there is any TokenType::Error, the query is unable to be parsed anyway.
Quoting such tokens can provide the support of utf-8 names.
See `tryQuoteUnrecognizedTokens` and `QuoteUnrecognizedTokensTest`.
mysql> CREATE TABLE 道.渠(...
is converted to
CREATE TABLE `道`.`渠`(...
Also fixed the bug with missing * while doing SELECT in full sync because db or table name are back quoted when not needed.
1. Dropped support for DatabaseOrdinary for MaterializeMySQL. It
is marked as experimental, and dropping support makes the code
more maintaible, and speeds up integration tests by 50%.
2. Get rid of thread name logic for StorageMaterializeMySQL wrapping,
use setInternalQuery instead (similar to MaterializedPostgreSQL).
We would update the set of seen GTIDs as soon as we saw a GTID_EVENT,
which arrives before a transaction. This would mostly work fine, but
if we lost the connection to MySQL in the middle of a large transaction
we would persist that the transaction had been processed as soon as the
transaction had started. When the connection was reestablished, we
would not process the transaction again, which meant that we only
applied parts of it.
Fix this by updating the seen GTIDs at the end of the transaction
instead.