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

When inserting null data into multipl blob columns into a table the return value of SQLParamData return SQL_NEED_DATA when is should have return SQL_SUCCESS [ODBC134] #131

Closed
firebird-automations opened this issue Jan 4, 2012 · 11 comments

Comments

@firebird-automations
Copy link

Submitted by: Keith Patrick (kpatrick)

Attachments:
FBlob.cpp
OdbcFb.zip
FBBlob2.cpp

When inserting null data into multipl blob columns into a table the return value of SQLParamData returns SQL_NEED_DATA when is should have return SQL_SUCCESS.
A prior call to SQLPutData was made to assign a NULL value to the blob.
This does not occur if the table contains only one blob column. If there are more than two blob columns in the table then the the ParamData is also not set correctly.
For example:

rc = ::SQLExecute \( hstmt \);
rc = ::SQLParamData \( hstmt, &ParamData \);
rc = ::SQLPutData \( hstmt, NULL, SQL\_NULL\_DATA \);
rc = ::SQLParamData \( hstmt, &ParamData \);
rc = ::SQLPutData \( hstmt, NULL, SQL\_NULL\_DATA \);
rc = ::SQLParamData \( hstmt, &ParamData \);          // rc should be SQL\_SUCCESS

Commits: 044fa9d b3faed5

@firebird-automations
Copy link
Author

Modified by: Keith Patrick (kpatrick)

Attachment: FBlob.cpp [ 12083 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

assignee: Alexander Potapchenko [ lightfore ] =>

@firebird-automations
Copy link
Author

Commented by: Jojakim Stahl (jstahl)

Hello Patrick,
can you check #⁠ODBC145? If you have the possibility to compile the driver, can you implement the patch I provided in the referenced ticket and check whether your problem is solved by this patch also?

@firebird-automations
Copy link
Author

Commented by: Keith Patrick (kpatrick)

Hi Jojakim,

I don't have the ability to build the driver. I can test a driver with this patch in if you can provide it to me ot tell me where I can get it.

Keith

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

assignee: Alexander Potapchenko [ lightfore ]

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Attached driver for testing

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

Attachment: OdbcFb.zip [ 12183 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

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

resolution: Fixed [ 1 ]

Fix Version: 2.0.2 [ 10465 ]

@firebird-automations
Copy link
Author

Commented by: Keith Patrick (kpatrick)

I download the driver and retest and the test case is fixed. I do see all the expected return codes from the SQLParamData and SQLPutData calls.

However if I then try and insert an actual blob after inserting a null blob then the new blob appears as null instead actually saving the data. I uploaded FBBlob2.cpp which demonstrates this. I noticed that there are other fixes to blob that may have addressed this problem.

If I don't write out the null blob first then the insert for the non blob works.

@firebird-automations
Copy link
Author

Modified by: Keith Patrick (kpatrick)

Attachment: FBBlob2.cpp [ 12245 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants