mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-19 02:27:55 +08:00
SQLDescribeCol: fill pcbColName even when szColName is null.
This commit is contained in:

committed by
Brian Bruns

parent
0919ca2a89
commit
2b72bcdc6f
@@ -732,12 +732,20 @@ SQLRETURN SQL_API SQLDescribeCol(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i==table->num_cols) {
|
||||
fprintf(stderr, "Column %s lost\n", (char*)sqlcol->name);
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
if (szColName) {
|
||||
namelen = MIN(cbColNameMax,strlen(sqlcol->name));
|
||||
strncpy((char*)szColName, sqlcol->name, namelen);
|
||||
szColName[namelen]='\0';
|
||||
*pcbColName=namelen;
|
||||
if (pcbColName)
|
||||
*pcbColName=namelen;
|
||||
} else {
|
||||
if (pcbColName)
|
||||
*pcbColName = strlen(sqlcol->name);
|
||||
}
|
||||
if (pfSqlType) { //Currently libmdbodbc.so returns values as string in SQLGetData() even though it is a number.
|
||||
*pfSqlType = SQL_VARCHAR;//_odbc_get_client_type(col->col_type);
|
||||
|
Reference in New Issue
Block a user