Issue Details (XML | Word | Printable)

Key: ODBC-134
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Alexander Potapchenko
Reporter: Keith Patrick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ODBC Driver

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

Created: 04/Jan/12 06:07 PM   Updated: 01/Jan/15 03:31 PM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0.2

File Attachments: 1. Text File FBBlob2.cpp (4 kB)
2. Text File FBlob.cpp (5 kB)
3. Zip Archive OdbcFb.zip (1.16 MB)

Environment: Window7


 Description  « Hide
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



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Keith Patrick made changes - 04/Jan/12 06:09 PM
Field Original Value New Value
Attachment FBlob.cpp [ 12083 ]
Alexander Potapchenko made changes - 04/Jan/12 07:52 PM
Assignee Alexander Potapchenko [ lightfore ]
Jojakim Stahl added a comment - 31/May/12 02:20 PM
Hello Patrick,
can you check #ODBC-145? 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?

Keith Patrick added a comment - 01/Jun/12 02:14 AM
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

Alexander Potapchenko made changes - 04/Aug/12 09:46 AM
Assignee Alexander Potapchenko [ lightfore ]
Alexander Potapchenko added a comment - 04/Aug/12 09:50 AM
Attached driver for testing

Alexander Potapchenko made changes - 04/Aug/12 09:50 AM
Attachment OdbcFb.zip [ 12183 ]
Alexander Potapchenko made changes - 04/Aug/12 09:50 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0.2 [ 10465 ]
Resolution Fixed [ 1 ]
Keith Patrick added a comment - 23/Oct/12 11:32 PM
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.

Keith Patrick made changes - 23/Oct/12 11:33 PM
Attachment FBBlob2.cpp [ 12245 ]
Alexander Potapchenko made changes - 01/Jan/15 03:31 PM
Status Resolved [ 5 ] Closed [ 6 ]