mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 18:43:18 +08:00
Improve found attribute handling in release builds
The found attribute is not used in release builds when Asserts are not evaluated. This leads to unused attributes and compiler errors. This PR fixes this problem by adding PG_USED_FOR_ASSERTS_ONLY to the variable declaration.
This commit is contained in:
parent
9b6175abe1
commit
25af8f4741
24
src/chunk.c
24
src/chunk.c
@ -3389,7 +3389,9 @@ ts_chunk_set_name(Chunk *chunk, const char *newname)
|
||||
{
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
namestrcpy(&form.table_name, newname);
|
||||
@ -3403,7 +3405,9 @@ ts_chunk_set_schema(Chunk *chunk, const char *newschema)
|
||||
{
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
namestrcpy(&form.schema_name, newschema);
|
||||
@ -3484,7 +3488,9 @@ ts_chunk_clear_status(Chunk *chunk, int32 status)
|
||||
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
/* applying the flags after locking the metadata tuple */
|
||||
@ -3515,7 +3521,9 @@ ts_chunk_add_status(Chunk *chunk, int32 status)
|
||||
}
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
/* Somebody could update the status before we are able to lock it so check again */
|
||||
@ -3563,7 +3571,9 @@ ts_chunk_set_compressed_chunk(Chunk *chunk, int32 compressed_chunk_id)
|
||||
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
/* Somebody could update the status before we are able to lock it so check again */
|
||||
@ -3611,7 +3621,9 @@ ts_chunk_clear_compressed_chunk(Chunk *chunk)
|
||||
|
||||
FormData_chunk form;
|
||||
ItemPointerData tid;
|
||||
bool found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
bool PG_USED_FOR_ASSERTS_ONLY found;
|
||||
|
||||
found = lock_chunk_tuple(chunk->fd.id, &tid, &form);
|
||||
Assert(found);
|
||||
|
||||
/* Somebody could update the status before we are able to lock it so check again */
|
||||
|
Loading…
x
Reference in New Issue
Block a user