-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lightning: fix panic due to row's column exceeds definition #33767
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. |
/cc @D3Hunter |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/1e8534a6e7381bb9d185c863c3877cf97c75d65e |
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.
rest LGTM
@@ -594,6 +594,14 @@ func encodeRowsTiDB(t *testing.T, b backend.Backend, tbl table.Table) kv.Rows { | |||
require.NoError(t, err) | |||
|
|||
row.ClassifyAndAppend(&dataRows, &dataChecksum, &indexRows, &indexChecksum) | |||
|
|||
rawRow := make([]types.Datum, 0) |
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.
Make slice cap with 15.
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.
Will fix it.
@@ -594,6 +594,14 @@ func encodeRowsTiDB(t *testing.T, b backend.Backend, tbl table.Table) kv.Rows { | |||
require.NoError(t, err) | |||
|
|||
row.ClassifyAndAppend(&dataRows, &dataChecksum, &indexRows, &indexChecksum) | |||
|
|||
rawRow := make([]types.Datum, 0) |
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.
Make slice cap with 15.
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.
lgtm
|
||
rawRow := make([]types.Datum, 14) | ||
for i := 0; i < 15; i++ { | ||
rawRow = append(rawRow, types.NewIntDatum(0)) |
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.
rawRow will have 29 items, but it's ok for test.
/run-integration-br-test |
@@ -594,6 +594,14 @@ func encodeRowsTiDB(t *testing.T, b backend.Backend, tbl table.Table) kv.Rows { | |||
require.NoError(t, err) | |||
|
|||
row.ClassifyAndAppend(&dataRows, &dataChecksum, &indexRows, &indexChecksum) | |||
|
|||
rawRow := make([]types.Datum, 14) |
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.
rawRow := make([]types.Datum, 15)
? 🤔
/run-integration-br-test |
/run-integration-br-test |
/run-integration-br-test |
/run-integration-br-test |
/run-integration-br-test |
/run-integration-br-test |
1 similar comment
/run-integration-br-test |
/run-integration-br-test |
1 similar comment
/run-integration-br-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 65e6f68
|
/hold wait br it test passed |
/unhold |
/run-mysql-test |
/run-mysql-test |
/run-unit-test [FAIL] planner/core TestHashPartitionPruning |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #33396
Problem Summary:
What is changed and how it works?
Check if the number of columns exceeds that of the permutation, which should equal to the table definition, before populating the insert statement.
Check List
Tests
Side effects
Documentation
Release note