fix analyze delete histogram bug and create table option parser bug
This commit is contained in:
parent
58eb40817e
commit
c8703c9b0e
@ -661,7 +661,10 @@ int ObDbmsStatsUtils::merge_col_stats(const ObTableStatParam ¶m,
|
||||
LOG_WARN("get unexpected null pointer", K(ret));
|
||||
} else if (is_part_id_valid(param, col_stat->get_partition_id())) {
|
||||
col_stat->set_num_distinct(ObGlobalNdvEval::get_ndv_from_llc(col_stat->get_llc_bitmap()));
|
||||
if (OB_FAIL(dst_col_stats.push_back(col_stat))) {
|
||||
if (OB_UNLIKELY(col_stat->get_num_distinct() < 0)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected error", KPC(col_stat), K(old_col_stats), K(ret));
|
||||
} else if (OB_FAIL(dst_col_stats.push_back(col_stat))) {
|
||||
LOG_WARN("fail to push back table stats", K(ret));
|
||||
}
|
||||
}
|
||||
|
@ -951,8 +951,9 @@ int ObOptStatSqlService::get_column_stat_sql(const uint64_t tenant_id,
|
||||
uint64_t data_version = 0;
|
||||
if (OB_FAIL(GET_MIN_DATA_VERSION(tenant_id, data_version))) {
|
||||
LOG_WARN("fail to get tenant data version", KR(ret), K(tenant_id), K(data_version));
|
||||
} else if (OB_UNLIKELY(ObHistType::INVALID_TYPE != stat.get_histogram().get_type() &&
|
||||
stat.get_histogram().get_bucket_cnt() == 0)) {
|
||||
} else if (OB_UNLIKELY((ObHistType::INVALID_TYPE != stat.get_histogram().get_type() &&
|
||||
stat.get_histogram().get_bucket_cnt() == 0) ||
|
||||
stat.get_num_distinct() < 0)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected error", K(ret), K(stat));
|
||||
} else if (OB_FAIL(get_valid_obj_str(stat.get_min_value(), min_meta, allocator, min_str, print_params)) ||
|
||||
|
@ -75,16 +75,20 @@ int ObAnalyzeExecutor::execute(ObExecContext &ctx, ObAnalyzeStmt &stmt)
|
||||
if (OB_UNLIKELY(params.count() != 1)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected error", K(ret), K(params));
|
||||
} else if (OB_FAIL(ObDbmsStatsLockUnlock::check_stat_locked(ctx, params.at(0)))) {
|
||||
LOG_WARN("failed fill stat locked", K(ret));
|
||||
} else if (OB_FAIL(ObDbmsStatsExecutor::delete_table_stats(ctx, params.at(0), cascade_columns))) {
|
||||
LOG_WARN("failed to delete table stats", K(ret));
|
||||
} else if (OB_FAIL(pl::ObDbmsStats::update_stat_cache(session->get_rpc_tenant_id(), params.at(0)))) {
|
||||
LOG_WARN("failed to update stat cache", K(ret));
|
||||
} else if (cascade_indexes && params.at(0).part_name_.empty()) {
|
||||
if (OB_FAIL(pl::ObDbmsStats::delete_table_index_stats(ctx, params.at(0)))) {
|
||||
LOG_WARN("failed to delete index stats", K(ret));
|
||||
} else {/*do nothing*/}
|
||||
} else {
|
||||
ObArenaAllocator tmp_alloc("DeleteStats", OB_MALLOC_NORMAL_BLOCK_SIZE, params.at(0).tenant_id_);
|
||||
params.at(0).allocator_ = &tmp_alloc;//use the temp allocator to free memory after delete stats.
|
||||
if (OB_FAIL(ObDbmsStatsLockUnlock::check_stat_locked(ctx, params.at(0)))) {
|
||||
LOG_WARN("failed to check stat locked", K(ret));
|
||||
} else if (OB_FAIL(ObDbmsStatsExecutor::delete_table_stats(ctx, params.at(0), cascade_columns))) {
|
||||
LOG_WARN("failed to delete table stats", K(ret));
|
||||
} else if (OB_FAIL(pl::ObDbmsStats::update_stat_cache(session->get_rpc_tenant_id(), params.at(0)))) {
|
||||
LOG_WARN("failed to update stat cache", K(ret));
|
||||
} else if (cascade_indexes && params.at(0).part_name_.empty()) {
|
||||
if (OB_FAIL(pl::ObDbmsStats::delete_table_index_stats(ctx, params.at(0)))) {
|
||||
LOG_WARN("failed to delete index stats", K(ret));
|
||||
} else {/*do nothing*/}
|
||||
}
|
||||
}
|
||||
LOG_TRACE("succeed to drop table stats", K(params));
|
||||
} else {
|
||||
|
@ -6959,6 +6959,7 @@ TABLE_MODE opt_equal_mark STRING_VALUE
|
||||
(void) ($$);
|
||||
if ($3->value_ < 0) {
|
||||
yyerror(&@1, result, "value for DELAY_KEY_WRITE shouldn't be negative");
|
||||
YYERROR;
|
||||
} else {
|
||||
malloc_non_terminal_node($$, result->malloc_pool_, T_DELAY_KEY_WRITE, 1, $3);
|
||||
}
|
||||
@ -6968,6 +6969,7 @@ TABLE_MODE opt_equal_mark STRING_VALUE
|
||||
(void)($2);
|
||||
if ($3->value_ < 0) {
|
||||
yyerror(&@1, result, "value for AVG_ROW_LENGTH shouldn't be negative");
|
||||
YYERROR;
|
||||
} else {
|
||||
malloc_non_terminal_node($$, result->malloc_pool_, T_AVG_ROW_LENGTH, 1, $3);
|
||||
}
|
||||
@ -6977,6 +6979,7 @@ TABLE_MODE opt_equal_mark STRING_VALUE
|
||||
(void)($2);
|
||||
if ($3->value_ < 0) {
|
||||
yyerror(&@1, result, "value for CHECKSUM shouldn't be negative");
|
||||
YYERROR;
|
||||
} else {
|
||||
malloc_non_terminal_node($$, result->malloc_pool_, T_TABLE_CHECKSUM, 1, $3);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user