fix memcheck issue: 1 to_number(), 2 core of spliting hash partition by range-gram
This commit is contained in:
@ -3910,6 +3910,16 @@ List* transformAlterTableStmt(Oid relid, AlterTableStmt* stmt, const char* query
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AT_SplitPartition:
|
case AT_SplitPartition:
|
||||||
|
if (!RELATION_IS_PARTITIONED(rel))
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||||
|
errmodule(MOD_OPT),
|
||||||
|
errmsg("can not split partition against NON-PARTITIONED table")));
|
||||||
|
if (rel->partMap->type == PART_TYPE_LIST || rel->partMap->type == PART_TYPE_HASH) {
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("can not split LIST/HASH partition table")));
|
||||||
|
}
|
||||||
|
|
||||||
/* transform the boundary of range partition: from A_Const into Const */
|
/* transform the boundary of range partition: from A_Const into Const */
|
||||||
splitDefState = (SplitPartitionState*)cmd->def;
|
splitDefState = (SplitPartitionState*)cmd->def;
|
||||||
if (!PointerIsValid(splitDefState->split_point)) {
|
if (!PointerIsValid(splitDefState->split_point)) {
|
||||||
@ -3930,12 +3940,6 @@ List* transformAlterTableStmt(Oid relid, AlterTableStmt* stmt, const char* query
|
|||||||
Const* upBound = NULL;
|
Const* upBound = NULL;
|
||||||
Oid srcPartOid = InvalidOid;
|
Oid srcPartOid = InvalidOid;
|
||||||
|
|
||||||
if (!RELATION_IS_PARTITIONED(rel))
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
|
||||||
errmodule(MOD_OPT),
|
|
||||||
errmsg("can not split partition against NON-PARTITIONED table")));
|
|
||||||
|
|
||||||
/* get partition number */
|
/* get partition number */
|
||||||
partNum = getNumberOfPartitions(rel);
|
partNum = getNumberOfPartitions(rel);
|
||||||
|
|
||||||
@ -5369,6 +5373,7 @@ static void get_src_partition_bound(Relation partTableRel, Oid srcPartOid, Const
|
|||||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||||
errmsg("CAN NOT get detail info from a partitioned relation WITHOUT specified partition.")));
|
errmsg("CAN NOT get detail info from a partitioned relation WITHOUT specified partition.")));
|
||||||
|
|
||||||
|
Assert(partTableRel->partMap->type == PART_TYPE_RANGE || partTableRel->partMap->type == PART_TYPE_INTERVAL);
|
||||||
partMap = (RangePartitionMap*)partTableRel->partMap;
|
partMap = (RangePartitionMap*)partTableRel->partMap;
|
||||||
|
|
||||||
srcPartSeq = partOidGetPartSequence(partTableRel, srcPartOid) - 1;
|
srcPartSeq = partOidGetPartSequence(partTableRel, srcPartOid) - 1;
|
||||||
|
@ -5561,7 +5561,7 @@ static void NUM_numpart_from_char(NUMProc* Np, int id, int plen, int& tmp_len)
|
|||||||
* locale sign expected - last read char was NUM_0/9 or NUM_DEC - and
|
* locale sign expected - last read char was NUM_0/9 or NUM_DEC - and
|
||||||
* next char is not digit
|
* next char is not digit
|
||||||
*/
|
*/
|
||||||
if (IS_LSIGN(Np->Num) && isread && (Np->inout_p + 1) <= Np->inout + plen &&
|
if (IS_LSIGN(Np->Num) && isread && (Np->inout_p + 1) < Np->inout + plen &&
|
||||||
!isdigit((unsigned char)*(Np->inout_p + 1))) {
|
!isdigit((unsigned char)*(Np->inout_p + 1))) {
|
||||||
int x;
|
int x;
|
||||||
char* tmp = Np->inout_p++;
|
char* tmp = Np->inout_p++;
|
||||||
|
Reference in New Issue
Block a user