wgzhao commented on issue #10451:
URL: https://github.com/apache/seatunnel/issues/10451#issuecomment-6140990659
Thanks @SEZ9.
**On the `database-pattern` question — yes, that is the mechanism.**
`database-pattern` defaults to `.*` (`CatalogOptions` line 48-52) and `Catalog`
filters `listDatabases()` with it (`Catalog` line 174-178), so nothing narrows
the scan and `mysql.*` is picked up along with the user databases. Narrowing
the pattern does make the failure go away, but only by not looking at the
system tables; it is a workaround for the trigger, not for the derivation that
produced the phantom type.
**On approach 1 — it now sits at the wrong layer, because #12333 fixes this
at the root.** These columns are not of type `SET UNSIGNED`; `SET UNSIGNED`
does not exist in MySQL. `mysql.event.sql_mode` is declared as
```
set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED',...,
'ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE')
```
The old derivation searched the whole `COLUMN_TYPE` for the word `unsigned`,
matched the literal value name `NO_UNSIGNED_SUBTRACTION` inside that value
list, and set the flag; `MySqlTypeConverter.convert` then appended `"
UNSIGNED"` and produced a type it has no case for.
#12333 (`Fixes #10451`, open, awaiting committer approval) stops the flag
from being set on types that cannot carry the attribute. With it,
`mysql.event.sql_mode` is discovered as `SET`, which `MySqlTypeConverter`
already maps to `STRING` (`case MYSQL_ENUM: case MYSQL_SET:`), so discovery
succeeds with `database-pattern` left at its default and no new case needed.
Which means a `MYSQL_SET_UNSIGNED` case would only make the invented type
map to `STRING`: it would leave the column flagged `unsigned`, which is wrong
for a SET column, and it is unreachable once #12333 lands — the flag is set in
exactly two places in the tree (`MySqlCatalog.buildColumn` and
`OceanBaseMySqlCatalog.buildColumn`, both via the shared guard), and neither
can set it for a SET column any more.
So I would rather not add it as the fix for this issue. If you want it
anyway as belt-and-braces against some future path setting the flag on a SET
column, I am happy to add the two cases in a separate small change rather than
fold them into the fix — just tell me which you prefer.
The leftover cleanup from the #12333 review (guard derived from the
converter constants instead of a hand-written list, `DATA_TYPE`-based check,
OceanBase E2E case) is already open as #12742.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]