ddl: Fix compatibility with null expression index#10162
ddl: Fix compatibility with null expression index#10162ti-chi-bot[bot] merged 4 commits intopingcap:masterfrom
Conversation
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
2e8f5d5 to
61bc500
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
close #9891 ddl: Fix TiFlash panic when meets expression index with format `((NULL))` Using `ColumnNothing` in IStorage may bring unexpected behavior when we try to write or read the column. So TiFlash create `ColumnInt8` instead of `ColumnNothing` when `TiDB::ColumnInfo.Tp == Null`. However, we don't expected the column is used when reading or writing to TiFlash. * `((null))` is not a normal expression index, this could be created by the user in accident (e.g. executing wrong SQL statement to create the expression index), TiDB should not write or read from it * Even for normal expression index, TiDB does not use expression when accessing to TiFlash Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com> Co-authored-by: JaySon-Huang <tshent@qq.com>
close #9891 ddl: Fix TiFlash panic when meets expression index with format `((NULL))` Using `ColumnNothing` in IStorage may bring unexpected behavior when we try to write or read the column. So TiFlash create `ColumnInt8` instead of `ColumnNothing` when `TiDB::ColumnInfo.Tp == Null`. However, we don't expected the column is used when reading or writing to TiFlash. * `((null))` is not a normal expression index, this could be created by the user in accident (e.g. executing wrong SQL statement to create the expression index), TiDB should not write or read from it * Even for normal expression index, TiDB does not use expression when accessing to TiFlash Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com> Co-authored-by: JaySon-Huang <tshent@qq.com>
close #9891 ddl: Fix TiFlash panic when meets expression index with format `((NULL))` Using `ColumnNothing` in IStorage may bring unexpected behavior when we try to write or read the column. So TiFlash create `ColumnInt8` instead of `ColumnNothing` when `TiDB::ColumnInfo.Tp == Null`. However, we don't expected the column is used when reading or writing to TiFlash. * `((null))` is not a normal expression index, this could be created by the user in accident (e.g. executing wrong SQL statement to create the expression index), TiDB should not write or read from it * Even for normal expression index, TiDB does not use expression when accessing to TiFlash Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com> Co-authored-by: JaySon-Huang <tshent@qq.com>
What problem does this PR solve?
Issue Number: close #9891
Problem Summary:
If the user create an expression index as above, TiDB will generate a "column" for the expression with
"Tp": 6. This type of column will generateColumnNothingwhich is not expected to be created at the IStorage, thus causing exception thrown during the DDL syncing when TiFlash handling the RaftLog from the table.Because TiFlash-proxy has persisted the RaftLog but get exception when decoding the RaftLog and apply it to the Storage layer, TiFlash panic.
tiflash/dbms/src/TiDB/Schema/TiDBTypes.h
Line 33 in 5c59a51
tiflash/dbms/src/Storages/StorageFactory.cpp
Lines 39 to 47 in 5c59a51
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note