mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 22:03:03 +01:00
Backport fix for bug CORE-2977 : FB 2.1 incorrectly works with indexed fields of type DATE in OLD ODS (9.1)
This commit is contained in:
parent
4a471e6127
commit
ca042283e1
@ -1301,6 +1301,7 @@ USHORT BTR_key_length(thread_db* tdbb, jrd_rel* relation, index_desc* idx)
|
||||
switch (tail->idx_itype)
|
||||
{
|
||||
case idx_numeric:
|
||||
case idx_timestamp1:
|
||||
length = sizeof(double);
|
||||
break;
|
||||
|
||||
@ -1354,6 +1355,7 @@ USHORT BTR_key_length(thread_db* tdbb, jrd_rel* relation, index_desc* idx)
|
||||
switch (tail->idx_itype)
|
||||
{
|
||||
case idx_numeric:
|
||||
case idx_timestamp1:
|
||||
length = sizeof(double);
|
||||
break;
|
||||
case idx_sql_time:
|
||||
@ -2450,6 +2452,7 @@ static void compress(thread_db* tdbb,
|
||||
switch (itype)
|
||||
{
|
||||
case idx_numeric:
|
||||
case idx_timestamp1:
|
||||
length = sizeof(double);
|
||||
break;
|
||||
case idx_sql_time:
|
||||
@ -2576,6 +2579,13 @@ static void compress(thread_db* tdbb,
|
||||
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
fprintf(stderr, "NUMERIC %lg ", temp.temp_double);
|
||||
#endif
|
||||
}
|
||||
else if (itype == idx_timestamp1) {
|
||||
temp.temp_double = MOV_date_to_double(desc);
|
||||
temp_is_negative = (temp.temp_double < 0);
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
fprintf(stderr, "TIMESTAMP1 %lg ", temp.temp_double);
|
||||
#endif
|
||||
}
|
||||
else if (itype == idx_numeric2) {
|
||||
|
@ -96,7 +96,7 @@ struct IndexDescAlloc : public pool_alloc_rpt<index_desc> {
|
||||
|
||||
const int idx_numeric = 0;
|
||||
const int idx_string = 1;
|
||||
// AB: idx_timestamp1 removed
|
||||
const int idx_timestamp1 = 2;
|
||||
const int idx_byte_array = 3;
|
||||
const int idx_metadata = 4;
|
||||
const int idx_sql_date = 5;
|
||||
|
Loading…
Reference in New Issue
Block a user