修复数组计算元素个数整数溢出问题
This commit is contained in:
@ -58,6 +58,13 @@
|
||||
|
||||
#include "fmgr.h"
|
||||
|
||||
/*
|
||||
* Maximum number of elements in an array. We limit this to at most about a
|
||||
* quarter billion elements, so that it's not necessary to check for overflow
|
||||
* in quite so many places --- for instance when polloc'ing Datum arrays.
|
||||
*/
|
||||
#define MaxArraySize ((Size)(MaxAllocSize) / sizeof(Datum))
|
||||
|
||||
/*
|
||||
* Arrays are varlena objects, so must meet the varlena convention that
|
||||
* the first int32 of the object contains the total object size in bytes.
|
||||
|
||||
Reference in New Issue
Block a user