Skip to content

explain_test does not check results last output. #29475

@mjonss

Description

@mjonss

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

change directory to the tidb repository and run:

git checkout 5ae87cae85e
(cd cmd/explaintest/ ; TZ='Europe/Amsterdam' ./run-tests.sh -t explain_generate_column_substitute)
(cd cmd/explaintest/ ; TZ='Europe/Amsterdam' ./run-tests.sh -r explain_generate_column_substitute)
git diff

This results in the error of explain_generate_column_substitute, since ed17428 did add more rows to the test file, resulting in the check of the last output that is empty from executing the select * from t ignore index(expression_index3) where d+ timestamp'0000-00-00 00:00:00.00001' = timestamp'2021-08-13 04:10:44'+ timestamp'0000-00-00 00:00:00.00001'; but is set to the same as with the index in the result file.

2. What did you expect to see? (Required)

Failure of the test or no diff after recording a new result.

3. What did you see instead (Required)

~/repos/tidb$ git checkout 5ae87cae85e
HEAD is now at 5ae87cae85 types: fix fsp for datetime, time and timestamp (#27170)
~/repos/tidb$ (cd cmd/explaintest/ ; ./run-tests.sh -t explain_generate_column_substitute)
extracting statistics: s
building tidb-server binary: ./explaintest_tidb-server
building portgenerator binary: ./portgenerator
building explain-test binary: ./explain_test
start tidb-server, log file: ./explain-test.out
tidb-server(PID: 998869) started
run explain test cases: explain_generate_column_substitute
explaintest end
~/repos/tidb$ (cd cmd/explaintest/ ; ./run-tests.sh -r explain_generate_column_substitute)
extracting statistics: s
building tidb-server binary: ./explaintest_tidb-server
building portgenerator binary: ./portgenerator
building explain-test binary: ./explain_test
start tidb-server, log file: ./explain-test.out
tidb-server(PID: 999384) started
record result for case: "explain_generate_column_substitute"
explaintest end
~/repos/tidb$ git diff
diff --git a/cmd/explaintest/r/explain_generate_column_substitute.result b/cmd/explaintest/r/explain_generate_column_substitute.result
index 5efbd22acf..99e4497b40 100644
--- a/cmd/explaintest/r/explain_generate_column_substitute.result
+++ b/cmd/explaintest/r/explain_generate_column_substitute.result
@@ -485,4 +485,3 @@ a   b       c       d       e
 2021-01-02     2021-03-30 08:10:00     12:01:03        2021-08-13 04:10:44     2021
 select * from t ignore index(expression_index3) where d+ timestamp'0000-00-00 00:00:00.00001' = timestamp'2021-08-13 04:10:44'+ timestamp'0000-00-00 00:00:00.00001';
 a      b       c       d       e
-2021-01-02     2021-03-30 08:10:00     12:01:03        2021-08-13 04:10:44     2021
~/repos/tidb$ 

4. What is your TiDB version? (Required)

Master branch as of d80efa5

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions