Skip to content

[For #18707] MySQL compatibility: support DIV and MOD operators#18760

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
spongedu:fix_#18701
Jan 5, 2021
Merged

[For #18707] MySQL compatibility: support DIV and MOD operators#18760
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
spongedu:fix_#18701

Conversation

@spongedu
Copy link
Copy Markdown
Contributor

@spongedu spongedu commented Jan 5, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add DIV and MOD operators. DIV implements integer division. This is needed for MySQL compatibility and for sqllogictest. This closes #18707. It may introduce incompatibilities if you are using DIV or MOD as column names or aliases. In case of incompatibility, write aliases after AS keyword or wrap identifiers in quotes (either double quotes or backquotes).

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Jan 5, 2021
@alexey-milovidov alexey-milovidov self-assigned this Jan 5, 2021
@alexey-milovidov
Copy link
Copy Markdown
Member

I would also check some corner cases out of curiosity:

SELECT DIV MOD FROM (SELECT 1 `DIV`)

This query currently works. I expect it to fail after this PR that is also Ok but might require "backward incompatible" label.
I will merge this PR and check it...

@alexey-milovidov alexey-milovidov merged commit 202d1f2 into ClickHouse:master Jan 5, 2021
@alexey-milovidov
Copy link
Copy Markdown
Member

f8313a3

@robot-clickhouse robot-clickhouse added pr-backward-incompatible Pull request with backwards incompatible changes and removed pr-improvement Pull request with some product improvements labels Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backward-incompatible Pull request with backwards incompatible changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySQL compatibility: DIV and MOD operators

3 participants