We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f2a74c commit 302373dCopy full SHA for 302373d
sqlglot/parser.py
@@ -6877,7 +6877,7 @@ def _parse_convert(
6877
6878
if self._match(TokenType.USING):
6879
to: t.Optional[exp.Expression] = self.expression(
6880
- exp.CharacterSet, this=self._parse_var()
+ exp.CharacterSet, this=self._parse_var(tokens={TokenType.BINARY})
6881
)
6882
elif self._match(TokenType.COMMA):
6883
to = self._parse_types()
tests/dialects/test_mysql.py
@@ -573,6 +573,9 @@ def test_convert(self):
573
"mysql": "CAST(x AS CHAR CHARACTER SET latin1)",
574
},
575
576
+ self.validate_identity(
577
+ "CONVERT('a' USING binary)", "CAST('a' AS CHAR CHARACTER SET binary)"
578
+ )
579
580
def test_match_against(self):
581
self.validate_all(
0 commit comments