FirebirdSQL/firebird-odbc-driver

ODBC function SQLGetInfo fails if SQL_KEYWORDS InfoType is requested. [ODBC190]

firebird-automations opened this issue · 5 comments

Submitted by: @paulbeach

ODBC function SQLGetInfo fails if SQL_KEYWORDS InfoType is requested.

The following fix has been committed (file MainUnicode.cpp):

  ConvertingString\( int length, SQLWCHAR \*wcString, TypeRealLen \*pLength = NULL, bool retCountOfBytes = true \)
  \{
          connection = NULL;
          realLength = pLength;
          returnCountOfBytes = retCountOfBytes;

          if \( wcString \)
          \{
                  isWhy = BYTESCHARS;
                  unicodeString = wcString;
                  if \( length == SQL\_NTS \)
                          lengthString = 0;
                  else if \( retCountOfBytes \)

- lengthString = length / 2;
+ lengthString = length / sizeof(wchar_t);
else
lengthString = length;

Commits: 64b1ce1 4ff3322

Modified by: @paulbeach

Version: 2.0.3 [ 10581 ]

description: ODBC function SQLGetInfo fails if SQL_KEYWORDS InfoType is requested.

environment: Linux x86-64

Modified by: @paulbeach

description: ODBC function SQLGetInfo fails if SQL_KEYWORDS InfoType is requested. => ODBC function SQLGetInfo fails if SQL_KEYWORDS InfoType is requested.

The following fix has been committed (file MainUnicode.cpp):

  ConvertingString\( int length, SQLWCHAR \*wcString, TypeRealLen \*pLength = NULL, bool retCountOfBytes = true \)
  \{
          connection = NULL;
          realLength = pLength;
          returnCountOfBytes = retCountOfBytes;

          if \( wcString \)
          \{
                  isWhy = BYTESCHARS;
                  unicodeString = wcString;
                  if \( length == SQL\_NTS \)
                          lengthString = 0;
                  else if \( retCountOfBytes \)

- lengthString = length / 2;
+ lengthString = length / sizeof(wchar_t);
else
lengthString = length;

Commented by: @alexpotapchenko

Fixed in CVS for B_2_0_0 and head with the same fix in SQLSetDescFieldW

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0.4 [ 10662 ]

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]