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

fix(tianmu) Query results more data (#282) #599

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions mysql-test/suite/tianmu/r/issue282.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
use test;
RingsC marked this conversation as resolved.
Show resolved Hide resolved
CREATE TABLE issue282_t1 (sku int PRIMARY KEY, pr int)engine=tianmu;
CREATE TABLE issue282_t2 (sku int PRIMARY KEY, sppr int, name varchar(255))engine=tianmu;
INSERT INTO issue282_t1 VALUES
(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10);
INSERT INTO issue282_t2 VALUES
(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'),
(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh');
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 AND (issue282_t2.sku=issue282_t1.sku OR issue282_t2.sppr=issue282_t1.sku);
sku sppr name sku pr
20 10 bbb 10 10
20 10 bbb 20 10
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR (issue282_t2.sku=issue282_t1.sku OR issue282_t2.sppr=issue282_t1.sku) order by issue282_t2.sku asc;
sku sppr name sku pr
10 10 aaa 10 10
20 10 bbb 10 10
20 10 bbb 20 10
20 10 bbb 30 20
20 10 bbb 40 30
20 10 bbb 50 10
20 10 bbb 60 10
30 10 ccc 10 10
30 10 ccc 30 20
40 20 ddd 20 10
40 20 ddd 40 30
50 10 eee 10 10
50 10 eee 50 10
60 20 fff 20 10
60 20 fff 60 10
70 20 ggg 20 10
80 30 hhh 30 20
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 AND (issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku);
sku sppr name sku pr
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR (issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku);
sku sppr name sku pr
10 10 aaa 10 10
20 10 bbb 10 10
20 10 bbb 20 10
20 10 bbb 30 20
20 10 bbb 40 30
20 10 bbb 50 10
20 10 bbb 60 10
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku;
sku sppr name sku pr
10 10 aaa 10 10
20 10 bbb 10 10
20 10 bbb 20 10
20 10 bbb 30 20
20 10 bbb 40 30
20 10 bbb 50 10
20 10 bbb 60 10
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku>20 OR issue282_t2.sku=issue282_t1.sku) AND issue282_t2.sppr=issue282_t1.sku;
sku sppr name sku pr
10 10 aaa 10 10
30 10 ccc 10 10
40 20 ddd 20 10
50 10 eee 10 10
60 20 fff 20 10
70 20 ggg 20 10
80 30 hhh 30 20
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku<=20 OR issue282_t2.sku=issue282_t1.sku) AND issue282_t2.sppr=issue282_t1.sku;
sku sppr name sku pr
10 10 aaa 10 10
20 10 bbb 10 10
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku<=20 AND issue282_t2.sku>issue282_t1.sku) OR issue282_t2.sppr=issue282_t1.sku;
sku sppr name sku pr
10 10 aaa 10 10
20 10 bbb 10 10
30 10 ccc 10 10
50 10 eee 10 10
40 20 ddd 20 10
60 20 fff 20 10
70 20 ggg 20 10
80 30 hhh 30 20
#
# Multiple nesting
#
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE
issue282_t1.sku=60 OR
(issue282_t2.sku=20 AND
(issue282_t2.sku=issue282_t1.sku OR
issue282_t2.sppr=issue282_t1.sku));
sku sppr name sku pr
20 10 bbb 10 10
20 10 bbb 20 10
10 10 aaa 60 10
20 10 bbb 60 10
30 10 ccc 60 10
40 20 ddd 60 10
50 10 eee 60 10
60 20 fff 60 10
70 20 ggg 60 10
80 30 hhh 60 10
SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE
issue282_t1.sku=10 AND
(issue282_t2.sku=20 AND
(issue282_t2.sku=issue282_t1.sku OR
issue282_t2.sppr=issue282_t1.sku));
sku sppr name sku pr
20 10 bbb 10 10
drop table issue282_t1 ,issue282_t2;
56 changes: 56 additions & 0 deletions mysql-test/suite/tianmu/t/issue282.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--source include/have_tianmu.inc

use test;
CREATE TABLE issue282_t1 (sku int PRIMARY KEY, pr int)engine=tianmu;
CREATE TABLE issue282_t2 (sku int PRIMARY KEY, sppr int, name varchar(255))engine=tianmu;

INSERT INTO issue282_t1 VALUES
(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10);

INSERT INTO issue282_t2 VALUES
(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'),
(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh');

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 AND (issue282_t2.sku=issue282_t1.sku OR issue282_t2.sppr=issue282_t1.sku);

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR (issue282_t2.sku=issue282_t1.sku OR issue282_t2.sppr=issue282_t1.sku) order by issue282_t2.sku asc;

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 AND (issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku);

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR (issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku);

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE issue282_t2.sku=20 OR issue282_t2.sku=issue282_t1.sku AND issue282_t2.sppr=issue282_t1.sku;

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku>20 OR issue282_t2.sku=issue282_t1.sku) AND issue282_t2.sppr=issue282_t1.sku;

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku<=20 OR issue282_t2.sku=issue282_t1.sku) AND issue282_t2.sppr=issue282_t1.sku;

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE (issue282_t2.sku<=20 AND issue282_t2.sku>issue282_t1.sku) OR issue282_t2.sppr=issue282_t1.sku;

--echo #
--echo # Multiple nesting
--echo #

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE
issue282_t1.sku=60 OR
(issue282_t2.sku=20 AND
(issue282_t2.sku=issue282_t1.sku OR
issue282_t2.sppr=issue282_t1.sku));

SELECT issue282_t2.sku, issue282_t2.sppr, issue282_t2.name, issue282_t1.sku, issue282_t1.pr
FROM issue282_t2, issue282_t1 WHERE
issue282_t1.sku=10 AND
(issue282_t2.sku=20 AND
(issue282_t2.sku=issue282_t1.sku OR
issue282_t2.sppr=issue282_t1.sku));

drop table issue282_t1 ,issue282_t2;
Loading