!5958 【处理8.0 core问题】blob字符序断言导致core, 添加IsBinaryType的hook函数,处理tinyblob类型
Merge pull request !5958 from lukeman/master
This commit is contained in:
@ -1773,6 +1773,9 @@ Oid LookupTypeInPackage(List* typeNames, const char* typeName, Oid pkgOid, Oid n
|
||||
|
||||
bool IsBinaryType(Oid typid)
|
||||
{
|
||||
if (u_sess->hook_cxt.isBinaryType != NULL) {
|
||||
return ((isBinaryType)(u_sess->hook_cxt.isBinaryType))(typid);
|
||||
}
|
||||
return ((typid) == BLOBOID ||
|
||||
(typid) == BYTEAOID);
|
||||
}
|
||||
@ -1807,4 +1810,4 @@ TypeTupStatus GetTypeTupStatus(Type typ)
|
||||
return (UNDEFINEDOID == HeapTupleGetOid(typ) ? UndefineTypeTup : NormalTypeTup);
|
||||
}
|
||||
return InvalidTypeTup;
|
||||
}
|
||||
}
|
||||
|
@ -2947,6 +2947,7 @@ typedef struct knl_u_hook_context {
|
||||
void *deparseQueryHook;
|
||||
void *checkSqlFnRetvalHook;
|
||||
void *typeTransfer;
|
||||
void *isBinaryType;
|
||||
void *forTsdbHook;
|
||||
void *pluginPlannerHook;
|
||||
void *groupingplannerHook;
|
||||
|
@ -65,6 +65,7 @@ extern HeapTuple FindPkgVariableType(ParseState* pstate, const TypeName* typname
|
||||
TypeDependExtend* depend_extend = NULL);
|
||||
extern char* CastPackageTypeName(const char* typName, Oid pkgOid, bool isPackage, bool isPublic = true);
|
||||
extern bool IsBinaryType(Oid typid);
|
||||
typedef bool (*isBinaryType)(Oid typid);
|
||||
#define ISCOMPLEX(typeid) (typeidTypeRelid(typeid) != InvalidOid)
|
||||
extern void check_type_supports_multi_charset(Oid typid, bool allow_array);
|
||||
extern char* ParseTypeName(const char* typName, Oid pkgOid);
|
||||
|
Reference in New Issue
Block a user