From 8c84024f8c85c2e15324293e6870b7b935c88494 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Thu, 1 Jun 2023 07:30:18 +0300 Subject: [PATCH] schemadiff: validating case-sensitive view names Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/schemadiff/diff_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/go/vt/schemadiff/diff_test.go b/go/vt/schemadiff/diff_test.go index 57d626db493..2f8d913f042 100644 --- a/go/vt/schemadiff/diff_test.go +++ b/go/vt/schemadiff/diff_test.go @@ -777,6 +777,22 @@ func TestDiffSchemas(t *testing.T) { "CREATE TABLE `t4` (\n\t`id` int,\n\tPRIMARY KEY (`id`)\n)", }, }, + { + // Making sure schemadiff distinguishes between VIEWs with different casing + name: "case insensitive views", + from: "create view v1 as select * from t; create table t(id int primary key); create view V1 as select * from t", + to: "", + diffs: []string{ + "drop view v1", + "drop view V1", + "drop table t", + }, + cdiffs: []string{ + "DROP VIEW `v1`", + "DROP VIEW `V1`", + "DROP TABLE `t`", + }, + }, } for _, ts := range tt { t.Run(ts.name, func(t *testing.T) {