From efbd06126e4bf540aebbf8f11cdd2c5486dfa227 Mon Sep 17 00:00:00 2001 From: Mikhail Faraponov <11322032+moredure@users.noreply.github.com> Date: Fri, 18 Mar 2022 14:18:47 +0200 Subject: [PATCH] Use WriteByte in case of single byte writing (#68) --- 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 {