File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
internal/stackql/dbmsinternal Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package dbmsinternal
22
33import (
44 "regexp"
5+ "strings"
56
67 "github.com/stackql/stackql-parser/go/vt/sqlparser"
78 "github.com/stackql/stackql/internal/stackql/constants"
@@ -94,7 +95,7 @@ func (pgr *standardDBMSInternalRouter) CanRoute(node sqlparser.SQLNode) (constan
9495 }
9596 return pgr .analyzeSelect (node )
9697 case * sqlparser.Set :
97- return pgr .affirmativeExec ( )
98+ return pgr .analyzeSet ( node )
9899 case * sqlparser.Show :
99100 return pgr .analyzeShow (node )
100101 case * sqlparser.Begin , * sqlparser.Commit , * sqlparser.Rollback :
@@ -157,6 +158,15 @@ func (pgr *standardDBMSInternalRouter) analyzeShow(node *sqlparser.Show) (consta
157158 return pgr .negative ()
158159}
159160
161+ func (pgr * standardDBMSInternalRouter ) analyzeSet (node * sqlparser.Set ) (constants.BackendQueryType , bool ) {
162+ for _ , n := range node .Exprs {
163+ if strings .HasPrefix (n .Name .GetRawVal (), "$" ) {
164+ return pgr .negative ()
165+ }
166+ }
167+ return pgr .affirmativeExec ()
168+ }
169+
160170func (pgr * standardDBMSInternalRouter ) ExprIsRoutable (node sqlparser.SQLNode ) bool {
161171 switch node := node .(type ) {
162172 case sqlparser.TableExpr :
You can’t perform that action at this time.
0 commit comments