diff --git a/fe/fe-core/src/main/jflex/sql_scanner.flex b/fe/fe-core/src/main/jflex/sql_scanner.flex index 583fc20243c7e7..314a04599b0dba 100644 --- a/fe/fe-core/src/main/jflex/sql_scanner.flex +++ b/fe/fe-core/src/main/jflex/sql_scanner.flex @@ -739,7 +739,7 @@ EndOfLineComment = "--" !({HintContent}|{ContainsLineTerminator}) {LineTerminato {SingleQuoteStringLiteral} { return newToken(SqlParserSymbols.STRING_LITERAL, - escapeBackSlash(yytext().substring(1, yytext().length()-1), sql_mode)); + escapeBackSlash(yytext().substring(1, yytext().length()-1), sql_mode).replaceAll("''", "'")); } {DoubleQuoteStringLiteral} { diff --git a/regression-test/data/insert_p0/insert.out b/regression-test/data/insert_p0/insert.out index 38a2a818ab55a0..b582f45123dc66 100644 --- a/regression-test/data/insert_p0/insert.out +++ b/regression-test/data/insert_p0/insert.out @@ -202,6 +202,3 @@ 44980 113.8777 again 1987-04-09 2010-01-02T04:03:06 false -0.01 0E-10 44980 113.8777 again 1987-04-09 2010-01-02T04:03:06 false -0.01 0E-10 --- !select -- -3 replace(cdate,'-','') - diff --git a/regression-test/suites/insert_p0/insert.groovy b/regression-test/suites/insert_p0/insert.groovy index cd3ba176bc835f..573d5d8366c6d6 100644 --- a/regression-test/suites/insert_p0/insert.groovy +++ b/regression-test/suites/insert_p0/insert.groovy @@ -83,20 +83,4 @@ suite("insert") { sql "sync" qt_insert """ select * from mutable_datatype order by c_bigint, c_double, c_string, c_date, c_timestamp, c_boolean, c_short_decimal""" - def table = "insert_with_quote" - sql """ DROP TABLE IF EXISTS ${table} """ - sql """ - CREATE TABLE ${table} ( - `id` int(11) NULL, - `dim1` string NULL - ) ENGINE=OLAP - UNIQUE KEY(`id`) - DISTRIBUTED BY HASH(`id`) BUCKETS 1 - PROPERTIES ( - "replication_allocation" = "tag.location.default: 1" - ); - """ - sql """insert into ${table}(id,dim1) values(3,\'replace(cdate,\\\'-\\\',\\\'\\\')\')""" - qt_select """ select * from ${table} """ - }