ApplySchema: Allow ALTER DATABASE.#5733
Conversation
There was a problem hiding this comment.
nit: assert.NoError(t, err)
There was a problem hiding this comment.
Since we no longer know how many object parsedDDLs will contain, we shouldn't specify max size of the array.
8bb04e9 to
9b748ee
Compare
|
We only parse the query but never execute it? |
For ApplySchema, we ultimately just pass through the DDLs to MySQL directly. We only parse them first to check that they're in fact DDLs and to optionally check if they affect "large" tables. |
I get it now. I can approve once the failing tests have been fixed. |
This allows using vtctl ApplySchema to execute ALTER DATABASE across all shards of a keyspace. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
9b748ee to
b23afc0
Compare
|
@deepthi Tests are passing now. The default charset is different on my machine vs. in CI so I changed the test to create and drop a new DB instead of altering an existing DB that later gets diffed. |
This allows using vtctl ApplySchema to execute ALTER DATABASE across all shards of a keyspace.
The main problem was just that
ALTER DATABASEhad never been added to the sqlparser at all.