From 9c597ff8d4797e4217a3c1bd982410d8b6c9bbb7 Mon Sep 17 00:00:00 2001 From: Raul-Mircea Date: Mon, 27 Jan 2020 13:50:59 +0100 Subject: [PATCH] Fix --- table_and_query.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/table_and_query.go b/table_and_query.go index 8e734f40..955a25e1 100644 --- a/table_and_query.go +++ b/table_and_query.go @@ -7,10 +7,12 @@ import ( // TableAndQuery returns the table name and the query already formatted as a string func (scope Scope) TableAndQuery() (string, string) { scope.InstanceSet("skip_bindvar", true) - scope.prepareQuerySQL() - //qs := LogFormatter("sql", "q", time.Duration(1), scope.SQL, scope.SQLVars, int64(1)) //t, q := scope.TableName(), qs[3].(string) + + if scope.SQL == "" { + scope.prepareQuerySQL() + } t, q := scope.TableName(), scope.SQL if t == "" { qsplit := strings.Fields(strings.ToLower(q))