[jira] [Commented] (IGNITE-6511) ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small
[ https://issues.apache.org/jira/browse/IGNITE-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16226680#comment-16226680 ] ASF GitHub Bot commented on IGNITE-6511: Github user isapego closed the pull request at: https://github.com/apache/ignite/pull/2925 > ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small > -- > > Key: IGNITE-6511 > URL: https://issues.apache.org/jira/browse/IGNITE-6511 > Project: Ignite > Issue Type: Bug > Components: odbc >Reporter: Sergey Kalashnikov >Assignee: Igor Sapego > Labels: usability > > When buffer size provided for error message is not big enough to hold the > entire error message, the function {{SqlGetDiagRec()}} returns wrong > resulting string length (-4) and wrong result code ({{SQL_SUCCESS}} instead > of {{SQL_SUCCESS_WITH_INFO}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-6511) ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small
[ https://issues.apache.org/jira/browse/IGNITE-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16218453#comment-16218453 ] Pavel Tupitsyn commented on IGNITE-6511: [~isapego] LGTM. > ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small > -- > > Key: IGNITE-6511 > URL: https://issues.apache.org/jira/browse/IGNITE-6511 > Project: Ignite > Issue Type: Bug > Components: odbc >Reporter: Sergey Kalashnikov >Assignee: Igor Sapego > Labels: usability > > When buffer size provided for error message is not big enough to hold the > entire error message, the function {{SqlGetDiagRec()}} returns wrong > resulting string length (-4) and wrong result code ({{SQL_SUCCESS}} instead > of {{SQL_SUCCESS_WITH_INFO}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-6511) ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small
[ https://issues.apache.org/jira/browse/IGNITE-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16218446#comment-16218446 ] Igor Sapego commented on IGNITE-6511: - Or [~ptupitsyn]. Can you help? > ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small > -- > > Key: IGNITE-6511 > URL: https://issues.apache.org/jira/browse/IGNITE-6511 > Project: Ignite > Issue Type: Bug > Components: odbc >Reporter: Sergey Kalashnikov >Assignee: Igor Sapego > Labels: usability > > When buffer size provided for error message is not big enough to hold the > entire error message, the function {{SqlGetDiagRec()}} returns wrong > resulting string length (-4) and wrong result code ({{SQL_SUCCESS}} instead > of {{SQL_SUCCESS_WITH_INFO}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-6511) ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small
[ https://issues.apache.org/jira/browse/IGNITE-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16218300#comment-16218300 ] ASF GitHub Bot commented on IGNITE-6511: GitHub user isapego opened a pull request: https://github.com/apache/ignite/pull/2925 IGNITE-6511: Fixed SQLGetDiagRec behaviour in ODBC You can merge this pull request into a Git repository by running: $ git pull https://github.com/gridgain/apache-ignite ignite-6511 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2925.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2925 commit 6743b3a8bd2b4761b05e800e5d104b686aa85ea3 Author: Igor Sapego Date: 2017-10-25T08:46:15Z IGNITE-6511: Fixed behaviour commit c015ee40f6ef3f9947ddc9ef77cf846d3f7c2a08 Author: Igor Sapego Date: 2017-10-25T09:24:08Z IGNITE-6511: Added test > ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small > -- > > Key: IGNITE-6511 > URL: https://issues.apache.org/jira/browse/IGNITE-6511 > Project: Ignite > Issue Type: Bug > Components: odbc >Reporter: Sergey Kalashnikov >Assignee: Igor Sapego > Labels: usability > > When buffer size provided for error message is not big enough to hold the > entire error message, the function {{SqlGetDiagRec()}} returns wrong > resulting string length (-4) and wrong result code ({{SQL_SUCCESS}} instead > of {{SQL_SUCCESS_WITH_INFO}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IGNITE-6511) ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small
[ https://issues.apache.org/jira/browse/IGNITE-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16182469#comment-16182469 ] Sergey Kalashnikov commented on IGNITE-6511: Workaround: check resulting error message length (reallen > 0) before manipulation with the error message pointer. Reproducer: {quote} BOOST_AUTO_TEST_CASE(TestLongErrorMessage) { StartAdditionalNode("Node1"); Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:0;SCHEMA=PUBLIC"); SQLCHAR req[] = "DROP INDEX Nonexisting"; SQLRETURN ret; ret = SQLExecDirect(stmt, req, SQL_NTS); BOOST_REQUIRE_EQUAL(ret, SQL_ERROR); SQLCHAR sqlstate[7] = {}; SQLINTEGER nativeCode; SQLCHAR message[10]; SQLSMALLINT reallen = 0; SQLGetDiagRec(SQL_HANDLE_STMT, stmt, 1, sqlstate, &nativeCode, message, sizeof(message), &reallen); BOOST_CHECK_EQUAL(reallen, sizeof(message)); } {quote} > ODBC: SQLGetDiagRec doesn't follow specification when buffer size is too small > -- > > Key: IGNITE-6511 > URL: https://issues.apache.org/jira/browse/IGNITE-6511 > Project: Ignite > Issue Type: Bug > Components: odbc >Reporter: Sergey Kalashnikov > Labels: usability > > When buffer size provided for error message is not big enough to hold the > entire error message, the function {{SqlGetDiagRec()}} returns wrong > resulting string length (-4) and wrong result code ({{SQL_SUCCESS}} instead > of {{SQL_SUCCESS_WITH_INFO}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)