DevHeads.net

Postings by Grant Shirreffs

SQLGetInfo

Looking at the code for SQLGetInfo, where it returns data indicating the driver capabilities with respect to the ODBC SQL syntax, it looks like the implementation is lacking.

Specifically, calls to SQL_NUMERIC_FUNCTIONS, SQL_TIMEDATE_FUNCTIONS and SQL_SYSTEM_FUNCTIONS all return 0, even though the convert_escape function in convert.c indicates support for almost all ODBC scalar functions.

Bound parameters in escaped functions

Hello,

I have found a bug in the translation of '?' parameters in escaped ODBC functions.

Where there is an escaped ODBC function within another, for example:

CASE WHEN {fn LENGTH({fn LTRIM(Name || ?))=?

Escaped characters in LIKE

PostgreSQL fully supports escaping of %, _ and \ in LIKE clauses, and supports the standard syntax for indicating the use of an escaping character: <a href="https://www.postgresql.org/docs/9.0/functions-matching.html" title="https://www.postgresql.org/docs/9.0/functions-matching.html">https://www.postgresql.org/docs/9.0/functions-matching.html</a>.

The ODBC driver correctly supports the standard ODBC 'escape' syntax for declaring the escaping character: (convert.c, line 5580).

So is there some reason I'm missing why the SQLGetInfo implementation, when asked SQL_LIKE_ESCAPE_CLAUSE, says that the driver doesn't support escaping of LIKE? (info.c, line 309).

Bug in is_setting_search_path

Hello,

I have found a bug in the is_setting_search_path function (connection.c line 1597).

The search loop is currently:

for (; *q; q++)
{
if (IS_NOT_SPACE(*q))
{
if (strnicmp(q, "search_path", 11) == 0)
return TRUE;
q++;
while (IS_NOT_SPACE(*q))
q++;
}
}

The inner while(IS_NOT_SPACE(*q)) loop will terminate if a null is reached.