Skip to content

Commit

Permalink
Revert "[Fix](load) Fix insert into wrong value #31890 (#31891)" (#31974
Browse files Browse the repository at this point in the history
)

This reverts commit d44adb0.
  • Loading branch information
xiaokang authored Mar 8, 2024
1 parent 45cbbe9 commit 4c334b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
2 changes: 1 addition & 1 deletion fe/fe-core/src/main/jflex/sql_scanner.flex
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down
3 changes: 0 additions & 3 deletions regression-test/data/insert_p0/insert.out
Original file line number Diff line number Diff line change
Expand Up @@ -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,'-','')

16 changes: 0 additions & 16 deletions regression-test/suites/insert_p0/insert.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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} """

}

0 comments on commit 4c334b9

Please sign in to comment.