Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jd-zhang opened this issue Jul 1, 2022 · 3 comments
Open

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

jd-zhang opened this issue Jul 1, 2022 · 3 comments

Comments

@jd-zhang
Copy link
Contributor

jd-zhang commented Jul 1, 2022

*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
Copy link
Contributor Author

jd-zhang commented Jul 1, 2022

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

@jd-zhang
Copy link
Contributor Author

jd-zhang commented Jul 6, 2022

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

@jd-zhang
Copy link
Contributor Author

jd-zhang commented Jul 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant