Fix some spm bugs
This commit is contained in:
@ -220,9 +220,9 @@ int ObExprToOutfileRow::extract_fisrt_wchar_from_varhcar(const ObObj &obj, int32
|
|||||||
// If the FIELDS ESCAPED BY character is not empty, it is used to prefix the following
|
// If the FIELDS ESCAPED BY character is not empty, it is used to prefix the following
|
||||||
// characters on output:
|
// characters on output:
|
||||||
// 1. The FIELDS ESCAPED BY character.
|
// 1. The FIELDS ESCAPED BY character.
|
||||||
// 2. The FIELDS [OPTIONALLY] ENCLOSED BY character.
|
// 2. The FIELDS [OPTIONALLY] ENCLOSED BY character.
|
||||||
// 3. The first character of the FIELDS TERMINATED BY and LINES TERMINATED BY values,
|
// 3. The first character of the FIELDS TERMINATED BY and LINES TERMINATED BY values,
|
||||||
// if the ENCLOSED BY character is empty or unspecified.
|
// if the ENCLOSED BY character is empty or unspecified.
|
||||||
// 4. ASCII 0 (what is actually written following the escape character is ASCII 0, not a
|
// 4. ASCII 0 (what is actually written following the escape character is ASCII 0, not a
|
||||||
// zero-valued byte).
|
// zero-valued byte).
|
||||||
// 5. If the FIELDS ESCAPED BY character is empty, no characters are escaped and NULL is output
|
// 5. If the FIELDS ESCAPED BY character is empty, no characters are escaped and NULL is output
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int ObPrepareExecutor::execute(ObExecContext &ctx, ObPrepareStmt &stmt)
|
|||||||
if (OB_FAIL(ObSQLUtils::calc_const_expr(ctx, stmt.get_prepare_sql(), result, ctx.get_allocator(), params_array))) {
|
if (OB_FAIL(ObSQLUtils::calc_const_expr(ctx, stmt.get_prepare_sql(), result, ctx.get_allocator(), params_array))) {
|
||||||
LOG_WARN("failed to calc const expr", K(stmt.get_prepare_sql()), K(ret));
|
LOG_WARN("failed to calc const expr", K(stmt.get_prepare_sql()), K(ret));
|
||||||
} else if (!result.is_string_type()) {
|
} else if (!result.is_string_type()) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_PARSER_SYNTAX;
|
||||||
LOG_WARN("prepare sql is not a string", K(result), K(ret));
|
LOG_WARN("prepare sql is not a string", K(result), K(ret));
|
||||||
} else {
|
} else {
|
||||||
ObString stmt_name;
|
ObString stmt_name;
|
||||||
|
|||||||
@ -258,7 +258,7 @@ struct ObSpmCacheCtx : public ObILibCacheCtx
|
|||||||
spm_force_disable_(false),
|
spm_force_disable_(false),
|
||||||
has_fixed_plan_to_check_(false),
|
has_fixed_plan_to_check_(false),
|
||||||
evolution_plan_type_(OB_PHY_PLAN_UNINITIALIZED),
|
evolution_plan_type_(OB_PHY_PLAN_UNINITIALIZED),
|
||||||
last_evolution_count_(0)
|
select_plan_type_(INVALID_TYPE)
|
||||||
{}
|
{}
|
||||||
enum SpmMode {
|
enum SpmMode {
|
||||||
MODE_INVALID,
|
MODE_INVALID,
|
||||||
@ -281,6 +281,13 @@ struct ObSpmCacheCtx : public ObILibCacheCtx
|
|||||||
STAT_ACCEPT_BASELINE_PLAN, // move baeline plan from evolution layer to plan layer
|
STAT_ACCEPT_BASELINE_PLAN, // move baeline plan from evolution layer to plan layer
|
||||||
STAT_MAX
|
STAT_MAX
|
||||||
};
|
};
|
||||||
|
enum SpmSelectPlanType
|
||||||
|
{
|
||||||
|
INVALID_TYPE,
|
||||||
|
EVO_PLAN,
|
||||||
|
BASELINE_PLAN,
|
||||||
|
MAX_TYPE
|
||||||
|
};
|
||||||
void set_get_normal_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_NORMAL; }
|
void set_get_normal_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_NORMAL; }
|
||||||
void set_get_offset_mode() { handle_cache_mode_ = MODE_GET_OFFSET; }
|
void set_get_offset_mode() { handle_cache_mode_ = MODE_GET_OFFSET; }
|
||||||
void set_get_for_update_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_FOR_UPDATE; }
|
void set_get_for_update_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_FOR_UPDATE; }
|
||||||
@ -308,7 +315,7 @@ struct ObSpmCacheCtx : public ObILibCacheCtx
|
|||||||
bool spm_force_disable_;
|
bool spm_force_disable_;
|
||||||
bool has_fixed_plan_to_check_;
|
bool has_fixed_plan_to_check_;
|
||||||
ObPhyPlanType evolution_plan_type_;
|
ObPhyPlanType evolution_plan_type_;
|
||||||
int64_t last_evolution_count_; // for retry
|
SpmSelectPlanType select_plan_type_; // for retry
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EvolutionTaskResult
|
struct EvolutionTaskResult
|
||||||
|
|||||||
Reference in New Issue
Block a user