We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77783da commit b75a3e3Copy full SHA for b75a3e3
sqlglot/parser.py
@@ -6882,7 +6882,7 @@ def _parse_convert(
6882
6883
if self._match(TokenType.USING):
6884
to: t.Optional[exp.Expression] = self.expression(
6885
- exp.CharacterSet, this=self._parse_var()
+ exp.CharacterSet, this=self._parse_var(tokens={TokenType.BINARY})
6886
)
6887
elif self._match(TokenType.COMMA):
6888
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