Fixed truncating 64bit (SQL_NULL_DATA) values (#416)

This commit is contained in:
Mladen Milinkovic 2023-07-06 12:47:10 +02:00 committed by GitHub
parent 0d67eb4c73
commit 328249a628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -72,8 +72,8 @@ struct _hstmt {
struct _sql_bind_info {
int column_number;
int column_bindtype; /* type/conversion required */
int column_bindlen; /* size of varaddr buffer */
int *column_lenbind; /* where to store length of varaddr used */
SQLLEN column_bindlen; /* size of varaddr buffer */
SQLLEN *column_lenbind; /* where to store length of varaddr used */
char *varaddr;
struct _sql_bind_info *next;
};

View File

@ -513,7 +513,7 @@ SQLRETURN SQL_API SQLBindCol(
/* if this is a repeat */
if (cur) {
cur->column_bindtype = fCType;
cur->column_lenbind = (int *)pcbValue;
cur->column_lenbind = pcbValue;
cur->column_bindlen = cbValueMax;
cur->varaddr = (char *) rgbValue;
} else {
@ -522,7 +522,7 @@ SQLRETURN SQL_API SQLBindCol(
newitem->column_number = icol;
newitem->column_bindtype = fCType;
newitem->column_bindlen = cbValueMax;
newitem->column_lenbind = (int *)pcbValue;
newitem->column_lenbind = pcbValue;
newitem->varaddr = (char *) rgbValue;
/* if there's no head yet */
if (! stmt->bind_head) {