diff --git a/dialects/table_name.go b/dialects/table_name.go index 8e2425fb..9ed48d66 100644 --- a/dialects/table_name.go +++ b/dialects/table_name.go @@ -105,7 +105,7 @@ func FullTableName(ctx context.Context, dialect Dialect, mapper names.Mapper, be tbName = TableNameWithSchema(dialect, tbName) } if dialect.URI() != nil && - (dialect.URI().DBType == schemas.MYSQL || dialect.URI().DBType == schemas.SQLITE) && + dialect.URI().DBType == schemas.MYSQL && dialect.IsShadow(ctx) && !hasShadowPrefix(tbName) { tbName = ShadowDBNamePrefix + TableNameWithDBName(dialect, tbName) } diff --git a/go.sum b/go.sum index 24d48f60..7f419676 100644 --- a/go.sum +++ b/go.sum @@ -659,7 +659,5 @@ modernc.org/z v1.2.19 h1:BGyRFWhDVn5LFS5OcX4Yd/MlpRTOc7hOPTdcIpCiUao= modernc.org/z v1.2.19/go.mod h1:+ZpP0pc4zz97eukOzW3xagV/lS82IpPN9NGG5pNF9vY= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 h1:bvLlAPW1ZMTWA32LuZMBEGHAUOcATZjzHcotf3SWweM= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= xorm.io/builder v0.3.11 h1:naLkJitGyYW7ZZdncsh/JW+HF4HshmvTHTyUyPwJS00= xorm.io/builder v0.3.11/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= diff --git a/integrations/engine_group_test.go b/integrations/engine_group_test.go index 635f73a6..15138e27 100644 --- a/integrations/engine_group_test.go +++ b/integrations/engine_group_test.go @@ -6,6 +6,7 @@ package integrations import ( "testing" + "xorm.io/xorm/dialects" "xorm.io/xorm" "xorm.io/xorm/log" @@ -32,4 +33,5 @@ func TestEngineGroup(t *testing.T) { eg.SetColumnMapper(master.GetColumnMapper()) eg.SetLogLevel(log.LOG_INFO) eg.ShowSQL(true) + eg.SetShadow(dialects.NewFalseShadow()) } diff --git a/integrations/session_get_test.go b/integrations/session_get_test.go index 306cf6be..168f631e 100644 --- a/integrations/session_get_test.go +++ b/integrations/session_get_test.go @@ -24,6 +24,8 @@ import ( ) func TestShadowGetVar(t *testing.T) { + //db, mock, err := sqlmock.New() + testEngine, err := xorm.NewEngine(string(schemas.MYSQL), "root:root@tcp(127.0.0.1:3306)/test?charset=utf8") assert.NoError(t, err) testEngine.ShowSQL(true)