------------------------------------------------------------------------------ * Create a SparseData structure * * There are ways to do this: * First way allocates empty dynamic StringInfo of unknown initial sizes * Second way creates a copy of an existing SparseData * Third way creates a SparseData with zero storage in it's StringInfos * Fourth way creates a SparseData in place using p
| 31 | * index data |
| 32 | */ |
| 33 | SparseData makeSparseData(void) |
| 34 | { |
| 35 | /* Allocate the struct */ |
| 36 | SparseData sdata = (SparseData)palloc(sizeof(SparseDataStruct)); |
| 37 | /* Allocate the included elements */ |
| 38 | sdata->vals = makeStringInfo(); |
| 39 | sdata->index = makeStringInfo(); |
| 40 | sdata->vals->len = 0; |
| 41 | sdata->index->len = 0; |
| 42 | sdata->vals->cursor = 0; |
| 43 | sdata->index->cursor = 0; |
| 44 | sdata->unique_value_count=0; |
| 45 | sdata->total_value_count=0; |
| 46 | sdata->type_of_data = FLOAT8OID; |
| 47 | return sdata; |
| 48 | } |
| 49 | SparseData makeEmptySparseData(void) |
| 50 | { |
| 51 | /* Allocate the struct */ |
no test coverage detected