Skip to content

Commit

Permalink
chore(mysql): shore up escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Apr 12, 2024
1 parent 283f715 commit 96652e6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ibis/backends/mysql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ def visit_NonNullLiteral(self, op, *, value, dtype):
raise com.UnsupportedBackendType(
"MySQL does not support arrays, structs or maps"
)
elif dtype.is_string():
return sge.convert(value.replace("\\", "\\\\"))
return None

def visit_JSONGetItem(self, op, *, arg, index):
Expand Down Expand Up @@ -260,7 +258,7 @@ def visit_RegexExtract(self, op, *, arg, pattern, index):
index.eq(0),
extracted,
self.f.regexp_replace(
extracted, pattern, rf"\\{index.sql(self.dialect)}"
extracted, pattern, f"\\{index.sql(self.dialect)}"
),
),
NULL,
Expand Down

0 comments on commit 96652e6

Please sign in to comment.