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

planner: add binding and recursive test for Merge hint #36352

Merged
merged 83 commits into from
Jul 20, 2022

Conversation

dayicklp
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #17472

Problem Summary: add binding and recursive test for Merge hint(#34574 ), and fix some unit test and function.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

dayicklp and others added 30 commits May 11, 2022 17:38
I want to insert a hint for CTE-inline, but the Optimizer doesn't find the hint which I code.
only insert some var
I fix my mistake , and remake the hintparser.y
comment on exported type CTEHintInfo should be of the form "CTEHintInfo ..." (with optional leading
fix merge conflict.
try to add a unit test
add cte-hint test(part of them), the cteinlinehint in different cte is coding.
when meet cteinlinehint, open the inline function
support CTEInlineHint in different cte query.
add some parer unit test, ref: TestCTE
change the hint for CTE name. Old name: CTEInline , New name: Merge. Because we need align with MySQL
test when with recursive,the hint merge is not start
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 20, 2022
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2022
@dayicklp dayicklp requested a review from winoros July 20, 2022 09:56
@@ -3631,6 +3631,11 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev
limitHints.preferLimitToCop = true
case HintMerge:
MergeHints.preferMerge = true
if hint.Tables != nil {
b.ctx.GetSessionVars().StmtCtx.AppendWarning(ErrInternal.GenWithStack("The MERGE hint is not used correctly, maybe it inputs a table name."))
MergeHints.preferMerge = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put MergeHints.preferMerge = true after L3638, and remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 20, 2022
@ti-chi-bot
Copy link
Member

@father1111: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

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 ti-community-infra/tichi repository.

@winoros
Copy link
Member

winoros commented Jul 20, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 57657c5

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 20, 2022
@dayicklp
Copy link
Contributor Author

/run-unit-test

1 similar comment
@dayicklp
Copy link
Contributor Author

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit c7cfebb into pingcap:master Jul 20, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jul 20, 2022

TiDB MergeCI notify

🔴 Bad News! [2] CI still failing after this pr merged.
These failed integration tests don't seem to be introduced by the current PR.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-common-test 🔴 failed 2, success 9, total 11 48 min Existing failure
idc-jenkins-ci/integration-cdc-test 🔴 failed 34, success 2, total 36 33 min Existing failure
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 18 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 7 min 13 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 5 min 43 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 5 min 23 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 5 min 3 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 4 min 53 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 23 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support common table expression (CTE)
7 participants