FS-9727: raise size limit on unkown size odbc column data from 256 to 16k
This commit is contained in:
parent
050ae1967f
commit
d045d9c159
|
@ -611,13 +611,17 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
|
||||||
SQLDescribeCol(stmt, x, (SQLCHAR *) names[y], (SQLSMALLINT) name_len, &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
|
SQLDescribeCol(stmt, x, (SQLCHAR *) names[y], (SQLSMALLINT) name_len, &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
|
||||||
|
|
||||||
if (!ColumnSize) {
|
if (!ColumnSize) {
|
||||||
ColumnSize = 255;
|
SQLCHAR val[16384] = { 0 };
|
||||||
}
|
ColumnSize = 16384;
|
||||||
|
SQLGetData(stmt, x, SQL_C_CHAR, val, ColumnSize, NULL);
|
||||||
|
vals[y] = strdup((char *)val);
|
||||||
|
} else {
|
||||||
ColumnSize++;
|
ColumnSize++;
|
||||||
|
|
||||||
vals[y] = malloc(ColumnSize);
|
vals[y] = malloc(ColumnSize);
|
||||||
memset(vals[y], 0, ColumnSize);
|
memset(vals[y], 0, ColumnSize);
|
||||||
SQLGetData(stmt, x, SQL_C_CHAR, (SQLCHAR *) vals[y], ColumnSize, NULL);
|
SQLGetData(stmt, x, SQL_C_CHAR, (SQLCHAR *) vals[y], ColumnSize, NULL);
|
||||||
|
}
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue