lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
94 stars 51 forks source link

SQL ATTR MAX ROWS SQLGetStmtAttrW returns 0 even set some value #162

Closed kothapraveen closed 4 months ago

kothapraveen commented 4 months ago

Hi Team,

Currently am working with below environment

unixODBC- 2.3.11 gcc540 RHEL7 64 FreeTDS 1.3

we are trying to validate the SQL_ATTR_MAX_ROWS using set & get methods set method used SQLSetStmtAttrW() returns the SQL_SUCCESS_WITH_INFO get method used SQLGetStmtAttrW returns SUCCESS

we are getting 0 value even we have set somevalue. please observe below logs

[ODBC][116077][1710347356.702105][SQLSetStmtAttrW.c][166] Entry: Statement = 0xce73d0 Attribute = SQL_ATTR_MAX_ROWS Value = 0x1f40 StrLen = -5 [ODBC][116077][1710347356.702193][SQLSetStmtAttrW.c][720] Exit:[SQL_SUCCESS_WITH_INFO] [ODBC][116077][1710347419.689357][SQLGetDiagRecW.c][535] Entry: Statement = 0xce73d0 Rec Number = 1 SQLState = 0x7ffff7dd58e0 Native = 0x7ffff7dd58ec Message Text = 0x7ffff7dd54e0 Buffer Length = 511 Text Len Ptr = 0x7fffffff964e DIAG [01S02] [FreeTDS][SQL Server]Option value changed

[ODBC][116077][1710347419.689501][SQLGetDiagRecW.c][596] Exit:[SQL_SUCCESS] SQLState = [01S02] Native = 0x7ffff7dd58ec -> 0 (32 bits) Message Text = [[FreeTDS][SQL Server]Option value changed] [ODBC][116077][1710347419.689813][SQLGetDiagRecW.c][535] Entry: Statement = 0xce73d0 Rec Number = 2 SQLState = 0x7ffff7dd58e0 Native = 0x7ffff7dd58ec Message Text = 0x7ffff7dd54e0 Buffer Length = 511 Text Len Ptr = 0x7fffffff964e [ODBC][116077][1710347419.689861][SQLGetDiagRecW.c][596] Exit:[SQL_NO_DATA] [ODBC][116077][1710347445.296876][SQLGetStmtAttrW.c][153] Entry: Statement = 0xce73d0 Attribute = SQL_ATTR_MAX_ROWS Value = 0x7fffffffb428 Buffer Length = -5 StrLen = 0x7fffffffb42c [ODBC][116077][1710347445.296955][SQLGetStmtAttrW.c][348] Exit:[SQL_SUCCESS] Could you please some one can help on this issue

lurcher commented 4 months ago

On 13/03/2024 17:29, kothapraveen wrote:

FreeTDS 1.3

Have you checked the source code for FreeTDS? Assuming you haven't asked the FreeTDS folk. I had a quick check of 1.4 (having downloaded the source for your last question) and looks like the only supported value is 0. The comments suggests calling "SET ROWCOUNT"

kothapraveen commented 4 months ago

Hi Nick,

Thanks for your prompt responses

am posting to freetds folks also https://github.com/FreeTDS/freetds/issues/534

but still am waiting for reply

due to time line am trying to get info where ever possible.

i have seen code also, but could not able to prove they are supporting 0 only? can you point me the same

lurcher commented 4 months ago

On 14/03/2024 00:40, kothapraveen wrote:

Hi Nick,

Thanks for your prompt responses

am posting to freetds folks also FreeTDS/freetds#534 https://github.com/FreeTDS/freetds/issues/534

but still am waiting for reply

due to time line am trying to get info where ever possible.

how we can confirm they are supporting 0 only?

Look at the code.

kothapraveen commented 4 months ago

Thank you