Merged PRs
dolt
- 9924: Implement dolt_global_tables system table
This adds support for a new system table,dolt_global_tables
.
It has the following schema:
It's purpose is to allow tables in one branch namespace to alias to tables in another ref, effectively simulating global tables if multiple "downstream" branches have dolt_global_tables point to the "upstream" table.CREATE TABLE `dolt_global_tables` ( `table_name` varchar(65535) NOT NULL, `target_ref` varchar(65535), `ref_table` varchar(65535), `options` varchar(65535), PRIMARY KEY (`table_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin
table_name can be a pattern just like the entries in theignore_tables
system table.
target_ref and ref_table, if null, are treated as the current branch and the input table name.
Currently options must equal "immediate", which means that writes to a global table are seen immediately by other branches. The behavior is identical to writing to another branch via a fully qualified db name.
This only effects name resolution during queries, and not other ways to interact with branches. This means that these tables are invisible to system procedures such asDOLT_ADD
, just like if you tried to add a system table.
I would love to have improved error messaging when using global tables with DOLT_ADD,show tables
, etc, but if the rest of the design is ready I can do that in a follow-up.
go-mysql-server
- 3250: Replace SubqueryAlias that selects an entire table with TableAlias