-
-
Notifications
You must be signed in to change notification settings - Fork 142
fix(tianmu): fix mysqld crash when exec query limit 0 (#1394) #1395
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| DROP DATABASE IF EXISTS issue1394_test; | ||
| CREATE DATABASE issue1394_test; | ||
| USE issue1394_test; | ||
| create table c(c1 int, c2 varchar(2)) engine=TIANMU; | ||
| create table d(d1 int, d2 varchar(2)) engine=TIANMU; | ||
| insert into c values(1, 'c1'); | ||
| insert into c values(2, 'c2'); | ||
| insert into c values(null, 'c3'); | ||
| insert into d values(1, 'd1'); | ||
| insert into d values(2, 'd2'); | ||
| insert into d values(null, 'd3'); | ||
| select * from d; | ||
| d1 d2 | ||
| 1 d1 | ||
| 2 d2 | ||
| NULL d3 | ||
| select * from d limit 0; | ||
| d1 d2 | ||
| select * from d limit 1; | ||
| d1 d2 | ||
| 1 d1 | ||
| select * from d where d1=1 limit 0; | ||
| d1 d2 | ||
| select * from d where d1=1 limit 1; | ||
| d1 d2 | ||
| 1 d1 | ||
| select * from c where exists ( select * from d where d1=1 limit 0); | ||
| c1 c2 | ||
| 1 c1 | ||
| 2 c2 | ||
| NULL c3 | ||
| select * from c where exists ( select * from d where d1=1 limit 1); | ||
| c1 c2 | ||
| 1 c1 | ||
| 2 c2 | ||
| NULL c3 | ||
| select * from c where exists ( select * from d where d1=1 limit 0,1) limit 0; | ||
| c1 c2 | ||
| select * from c where exists ( select * from d where d1=1 limit 0,1) limit 1; | ||
| c1 c2 | ||
| 1 c1 | ||
| select * from c where exists ( select * from d where d1=1 limit 0) limit 0; | ||
| c1 c2 | ||
| select * from c where exists ( select * from d where d1=1 limit 1) limit 1; | ||
| c1 c2 | ||
| 1 c1 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL; | ||
| c1 c2 d1 d2 | ||
| NULL NULL NULL d3 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 1; | ||
| c1 c2 d1 d2 | ||
| NULL NULL NULL d3 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 0; | ||
| c1 c2 d1 d2 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL; | ||
| c1 c2 d1 d2 | ||
| 1 c1 1 d1 | ||
| 2 c2 2 d2 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 1; | ||
| c1 c2 d1 d2 | ||
| 1 c1 1 d1 | ||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 0; | ||
| c1 c2 d1 d2 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL; | ||
| c1 c2 d1 d2 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 1; | ||
| c1 c2 d1 d2 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 0; | ||
| c1 c2 d1 d2 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL; | ||
| c1 c2 d1 d2 | ||
| 1 c1 1 d1 | ||
| 2 c2 2 d2 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 1; | ||
| c1 c2 d1 d2 | ||
| 1 c1 1 d1 | ||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 0; | ||
| c1 c2 d1 d2 | ||
| DROP DATABASE issue1394_test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --source include/have_tianmu.inc | ||
|
|
||
| --disable_warnings | ||
| DROP DATABASE IF EXISTS issue1394_test; | ||
| --enable_warnings | ||
|
|
||
| CREATE DATABASE issue1394_test; | ||
|
|
||
| USE issue1394_test; | ||
|
|
||
| --disable_warnings | ||
|
|
||
| ## DDL | ||
|
|
||
| create table c(c1 int, c2 varchar(2)) engine=TIANMU; | ||
|
|
||
| create table d(d1 int, d2 varchar(2)) engine=TIANMU; | ||
|
|
||
| ## insert data | ||
|
|
||
| insert into c values(1, 'c1'); | ||
|
|
||
| insert into c values(2, 'c2'); | ||
|
|
||
| insert into c values(null, 'c3'); | ||
|
|
||
| insert into d values(1, 'd1'); | ||
|
|
||
| insert into d values(2, 'd2'); | ||
|
|
||
| insert into d values(null, 'd3'); | ||
|
|
||
| ## query | ||
|
|
||
| select * from d; | ||
|
|
||
| select * from d limit 0; | ||
|
|
||
| select * from d limit 1; | ||
|
|
||
| select * from d where d1=1 limit 0; | ||
|
|
||
| select * from d where d1=1 limit 1; | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 0); | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 1); | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 0,1) limit 0; | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 0,1) limit 1; | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 0) limit 0; | ||
|
|
||
| select * from c where exists ( select * from d where d1=1 limit 1) limit 1; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 1; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 0; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 1; | ||
|
|
||
| SELECT * FROM c RIGHT OUTER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 0; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 1; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NULL limit 0; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 1; | ||
|
|
||
| SELECT * FROM c INNER JOIN d ON c.c1 = d.d1 WHERE d.d1 IS NOT NULL limit 0; | ||
|
|
||
| ## clean test table | ||
|
|
||
| DROP DATABASE issue1394_test; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.