Skip to content

Commit

Permalink
Remove NULL value handling in CreateShardRow
Browse files Browse the repository at this point in the history
The codebase doesn't use this functionality, so I see little point in
maintaining it.
  • Loading branch information
jasonmp85 committed May 15, 2015
1 parent 0a92c46 commit 128424a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions distribution_metadata.c
Expand Up @@ -605,24 +605,17 @@ CreateShardRow(Oid distributedTableId, char shardStorage, text *shardMinValue,
PointerGetDatum(shardMinValue),
PointerGetDatum(shardMaxValue)
};
char nulls[] = { ' ', ' ', ' ', ' ' };
const int argCount = sizeof(argValues) / sizeof(argValues[0]);
int spiStatus = 0;
bool isNull = false;
Datum shardIdDatum = 0;

SPI_connect();

if (shardMinValue == NULL || shardMaxValue == NULL)
{
nulls[2] = 'n';
nulls[3] = 'n';
}

spiStatus = SPI_execute_with_args("INSERT INTO pgs_distribution_metadata.shard "
"(relation_id, storage, min_value, max_value) "
"VALUES ($1, $2, $3, $4) RETURNING id", argCount,
argTypes, argValues, nulls, false, 1);
argTypes, argValues, NULL, false, 1);
Assert(spiStatus == SPI_OK_INSERT_RETURNING);

shardIdDatum = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1,
Expand Down

0 comments on commit 128424a

Please sign in to comment.