-
Notifications
You must be signed in to change notification settings - Fork 102
lightning: evaluate all generated columns even if they are virtual #1407
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Why do this PR need to be cherry-picked into 4.0 and 5.0? |
@glorv the following schema works on 4.0 and I believe Lightning before this PR won't populate the create table a(a int primary key, b int as (a + 1) virtual unique); also, this flag exists on 4.0: https://docs.pingcap.com/zh/tidb/v4.0/tidb-configuration-file#allow-expression-index-%E4%BB%8E-v400-%E7%89%88%E6%9C%AC%E5%BC%80%E5%A7%8B%E5%BC%95%E5%85%A5 |
tests/config/tidb.toml
Outdated
@@ -11,3 +11,6 @@ ssl-key = "/tmp/backup_restore_test/certs/tidb.key" | |||
cluster-ssl-ca = "/tmp/backup_restore_test/certs/ca.pem" | |||
cluster-ssl-cert = "/tmp/backup_restore_test/certs/tidb.pem" | |||
cluster-ssl-key = "/tmp/backup_restore_test/certs/tidb.key" | |||
|
|||
[experimental] | |||
allow-expression-index = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needed when cherry-picking.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 031fab4
|
In response to a cherrypick label: new pull request created: #1417. |
In response to a cherrypick label: new pull request created: #1418. |
In response to a cherrypick label: new pull request created: #1419. |
What problem does this PR solve?
Fix #1404
What is changed and how it works?
Expression indices rely on a virtual generated column, which is not calculated by Lightning (unless depended by a stored generated column). This caused the virtual generated column to contain invalid value and thus invalidate the index.
This PR just calculates all generated columns no matter they are virtual or stored.
Check List
Tests
Code changes
Side effects
Related changes
Release note