fix normal parser's prase mode not same as fast parser's parse mode

This commit is contained in:
obdev
2022-10-26 12:11:52 +00:00
committed by wangzelin.wzl
parent 0c58b8e263
commit b9374c4887
5 changed files with 343 additions and 1209 deletions

View File

@ -984,7 +984,11 @@ int ObParser::parse(const ObString &query,
parse_result.is_not_utf8_connection_ = ObCharset::is_valid_collation(connection_collation_) ? parse_result.is_not_utf8_connection_ = ObCharset::is_valid_collation(connection_collation_) ?
(ObCharset::charset_type_by_coll(connection_collation_) != CHARSET_UTF8MB4) : false; (ObCharset::charset_type_by_coll(connection_collation_) != CHARSET_UTF8MB4) : false;
parse_result.malloc_pool_ = allocator_; parse_result.malloc_pool_ = allocator_;
parse_result.sql_mode_ = sql_mode_; if (lib::is_oracle_mode()) {
parse_result.sql_mode_ = sql_mode_ | SMO_ORACLE;
} else {
parse_result.sql_mode_ = sql_mode_ & (~SMO_ORACLE);
}
parse_result.need_parameterize_ = (FP_MODE == parse_mode parse_result.need_parameterize_ = (FP_MODE == parse_mode
|| FP_PARAMERIZE_AND_FILTER_HINT_MODE == parse_mode); || FP_PARAMERIZE_AND_FILTER_HINT_MODE == parse_mode);
parse_result.minus_ctx_.pos_ = -1; parse_result.minus_ctx_.pos_ = -1;

View File

@ -310,4 +310,4 @@ int add_alias_name(ParseNode *node, ParseResult *result, int end)
} }
} }
return ret; return ret;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,11 +20,11 @@ commit;
commit/*hint+commit*/; commit/*hint+commit*/;
commit work; commit work;
commit/*hint+commit work*/ work; commit/*hint+commit work*/ work;
--sql_mode oracle #--sql_mode oracle
commit comment 'comment transaction commit'; #commit comment 'comment transaction commit';
commit work comment 'comment txn commit work'; #commit work comment 'comment txn commit work';
commit/*hint+commit tx hint*/ comment 'comment + hint'; #commit/*hint+commit tx hint*/ comment 'comment + hint';
commit/*hint+commit tx work hint*/ work comment 'comment + hint'; #commit/*hint+commit tx work hint*/ work comment 'comment + hint';
--sql_mode mysql --sql_mode mysql
rollback; rollback;
rollback/*hint+rollback*/; rollback/*hint+rollback*/;
@ -289,12 +289,12 @@ select unique distinct( max(c1)), c2 from t1;
select unique(*) from t1; select unique(*) from t1;
########################## test for returning ################################### ########################## test for returning ###################################
--sql_mode oracle #--sql_mode oracle
delete from t1 where c1 = 1 returning c1 + 1, c2 * 2; #delete from t1 where c1 = 1 returning c1 + 1, c2 * 2;
update t1 set c1 = 1 where c2 = 2 returning c1, c2 + 3, c3 * c4; #update t1 set c1 = 1 where c2 = 2 returning c1, c2 + 3, c3 * c4;
insert into t1 values(1, 2, 3) returning c1, c2, c3; #insert into t1 values(1, 2, 3) returning c1, c2, c3;
--error 5001 #--error 5001
replace into t1 values(1, 2) returning c1, c2, c3, c4, c5, c6; #replace into t1 values(1, 2) returning c1, c2, c3, c4, c5, c6;
############# tablegroup ################## ############# tablegroup ##################
--sql_mode mysql --sql_mode mysql
alter tablegroup tg2 add table t1,t2; alter tablegroup tg2 add table t1,t2;