mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 09:32:34 +00:00
Merge pull request #502 in FS/freeswitch from ~SAUMAR/freeswitch:bugfix/FS-7673-odbc-null-value-incorrectly-evaluated to master
* commit '3aa051e1a14dfc40a77757247b6849dbd2c9c69d': FS-7673: ODBC NULL value incorrectly evaluated in mod_v8
This commit is contained in:
commit
e7e79c213d
@ -315,12 +315,17 @@ JS_ODBC_FUNCTION_IMPL(GetData)
|
|||||||
SQLULEN ColumnSize;
|
SQLULEN ColumnSize;
|
||||||
SQLCHAR name[1024] = "";
|
SQLCHAR name[1024] = "";
|
||||||
SQLCHAR *data = _colbuf;
|
SQLCHAR *data = _colbuf;
|
||||||
|
SQLLEN pcbValue;
|
||||||
|
|
||||||
SQLDescribeCol(_stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
|
SQLDescribeCol(_stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
|
||||||
SQLGetData(_stmt, x, SQL_C_CHAR, _colbuf, _cblen, NULL);
|
SQLGetData(_stmt, x, SQL_C_CHAR, _colbuf, _cblen, &pcbValue);
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), String::NewFromUtf8(GetIsolate(), data ? (const char *)data : ""));
|
if (SQL_NULL_DATA == pcbValue) {
|
||||||
|
arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), Null(info.GetIsolate()));
|
||||||
|
} else {
|
||||||
|
arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), String::NewFromUtf8(GetIsolate(), data ? (const char *)data : ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user