зеркало из https://github.com/github/vitess-gh.git
Signed-off-by: Hormoz Kheradmand <hormoz.kheradmand@shopify.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Hormoz Kheradmand <hkdsun@users.noreply.github.com>
This commit is contained in:
Родитель
7455d4e0e0
Коммит
295e22a331
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -2788,7 +2788,11 @@ insert_method_options:
|
|||
| LAST
|
||||
|
||||
table_opt_value:
|
||||
reserved_sql_id
|
||||
table_id '.' reserved_table_id
|
||||
{
|
||||
$$ = String(TableName{Qualifier: $1, Name: $3})
|
||||
}
|
||||
| reserved_sql_id
|
||||
{
|
||||
$$ = $1.String()
|
||||
}
|
||||
|
|
|
@ -579,6 +579,18 @@ func TestExecutorAddDropVindexDDL(t *testing.T) {
|
|||
}
|
||||
utils.MustMatch(t, wantqr, qr)
|
||||
|
||||
// now make sure we can create another vindex that references a table with dashes (i.e. escaping is necessary)
|
||||
stmt = "alter vschema on test2 add vindex test_lookup_fqn(c1,c2) using consistent_lookup_unique with owner=`test`, from=`c1,c2`, table=`test-keyspace`.`lookup-fqn`, to=`keyspace_id`"
|
||||
_, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, vindex = waitForVindex(t, ks, "test_lookup_fqn", vschemaUpdates, executor)
|
||||
require.Equal(t, "consistent_lookup_unique", vindex.Type)
|
||||
require.Equal(t, "test", vindex.Owner)
|
||||
require.Equal(t, "c1,c2", vindex.Params["from"])
|
||||
require.Equal(t, "`test-keyspace`.`lookup-fqn`", vindex.Params["table"])
|
||||
require.Equal(t, "keyspace_id", vindex.Params["to"])
|
||||
|
||||
stmt = "alter vschema on test2 add vindex nonexistent (c1,c2)"
|
||||
_, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil)
|
||||
require.EqualError(t, err, "vindex nonexistent does not exist in keyspace TestExecutor")
|
||||
|
|
Загрузка…
Ссылка в новой задаче