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

字符的转义存在着差异 #787

Open jd-zhang opened 2 years ago

jd-zhang commented 2 years ago

Issue migrated from trac ticket # 869 www.kunlunbase.com

component: computing nodes | priority: major

2022-07-01 13:31:58: vito@zettadb.com created the issue


sql code: select quote_literal(e'\');

 quote_literal
---------------
 E'\\\\'
(1 row)

pg的输出:

 quote_literal
---------------
 E'\\'
(1 row)

CREATE TABLE INT8_TBL(q1 int8, q2 int8);

INSERT INTO INT8_TBL VALUES(' 123 ',' 456'); INSERT INTO INT8_TBL VALUES('123 ','4567890123456789'); INSERT INTO INT8_TBL VALUES('4567890123456789','123'); INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789'); INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');

SELECT '' AS to_char_16, to_char(q2, E'99999 "text" 9999 "9999" 999 "\"text between quote marks\"" 9999') FROM INT8_TBL;

;
 to_char_16 |                         to_char
------------+----------------------------------------------------------
            |       text      9999 456+ \text etween quote mark\" 9999
            | ##### text #### 9999 ###+ \text etween quote mark\" 9999
            |       text      9999 123+ \text etween quote mark\" 9999
            | ##### text #### 9999 ###+ \text etween quote mark\" 9999
            | ##### text #### 9999 ###- \text etween quote mark\" 9999
(5 rows)

pg的输出:


 to_char_16 |                          to_char
------------+-----------------------------------------------------------
            |       text      9999     "text between quote marks"   456
            |  45678 text 9012 9999 345 "text between quote marks" 6789
            |       text      9999     "text between quote marks"   123
            |  45678 text 9012 9999 345 "text between quote marks" 6789
            | -45678 text 9012 9999 345 "text between quote marks" 6789
(5 rows)

DROP TABLE deptest; DROP USER regress_dep_user3;

CREATE USER regress_dep_user0; CREATE USER regress_dep_user1; CREATE USER regress_dep_user2;

drop table if exists deptest1; CREATE TABLE deptest1 (f1 int unique); GRANT ALL ON deptest1 TO regress_dep_user1 WITH GRANT OPTION;

SET SESSION AUTHORIZATION regress_dep_user1; CREATE TABLE deptest (a serial primary key, b text); GRANT ALL ON deptest1 TO regress_dep_user2; RESET SESSION AUTHORIZATION; \z deptest1

Schema |   Name   | Type  |                                         Access privileges                                          | Column privileges | Policies
--------+----------+-------+----------------------------------------------------------------------------------------------------+-------------------+----------
 public | deptest1 | table | abc=arwdDxt/abc\nregress_dep_user1=a*r*w*d*D*x*t*/abc\nregress_dep_user2=arwdDxt/regress_dep_user1 |                   |

pg的输出是:

 Schema |   Name   | Type  |              Access privileges              | Column privileges | Policies
--------+----------+-------+---------------------------------------------+-------------------+----------
 public | deptest1 | table | vito=arwdDxt/vito                          +|                   |
        |          |       | regress_dep_user1=a*r*w*d*D*x*t*/vito      +|                   |
        |          |       | regress_dep_user2=arwdDxt/regress_dep_user1 |                   |
(1 row)
jd-zhang commented 2 years ago

2022-07-01 14:45:30: zhaowei@zettadb.com changed owner from smith to david

jd-zhang commented 2 years ago

2022-07-06 18:03:32: zhaowei@zettadb.com changed owner from david to kunlun

jd-zhang commented 2 years ago

2022-07-06 18:03:32: zhaowei@zettadb.com changed status from assigned to accepted