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
subselect in the UNION ALL
query may produce incorrect result
#52992
Comments
Stable reproduce
Or wait for 1 minute for the modified row count to be dumped into the table. ExplanationNot sure why, but it's only reproducible when the
And the Lines 1779 to 1797 in b1818cd
Root causeIn brief, it's mainly related to the The detailed process is as follows:
I believe we need to check and disable the wrong |
Similar to issue #52985 , and lower severity to major. |
/remove-severity critical |
/severity major |
1. Minimal reproduce step (Required)
Firstly, execute
init.sql
to create the table. Then executingerror.sql
yields unexpected results. Note that reproducing these results might not be entirely stable. Typically, it can be completed within three attempts. You can try executingerror.sql
multiple times or executeinit.sql
again to rebuild the table.init.sql.txt
error.sql.txt
This problem is not easy to reproduce, but I have managed to reproduceit successfully several times. Sometimes, it requires waiting for a while after creating the table before repeatedly executing
error.sql
.2. What did you expect to see? (Required)
When the result in the first column is 1, it means it comes from the second select query, where the third column is a subquery. When executed separately, the result of the subquery is NULL.
Therefore, when the first column is 1, the third column should always be NULL.
3. What did you see instead (Required)
However, there are some cases where the column is not NULL, and there is inconsistency between the TiDB single-node version and the multi-node version.
output_re_main2.log
output_re_single2.log
4. What is your TiDB version? (Required)
topology:
distributed.yaml:
single.yaml
about us
We are the BASS team from the School of Cyber Science and Technology at Beihang University. Our main focus is on system software security, operating systems, and program analysis research, as well as the development of automated program testing frameworks for detecting software defects. Using our self-developed database vulnerability testing tool, we have identified the above-mentioned vulnerabilities in TiDB that may lead to database logic error.
The text was updated successfully, but these errors were encountered: