fix illegal stmt caused by deep copy of sharding condition which contains query ref expr

This commit is contained in:
obdev 2023-08-04 08:48:25 +00:00 committed by ob-robot
parent bd5ae50a72
commit f87b31f4e7
4 changed files with 9 additions and 8 deletions

View File

@ -1268,7 +1268,6 @@ public:
sizeof(hashbucket),
*bucket_allocer_)))) {
HASH_WRITE_LOG(HASH_WARNING, "create buckets fail, ret=%d", ret);
ret = OB_ERR_UNEXPECTED;
} else {
for (int64_t i = 0; i < old_bucket_num && OB_SUCC(ret); i++) {
hashbucket &old_bucket = old_buckets[i];

View File

@ -1126,10 +1126,10 @@ int do_create(Array &array, const int64_t total_size, const int64_t array_size,
{
UNUSED(array_size);
int ret = 0;
if (total_size <= 0 || item_size <= 0) {
ret = -1;
if (OB_UNLIKELY(total_size <= 0 || item_size <= 0)) {
ret = OB_ERR_UNEXPECTED;
} else if (NULL == (array = (Array)alloc.alloc(total_size * item_size))) {
ret = -1;
ret = OB_ALLOCATE_MEMORY_FAILED;
_OB_LOG(WARN, "alloc memory failed,size:%ld", total_size * item_size);
} else {
//BACKTRACE(WARN, total_size * item_size > 65536, "hashutil create init size=%ld", total_size * item_size);

View File

@ -36,10 +36,10 @@ int ObSQLParser::parse(const char * str_ptr, const int64_t str_len, ParseResult
// proxy don't need this, only for observer
ObActiveSessionGuard::get_stat().in_parse_ = true;
#endif
if (0 != parse_init(&result)) {
ret = OB_ERR_PARSER_INIT;
} else {
ret = parse_sql(&result, str_ptr, static_cast<size_t>(str_len));
if (OB_FAIL(parse_init(&result))) {
// do nothing
} else if (OB_FAIL(parse_sql(&result, str_ptr, static_cast<size_t>(str_len)))) {
// do nothing
}
#ifndef SQL_PARSER_COMPILATION
ObActiveSessionGuard::get_stat().in_parse_ = false;

View File

@ -3174,6 +3174,8 @@ int ObTransformPredicateMoveAround::create_equal_exprs_for_insert(ObDelUpdStmt *
}
if (OB_FAIL(ret)) {
//do nothing
} else if (source_exprs.at(i)->has_flag(CNT_SUB_QUERY)) {
//do nothing
} else if (!ObOptimizerUtil::find_item(part_exprs, target_exprs.at(i))) {
// do nothing
} else if (!is_not_null) {