Skip to content

Commit d80a79b

Browse files
committed
use the newer signed defs for type mapping
The sign-explicit defs have been added to replace the implicitly signed ones.
1 parent 4b410c5 commit d80a79b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

driver/defs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@
304304
/* -6: SQL_TINYINT -> SQL_C_TINYINT */
305305
#define ESODBC_ES_TO_CSQL_BYTE SQL_C_TINYINT
306306
/* 5: SQL_SMALLINT -> SQL_C_SHORT */
307-
#define ESODBC_ES_TO_CSQL_SHORT SQL_C_SHORT
307+
#define ESODBC_ES_TO_CSQL_SHORT SQL_C_SSHORT
308308
/* 4: SQL_INTEGER -> SQL_C_LONG */
309-
#define ESODBC_ES_TO_CSQL_INTEGER SQL_C_LONG
309+
#define ESODBC_ES_TO_CSQL_INTEGER SQL_C_SLONG
310310
/* -5: SQL_BIGINT -> SQL_C_SBIGINT */
311311
#define ESODBC_ES_TO_CSQL_LONG SQL_C_SBIGINT
312312
/* 6: SQL_FLOAT -> SQL_C_DOUBLE */
@@ -318,7 +318,7 @@
318318
/* 8: SQL_DOUBLE -> SQL_C_FLOAT */
319319
#define ESODBC_ES_TO_CSQL_DOUBLE SQL_C_DOUBLE
320320
/* 16: ??? -> SQL_C_TINYINT */
321-
#define ESODBC_ES_TO_CSQL_BOOLEAN SQL_C_TINYINT
321+
#define ESODBC_ES_TO_CSQL_BOOLEAN SQL_C_STINYINT
322322
/* 12: SQL_VARCHAR -> SQL_C_WCHAR */
323323
#define ESODBC_ES_TO_CSQL_KEYWORD SQL_C_WCHAR
324324
/* 12: SQL_VARCHAR -> SQL_C_WCHAR */
@@ -328,7 +328,7 @@
328328
/* -3: SQL_VARBINARY -> SQL_C_BINARY */
329329
#define ESODBC_ES_TO_CSQL_BINARY SQL_C_BINARY
330330
/* 0: SQL_TYPE_NULL -> SQL_C_TINYINT */
331-
#define ESODBC_ES_TO_CSQL_NULL SQL_C_TINYINT
331+
#define ESODBC_ES_TO_CSQL_NULL SQL_C_STINYINT
332332
/* 1111: ??? -> SQL_C_BINARY */
333333
#define ESODBC_ES_TO_CSQL_UNSUPPORTED SQL_C_BINARY
334334
/* 2002: ??? -> SQL_C_BINARY */

driver/queries.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,24 +789,28 @@ static SQLRETURN copy_longlong(esodbc_rec_st *arec, esodbc_rec_st *irec,
789789
irec->meta_type);
790790
break;
791791

792+
case SQL_C_TINYINT:
792793
case SQL_C_STINYINT:
793794
*(SQLSCHAR *)data_ptr = (SQLSCHAR)ll;
794795
write_copied_octets(octet_len_ptr, sizeof(SQLSCHAR),
795796
stmt->max_length, irec->meta_type);
796797
break;
797798

799+
case SQL_C_SHORT:
798800
case SQL_C_SSHORT:
799801
*(SQLSMALLINT *)data_ptr = (SQLSMALLINT)ll;
800802
write_copied_octets(octet_len_ptr, sizeof(SQLSMALLINT),
801803
stmt->max_length, irec->meta_type);
802804
break;
803805

806+
case SQL_C_LONG:
804807
case SQL_C_SLONG:
805808
*(SQLINTEGER *)data_ptr = (SQLINTEGER)ll;
806809
write_copied_octets(octet_len_ptr, sizeof(SQLINTEGER),
807810
stmt->max_length, irec->meta_type);
808811
break;
809812

813+
case SQL_C_BIGINT:
810814
case SQL_C_SBIGINT:
811815
*(SQLBIGINT *)data_ptr = (SQLBIGINT)ll;
812816
write_copied_octets(octet_len_ptr, sizeof(SQLBIGINT),

0 commit comments

Comments
 (0)