zettadb / kunlun

KunlunBase is a distributed relational database management system(RDBMS) with complete NewSQL capabilities and robust transaction ACID guarantees and is compatible with standard SQL. Applications which used PostgreSQL or MySQL can work with KunlunBase as-is without any code change or rebuild because KunlunBase supports both PostgreSQL and MySQL connection protocols and DML SQL grammars. MySQL DBAs can quickly work on a KunlunBase cluster because we use MySQL as storage nodes of KunlunBase. KunlunBase can elastically scale out as needed, and guarantees transaction ACID under error conditions, and KunlunBase fully passes TPC-C, TPC-H and TPC-DS test suites, so it not only support OLTP workloads but also OLAP workloads. Application developers can use KunlunBase to build IT systems that handles terabytes of data, without any effort on their part to implement data sharding, distributed transaction processing, distributed query processing, crash safety, high availability, strong consistency, horizontal scalability. All these powerful features are provided by KunlunBase. KunlunBase supports powerful and user friendly cluster management, monitor and provision features, can be readily used as DBaaS.
http://www.kunlunbase.com
Apache License 2.0
143 stars 20 forks source link

Exression cannot be serialized #755

Closed jd-zhang closed 2 years ago

jd-zhang commented 2 years ago

Issue migrated from trac ticket # 777

component: computing nodes | priority: major | resolution: fixed

2022-05-31 12:01:09: vito@zettadb.com created the issue


sql code: CREATE TABLE t1 (a int, b text); GRANT ALL ON t1 TO public; CREATE OR REPLACE FUNCTION f_leak(text) RETURNS bool COST 0.0000001 LANGUAGE plpgsql AS 'BEGIN RAISE NOTICE f_leak => %, $1; RETURN true; END'; GRANT EXECUTE ON FUNCTION f_leak(text) TO public;

DELETE FROM only t1 WHERE f_leak(b); EXPLAIN (COSTS OFF) DELETE FROM t1 WHERE f_leak(b);

ERROR:  Kunlun-db: Exression cannot be serialized: ({FUNCEXPR :funcid 16665 :funcresulttype 16 :funcretset false :funcvariadic false :funcformat 0 :funccollid 0 :inputcollid 100 :args ({VAR :varno 65003 :varattno 2 :vartype 25 :vartypmod -1 :varcollid 100 :varlevelsup 0 :varnoold 1 :varoattno 2 :location 48}) :location 41})
jd-zhang commented 2 years ago

2022-05-31 15:39:42: smith

jd-zhang commented 2 years ago

2022-05-31 15:39:42: smith commented


Replying to [#777 vito]:

sql code: CREATE TABLE t1 (a int, b text); GRANT ALL ON t1 TO public; CREATE OR REPLACE FUNCTION f_leak(text) RETURNS bool COST 0.0000001 LANGUAGE plpgsql AS 'BEGIN RAISE NOTICE f_leak => %, $1; RETURN true; END'; GRANT EXECUTE ON FUNCTION f_leak(text) TO public;

DELETE FROM only t1 WHERE f_leak(b); EXPLAIN (COSTS OFF) DELETE FROM t1 WHERE f_leak(b);

ERROR:  Kunlun-db: Exression cannot be serialized: ({FUNCEXPR :funcid 16665 :funcresulttype 16 :funcretset false :funcvariadic false :funcformat 0 :funccollid 0 :inputcollid 100 :args ({VAR :varno 65003 :varattno 2 :vartype 25 :vartypmod -1 :varcollid 100 :varlevelsup 0 :varnoold 1 :varoattno 2 :location 48}) :location 41})

目前的实现中,delete/update不支持用户自定义函数,或者mysql不支持的函数。对于这些用例,暂时可以跳过

jd-zhang commented 2 years ago

2022-05-31 15:40:15: smith changed status from assigned to accepted

jd-zhang commented 2 years ago

2022-05-31 16:33:17: vito@zettadb.com commented


rowsecurity.sql和updatable_views.sql中相关的语句暂时做了跳过 那么进行关闭

jd-zhang commented 2 years ago

2022-05-31 16:33:17: vito@zettadb.com set resolution to fixed

jd-zhang commented 2 years ago

2022-05-31 16:33:17: vito@zettadb.com changed status from accepted to closed