Skip to content

Commit 0dea6ff

Browse files
authored
Fix quoting in set keyspace response and parsing of some identifier escapes (#127)
1 parent b1c54af commit 0dea6ff

File tree

5 files changed

+2059
-2032
lines changed

5 files changed

+2059
-2032
lines changed

parser/identifier.go

+14
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ func (i Identifier) equal(id string) bool {
4444
func (i Identifier) isEmpty() bool {
4545
return len(i.id) == 0
4646
}
47+
48+
func (i Identifier) String() string {
49+
if i.ignoreCase {
50+
return i.id
51+
}
52+
return "\"" + i.id + "\""
53+
}
54+
55+
func (i Identifier) ID() string {
56+
if i.ignoreCase {
57+
return strings.ToLower(i.id)
58+
}
59+
return strings.ReplaceAll(i.id, "\"\"", "\"")
60+
}

0 commit comments

Comments
 (0)