-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Labels
Medium priorityCreated by Linear-GitHub SyncCreated by Linear-GitHub Sync
Description
Description
create table <table_dest> like <table_src> allows you to create a new table with the schema of an existing table; no data is copied to the new table.
I think we have most of the building blocks required, but here's a brief list based on an initial survey:
- parsing support
- need
nom-sqlparsing support; seems to already be supported insqlparser(I didn't look too closely, so this needs validation)
- need
- will need to filter out the target table if the source table is excluded/not included in the table replication set
- We can get the schema of the source table from the
Tableservice and/or reference it fromMySqlBinlogConnector::table_schemas. We won't hit this statement with any degree of real frequency, so the once-in-a-blue-moon call to theTableservice is fine (as long as it doesn't block any other replication activity).
The main work will probably be in try_non_ddl_action_from_query(), even though this is a DDL action 🤷; the function might need to be renamed. The reason why we end up in that function is due to the fact that the QueryEvent for the create table like does not have the StatusVarKey::UpdatedDbNames status var.
[0] MySQL 8.4 Reference Manual :: 15.1.20.3 CREATE TABLE ... LIKE Statement
Metadata
Metadata
Assignees
Labels
Medium priorityCreated by Linear-GitHub SyncCreated by Linear-GitHub Sync