From 868ae052a1bb22309dcf8b8f6bd507c3ad849b02 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sun, 23 Feb 2020 15:16:40 +0800 Subject: [PATCH] Add escape sql params test --- logger/sql_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger/sql_test.go b/logger/sql_test.go index 829d63025..aee064d8f 100644 --- a/logger/sql_test.go +++ b/logger/sql_test.go @@ -26,8 +26,8 @@ func TestExplainSQL(t *testing.T) { { SQL: "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NumericRegexp: nil, - Vars: []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.com", myrole, pwd}, - Result: `create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values ("jinzhu", 1, 999.990000, true, "12345", "2020-02-23 11:10:10", "2020-02-23 11:10:10", NULL, "w@g.com", "admin", "pass")`, + Vars: []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd}, + Result: `create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values ("jinzhu", 1, 999.990000, true, "12345", "2020-02-23 11:10:10", "2020-02-23 11:10:10", NULL, "w@g.\"com", "admin", "pass")`, }, { SQL: "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10)",