Skip to content

Fix bug in if function when then clause contain const nullable column#14646

Merged
alesapin merged 3 commits intomasterfrom
if_bug
Sep 14, 2020
Merged

Fix bug in if function when then clause contain const nullable column#14646
alesapin merged 3 commits intomasterfrom
if_bug

Conversation

@alesapin
Copy link
Copy Markdown
Member

@alesapin alesapin commented Sep 9, 2020

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

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix bug when ALTER UPDATE mutation with Nullable column in assignment expression and constant value (like UPDATE x = 42) leads to incorrect value in column or segfault. Fixes #13634, #14045.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Sep 9, 2020
@alesapin
Copy link
Copy Markdown
Member Author

alesapin commented Sep 9, 2020

Only some asserts and test added, but I'm going to fix it.

@alesapin alesapin changed the title Bugreport: incorrect columns in if function Fix bug in if function when then clause contain const nullable column Sep 11, 2020
@alesapin alesapin marked this pull request as ready for review September 11, 2020 09:25
@alesapin
Copy link
Copy Markdown
Member Author

I think it's quite a rare bug and reproduction steps without mutation will be quite complicated. I think bug exists for a long time but triggered with one of if function improvements/optimizations for Nullable columns.

@KochetovNicolai KochetovNicolai self-assigned this Sep 11, 2020
@alesapin
Copy link
Copy Markdown
Member Author

Performance OK

@alesapin alesapin merged commit 336430d into master Sep 14, 2020
@alesapin alesapin deleted the if_bug branch September 14, 2020 06:51
robot-clickhouse pushed a commit that referenced this pull request Sep 14, 2020
robot-clickhouse pushed a commit that referenced this pull request Sep 14, 2020
alesapin added a commit that referenced this pull request Sep 14, 2020
Fix bug in if function when then clause contain const nullable column

(cherry picked from commit 336430d)
robot-clickhouse pushed a commit that referenced this pull request Sep 14, 2020
@filimonov
Copy link
Copy Markdown
Contributor

to 20.3?

alesapin added a commit that referenced this pull request Sep 14, 2020
Backport #14646 to 20.9: Fix bug in if function when then clause contain const nullable column
alesapin added a commit that referenced this pull request Sep 14, 2020
Backport #14646 to 20.8: Fix bug in if function when then clause contain const nullable column
alesapin added a commit that referenced this pull request Sep 14, 2020
Backport #14646 to 20.6: Fix bug in if function when then clause contain const nullable column
@alexey-milovidov
Copy link
Copy Markdown
Member

@filimonov Sure. We have backported it.

alesapin added a commit that referenced this pull request Sep 15, 2020
Backport #14646 to 20.7: Fix bug in if function when then clause contain const nullable column
traceon added a commit to traceon/ClickHouse that referenced this pull request Sep 20, 2020
* master: (375 commits)
  Update type-conversion-functions.md
  Update maxmap.md
  Update maxmap.md
  Update maxmap.md
  Update single_fixed_string_groupby.xml
  Alter remove column properties and TTLs (ClickHouse#14742)
  better fixed string group by support
  Fix incorrect key condition of fixed strings.
  constant output order
  more tests for  ClickHouse#14646
  Maybe fix MSan report in base64
  Proper exception message for wrong number of arguments of CAST
  Added a test
  Fix buffer overflow in "bar" function
  Update convertMySQLDataType.cpp
  Fix clang-tidy
  Remove obsolete code from performance test
  Slightly better code
  Even more
  Even more
  ...

# Conflicts:
#	src/Interpreters/Context.cpp
traceon added a commit to traceon/ClickHouse that referenced this pull request Sep 21, 2020
* ldap-any-user-authentication: (781 commits)
  Remove extra declaration
  Synchronize the code with respect to IAccessStorage::login() functionality
  Update type-conversion-functions.md
  Update maxmap.md
  Update maxmap.md
  Update maxmap.md
  Update single_fixed_string_groupby.xml
  Alter remove column properties and TTLs (ClickHouse#14742)
  better fixed string group by support
  Fix incorrect key condition of fixed strings.
  constant output order
  more tests for  ClickHouse#14646
  Maybe fix MSan report in base64
  Proper exception message for wrong number of arguments of CAST
  Added a test
  Fix buffer overflow in "bar" function
  Update convertMySQLDataType.cpp
  Fix clang-tidy
  Remove obsolete code from performance test
  Slightly better code
  ...

# Conflicts:
#	src/Access/ContextAccess.cpp
#	src/Access/ContextAccess.h
#	src/Access/ExternalAuthenticators.h
#	src/Access/LDAPAccessStorage.cpp
#	src/Access/LDAPClient.h
#	src/Access/LDAPParams.h
#	src/Common/ErrorCodes.cpp
#	src/Interpreters/Context.cpp
#	src/Interpreters/Context.h
@den-crane den-crane mentioned this pull request Oct 9, 2020
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.

Updating a Nullable column to a value would sets another value if where is used

5 participants