Skip to content

MySQL: Add support for casting using the BINARY keyword - #2146

Merged
yoavcloud merged 2 commits into
apache:mainfrom
yoavcloud:mysql_binary_kw_cast
Jan 14, 2026
Merged

MySQL: Add support for casting using the BINARY keyword#2146
yoavcloud merged 2 commits into
apache:mainfrom
yoavcloud:mysql_binary_kw_cast

Conversation

@yoavcloud

Copy link
Copy Markdown
Contributor

MySQL allows casting using the BINARY keyword, for example:

SELECT BINARY 1+1

Adding support for parsing this as SELECT CAST(1+1 AS BINARY). Ideally, the parser would maintain the original query form, however, since this is deprecated in MySQL, I preferred a less instrusive solution (versus introducing a TypedExpr struct silimar to, or to replace TypedString).

@iffyioiffyio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @yoavcloud!

@iffyio

Copy link
Copy Markdown
Contributor

FYI @yoavcloud there's some conflicts in this branch when you have some time

@yoavcloud
yoavcloud added this pull request to the merge queueJan 14, 2026
Merged via the queue into apache:main with commit 6daa46dJan 14, 2026
10 checks passed
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Feb 3, 2026
fmguerreiro pushed a commit to fmguerreiro/datafusion-sqlparser-rs that referenced this pull request Feb 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yoavcloud@iffyio