cubrid icon indicating copy to clipboard operation
cubrid copied to clipboard

[CBRD-24261] POC: extending syntax for table specification as table-name@server-name

Open ctshim opened this issue 3 years ago • 1 comments

http://jira.cubrid.org/browse/CBRD-24261

  • [CBRD-24261] POC: tbl@server, step 1
==============================================
These are currently testable cases.
==============================================
select * from remote_t@srv1;
select * from remote_t@srv1 tbl;
select remote_t.* from remote_t@srv1;
select tbl.* from remote_t@srv1 tbl;

select COL1, col3, col2 from REMOTE_T@srv1;
select tbl.COL1, Tbl.col3, TBL.col2 from REMOTE_T@srv1 TBL;
select COL1, col3, col1, col1, col2 from remote_t@srv1 tbl;

select 7, 'test' from remote_t@srv1 tbl;

select col1 from remote_t@srv1 tbl(a); -- fail

select *, 'test' from remote_t@srv1 tbl;
select *, col1 from remote_t@srv1 tbl; 
select tbl.*, 'test', 77 from remote_t@srv1 tbl;
select tbl.*, col1 from remote_t@srv1 tbl;
select tbl.*, tbl.col1 from remote_t@srv1 tbl; 

select *, tbl.* from remote_t@srv1 tbl;  -- fail: 
select tbl.*, * from remote_t@srv1 tbl;  -- fail: 

select col3, col2 from remote_t@srv1 where col3 >= 1;
select col3, col2 from remote_t@srv1 tbl where col3 >= 1;
select col3, col2 from remote_t@srv1 tbl where tbl.col3 >= 1;
select col3, col2 from remote_t@srv1 where col1 >= 1;  
select col3, col2 from remote_t@srv1 tbl where col1 >= 1; 
select col3, col2 from remote_t@srv1 tbl where tbl.col1 >= 1; 

select tbl.col3, col3, col2, tbl.col2 from remote_t@srv1 tbl;

select col3 c1, col2 c2 from remote_t@srv1;
select col3 c1, col2 c2 from remote_t@srv1 where col3 >= 1;
select col3 c1, col2 c2 from remote_t@srv1 tbl where col3 >= 1;
select col3 c1, col2 c2 from remote_t@srv1 tbl where tbl.col3 >= 1;
select tbl.col3 c1, tbl.col2 c2 from remote_t@srv1 tbl where col3 >= 1;
select tbl.col3 c1, tbl.col2 c2 from remote_t@srv1 tbl where tbl.col3 >= 1;

select col3, col2 from remote_t@srv1 tbl order by col1 group by tbl.col4;  -- fail
select col3, col2 from remote_t@srv1 tbl group by tbl.col4 order by col1 desc;

select tbl.* from remote_t@srv1 tbl where col1 >=1;
select tbl.* from remote_t@srv1 tbl where tbl.col1 >=1;
select tbl.*, col1 from remote_t@srv1 tbl where tbl.col1 >=1;
select tbl.*, tbl.col1 from remote_t@srv1 tbl where tbl.col1 >=1;

select tbl.col3, tbl.col2 from remote_t@srv1; -- fail:
select tbl.col3 c1, tbl.col2 c2 from remote_t@srv1; -- fail: 

select col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, col15, col16 from remote_t@srv1 limit 3;


select * from dblink_t1@srv1 t1, remote_t@srv1 t2;
select *, t2.* from dblink_t1@srv1 t1, remote_t@srv1 t2; -- fail:
----
select *, t2.col1 from dblink_t1@srv1 t1, remote_t@srv1 t2;
select t1.*, t2.* from dblink_t1@srv1 t1, remote_t@srv1 t2;

select t1.* from dblink_t1@srv1 t1, remote_t@srv1 t2;
select t1.col1, t1.* from dblink_t1@srv1 t1, remote_t@srv1 t2;
select t1.col1, t1.col2, t1.*, t1.col3 from dblink_t1@srv1 t1;  -- fail:
select t1.col1, t1.col2, t1.*, t1.col3 from remote_t@srv1 t1;
select t1.col1, t2.* from dblink_t1@srv1 t1, remote_t@srv1 t2;
select t2.*, t1.col1 from dblink_t1@srv1 t1, remote_t@srv1 t2;  


select event_code, (select col1 from remote_t@srv1 as t limit 1) from public.game limit 2;
select col1, (select event_code from public.game limit 1) from remote_t@srv1 as t;  
select col1, (select event_code from public.game limit 1) from remote_t@srv1 as t where t.col1 > 3;


select col1 from dblink_t1@srv1 t1, remote_t@srv1 t2; -- fail: 
select t1.col1, t2.col1 from dblink_t1@srv1 t1, remote_t@srv1 t2; 
select t1.col1, t2.col1 from dblink_t1@srv1 t1, remote_t@srv1 t2 where t1.col1 = t2.col1; 
select t1.col1 from dblink_t1@srv1 t1, remote_t@srv1 t2 where t1.col1 = t2.col1; 
select event_code from public.game g, remote_t@srv1 r where g.event_code > r.col1;

select t2.col1 from dblink_t1@srv1 t1 inner join remote_t@srv1 t2 on  t1.col1 = t2.col1 order by t2.col2;

select col1 from remote_t@srv1 t1  union select col1  from remote_t@srv1 t2  order by t1.col2;    -- fail
 select col1 from remote_t@srv1 t1  union select col1  from remote_t@srv1 t2  order by t1.col1;

ctshim avatar Apr 15 '22 08:04 ctshim

Codecov Report

Merging #3519 (497df20) into develop (a81dbef) will decrease coverage by 27.78%. The diff coverage is 3.97%.

:exclamation: Current head 497df20 differs from pull request most recent head 38f861c. Consider uploading reports for the commit 38f861c to get more accurate results

@@             Coverage Diff              @@
##           develop    #3519       +/-   ##
============================================
- Coverage    51.96%   24.18%   -27.79%     
============================================
  Files          515      515               
  Lines       395489   395307      -182     
============================================
- Hits        205501    95587   -109914     
- Misses      189988   299720   +109732     
Impacted Files Coverage Δ
src/base/object_representation.h 66.66% <ø> (ø)
src/base/release_string.c 66.12% <ø> (ø)
src/broker/broker_admin.c 7.69% <0.00%> (-13.15%) :arrow_down:
src/broker/broker_config.c 41.12% <0.00%> (-1.02%) :arrow_down:
src/broker/broker_filename.c 42.17% <0.00%> (-7.03%) :arrow_down:
src/broker/broker_shm.c 67.09% <ø> (-3.85%) :arrow_down:
src/broker/cas_cgw.c 0.00% <0.00%> (ø)
src/broker/cas_function.c 0.00% <ø> (-33.46%) :arrow_down:
src/executables/util_admin.c 50.58% <ø> (+0.58%) :arrow_up:
src/loaddb/load_db.c 27.65% <ø> (+0.27%) :arrow_up:
... and 277 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a81dbef...38f861c. Read the comment docs.

codecov-commenter avatar Apr 15 '22 13:04 codecov-commenter

This closed, the issue is continued at CBRD-24501.

beyondykk9 avatar Nov 16 '23 02:11 beyondykk9