biokoda / actordb

ActorDB distributed SQL database
Mozilla Public License 2.0
1.89k stars 72 forks source link

Same name columns in query result are swallowed and column order can't be specified #74

Open forchid opened 5 years ago

forchid commented 5 years ago

Query result issues

Case-1: Table a or b result are swallowed

actordb> actor bank(b);select * from accounts a join accounts b on a.id=b.id limit 20;
actordb (1)> c
******************
balance id name |
------------------
0       0  账户-0  |
1       1  账户-1  |
2       2  账户-2  |
3       3  账户-3  |
4       4  账户-4  |
5       5  账户-5  |
6       6  账户-6  |
7       7  账户-7  |
8       8  账户-8  |
9       9  账户-9  |
10      10 账户-10 |
11      11 账户-11 |
12      12 账户-12 |
13      13 账户-13 |
14      14 账户-14 |
15      15 账户-15 |
16      16 账户-16 |
17      17 账户-17 |
18      18 账户-18 |
19      19 账户-19 |
------------------

Case-2: As case-1

actordb> actor bank(b);select  a.*, b.* from accounts a join accounts b on a.id=b.id limit 20;
actordb (1)> c
******************
**balance id name**  |
------------------
0       0  账户-0  |
1       1  账户-1  |
2       2  账户-2  |
3       3  账户-3  |
4       4  账户-4  |
5       5  账户-5  |
6       6  账户-6  |
7       7  账户-7  |
8       8  账户-8  |
9       9  账户-9  |
10      10 账户-10 |
11      11 账户-11 |
12      12 账户-12 |
13      13 账户-13 |
14      14 账户-14 |
15      15 账户-15 |
16      16 账户-16 |
17      17 账户-17 |
18      18 账户-18 |
19      19 账户-19 |
------------------

Case-3: The columns order can't be specified in select(the result columns should be id,blance,name)

actordb> actor bank(b);select a.id, a.name, a.balance from accounts a limit 20;
actordb (1)> c
******************
balance id name  |
------------------
0       0  账户-0  |
1       1  账户-1  |
2       2  账户-2  |
3       3  账户-3  |
4       4  账户-4  |
5       5  账户-5  |
6       6  账户-6  |
7       7  账户-7  |
8       8  账户-8  |
9       9  账户-9  |
10      10 账户-10 |
11      11 账户-11 |
12      12 账户-12 |
13      13 账户-13 |
14      14 账户-14 |
15      15 账户-15 |
16      16 账户-16 |
17      17 账户-17 |
18      18 账户-18 |
19      19 账户-19 |
------------------
SergejJurecko commented 5 years ago

This is a limitation of the console implementation. The database itself returns it correctly

Sergej Jurečko - CIO - Biokoda d.o.o.


From: Peter pan notifications@github.com Sent: Tuesday, May 28, 2019 10:06 AM To: biokoda/actordb Cc: Subscribed Subject: [biokoda/actordb] Same name columns in query result are swallowed and column order can't be specified (#74)

Query result issues

Case-1: Table a or b result are swallowed

actordb> actor bank(abc);select *****from accounts a join accounts b on a.id=b.id limit 20; actordb (1)> c


balance id name | 0 0 账户-0 | 1 1 账户-1 | 2 2 账户-2 | 3 3 账户-3 | 4 4 账户-4 | 5 5 账户-5 | 6 6 账户-6 | 7 7 账户-7 | 8 8 账户-8 | 9 9 账户-9 | 10 10 账户-10 | 11 11 账户-11 | 12 12 账户-12 | 13 13 账户-13 | 14 14 账户-14 | 15 15 账户-15 | 16 16 账户-16 | 17 17 账户-17 | 18 18 账户-18 | 19 19 账户-19 | Case-2: As case-1

actordb> actor bank(abc);select a., b. from accounts a join accounts b on a.id=b.id limit 20; actordb (1)> c


balance id name | 0 0 账户-0 | 1 1 账户-1 | 2 2 账户-2 | 3 3 账户-3 | 4 4 账户-4 | 5 5 账户-5 | 6 6 账户-6 | 7 7 账户-7 | 8 8 账户-8 | 9 9 账户-9 | 10 10 账户-10 | 11 11 账户-11 | 12 12 账户-12 | 13 13 账户-13 | 14 14 账户-14 | 15 15 账户-15 | 16 16 账户-16 | 17 17 账户-17 | 18 18 账户-18 | 19 19 账户-19 | Case-3: The columns order can't be specified in select(the result columns should be id,blance,name)

actordb> actor bank(abc);select a.id, a.name, a.balance from accounts a limit 20; actordb (1)> c


balance id name | 0 0 账户-0 | 1 1 账户-1 | 2 2 账户-2 | 3 3 账户-3 | 4 4 账户-4 | 5 5 账户-5 | 6 6 账户-6 | 7 7 账户-7 | 8 8 账户-8 | 9 9 账户-9 | 10 10 账户-10 | 11 11 账户-11 | 12 12 账户-12 | 13 13 账户-13 | 14 14 账户-14 | 15 15 账户-15 | 16 16 账户-16 | 17 17 账户-17 | 18 18 账户-18 | 19 19 账户-19 |

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/biokoda/actordb/issues/74?email_source=notifications&email_token=AAAEMHQIXKLURDEFO5EUSE3PXTRXBA5CNFSM4HQAYTUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWFBUXQ, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAAEMHXFVG4IOKCSGDXYWRLPXTRXBANCNFSM4HQAYTUA.