zettadb/kunlun

没有将反斜线当做普通文本

jd-zhang opened this issue · 2 comments

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

component: computing nodes | priority: major

2022-07-05 16:53:08: vito@zettadb.com created the issue


sql code:
set escape_string_warning = off;
set standard_conforming_strings = on;

select 'a\bcd' as f1, 'a\b*cd' as f2, 'a\b**cd' as f3, 'abcd' as f4, 'ab*cd' as f5, '\' as f6;

ERROR:  syntax error at or near "\"
LINE 1: ...cd' as f2, 'a\b*''cd' as f3, 'abcd\'   as f4, 'ab\*cd' as ...

pg中的输出:

  f1   |   f2   |   f3    |  f4   |   f5   | f6
-------+--------+---------+-------+--------+----
 a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
(1 row)

set standard_conforming_strings = off;

select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\'   as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
  f1   |   f2   |   f3    |  f4   |   f5   | f6
-------+--------+---------+-------+--------+----
 a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
(1 row)

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

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