We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 403f8eb commit 8d13122Copy full SHA for 8d13122
pkg/sqlcmd/variables.go
@@ -285,7 +285,7 @@ func ValidIdentifier(name string) error {
285
286
first := true
287
for _, c := range name {
288
- if !unicode.IsLetter(c) && (first || (!unicode.IsDigit(c) && !strings.ContainsRune(validVariableRunes, c))) {
+ if !unicode.IsLetter(c) && c != '_' && (first || (!unicode.IsDigit(c) && !strings.ContainsRune(validVariableRunes, c))) {
289
return fmt.Errorf("Invalid variable identifier %s", name)
290
}
291
first = false
pkg/sqlcmd/variables_test.go
@@ -104,6 +104,7 @@ func TestValidIdentifier(t *testing.T) {
104
{"A1", true},
105
{"A+", false},
106
{"A-_b", true},
107
+ {"__X", true},
108
109
for _, tst := range tests {
110
err := ValidIdentifier(tst.raw)
0 commit comments