Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APIS-790] Invalid BufferLength in SQLGetDiagRecW(...) for wide char #17

Merged
merged 1 commit into from
Jul 8, 2019
Merged

[APIS-790] Invalid BufferLength in SQLGetDiagRecW(...) for wide char #17

merged 1 commit into from
Jul 8, 2019

Conversation

beyondykk9
Copy link
Contributor

This is for a sub-task of APIS-788, [Improve the functions of ODBC, patch the bugs related to multi-byte character set.]

SQLGetDiagRecW(..., SQLSMALLINT * TextLength) calls SQLGetDataRec to process the diagnostic records. But the TextLength is not set correctly in case that the SQLGetDataRec returns SUCESS_WITH_INFO.

The TextLength might be 0 in that case. This routine has to be fixed to process the diagnostic message correctly for wide character environment.

@beyondykk9 beyondykk9 requested a review from kisoo-han July 8, 2019 04:40
@beyondykk9 beyondykk9 merged commit 5fb6b15 into CUBRID:develop Jul 8, 2019
swi0110 added a commit that referenced this pull request Oct 22, 2019
* [#7] modification of the README.txt and license.txt files for 10.1 release (#8)

* [RND-269] SQLDescribeCol() function should return SQL_LONGVARBINARY and SQL_LONGVARCHAR for BLOB and CLOB data type rather than SQL_C_DEFAULT. (#10)

* in the UNICODE version of cubrid_odbc.dll, SQLDescribeCol() function should return SQL_WCHAR instead of SQL_WVARCHAR for the CHAR(n) database type under utf-8 charset. (#11)

* [APIS-759] To prevent application crash caused by health_checker thread, GET_MODULE_HANDLE_EX_FLAG_PIN flag was used when calling the GetModuleHandleEx function at DLL_PROCESS_ATTACH state in DllMain. (#12)

* [APIS-773] Modify/Remove broken link in README or Wiki at github/CUBRID repositories (#13)

* [APIS-776] fix SQLGetInfoW function standard(spec) violation (#14)

* The SQLGetInfoW function conform to the following odbc specification.

"If *InfoValuePtr is a Unicode string (when calling SQLGetInfoW), the
BufferLength argument must be an even number; if not, SQLSTATE HY090
(Invalid string or buffer length) is returned."

* The SQLGetInfoW function conform to the following odbc specification.

"If InfoValuePtr is NULL, StringLengthPtr will still return the total
number of bytes (excluding the null-termination character for character
data) available to reurn in the buffer pointed to by InfoValuePtr."

* The SQLGetInfoW function conform to the following odbc specification.

"For character data, if the number of bytes available to return is
greater than or equal to BufferLength, the information in *InfoValuePtr
is truncated to BufferLength bytes minus the length of a
null-termination character and is null-terminated by the driver."

* The SQLGetInfo and SQLGetInfoW functions conform to the following odbc
specification.

"StringLengthPtr argument - Pointer to a buffer in which to return the
total number of bytes (excluding the null-termination character for
character data) available to return in *InfoValuePtr."

* [APIS-785] Change unicode.c encoding to UTF8 (from UTF16) (#15)

* [APIS-788] sub-task [APIS-789] Upgrade build environment for Visual Studio (#16)

* [APIS-790] Invalid BufferLength in SQLGetDiagRecW(...) for wide char (#17)

* [APIS-791] SQLGetDiagRecW returns SQL State to S01000 for connection error. (#18)

* Apis 792 (#20)

* [APIS-792] Providing the session information for current connection via DiagField

* [APIS-792] Providing the session information for current connection via DiagField

* [APIS-793] Increasing default column length for derived column (#21)

* [APIS-796] Correct processing SQLCancel(...) (#24)

* [APIS-796] Correct processing SQLCancel(...)

* [APIS-796] revised: Correct processing SQLCancel(...)

* [APIS-795] Correct processing multi-bye binding in update query (#23)

* [APIS-795] Correct processing multi-bye binding in update query

* [APIS-795] revised: Correct processing multi-bye binding in update query

* [APIS-797] Processing to get the query-plan for any queries. (#25)

* [APIS-797] Processing to get the query-plan for any queries.

* [APIS-797] revised: Processing to get the query-plan for any queries.

* [APIS-794] Processing multi-byte (utf-8) column name (#22)

* [APIS-798] Correct processing multi-byte for native query (SQLNativeSql) (#26)

* [APIS-789] Upgrad build envrionment: compatibility for Legacy standard I/O Definition (#27)

* [APIS-799] Correct processing of string length for SUCCESS_WITH_INFO (#28)

* [APIS-799] Correct processing of string length for SUCCESS_WITH_INFO

* [APIS-799] revised: Correct processing of string length for SUCCESS_WITH_INFO

* [APIS-800] Correct processing for multi-byte to wide-char and vice-vesa. (#29)

* [APIS-800] Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-800] revised: Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-800] revised: Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-802] Adding Test Case for ODBC update version (#30)

* [APIS-802] Adding Test Case for ODBC update version (CPP Case) (#31)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* APIS-802 revised... (#32)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS 802] add unit test case for C++ (#33)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] add unit test case (#34)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] change connect (SQLConnto --> SQLDriverConnt) for user specify

* [APIS-802] add test cases for C++ (source code encoding EUC-KR) (#36)

* Add to test-code for under version to 9.2.x.
tw-kang added a commit that referenced this pull request Dec 12, 2019
* [#7] modification of the README.txt and license.txt files for 10.1 release (#8)

* [RND-269] SQLDescribeCol() function should return SQL_LONGVARBINARY and SQL_LONGVARCHAR for BLOB and CLOB data type rather than SQL_C_DEFAULT. (#10)

* in the UNICODE version of cubrid_odbc.dll, SQLDescribeCol() function should return SQL_WCHAR instead of SQL_WVARCHAR for the CHAR(n) database type under utf-8 charset. (#11)

* [APIS-759] To prevent application crash caused by health_checker thread, GET_MODULE_HANDLE_EX_FLAG_PIN flag was used when calling the GetModuleHandleEx function at DLL_PROCESS_ATTACH state in DllMain. (#12)

* [APIS-773] Modify/Remove broken link in README or Wiki at github/CUBRID repositories (#13)

* [APIS-776] fix SQLGetInfoW function standard(spec) violation (#14)

* The SQLGetInfoW function conform to the following odbc specification.

"If *InfoValuePtr is a Unicode string (when calling SQLGetInfoW), the
BufferLength argument must be an even number; if not, SQLSTATE HY090
(Invalid string or buffer length) is returned."

* The SQLGetInfoW function conform to the following odbc specification.

"If InfoValuePtr is NULL, StringLengthPtr will still return the total
number of bytes (excluding the null-termination character for character
data) available to reurn in the buffer pointed to by InfoValuePtr."

* The SQLGetInfoW function conform to the following odbc specification.

"For character data, if the number of bytes available to return is
greater than or equal to BufferLength, the information in *InfoValuePtr
is truncated to BufferLength bytes minus the length of a
null-termination character and is null-terminated by the driver."

* The SQLGetInfo and SQLGetInfoW functions conform to the following odbc
specification.

"StringLengthPtr argument - Pointer to a buffer in which to return the
total number of bytes (excluding the null-termination character for
character data) available to return in *InfoValuePtr."

* [APIS-785] Change unicode.c encoding to UTF8 (from UTF16) (#15)

* [APIS-788] sub-task [APIS-789] Upgrade build environment for Visual Studio (#16)

* [APIS-790] Invalid BufferLength in SQLGetDiagRecW(...) for wide char (#17)

* [APIS-791] SQLGetDiagRecW returns SQL State to S01000 for connection error. (#18)

* Apis 792 (#20)

* [APIS-792] Providing the session information for current connection via DiagField

* [APIS-792] Providing the session information for current connection via DiagField

* [APIS-793] Increasing default column length for derived column (#21)

* [APIS-796] Correct processing SQLCancel(...) (#24)

* [APIS-796] Correct processing SQLCancel(...)

* [APIS-796] revised: Correct processing SQLCancel(...)

* [APIS-795] Correct processing multi-bye binding in update query (#23)

* [APIS-795] Correct processing multi-bye binding in update query

* [APIS-795] revised: Correct processing multi-bye binding in update query

* [APIS-797] Processing to get the query-plan for any queries. (#25)

* [APIS-797] Processing to get the query-plan for any queries.

* [APIS-797] revised: Processing to get the query-plan for any queries.

* [APIS-794] Processing multi-byte (utf-8) column name (#22)

* [APIS-798] Correct processing multi-byte for native query (SQLNativeSql) (#26)

* [APIS-789] Upgrad build envrionment: compatibility for Legacy standard I/O Definition (#27)

* [APIS-799] Correct processing of string length for SUCCESS_WITH_INFO (#28)

* [APIS-799] Correct processing of string length for SUCCESS_WITH_INFO

* [APIS-799] revised: Correct processing of string length for SUCCESS_WITH_INFO

* [APIS-800] Correct processing for multi-byte to wide-char and vice-vesa. (#29)

* [APIS-800] Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-800] revised: Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-800] revised: Correct processing for multi-byte to wide-char and vice-versa.

* [APIS-802] Adding Test Case for ODBC update version (#30)

* [APIS-802] Adding Test Case for ODBC update version (CPP Case) (#31)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* APIS-802 revised... (#32)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS 802] add unit test case for C++ (#33)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] add unit test case (#34)

* [APIS-802] Adding Test Case for ODBC update version

* [APIS-802] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] Adding Test Case for ODBC update version (conn-string utf-8 modify)

* [APIS-802] [Revised] Adding Test Case for ODBC update version (CPP Case)

* [APIS-802] change connect (SQLConnto --> SQLDriverConnt) for user specify

* [APIS-802] add test cases for C++ (source code encoding EUC-KR) (#36)

* Add to test-code for under version to 9.2.x. (#37)

* [APIS-803] Driver Release for 10.2 (#39)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants