!2869 修复开启partial seq scan后Seq Scan算子初始化期间core

Merge pull request !2869 from 陈栋/bugfix
This commit is contained in:
opengauss-bot 2023-02-08 12:47:37 +00:00 committed by Gitee
commit 1d05bff955
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 21 additions and 5 deletions

View File

@ -3888,10 +3888,10 @@ static void AssignUStoreAttr(const char* newval, void* extra)
if (!IS_NULL_STR(ptoken)) {
if (strcasecmp(ptoken, "enable_ustore_partial_seqscan") == 0) {
ParseUStoreBool(&u_sess->attr.attr_storage.enable_ustore_partial_seqscan, ptoken, pdelimiter, psave);
status[ENABLE_USTORE_PARTIAL_SEQSCAN_IDX] = true;
status[ENABLE_USTORE_PARTIAL_SEQSCAN_IDX] = false;
} else if (strcasecmp(ptoken, "enable_candidate_buf_usage_count") == 0) {
ParseUStoreBool(&u_sess->attr.attr_storage.enable_candidate_buf_usage_count, ptoken, pdelimiter, psave);
status[ENABLE_CANDIATATE_BUF_USAGE_IDX] = true;
status[ENABLE_CANDIATATE_BUF_USAGE_IDX] = false;
} else if (strcasecmp(ptoken, "ustats_tracker_naptime") == 0) {
ParseUStoreInt(&u_sess->attr.attr_storage.ustats_tracker_naptime, ptoken, pdelimiter, psave,
MIN_USTATS_TRACKER_NAPTIME, MAX_USTATS_TRACKER_NAPTIME);

View File

@ -827,8 +827,8 @@ static inline void FlatTLtoBool(const List* targetList, bool* boolArr, AttrNumbe
{
ListCell* tl = NULL;
foreach (tl, targetList) {
GenericExprState* gstate = (GenericExprState*)lfirst(tl);
Var* variable = (Var*)gstate->xprstate.expr;
TargetEntry* tle = (TargetEntry*)lfirst(tl);
Var* variable = (Var*)tle->expr;
Assert(variable != NULL); /* if this happens we've messed up */
if ((variable->varoattno > 0) && (variable->varoattno <= natts)) {
boolArr[variable->varoattno - 1] = false; /* sometimes varattno in parent is different */
@ -1049,7 +1049,7 @@ SeqScanState* ExecInitSeqScan(SeqScan* node, EState* estate, int eflags)
FlatTLtoBool(scanstate->ps.plan->flatList, isNullProj, natts);
if (scanstate->ps.plan->targetlist->length < natts)
if (scanstate->ps.plan->targetlist->length > scanstate->ps.plan->flatList->length) {
FlatTLtoBool(scanstate->ps.plan->targetlist, isNullProj, natts); /* parent unaware of 'HAVING' clause */
TLtoBool(scanstate->ps.plan->targetlist, isNullProj, natts); /* parent unaware of 'HAVING' clause */
}
if ((scanstate->ps.plan->qual != NULL) && (scanstate->ps.plan->qual->length > 0)) /* query has qualifications */

View File

@ -809,3 +809,11 @@ ERROR: relation "t_t_mutil_t2" already exists in schema "public"
DETAIL: creating new table with existing name in the same schema
update t_t_mutil_t1 a,t_t_mutil_t2 b set b.col2=5,a.col2=4 where a.col1=b.col1;
ERROR: multi-relation update only support in B-format database
--ustore update
set ustore_attr to 'enable_candidate_buf_usage_count=true;enable_ustore_partial_seqscan=true';
drop table if exists ustore_t1;
NOTICE: table "ustore_t1" does not exist, skipping
create table ustore_t1(id int, name varchar(10)) with (storage_type = ustore);
insert into ustore_t1 values(1, 'a');
update ustore_t1 set ustore_t1.name = 'b' where ustore_t1.id = 1;
drop table ustore_t1;

View File

@ -344,3 +344,11 @@ drop table test;
create table t_t_mutil_t1(col1 int,col2 int);
create table t_t_mutil_t2(col1 int,col2 int);
update t_t_mutil_t1 a,t_t_mutil_t2 b set b.col2=5,a.col2=4 where a.col1=b.col1;
--ustore update
set ustore_attr to 'enable_candidate_buf_usage_count=true;enable_ustore_partial_seqscan=true';
drop table if exists ustore_t1;
create table ustore_t1(id int, name varchar(10)) with (storage_type = ustore);
insert into ustore_t1 values(1, 'a');
update ustore_t1 set ustore_t1.name = 'b' where ustore_t1.id = 1;
drop table ustore_t1;