Fix ODBC types to match standard typedefs

This fixes a bug that I'm currently experiencing reproducible in the following way:

-Use lua5.3
-"long int" must have size 8
-SQLINTEGER must have size 4

Selecting a column of integer type would mess up the values.
This commit is contained in:
Mauro 2019-06-14 13:26:50 +02:00 committed by GitHub
parent e717678e2b
commit 6942e2b3e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,7 +346,7 @@ static int push_column(lua_State *L, int coltypes, const SQLHSTMT hstmt,
switch (type) {
/* nUmber */
case 'u': {
double num;
SQLDOUBLE num;
SQLLEN got;
SQLRETURN rc = SQLGetData(hstmt, i, SQL_C_DOUBLE, &num, 0, &got);
if (error(rc))
@ -360,7 +360,7 @@ static int push_column(lua_State *L, int coltypes, const SQLHSTMT hstmt,
#if LUA_VERSION_NUM>=503
/* iNteger */
case 'n': {
long int num;
SQLINTEGER num;
SQLLEN got;
SQLRETURN rc = SQLGetData(hstmt, i, SQL_C_SLONG, &num, 0, &got);
if (error(rc))
@ -374,7 +374,7 @@ static int push_column(lua_State *L, int coltypes, const SQLHSTMT hstmt,
#endif
/* bOol */
case 'o': {
char b;
SQLCHAR b;
SQLLEN got;
SQLRETURN rc = SQLGetData(hstmt, i, SQL_C_BIT, &b, 0, &got);
if (error(rc))