From 059cccf4bdb2872415baf23ccae3d5165037b864 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Wed, 26 Jul 2023 13:43:26 +0800 Subject: [PATCH] chore: unnecessary use of fmt.Sprintf --- plan/sql_rewrite.go | 4 ++-- rel/sql.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plan/sql_rewrite.go b/plan/sql_rewrite.go index 2d8e3fef..f6ce0a16 100644 --- a/plan/sql_rewrite.go +++ b/plan/sql_rewrite.go @@ -130,7 +130,7 @@ func RewriteShowAsSelect(stmt *rel.SqlShow, ctx *Context) (*rel.SqlSelect, error +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ */ - sqlStatement = fmt.Sprintf("select Table, Non_unique, Key_name, Seq_in_index, Column_name, Collation, Cardinality, Sub_part, Packed, `Null`, Index_type, Index_comment from `schema`.`indexes`;") + sqlStatement = "select Table, Non_unique, Key_name, Seq_in_index, Column_name, Collation, Cardinality, Sub_part, Packed, `Null`, Index_type, Index_comment from `schema`.`indexes`;" case "variables": // SHOW [GLOBAL | SESSION] VARIABLES [like_or_where] @@ -172,7 +172,7 @@ func RewriteShowAsSelect(stmt *rel.SqlShow, ctx *Context) (*rel.SqlSelect, error | Binlog_snapshot_position | 0 */ case "engines": - sqlStatement = fmt.Sprintf("select Engine, Support, Comment, Transactions, XA, Savepoints from `context`.`engines`;") + sqlStatement = "select Engine, Support, Comment, Transactions, XA, Savepoints from `context`.`engines`;" /* show engines; mysql> show engines; diff --git a/rel/sql.go b/rel/sql.go index 881cb175..6962b5c3 100644 --- a/rel/sql.go +++ b/rel/sql.go @@ -1765,7 +1765,7 @@ func SqlWhereFromPb(pb *SqlWherePb) *SqlWhere { } func (m *SqlInto) Keyword() lex.TokenType { return lex.TokenInto } -func (m *SqlInto) String() string { return fmt.Sprintf("%s", m.Table) } +func (m *SqlInto) String() string { return m.Table } func (m *SqlInto) WriteDialect(w expr.DialectWriter) {} func (m *SqlInto) Equal(s *SqlInto) bool { if m == nil && s == nil { @@ -1959,7 +1959,7 @@ func (m *SqlCommand) WriteDialect(w expr.DialectWriter) {} func (m *SqlCreate) Keyword() lex.TokenType { return lex.TokenCreate } func (m *SqlCreate) FingerPrint(r rune) string { return m.String() } -func (m *SqlCreate) String() string { return fmt.Sprintf("not-implemented") } +func (m *SqlCreate) String() string { return "not-implemented" } func (m *SqlCreate) WriteDialect(w expr.DialectWriter) {} func (m *SqlDrop) Keyword() lex.TokenType { return lex.TokenDrop } @@ -1969,7 +1969,7 @@ func (m *SqlDrop) WriteDialect(w expr.DialectWriter) {} func (m *SqlAlter) Keyword() lex.TokenType { return lex.TokenAlter } func (m *SqlAlter) FingerPrint(r rune) string { return m.String() } -func (m *SqlAlter) String() string { return fmt.Sprintf("not-implemented") } +func (m *SqlAlter) String() string { return "not-implemented" } func (m *SqlAlter) WriteDialect(w expr.DialectWriter) {} // Node serialization helpers