| 294 | } |
| 295 | |
| 296 | static Datum * |
| 297 | consts_to_datums(PartitionKey partkey, List *consts) |
| 298 | { |
| 299 | Datum *datums; |
| 300 | ListCell *lc; |
| 301 | int i; |
| 302 | |
| 303 | if (partkey->partnatts != list_length(consts)) |
| 304 | elog(ERROR, "wrong number of partition bounds"); |
| 305 | |
| 306 | datums = palloc(partkey->partnatts * sizeof(Datum)); |
| 307 | |
| 308 | i = 0; |
| 309 | foreach(lc, consts) |
| 310 | { |
| 311 | Const *c = (Const *) lfirst(lc); |
| 312 | |
| 313 | if (!IsA(c, Const)) |
| 314 | elog(ERROR, "expected Const in partition bound"); |
| 315 | |
| 316 | datums[i] = c->constvalue; |
| 317 | i++; |
| 318 | } |
| 319 | |
| 320 | return datums; |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | * Sort the list of GpPartitionBoundSpecs based first on START, if START does |
no test coverage detected