kunlun icon indicating copy to clipboard operation
kunlun copied to clipboard

Misleaing info for select for share, select for update, and select tbname from tbname

Open jd-zhang opened this issue 5 years ago • 12 comments

*Issue migrated from trac ticket # 49 www.kunlunbase.com *

component: computing nodes | priority: major

2021-04-22 15:06:22: [email protected] created the issue


we do not support the following cases: select ... for share select ... for update select table_name from table_name

But the information is misleading, we need to change the info, to say 'unsupported' directly.

tdb1=# create table ts1(id int, info text); CREATE TABLE tdb1=# select * from ts1 for share; ERROR: MySQL storage node (1, 1) returned error: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig from tdb1_$$pub' at line 1. tdb1=# select * from ts1 for update; ERROR: MySQL storage node (1, 1) returned error: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig from tdb1$$pub' at line 1. tdb1=# select ts1 from ts1; ERROR: MySQL storage node (1, 1) returned error: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig from tdb1$$_public.ts1' at line 1.

jd-zhang avatar Apr 22 '21 15:04 jd-zhang

2021-04-26 14:57:42: [email protected] commented


Likewise, the following is used to call another function using the table as a type:

CREATE TABLE INT8_TBL(q1 int8, q2 int8);

create function extractq2(t int8_tbl) returns int8 as $$ select t.q2 $$ language sql immutable;

create function extractq2_2(t int8_tbl) returns table(ret1 int8) as $$ select extractq2(t) offset 0 $$ language sql immutable;

select x from int8_tbl, extractq2_2(int8_tbl) f(x);

jd-zhang avatar Apr 26 '21 14:04 jd-zhang

2021-05-31 18:21:17: [email protected] commented


the case in comment:1 is working now, as well as the 'select ts1 from ts1;' query.

we don't support locking clauses of SELECT stmts currently, it's tracked as a feature to do in future in this ticket.

jd-zhang avatar May 31 '21 18:05 jd-zhang

2021-05-31 18:21:17: [email protected]

jd-zhang avatar May 31 '21 18:05 jd-zhang

2021-05-31 18:21:17: [email protected] changed owner from kunlun to david

jd-zhang avatar May 31 '21 18:05 jd-zhang

2021-05-31 18:21:17: [email protected] changed status from assigned to accepted

jd-zhang avatar May 31 '21 18:05 jd-zhang

2021-05-31 18:21:17: [email protected] changed type from defect to feature

jd-zhang avatar May 31 '21 18:05 jd-zhang

2022-04-18 18:31:47: [email protected]

jd-zhang avatar Apr 18 '22 18:04 jd-zhang

2022-07-04 10:12:11: [email protected]

jd-zhang avatar Jul 04 '22 10:07 jd-zhang

2022-07-04 10:12:11: [email protected] changed owner from david to smith

jd-zhang avatar Jul 04 '22 10:07 jd-zhang

2022-07-04 10:12:11: [email protected] changed status from accepted to assigned

jd-zhang avatar Jul 04 '22 10:07 jd-zhang

2022-07-04 10:12:11: [email protected] changed type from feature to enhancement

jd-zhang avatar Jul 04 '22 10:07 jd-zhang

2022-07-06 17:56:32: smith changed status from assigned to accepted

jd-zhang avatar Jul 06 '22 17:07 jd-zhang