Skip to content
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

ddl: make prefix index compatible with mysql 8.0 when prefix length equal to column length | tidb-test=pr/2308 #48296

Merged
merged 9 commits into from
Mar 12, 2024

Conversation

jiyfhust
Copy link
Contributor

@jiyfhust jiyfhust commented Nov 4, 2023

What problem does this PR solve?

Issue Number: close #48295

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2023
Copy link

tiprow bot commented Nov 4, 2023

Hi @jiyfhust. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Nov 4, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Nov 4, 2023
Copy link

codecov bot commented Nov 4, 2023

Codecov Report

Merging #48296 (1cce48f) into master (15947c1) will increase coverage by 1.4937%.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48296        +/-   ##
================================================
+ Coverage   70.7189%   72.2126%   +1.4937%     
================================================
  Files          1473       1473                
  Lines        436986     437023        +37     
================================================
+ Hits         309032     315586      +6554     
+ Misses       108587     101861      -6726     
- Partials      19367      19576       +209     
Flag Coverage Δ
integration 47.4400% <100.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 47.7311% <ø> (+1.8769%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 8, 2023
@jiyfhust
Copy link
Contributor Author

@zimulala @wjhuang2016 Could you take a look at this?

@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 13, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Feb 1, 2024
@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 5, 2024

/test check-dev2

Copy link

tiprow bot commented Mar 5, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 5, 2024
@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 5, 2024

@mjonss Can you take a look this pr, thanks.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 5, 2024

/cc @mjonss

@ti-chi-bot ti-chi-bot bot requested a review from mjonss March 5, 2024 10:03
@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 5, 2024


time="2024-03-05T14:20:00+08:00" level=error msg="1 tests failed\n"

time="2024-03-05T14:20:00+08:00" level=error msg="run test [key] err: sql:show create table t1;: failed to run query \n\"show create table t1;\" \n around line 243, \nwe need(208):\nshow create table t1;\nTable\tCreate Table\nt1\tCREATE TABLE `t1` (\n  `a` varchar(10) DEFAULT NULL,\n  `b` varchar(10) DEFAULT NULL,\n  KEY `a` (`a`(10),`b`(10))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8\nbut got(208):\nshow create table t1;\nTable\tCreate Table\nt1\tCREATE TABLE `t1` (\n  `a` varchar(10) DEFAULT NULL,\n  `b` varchar(10) DEFAULT NULL,\n  KEY `a` (`a`,`b`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n\n"

tidb-server(PID: 2179) stopped

Is mysql-test not public? There is a fail tests.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 5, 2024
Copy link

ti-chi-bot bot commented Mar 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-05 08:06:31.526375629 +0000 UTC m=+154418.548622015: ☑️ agreed by wjhuang2016.
  • 2024-03-05 14:49:57.906562235 +0000 UTC m=+178624.928808623: ☑️ agreed by tangenta.

@wjhuang2016 wjhuang2016 changed the title ddl: make prefix index compatible with mysql 8.0 when prefix length equal to column length ddl: make prefix index compatible with mysql 8.0 when prefix length equal to column length | tidb-test=pr/2308 Mar 8, 2024
@wjhuang2016
Copy link
Member

/run-mysql-test

@wjhuang2016
Copy link
Member

/test mysql-test

Copy link

tiprow bot commented Mar 8, 2024

@wjhuang2016: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 8, 2024

/test mysql-test

Copy link

tiprow bot commented Mar 8, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 8, 2024

/test mysql-test

Copy link

tiprow bot commented Mar 8, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

/test mysql-test

Copy link

tiprow bot commented Mar 10, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

/test mysql-test

Copy link

tiprow bot commented Mar 11, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

time="2024-03-11T11:33:40+08:00" level=error msg="5 tests failed\n"

time="2024-03-11T11:33:40+08:00" level=error msg="run test [alter_table_partition] err: sql:ALTER TABLE t1 ALGORITHM = INPLACE, LOCK = NONE, ADD PARTITION (PARTITION p4 VALUES LESS THAN (2010));: failed to run query \n\"ALTER TABLE t1 ALGORITHM = INPLACE, LOCK = NONE, ADD PARTITION (PARTITION p4 VALUES LESS THAN (2010));\" \n around line 79, \nwe need(231):\ndue to t1 has no global stats\n# Test ALGORITHM = INPLACE, LOCK = * for all operations\nALTER TABLE t1 ALGORITHM = INPLACE, LOCK = NONE, ADD PARTITION (PARTITION p4 VALUES LESS THAN (2010));\nLevel\tCode\tMessage\nError\t1846\tALGORITHM=IN\nbut got(231):\nALTER TABLE t1 ALGORITHM = INPLACE, LOCK = NONE, ADD PARTITION (PARTITION p4 VALUES LESS THAN (2010));\nLevel\tCode\tMessage\nError\t1846\tALGORITHM=INPLACE is not supported. Reason: Cannot alter table by INPLACE. Try ALGORITHM=INSTANT.\n\n"

time="2024-03-11T11:33:40+08:00" level=error msg="run test [array_index] err: sql:explain select * from t1 ignore key(i1) where json_contains(doc->\"$\",\"[1,2,3]\");: failed to run query \n\"explain select * from t1 ignore key(i1) where json_contains(doc->\"$\",\"[1,2,3]\");\" \n around line 135, \nwe need(349):\nexplain select * from t1 ignore key(i1) where json_contains(doc->\"$\",\"[1,2,3]\");\nid\testRows\ttask\taccess object\toperator info\nTableReader_7\t0.80\troot\t\tdata:Selection_6\n└─Selection_6\t0.80\tcop[tikv]\t\tjson_contains(json_extract(array_index.t1.doc, \"$\"), cast(\"[1,2,3]\", json BINARY))\n  └─TableFullScan_5\t1.00\tcop[tikv]\ttable:t1\tkeep order:false\n\nbut got(349):\nexplain select * from t1 ignore key(i1) where json_contains(doc->\"$\",\"[1,2,3]\");\nid\testRows\ttask\taccess object\toperator info\nTableReader_7\t1.00\troot\t\tdata:Selection_6\n└─Selection_6\t1.00\tcop[tikv]\t\tjson_contains(json_extract(array_index.t1.doc, \"$\"), cast(\"[1,2,3]\", json BINARY))\n  └─TableFullScan_5\t1.00\tcop[tikv]\ttable:t1\tkeep order:false\n\n"

time="2024-03-11T11:33:40+08:00" level=error msg="run test [count_distinct] err: sql:DROP TABLE t;: failed to run query \n\"DROP TABLE t;\" \n around line 189, \nwe need(14):\nLevel\tCode\tMes\nbut got(14):\nDROP TABLE t;\n\n"

time="2024-03-11T11:33:40+08:00" level=error msg="run test [explain] err: sql:execute s1;: failed to run query \n\"execute s1;\" \n around line 126, \nwe need(630):\nexecute s1;\nid\testRows\ttask\taccess object\toperator info\nProjection\t8000.00\troot\t\t1->Column#6\n└─HashAgg\t8000.00\troot\t\tgroup by:explain.t1.a, funcs:count(1)->Column#9\n  └─HashJoin\t100000000.00\troot\t\tCARTESIAN inner join\n    ├─TableReader(Build)\t10000.00\troot\t\tdata:TableFullScan\n    │ └─TableFullScan\t10000.00\tcop[tikv]\ttable:t2\tkeep order:false, stats:pseudo\n    └─TableReader(Probe)\t10000.00\troot\t\tdata:TableFullScan\n      └─TableFullScan\t10000.00\tcop[tikv]\ttable:t1\tkeep order:false, stats:pseudo\nprepare s1 from\n'explain format=\"brief\" SELECT 1\nFROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.\nbut got(630):\nexecute s1;\nid\testRows\ttask\taccess object\toperator info\nProjection\t8000.00\troot\t\t1->Column#6\n└─HashAgg\t8000.00\troot\t\tgroup by:explain.t1.a, funcs:count(1)->Column#9\n  └─HashJoin\t100000000.00\troot\t\tCARTESIAN inner join\n    ├─TableReader(Build)\t10000.00\troot\t\tdata:TableFullScan\n    │ └─TableFullScan\t10000.00\tcop[tikv]\ttable:t2\tkeep order:false, stats:pseudo\n    └─TableReader(Probe)\t10000.00\troot\t\tdata:TableFullScan\n      └─TableFullScan\t10000.00\tcop[tikv]\ttable:t1\tkeep order:false, stats:pseudo\nLevel\tCode\tMessage\nWarning\t1105\tskip prepared plan-cache: not a SELECT/UPDATE/INSERT/DELETE/SET statement\n\n"

time="2024-03-11T11:33:40+08:00" level=error msg="run test [filesort] err: sql:SELECT 1 AS a FROM t1 LEFT JOIN t2 ON FALSE GROUP BY a;: failed to run query \n\"SELECT 1 AS a FROM t1 LEFT JOIN t2 ON FALSE GROUP BY a;\" \n around line 139, \nwe need(60):\nLevel\tCode\tMessage\nWarning\t8200\tUnsupported partition type K\nbut got(60):\nSELECT 1 AS a FROM t1 LEFT JOIN t2 ON FALSE GROUP BY a;\na\n1\n\n"

tidb-server(PID: 2373) stopped

The error messages seems with no relationship with the modifications, but why it always occurs.

please take a look @wjhuang2016

Copy link

ti-chi-bot bot commented Mar 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mjonss, tangenta, wjhuang2016

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot merged commit 5745d3d into pingcap:master Mar 12, 2024
23 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #51707.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 12, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@jiyfhust jiyfhust deleted the fix_prefix_compatible branch March 12, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefix index is not compatible with mysql 8.0 when column length equal to prefix length
5 participants