lidavidm commented on code in PR #2254:
URL: https://github.com/apache/arrow-adbc/pull/2254#discussion_r1800507256


##########
go/adbc/driver/snowflake/connection.go:
##########
@@ -73,9 +73,51 @@ type connectionImpl struct {
        useHighPrecision  bool
 }
 
+func escapeSingleQuoteForLike(arg string) string {
+       if len(arg) == 0 {
+               return arg
+       }
+
+       idx := strings.IndexByte(arg, '\'')
+       if idx == -1 {
+               return arg
+       }
+
+       var b strings.Builder
+       b.Grow(len(arg))
+
+       for {
+               before, after, found := strings.Cut(arg, `'`)
+               b.WriteString(before)
+               if !found {
+                       return b.String()
+               }
+
+               if before[len(before)-1] != '\\' {
+                       b.WriteByte('\\')
+               }

Review Comment:
   Maybe it's time I open a branch for 1.2.0...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to