Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
2bfef26
pkg/server/handler/optimizor: stabilize plan replayer tests (#65735)
wjhuang2016 Jan 24, 2026
afbf7ac
parser: add split region options DDL (#65579)
xhebox Jan 25, 2026
dace550
br: PITR table filter reuses database id if it exists (#65631)
Leavrth Jan 26, 2026
6d55295
pkg/util/gctuner: stabilize TestIssue48741 (#65733)
wjhuang2016 Jan 26, 2026
d731491
*: upgrade client-go to lastest version (#65743)
lcwangchao Jan 26, 2026
fc6f7b2
pkg/executor: fix unstable TestIssue20779 (#65770)
wjhuang2016 Jan 26, 2026
959bf33
planner: support basic usage of partial index (#65051)
winoros Jan 26, 2026
5de6f55
pkg/planner: fix data race in Plan.ExplainID (#65776)
wjhuang2016 Jan 26, 2026
a56735e
image: upgrade base version (#65718)
hawkingrei Jan 26, 2026
5da5f2a
pkg/server: fix unstable TestTTL (#65784)
wjhuang2016 Jan 26, 2026
e6689be
planner: support straight_join() hint in CTEs and subqueries (#65696)
fixdb Jan 27, 2026
f803235
pkg/privilege: fix flaky ldap TLS tests (#65773)
wjhuang2016 Jan 27, 2026
5ee2924
.gitignore: group its content and change bazel related for git worktr…
winoros Jan 27, 2026
550a05a
.gitignore: add back the bazel gitignore items (#65859)
YangKeao Jan 28, 2026
a919687
planner: introduce external storage for plan replayer (#65477)
zeminzhou Jan 28, 2026
245c8e1
dml: fix the data/index inconsistency when updating partial index or …
YangKeao Jan 28, 2026
39856f6
plan, exec: pushing down limit to slow log executor (#65740)
lance6716 Jan 28, 2026
41ba813
planner: refactor some test cases (#65790)
hawkingrei Jan 28, 2026
de6b177
AGENTS.md: use bazel bin (#65842)
hawkingrei Jan 28, 2026
f4cf761
planner: skip out of range for full range (#65854)
terry1purcell Jan 28, 2026
f9b0e05
bindinfo, planner: restore binding match cache for plan cache (#65766)
hawkingrei Jan 28, 2026
fbe0162
pkg/util: fix workloadrepo interval race (#65777)
wjhuang2016 Jan 28, 2026
1e98f72
build(deps-dev): bump lodash from 4.17.21 to 4.17.23 in /lightning/we…
dependabot[bot] Jan 28, 2026
0a79a3e
*: stabilize integrationtest privilege/privileges (#65787)
wjhuang2016 Jan 29, 2026
592130e
*: upgrade client-go and grpc-go (#65850)
joechenrh Jan 29, 2026
9a3cd60
cmd/tidb-server: bypass store liveness check on unistore (#65855)
wjhuang2016 Jan 29, 2026
d6709d2
planner: support `flush stats_delta cluster` (#65879)
qw4990 Jan 29, 2026
811a10e
planner: Fixes panic when setting tidb_opt_fix_control with an empty …
qw4990 Jan 29, 2026
e94da42
lightning: fix flaky integration test (#65891)
D3Hunter Jan 29, 2026
76aa193
pkg/planner: fix unstable index advisor TPCH tests (#65783)
wjhuang2016 Jan 29, 2026
8355dd2
pkg/sessiontxn: fix stale read infoschema assertions (#65786)
wjhuang2016 Jan 29, 2026
45b0b29
executor: respect session sysvars in fast admin check (#65877)
fzzf678 Jan 29, 2026
62e3fca
statistics: refactor out of range percent calculations (#65857)
terry1purcell Jan 29, 2026
1ac156c
executor: reuse projection builder for index join (#65774)
AilinKid Jan 29, 2026
060097f
pkg/domain: close stats handle before closing advanced sys session po…
wjhuang2016 Jan 29, 2026
e8a60bd
s3: add RequestChecksumCalculationWhenRequired for s3Compatible clien…
GMHDBJD Jan 29, 2026
b54d84b
planner: speed up TestPlanCacheRandomCases (#65844)
fixdb Jan 29, 2026
f33cb3c
planner: replace `DumpStatsDeltaToKV` function call with `flush stats…
qw4990 Jan 29, 2026
2c54c80
objstore/locking: don't use "." as prefix when locking (#65903)
YuJuncen Jan 29, 2026
32d5e26
statistics: sync stats session time_zone with global value (#65821)
0xPoe Jan 29, 2026
fad8e67
ddl: forbid drop/rename on system tables in nextgen and change BR to …
D3Hunter Jan 30, 2026
9b3495f
executor: optimize analyze column memory usage (#65446)
guo-shaoge Jan 30, 2026
e6fa5f4
s3: use ListObjectsV2 instead of v1 for object listing (#65894)
Leavrth Jan 30, 2026
36fa9a1
benchdaily: remove useless item (#65927)
hawkingrei Jan 30, 2026
fb1a575
pkg/bindinfo: fix flaky TestBatchDropBindings (#65769)
wjhuang2016 Jan 30, 2026
da96b4d
pkg/statistics: fix flaky globalstats binding concurrency test (#65771)
wjhuang2016 Jan 30, 2026
258332a
refactor(runaway): use info cache to check runaway watch tables (#65747)
JmPotato Jan 30, 2026
85389ef
*: stabilize integrationtest executor/stale_txn (#65788)
wjhuang2016 Jan 30, 2026
d122abe
*: update AGENTS.md issue and regression-test rules (#65912)
wjhuang2016 Feb 2, 2026
d2ae4e8
*: stabilize integrationtest stale read timestamp (#65953)
wjhuang2016 Feb 2, 2026
bbeaafd
objstore: use aws.retryer interface instead (#65949)
Leavrth Feb 2, 2026
279453c
planner/core: fix leading hint mismatch causing missing other conditi…
guo-shaoge Feb 2, 2026
c2202e1
planner: refactor TestVerboseExplain (#65933)
hawkingrei Feb 2, 2026
5da8f9a
executor: fix plan replayer load for semicolons (#65885)
fixdb Feb 2, 2026
44c7345
pkg/util: stabilize TLS tests (#65734)
wjhuang2016 Feb 2, 2026
b99298c
pkg/server/handler/optimizor: stabilize stats handler test (#65736)
wjhuang2016 Feb 2, 2026
77b0fee
planner: Remove an unused return value from cardinality.Selectivity. …
wddevries Feb 2, 2026
d6c47b0
planner: fix EXISTS subquery on cluster tables causing Column ID -1 (…
eureka928 Feb 2, 2026
53c8982
planner: fix plan explore can not detect the specific index path. (#6…
AilinKid Feb 2, 2026
38fdd1b
planner: reduce within bucket usage of range risk (#65856)
terry1purcell Feb 2, 2026
97c2efc
memory: fix data race & enhance behaviors in arbitrator (#65569)
solotzg Feb 3, 2026
ba22c17
importinto: use real file size when calculate resource (#65762)
D3Hunter Feb 3, 2026
3e15cf8
planner: nominate guo-shaoge as planner approver. (#65995)
AilinKid Feb 3, 2026
06da9d7
pkg/resourcegroup: fix unstable TestResourceGroupRunaway (#65780)
wjhuang2016 Feb 3, 2026
3acb646
*: adapt TopSQL naming for TopProfiling (prepare for TopRU) (#65820)
zimulala Feb 3, 2026
1b68e1e
feat(session): add schema upgrade v254 to optimize runaway watch inde…
JmPotato Feb 3, 2026
6c97ced
planner: handle double NOT in outer join (#65942)
hawkingrei Feb 3, 2026
72d131e
stmtsummary: fix a memory leak caused by stmt summary referencing pac…
tiancaiamao Feb 3, 2026
995d6f9
stats: add defensive guard for interval calculation (#65889)
0xPoe Feb 3, 2026
715b1cc
planner, core: implement partial order TopN attach2Task and partial o…
elsa0520 Feb 3, 2026
ec781f5
bindinfo: explore per-table index hints during plan generation (#66000)
AilinKid Feb 3, 2026
6ff1adf
planner: make pkg integration tests ignore plan-id with explain forma…
lostcache Feb 3, 2026
91c63e0
Merge branch 'master' into aa_merge_master_2
lcwangchao Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/skills/tidb-test-guidelines/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ description: Decide where to place TiDB tests and how to write them (basic struc
- If a test must use multiple sessions or domains (for example, cross-session cache behavior), keep the extra stores/testkits but document why in the test.
- Keep per-test runtime short; consolidate similar checks only if runtime stays reasonable.
- Use behavior-based test names; never use issue-id-only names.
- In test code, use the variable name `tk` for `*testkit.TestKit` (avoid `testKit`).
- When merging multiple tests into one, keep a single `store` and a single `tk` unless multi-session behavior is required; do not create a new store/tk inside the same test body without a documented reason.

## Placement rules

Expand All @@ -38,9 +40,11 @@ description: Decide where to place TiDB tests and how to write them (basic struc

- Apply the same rules (placement, shard_count, naming) to other packages beyond `pkg/planner`.
- Use existing testdata patterns (`*_in.json`, `*_out.json`, `*_xut.json`) in the same directory when extending suites. When tests use testdata, run with `-record --tags=intest` as needed.
- For `pkg/planner/core/casetest/rule` predicate pushdown cases, keep SQL in `predicate_pushdown_suite_in.json` and record both `EXPLAIN format='brief'` and query results via the test runner (see `rule_predicate_pushdown_test.go`).
- When moving benchmarks between packages, update any `TestBenchDaily` wrappers that list them and keep `Makefile` `bench-daily` entries aligned with the new package location.
- When updating tests in any `pkg/*` package, ask AI to update the corresponding case map under `references/`.
- When updating tests in any other directory, also update this skill: add or extend a case map under `references/` and add guidance in this `SKILL.md` so future changes stay consistent.
- When merging issue regression tests into existing behavior tests, keep the issue id in SQL comments (e.g. `/* issue:12345 */`) or nearby comments for traceability.
- Prefer unit tests over `tests/integrationtest` for end-to-end coverage unless you need to avoid union-storage executor differences or require full workflow validation.
- When tests read source files under Bazel, use `go/runfiles` and ensure the target file is exported via `exports_files()` in its owning `BUILD.bazel`.
- For Bazel runfiles, be ready to include the workspace prefix (from `TEST_WORKSPACE`) in the runfile path if needed.
Expand Down
23 changes: 11 additions & 12 deletions .github/skills/tidb-test-guidelines/references/planner-case-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@
## pkg/planner/core/casetest

### Tests
- `pkg/planner/core/casetest/integration_test.go` - planner/core/casetest: Cascades integration cases for verbose explain outputs, TiFlash isolation/MPP/partition behaviors, fix-control regressions, and issue-specific plan checks.
- `pkg/planner/core/casetest/integration_test.go` - planner/core/casetest: Cascades integration cases for verbose explain outputs, TiFlash isolation/MPP/partition behaviors, fix-control regressions, and merged issue regressions.
- `pkg/planner/core/casetest/main_test.go` - Configures default goleak settings and registers testdata.
- `pkg/planner/core/casetest/plan_test.go` - planner/core/casetest: Tests prefer range scan and normalized plan output.
- `pkg/planner/core/casetest/plan_test.go` - planner/core/casetest: Tests plan digest stability, normalized plan output, and related regressions.
- `pkg/planner/core/casetest/stats_test.go` - planner/core/casetest: Tests group NDVs.
- `pkg/planner/core/casetest/tiflash_predicate_push_down_test.go` - planner/core/casetest: Tests TiFlash late materialization and inverted index plans.

### Testdata
- `pkg/planner/core/casetest/testdata/integration_suite_in.json`
Expand Down Expand Up @@ -167,7 +166,7 @@
## pkg/planner/core/casetest/cbotest

### Tests
- `pkg/planner/core/casetest/cbotest/cbo_test.go` - planner/core/casetest/cbotest: Tests CBO regressions, no-analyze stats, and straight join cases.
- `pkg/planner/core/casetest/cbotest/cbo_test.go` - planner/core/casetest/cbotest: Tests CBO analyze suites, no-analyze stats, straight join cases, and merged issue regressions.
- `pkg/planner/core/casetest/cbotest/main_test.go` - Configures default goleak settings and registers testdata.

### Testdata
Expand Down Expand Up @@ -293,7 +292,7 @@
## pkg/planner/core/casetest/join

### Tests
- `pkg/planner/core/casetest/join/join_test.go` - planner/core/casetest/join: Tests semijoin order, NULL-safe join EQ, join condition simplification, join key preservation, and issue regressions.
- `pkg/planner/core/casetest/join/join_test.go` - planner/core/casetest/join: Tests semijoin order, NULL-safe join EQ, join condition simplification, join key preservation, and merged issue regressions.
- `pkg/planner/core/casetest/join/main_test.go` - Configures default goleak settings and registers testdata.

## pkg/planner/core/casetest/logicalplan
Expand All @@ -306,7 +305,7 @@

### Tests
- `pkg/planner/core/casetest/mpp/main_test.go` - Configures default goleak settings and registers testdata.
- `pkg/planner/core/casetest/mpp/mpp_test.go` - planner/core/casetest/mpp: Tests MPP joins (broadcast/shuffle), exchange pruning, fine-grained join/agg, pushdown rules, versioning, and issue regressions.
- `pkg/planner/core/casetest/mpp/mpp_test.go` - planner/core/casetest/mpp: Tests MPP joins (broadcast/shuffle), exchange pruning, join/agg pushdown, versioning, and merged issue regressions.

### Testdata
- `pkg/planner/core/casetest/mpp/testdata/integration_suite_in.json`
Expand All @@ -324,7 +323,7 @@
### Tests
- `pkg/planner/core/casetest/partition/integration_partition_test.go` - planner/core/casetest/partition: Tests list/list-columns pruning and dynamic/static plan differences.
- `pkg/planner/core/casetest/partition/main_test.go` - Configures default goleak settings and registers testdata.
- `pkg/planner/core/casetest/partition/partition_pruner_test.go` - planner/core/casetest/partition: Tests hash/list partition pruning and partition info extraction.
- `pkg/planner/core/casetest/partition/partition_pruner_test.go` - planner/core/casetest/partition: Tests partition pruning rules, extract functions, and merged issue regressions.

### Testdata
- `pkg/planner/core/casetest/partition/testdata/integration_partition_suite_in.json`
Expand All @@ -338,7 +337,7 @@

### Tests
- `pkg/planner/core/casetest/physicalplantest/main_test.go` - Configures default goleak settings and registers testdata.
- `pkg/planner/core/casetest/physicalplantest/physical_plan_test.go` - planner/core/casetest/physicalplantest: Tests refine/agg eliminator with plan suite data.
- `pkg/planner/core/casetest/physicalplantest/physical_plan_test.go` - planner/core/casetest/physicalplantest: Tests plan suite cases, MPP hints, agg elimination, and merged issue regressions.

### Testdata
- `pkg/planner/core/casetest/physicalplantest/testdata/cascades_template_in.json`
Expand All @@ -358,7 +357,7 @@
- `pkg/planner/core/casetest/plancache/plan_cache_rebuild_test.go` - planner/core/casetest/plancache: Tests cached-plan clone/rebuild correctness and fast point get cloning.
- `pkg/planner/core/casetest/plancache/plan_cache_suite_test.go` - planner/core/casetest/plancache: Tests prepared/non-prepared plan cache regressions, bindings, MV index, and resource groups.
- `pkg/planner/core/casetest/plancache/plan_cache_test.go` - planner/core/casetest/plancache: Tests deallocate prepare cache separation and cache key benchmarks.
- `pkg/planner/core/casetest/plancache/plan_cacheable_checker_test.go` - planner/core/casetest/plancache: Tests cacheable checks, IN-list fix control, and issue regressions.
- `pkg/planner/core/casetest/plancache/plan_cacheable_checker_test.go` - planner/core/casetest/plancache: Tests cacheable checks, IN-list fix control, and merged issue regressions.

### Testdata
- `pkg/planner/core/casetest/plancache/testdata/plan_cache_suite_in.json`
Expand Down Expand Up @@ -396,9 +395,9 @@
- `pkg/planner/core/casetest/rule/rule_eliminate_projection_test.go` - planner/core/casetest/rule: Tests projection elimination with expression indexes.
- `pkg/planner/core/casetest/rule/rule_inject_extra_projection_test.go` - planner/core/casetest/rule: Tests cast injection for aggregate function modes.
- `pkg/planner/core/casetest/rule/rule_join_reorder_test.go` - planner/core/casetest/rule: Tests join reorder hints, hash-join toggle, and TiFlash/dynamic partitions.
- `pkg/planner/core/casetest/rule/rule_outer2inner_test.go` - planner/core/casetest/rule: Tests outer-to-inner rewrites with regressions.
- `pkg/planner/core/casetest/rule/rule_outer2inner_test.go` - planner/core/casetest/rule: Tests outer-to-inner rewrites with merged issue regressions.
- `pkg/planner/core/casetest/rule/rule_outer_to_semi_join_test.go` - planner/core/casetest/rule: Tests outer-to-semi join rewrite correctness.
- `pkg/planner/core/casetest/rule/rule_predicate_pushdown_test.go` - planner/core/casetest/rule: Tests predicate pushdown cases with collation-sensitive constants.
- `pkg/planner/core/casetest/rule/rule_predicate_pushdown_test.go` - planner/core/casetest/rule: Tests predicate pushdown cases and records plan+result for selected cases.
- `pkg/planner/core/casetest/rule/rule_predicate_simplification_test.go` - planner/core/casetest/rule: Tests predicate simplification across complex schemas.

### Testdata
Expand Down Expand Up @@ -477,7 +476,7 @@
### Tests
- `pkg/planner/core/casetest/windows/main_test.go` - Configures default goleak settings and registers testdata.
- `pkg/planner/core/casetest/windows/widow_with_exist_subquery_test.go` - planner/core/casetest/windows: Tests window functions with correlated EXISTS subqueries.
- `pkg/planner/core/casetest/windows/window_push_down_test.go` - planner/core/casetest/windows: Tests TiFlash window pushdown plans and warnings.
- `pkg/planner/core/casetest/windows/window_push_down_test.go` - planner/core/casetest/windows: Tests TiFlash window pushdown plans, warnings, and merged issue regressions.

### Testdata
- `pkg/planner/core/casetest/windows/testdata/window_push_down_suite_in.json`
Expand Down
98 changes: 61 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,56 +1,80 @@
# OS / filesystem
__MACOSX
bin
/tidb-server/tidb-server
/tidb-server/debug
coverage.out
.DS_Store

# Editor / IDE
.idea/
*.iml
.ijwb/
.vscode
*.swp
*.log
*.test.bin
tags
profile.coverprofile
mysql_tester
tests/integrationtest/integration-test.out
tests/integrationtest/integrationtest_tidb-server
tests/integrationtest/s/
tests/integrationtest/replayer/
*.fail.go

# Local tooling metadata
.specstory
.cursor
.codex
.trae

# Go workspace / tooling
go.work
go.work.sum
.golangci.bck.yml

# Binaries / generated tools
bin
/tidb-server/tidb-server
/tidb-server/debug
tools/bin/
vendor
mysql_tester
genkeyword
/_tools/
.DS_Store
.vscode
bench_daily.json
coverage.txt
var
fix.sql
export-20*/
*-coverage.xml
*-junit-report.xml
compose-dev.yaml
# Files generated when testing
out

# Dependencies
vendor

# Bazel
# skywalking-eyes 0.4 cannot handle the git glob syntax correctly. As a temporary workaround,
# we explicitly list the bazel-related files and directories to be ignored.
# TODO: test and consider upgrading skywalking-eyes in the future.
/_bazel
bazel-*
bazel-bin
bazel-out
bazel-testlogs
bazel-tidb
MODULE.bazel.lock
.ijwb/
/oom_record/
*.log.json
genkeyword

# Testing / coverage / reports
# Files generated when testing
out
test_coverage
coverage.out
coverage.txt
coverage.dat
.specstory
.golangci.bck.yml
go.work
go.work.sum
.cursor
.codex
profile.coverprofile
*-coverage.xml
*-junit-report.xml
*.test.bin
*.fail.go
*.log
*.log.json
*__failpoint_stash__
/oom_record/

# Integration tests
tests/integrationtest/integration-test.out
tests/integrationtest/integrationtest_tidb-server
tests/integrationtest/s/
tests/integrationtest/replayer/

# Local dev artifacts
bench_daily.json
compose-dev.yaml
fix.sql
export-20*/
var

# Personal config files
/*config.toml
.cache
.trae
27 changes: 26 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ This file provides guidance to agents when working with code in this repository.

- When creating new source files (for example: `*.go`), include the standard TiDB copyright (and Apache 2.0 license) header at the top; copy the header from an existing file in the same directory and update the year if needed.

### Notes

- Notes directory: `docs/note/<component>/` is the canonical location for component notes. If missing, create it and add an entry here.
- Notes rules: update existing sections when topics overlap; append new sections only for new topics. Purpose: capture decisions, pitfalls, and test patterns.
- Planner rule notes: `docs/note/planner/rule/rule_ai_notes.md`.
- If a single notes file exceeds 2000 lines, split by functionality into multiple markdown files and update references here.

## Building

### Bazel bootstrap (`make bazel_prepare`)
Expand All @@ -68,7 +75,7 @@ Recommended local build flow:
make bazel_prepare

# build
make
make bazel_bin

# optional: regenerate generated code if needed
make gogenerate
Expand Down Expand Up @@ -136,6 +143,13 @@ The following points must be achieved:
2. Existing tests should be reused as much as possible, and existing test data and table structures should be utilized. Modifications should be made on this basis to accommodate the new tests.
3. Some tests use the JSON files in `testdata` as the test set (`xxxx_in.json`) and the validation set (`xxxx_out.json` and `xxxx_xut.json`). It is necessary to modify the test set before running the unit test.

#### Regression tests for bug fixes

- A bug fix should include a regression test that reproduces the issue.
- Verify the new/updated test fails on the buggy code (before the fix), and passes after the fix.
- Example approaches: run the test on `upstream/master` (or the target base commit) before applying the fix, or temporarily revert the fix and confirm the test fails.
- Include the exact test command in the PR description under `Tests` (for example: `go test -run TestXxx --tags=intest ./pkg/...`).

### Integration Tests

Integration tests are located in the `/tests/integrationtest` directory.
Expand Down Expand Up @@ -249,6 +263,17 @@ curl -f "http://${PD_ADDR}/pd/api/v1/version"
- **Environment check**: Check for running playground processes before starting.
- **Fmt-only changes**: If PR only involves code formatting (gofmt, indentation), do NOT run time-consuming `realtikvtest`. Just ensure local compilation passes.

## Issue Instructions

- When submitting an issue, follow the GitHub templates under `.github/ISSUE_TEMPLATE/` and fill in all required fields.
- Bug reports should include minimal reproduction steps, expected/actual behavior, and the TiDB version (for example: the output of `SELECT tidb_version()`).
- Search existing issues/PRs first to avoid duplicates (try `gh` first; for example: `gh search issues --repo pingcap/tidb --include-prs "<keywords>"`), and include any relevant logs/configuration/SQL plans to help diagnosis.
- Apply labels to help triage:
- `type/*` is usually applied by the issue template; add `type/regression` when applicable.
- Add at least one `component/*` label (for example: `component/ddl`, `component/br`, `component/parser`).
- For bug/regression issues, `severity/*` and affected-version label(s) are required (for example: `affects-8.5`; use `may-affects-*` if unsure).
- If you don't have permission to add labels, include a `Suggested labels: ...` line in the issue body.

## Pull Request Instructions

### PR title
Expand Down
Loading