Merge pull request #23217 from kssenii/default-q

Use double quote identifier in odbc as default in case of error
This commit is contained in:
alexey-milovidov 2021-04-18 03:18:49 +03:00 committed by GitHub
commit 723c8c10be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,18 @@ namespace ErrorCodes
std::string getIdentifierQuote(nanodbc::connection & connection)
{
return connection.get_info<std::string>(SQL_IDENTIFIER_QUOTE_CHAR);
std::string quote;
try
{
quote = connection.get_info<std::string>(SQL_IDENTIFIER_QUOTE_CHAR);
}
catch (...)
{
LOG_WARNING(&Poco::Logger::get("ODBCGetIdentifierQuote"), "Cannot fetch identifier quote. Default double quote is used. Reason: {}", getCurrentExceptionMessage(false));
return "\"";
}
return quote;
}