From caa7ffa6ad2c4d6cf9ff618963c2a8e3974d0fa9 Mon Sep 17 00:00:00 2001 From: Jacques Grove Date: Mon, 28 Sep 2020 13:51:05 -0700 Subject: [PATCH] Fix dbname that needs escaping that we broke in fce4cfd894 Rename function to keep lint happy Signed-off-by: Jacques Grove --- go/vt/mysqlctl/schema.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go/vt/mysqlctl/schema.go b/go/vt/mysqlctl/schema.go index a90ed76943d..c50cd439aaa 100644 --- a/go/vt/mysqlctl/schema.go +++ b/go/vt/mysqlctl/schema.go @@ -58,10 +58,10 @@ func encodeTableName(tableName string) string { return buf.String() } -// tableListSql returns an IN clause "('t1', 't2'...) for a list of tables." -func tableListSql(tables []string) (string, error) { +// tableListSQL returns an IN clause "('t1', 't2'...) for a list of tables." +func tableListSQL(tables []string) (string, error) { if len(tables) == 0 { - return "", vterrors.New(vtrpc.Code_INTERNAL, "no tables for tableListSql") + return "", vterrors.New(vtrpc.Code_INTERNAL, "no tables for tableListSQL") } encodedTables := make([]string, len(tables)) @@ -234,7 +234,7 @@ func (mysqld *Mysqld) collectSchema(ctx context.Context, dbName, tableName, tabl // normalizedSchema returns a table schema with database names replaced, and auto_increment annotations removed. func (mysqld *Mysqld) normalizedSchema(ctx context.Context, dbName, tableName, tableType string) (string, error) { backtickDBName := sqlescape.EscapeID(dbName) - qr, fetchErr := mysqld.FetchSuperQuery(ctx, fmt.Sprintf("SHOW CREATE TABLE %s.%s", dbName, sqlescape.EscapeID(tableName))) + qr, fetchErr := mysqld.FetchSuperQuery(ctx, fmt.Sprintf("SHOW CREATE TABLE %s.%s", backtickDBName, sqlescape.EscapeID(tableName))) if fetchErr != nil { return "", fetchErr } @@ -308,7 +308,7 @@ func (mysqld *Mysqld) getPrimaryKeyColumns(ctx context.Context, dbName string, t } defer conn.Recycle() - tableList, err := tableListSql(tables) + tableList, err := tableListSQL(tables) if err != nil { return nil, err }