!5931 【处理8.0 core问题】blob字符序断言导致core
Merge pull request !5931 from lukeman/master
This commit is contained in:
@ -34,12 +34,14 @@
|
||||
#endif /* FRONTEND_PARSER */
|
||||
#include "storage/tcap.h"
|
||||
#include "parser/parse_utilcmd.h"
|
||||
#include "parser/parse_type.h"
|
||||
|
||||
static bool query_check_no_flt_walker(Node* node, void* context);
|
||||
static bool query_check_srf_walker(Node* node, void* context);
|
||||
static bool expression_returns_set_walker(Node* node, void* context);
|
||||
static bool expression_rownum_walker(Node* node, void* context);
|
||||
static int leftmostLoc(int loc1, int loc2);
|
||||
static void AssertExprCollation(const Node* expr, Oid collation);
|
||||
Oid userSetElemTypeCollInfo(const Node* expr, Oid (*exprFunc)(const Node*));
|
||||
|
||||
/*
|
||||
@ -1070,6 +1072,15 @@ Oid exprInputCollation(const Node* expr)
|
||||
return coll;
|
||||
}
|
||||
|
||||
static void AssertExprCollation(const Node* expr, Oid collation)
|
||||
{
|
||||
Oid expr_collation = exprCollation(expr);
|
||||
if (DB_IS_CMPT(B_FORMAT) && ENABLE_MULTI_CHARSET && IsBinaryType(exprType(expr))) {
|
||||
expr_collation = BINARY_COLLATION_OID;
|
||||
}
|
||||
Assert(collation == expr_collation);
|
||||
}
|
||||
|
||||
/*
|
||||
* exprSetCollation -
|
||||
* Assign collation information to an expression tree node.
|
||||
@ -1114,7 +1125,7 @@ void exprSetCollation(Node* expr, Oid collation)
|
||||
((FuncExpr*)expr)->funccollid = collation;
|
||||
break;
|
||||
case T_NamedArgExpr:
|
||||
Assert(collation == exprCollation((Node*)((NamedArgExpr*)expr)->arg));
|
||||
AssertExprCollation((Node*)((NamedArgExpr*)expr)->arg, collation);
|
||||
break;
|
||||
case T_OpExpr:
|
||||
((OpExpr*)expr)->opcollid = collation;
|
||||
@ -1148,7 +1159,7 @@ void exprSetCollation(Node* expr, Oid collation)
|
||||
tent = (TargetEntry*)linitial(qtree->targetList);
|
||||
Assert(IsA(tent, TargetEntry));
|
||||
Assert(!tent->resjunk);
|
||||
Assert(collation == exprCollation((Node*)tent->expr));
|
||||
AssertExprCollation((Node*)tent->expr, collation);
|
||||
} else {
|
||||
/* for all other sublink types, result is boolean */
|
||||
Assert(!OidIsValid(collation));
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
#include "utils/rel_gs.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "foreign/foreign.h"
|
||||
#include "parser/parse_type.h"
|
||||
#ifdef PGXC
|
||||
#include "pgxc/execRemote.h"
|
||||
#include "tcop/utility.h"
|
||||
@ -158,8 +159,9 @@ static ObjectAddress DefineVirtualRelation(RangeVar* relation, List* tlist, bool
|
||||
(errcode(ERRCODE_INDETERMINATE_COLLATION),
|
||||
errmsg("could not determine which collation to use for view column \"%s\"", def->colname),
|
||||
errhint("Use the COLLATE clause to set the collation explicitly.")));
|
||||
} else
|
||||
} else if (!(DB_IS_CMPT(B_FORMAT) && ENABLE_MULTI_CHARSET && IsBinaryType(exprType((Node*)tle->expr)))) {
|
||||
Assert(!OidIsValid(def->collOid));
|
||||
}
|
||||
def->constraints = NIL;
|
||||
|
||||
attrList = lappend(attrList, def);
|
||||
|
||||
Reference in New Issue
Block a user