Bug #41946 Inserting a row using SQLSetPos does not correspond to DB name in SELECT
Submitted: 8 Jan 2009 7:50 Modified: 10 Nov 2009 15:09
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1 OS:Microsoft Windows
Assigned to: Bogdan Degtyariov
Tags: linked server, SQLSetPos

[8 Jan 2009 7:50] Bogdan Degtyariov
Description:
Inserting a new record using SQLSetPos does not correspond to the database name in SELECT if querying tables from databases other than the current DB.

SQLSetPos attempts to do INSERT in the current database, but finishes with SQL_ERROR result and "table does not exist" message from MySQL Server.

How to repeat:
- Create table1 in database1
- SQLConnect to database2
- SELECT * FROM database1.table1
- SQLSetPos (SQL_ADD)

Test case is attached in the file below

Suggested fix:
Fix is attached in the file below
[8 Jan 2009 8:52] Bogdan Degtyariov
fix and test case

Attachment: bug41946.diff (application/octet-stream, text), 2.31 KiB.

[1 Nov 2009 16:30] Lawrenty Novitsky
Patch pushed as rev#848. Will be released in the 5.1.6
[5 Nov 2009 17:44] Tony Bedford
An entry was added to the 5.1.6 changelog:

Inserting a new record using SQLSetPos did not correspond to the database name specified in the SELECT statement when querying tables from databases other than the current one.

SQLSetPos attempted to do the INSERT in the current database, but finished with a SQL_ERROR result and “Table does not exist” message from MySQL Server.
[10 Nov 2009 11:14] Lawrenty Novitsky
Patched backported to 3.51 and pushed as rev#708. will be released in 3.51.28
[10 Nov 2009 11:22] Lawrenty Novitsky
(ported to 3.51)
[10 Nov 2009 15:09] Tony Bedford
Changelog entry updated to include version 3.51.28.