Skip to content

Commit be720c1

Browse files
more permissive registry nomenclature
Signed-off-by: General Kroll <generalkroll0@gmail.com>
1 parent 6b75d79 commit be720c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

go/vt/sqlparser/ast_funcs.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package sqlparser
1919
import (
2020
"encoding/hex"
2121
"encoding/json"
22+
"fmt"
2223
"strings"
2324

2425
"vitess.io/vitess/go/vt/log"
@@ -683,6 +684,23 @@ func (node TableIdent) GetRawVal() string {
683684
return node.v
684685
}
685686

687+
func (tn TableName) GetRawVal() string {
688+
name := tn.Name.GetRawVal()
689+
q1 := tn.Qualifier.GetRawVal()
690+
q2 := tn.QualifierSecond.GetRawVal()
691+
q3 := tn.QualifierThird.GetRawVal()
692+
if q3 != "" {
693+
return fmt.Sprintf("%s.%s.%s.%s", name, q1, q2, q3)
694+
}
695+
if q2 != "" {
696+
return fmt.Sprintf("%s.%s.%s", name, q1, q2)
697+
}
698+
if q1 != "" {
699+
return fmt.Sprintf("%s.%s", name, q1)
700+
}
701+
return name
702+
}
703+
686704
func ContainEscapableChars(s string, at AtCount) bool {
687705
isDbSystemVariable := at != NoAt
688706

0 commit comments

Comments
 (0)