Skip to content

Fix Intersect with constant strings#37738

Merged
alexey-milovidov merged 2 commits intomasterfrom
fix-intersect-with-const
Jun 1, 2022
Merged

Fix Intersect with constant strings#37738
alexey-milovidov merged 2 commits intomasterfrom
fix-intersect-with-const

Conversation

@antonio2368
Copy link
Copy Markdown
Member

@antonio2368 antonio2368 commented Jun 1, 2022

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix SELECT ... INTERSECT and EXCEPT SELECT statements with constant string types.

Fix #37727

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-ch-test-poll robot-ch-test-poll added the pr-bugfix Pull request with bugfix, not backported by default label Jun 1, 2022
const IColumn & column = *key_columns[0];
const ColumnString & column_string = assert_cast<const ColumnString &>(column);
const IColumn * column = key_columns[0];
if (isColumnConst(*column))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BTW, what about other modifiers like Nullable?

Copy link
Copy Markdown
Member Author

@antonio2368 antonio2368 Jun 1, 2022

Choose a reason for hiding this comment

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

That works, nullable columns use specific hashing method for integer (e.g. nullable_keys128) and generic method for other types.
Single const string is a special case that uses String hash method but it didn't handle the const, and that was the case reported in the issue.

@alexey-milovidov
Copy link
Copy Markdown
Member

Backward compatibility check

As expected.

@alexey-milovidov alexey-milovidov merged commit 89638de into master Jun 1, 2022
@alexey-milovidov alexey-milovidov deleted the fix-intersect-with-const branch June 1, 2022 16:31
@tavplubix
Copy link
Copy Markdown
Member

@alexey-milovidov it is not expected, you've just broken stress tests in master by merging this. To avoid failures like this no-backward-compatibility-check tag must be added (6a51609)

@Avogar, is it possible to make BC check more convenient? Maybe use git history to exclude tests that were created (or modified?) between HEAD and merge-base of HEAD and previous release tag...

@tavplubix
Copy link
Copy Markdown
Member

Btw, there's a typo in the test name

@antonio2368
Copy link
Copy Markdown
Member Author

Btw, there's a typo in the test name

Yes, the plan was to fix the typo with the backwards tag added.
Also, isn't it better to add the tag with the version so we don't disable it indefinitely? I assume you just wanted to push a quick fix.

@tavplubix
Copy link
Copy Markdown
Member

Also, isn't it better to add the tag with the version so we don't disable it indefinitely? I assume you just wanted to push a quick fix.

Yep, tag with the version is better. (however, we will try to use git history instead)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SELECT 'Play ClickHouse' InterSect SELECT 'Play ClickHouse' makes null pointer dereference.

5 participants