[unixODBC-support] SQLSTATE changes after SQLGetDiagRecW

Frank A. U. fau at email.com
Wed Jul 31 18:52:17 BST 2013


Hello,
Please have a look at the following log.

I call SQLSetEnvAttr() and it fails with the SQLSTATE error HY024.

[ODBC][2718][1375292272.095758][SQLSetEnvAttr.c][189]
		Entry:
			Environment = 0x7fffec0009f0
			Attribute = SQL_ATTR_ODBC_VERSION
			Value = 0x7fffe7fafff0
			StrLen = 0
[ODBC][2718][1375292272.095848][SQLSetEnvAttr.c][256]Error: HY024

Then I'm starting to fetch the diagnostic messages.  I start by querying
for the length of the message starting with record 1.

(BTW: In case you are wondering I double the buffer size later to make
sure even UTF-16 would fit).

[ODBC][2718][1375292272.096185][SQLGetDiagRecW.c][385]
		Entry:
			Environment = 0x7fffec0009f0
			Rec Number = 1
			SQLState = (nil)
			Native = (nil)
			Message Text = (nil)
			Buffer Length = 0
			Text Len Ptr = 0x7fffe7faffe8
[ODBC][2718][1375292272.096237][SQLGetDiagRecW.c][427]
		Exit:[SQL_SUCCESS_WITH_INFO]
			SQLState = (null)
			Native = NULLPTR
			Message Text = [NULLPTR]

Next I fetch the actual message.  However the SQLSTATE suddenly changes
to S1009.  If I interpret the standard correctly this must never happen.

[ODBC][2718][1375292272.096291][SQLGetDiagRecW.c][385]
		Entry:
			Environment = 0x7fffec0009f0
			Rec Number = 1
			SQLState = 0x7fffe7faffe0
			Native = 0x7fffe7faffd8
			Message Text = 0x7fffec001d00
			Buffer Length = 99
			Text Len Ptr = (nil)
[ODBC][2718][1375292272.096339][SQLGetDiagRecW.c][427]
		Exit:[SQL_SUCCESS]
			SQLState = S1009
			Native = 0x7fffe7faffd8 -> 0
			Message Text = [[unixODBC][Driver Manager]Invalid attribute value]




More information about the unixODBC-support mailing list