sql: Introduce VirtualSchema infrastructure#8119
Conversation
|
Review status: 0 of 18 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. sql/data_source.go, line 205 [r4] (raw file):
If someone has created a database named Comments from Reviewable |
|
LGTM Review status: 0 of 18 files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. sql/information_schema.go, line 54 [r4] (raw file):
instead, say that not all fields all filled in. sql/virtual_schema.go, line 98 [r1] (raw file):
s/checkVirtualDBDesc/getVirtualDBDesc ? sql/virtual_schema.go, line 103 [r1] (raw file):
really necessary? sql/virtual_schema.go, line 42 [r4] (raw file):
wasn't the previous definition nicer? And in fact can't we make it more specific - can't it return a... sql/virtual_schema.go, line 74 [r4] (raw file):
do we really need struct separately from sql/virtual_schema.go, line 79 [r4] (raw file):
this method deserves a comment Comments from Reviewable |
7694193 to
82ba1b1
Compare
|
Thanks for the reviews. I added in a final commit which has the real implementation for Review status: 0 of 19 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. sql/data_source.go, line 205 [r4] (raw file):
|
82ba1b1 to
ca6544c
Compare
|
Review status: 0 of 19 files reviewed at latest revision, 4 unresolved discussions, some commit checks pending. sql/virtual_schema.go, line 42 [r4] (raw file):
|
ca6544c to
f33fc0c
Compare
|
Review status: 0 of 19 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. sql/virtual_schema.go, line 42 [r4] (raw file):
|
This first commit creates the skeleton of the `virtualSchema` infrastructure. To test this out, it adds the initial "information_schema" database, with no tables. Note that this change will result in previous databases called `information_schema` being inaccessible. This is because the new virtual database will shadow it.
This commit makes sure no mutations on virtual tables are possible, and that the tables are indistinguishable from real tables with read-only privileges.
This commit replaces the old mock population function for `information_schema.tables` with the real one. One thing to note is that the commit removed a number of columns from the table which were all MySQL extensions.
f33fc0c to
4581375
Compare
|
Review status: 0 of 19 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. sql/virtual_schema.go, line 42 [r4] (raw file):
|
Related to #7965.
This PR introduces the
VirtualSchemainfrastructure into the SQL layer. This new structure allows static virtual descriptors to be used for non-distributed read-only SQL relations, and provides a means to mock out the results of selecting from tables within these schemas.This is the initial step towards supporting
information_schemaandpg_catalog.This change is