Fix crash in SchemaAllowedHandler.

This commit is contained in:
Vitaly Baranov 2020-08-29 15:53:15 +03:00
parent 2d33a4029b
commit 90dd31fef1

View File

@ -21,15 +21,14 @@ namespace
{ {
bool isSchemaAllowed(SQLHDBC hdbc) bool isSchemaAllowed(SQLHDBC hdbc)
{ {
std::string identifier; SQLUINTEGER value;
SQLSMALLINT value_length = sizeof(value);
SQLSMALLINT t; SQLRETURN r = POCO_SQL_ODBC_CLASS::SQLGetInfo(hdbc, SQL_SCHEMA_USAGE, &value, sizeof(value), &value_length);
SQLRETURN r = POCO_SQL_ODBC_CLASS::SQLGetInfo(hdbc, SQL_SCHEMA_USAGE, nullptr, 0, &t);
if (POCO_SQL_ODBC_CLASS::Utility::isError(r)) if (POCO_SQL_ODBC_CLASS::Utility::isError(r))
throw POCO_SQL_ODBC_CLASS::ConnectionException(hdbc); throw POCO_SQL_ODBC_CLASS::ConnectionException(hdbc);
return t != 0; return value != 0;
} }
} }