Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f8683e8

Browse files
committed
> 1) When a row is retrieved, and then a SQL_FETCH_FIRST is issued, the
check > in convert.c > does not consider the fact that the value in the field has been altered to > be a '1' if the > backend handed it a 't'. The net result being that the first row on any > subsequent queries > has all it's boolean set to 0. Aidan Mountford
1 parent 184505b commit f8683e8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/interfaces/odbc/convert.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,23 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
292292
{ /* change T/F to 1/0 */
293293
char *s = (char *) value;
294294

295-
if (s[0] == 'T' || s[0] == 't')
295+
/* Aidan Mountford (aidan@oz.to) 1/08/2001:
296+
297+
>> if (s[0] == 'T' || s[0] == 't') <<< This wont work...
298+
299+
When MoveFirst is called twice on one set of tuples,
300+
this will have the effect of setting s[0] to 1 on the
301+
first pass, and s[0] on the second.
302+
303+
This is bad ;)
304+
305+
*/
306+
307+
if (s[0] == 'T' || s[0] == 't' || s[0] == '1')
296308
s[0] = '1';
297309
else
298-
s[0] = '0';
310+
s[0] = '0';
311+
299312
}
300313
break;
301314

@@ -1158,7 +1171,10 @@ copy_statement_with_parameters(StatementClass *stmt)
11581171
}
11591172
else
11601173
{
1174+
1175+
11611176
used = stmt->parameters[param_number].used ? *stmt->parameters[param_number].used : SQL_NTS;
1177+
11621178
buffer = stmt->parameters[param_number].buffer;
11631179
}
11641180

0 commit comments

Comments
 (0)