mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
bool and money fixes
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2002-03-15 Brian Bruns <camber@ais.org>
|
||||
|
||||
* src/libmdb/money.c: Two's complement fix from
|
||||
* src/libmdb/data.c: BOOL fixes from Mike Finger and Ben McKeegan
|
||||
* src/libmdb/table.c: BOOL fixes from Mike Finger
|
||||
|
||||
2001-09-29 Brian Bruns <camber@ais.org>
|
||||
|
||||
* src/odbc/odbc.c:
|
||||
|
@@ -193,6 +193,7 @@ unsigned char isnull;
|
||||
rc = _mdb_attempt_bind(mdb, col, isnull,
|
||||
row_start + col_start, col->col_size);
|
||||
if (!rc) return 0;
|
||||
if (col->col_type != MDB_BOOL)
|
||||
col_start += col->col_size;
|
||||
}
|
||||
}
|
||||
@@ -245,6 +246,8 @@ unsigned char isnull;
|
||||
len=mdb->pg_buf[row_end - bitmask_sz - var_cols_found
|
||||
- 1 - num_of_jumps ] - col_start;
|
||||
}
|
||||
if (len<0)
|
||||
len+=256;
|
||||
}
|
||||
|
||||
isnull = mdb_is_null(null_mask, j+1);
|
||||
|
@@ -45,17 +45,20 @@ int neg=0;
|
||||
multiplier[0]=1;
|
||||
|
||||
money = &mdb->pg_buf[start];
|
||||
|
||||
if (money[7] && 0x01) {
|
||||
/* negative number -- preform two's complement */
|
||||
neg = 1;
|
||||
for (i=0;i<8;i++) {
|
||||
for (i=0;i<num_bytes;i++) {
|
||||
money[i] = ~money[i];
|
||||
}
|
||||
for (i=7; i>=0; i--) {
|
||||
money[7] += 1;
|
||||
for (i=0; i<num_bytes; i++) {
|
||||
money[i] += 1;
|
||||
if (money[i]!=0) break;
|
||||
}
|
||||
}
|
||||
|
||||
money[7]=0;
|
||||
for (pos=0;pos<num_bytes;pos++) {
|
||||
multiply_byte(product, money[pos], multiplier);
|
||||
|
||||
|
@@ -105,11 +105,14 @@ GSList *slist = NULL;
|
||||
read_pg_if(mdb, &cur_col, 13);
|
||||
col.is_fixed = mdb->pg_buf[cur_col + mdb->col_fixed_offset] &
|
||||
0x01 ? 1 : 0;
|
||||
if (col.col_type != MDB_BOOL) {
|
||||
read_pg_if(mdb, &cur_col, 17);
|
||||
low_byte = mdb->pg_buf[cur_col + mdb->col_size_offset];
|
||||
read_pg_if(mdb, &cur_col, 18);
|
||||
high_byte = mdb->pg_buf[cur_col + mdb->col_size_offset + 1];
|
||||
col.col_size += high_byte * 256 + low_byte;
|
||||
} else
|
||||
col.col_size=0;
|
||||
|
||||
pcol = g_memdup(&col, sizeof(MdbColumn));
|
||||
slist = g_slist_insert_sorted(slist,pcol,(GCompareFunc)mdb_col_comparer);
|
||||
|
Reference in New Issue
Block a user