1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

- Add aligment of variable data types

- Add aligment for interval data types
- Avoid floating point overflow in penalty functions
Janko Richter <jankorichter@yahoo.de> and teodor
This commit is contained in:
Teodor Sigaev
2004-06-03 12:26:10 +00:00
parent 921d749bd4
commit 7b81988f9b
17 changed files with 161 additions and 110 deletions

View File

@ -140,7 +140,7 @@ gbt_tstz_compress(PG_FUNCTION_ARGS)
if (entry->leafkey)
{
tsKEY *r = (tsKEY *) palloc(sizeof(tsKEY));
TimestampTz ts = *(TimestampTz *) DatumGetPointer(entry->key);
Timestamp gmt ;
@ -167,6 +167,7 @@ gbt_ts_consistent(PG_FUNCTION_ARGS)
tsKEY *kkk = (tsKEY *) DatumGetPointer(entry->key);
GBT_NUMKEY_R key ;
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
key.lower = (GBT_NUMKEY*) &kkk->lower ;
key.upper = (GBT_NUMKEY*) &kkk->upper ;
@ -180,12 +181,13 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
TimestampTz *query = (Timestamp *) PG_GETARG_POINTER(1);
tsKEY *kkk = (tsKEY *) DatumGetPointer(entry->key);
char *kkk = (char *) DatumGetPointer(entry->key);
GBT_NUMKEY_R key ;
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
Timestamp qqq ;
key.lower = (GBT_NUMKEY*) &kkk->lower ;
key.upper = (GBT_NUMKEY*) &kkk->upper ;
key.lower = (GBT_NUMKEY*) &kkk[0];
key.upper = (GBT_NUMKEY*) &kkk[MAXALIGN(tinfo.size)];
tstz_to_ts_gmt ( &qqq, query );
PG_RETURN_BOOL(