From b99580053a4ae289062e082a7d93e171e7219ba1 Mon Sep 17 00:00:00 2001 From: Mikhail Faraponov <11322032+moredure@users.noreply.github.com> Date: Thu, 17 Mar 2022 15:06:47 +0200 Subject: [PATCH] Use WriteByte in case of single byte writing --- mysql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql.go b/mysql.go index 1b3f9c8..ea22c42 100644 --- a/mysql.go +++ b/mysql.go @@ -256,7 +256,7 @@ func (dialector Dialector) QuoteTo(writer clause.Writer, str string) { shiftDelimiter = 0 underQuoted = false continuousBacktick = 0 - writer.WriteString("`") + writer.WriteByte('`') } writer.WriteByte(v) continue @@ -281,7 +281,7 @@ func (dialector Dialector) QuoteTo(writer clause.Writer, str string) { if continuousBacktick > 0 && !selfQuoted { writer.WriteString("``") } - writer.WriteString("`") + writer.WriteByte('`') } func (dialector Dialector) Explain(sql string, vars ...interface{}) string {