Bug #28221 Catastrophic Failures with linked servers
Submitted: 3 May 2007 15:50 Modified: 22 May 2007 16:32
Reporter: Sundar Raman Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.15 OS:Windows (Server 2003)
Assigned to: CPU Architecture:Any
Tags: linked server, msdasql, MSSQL, oledb, provider

[3 May 2007 15:50] Sundar Raman
Description:
This issue is related to creating Linked Servers on SQLServer2005, using the MSDASQL OLEDB provider.
When running queries against the mysql linked server, the following error is reported:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "foo" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "foo".

I have found that this error can sometimes be resolved by restarting the SQL Server service. This works with version 3.51.12 of the MyODBC driver.
With version 3.51.14 the problem is intermittent and cannot be fixed.

How to repeat:
Steps to reproduce:
Create a linked server on MSSQL using the version 3.51.14 driver. Run a query that expects to receive a larger dataset (for example 10k rows), but include a join between a SQL Server table and a linked server table. For example:
select mssql.fname,mssql.lname,mssql.ssno,mssql.address1,
mysql.fname,mysql.lname,mysql.ssno
from sqlservertable mssql
join linkedserver...mysqltable mysql on mysql.ssno=mssql.ssno
order by mysql.lname desc

Run the query a few times (it may work for the first 2 or 3 times). Eventually a "catastrophic failure" is reported by the OLEDB provider.

Suggested fix:
The problem does not seem to exist in MyODBC version 3.51.12. Reverting to 3.51.12 resolves the problem. So something in the change between 3.51.12 and 3.51.14 appears to have introduced the issue.
[4 May 2007 8:06] Tonci Grgin
Hi Sundar and thanks for your report.

Please turn on general query log on MySQL server and ODBC call tracing. Attach logs together with error log from MySQL server to this report.
[15 May 2007 10:13] Tonci Grgin
Sundar, are you by any chance using OUTER JOINS (or does mssql sees your joins like that)?
[15 May 2007 10:34] Michael Weinberger
I had the same issue - 3.51.15 has been posted and is available for download - that has solved my issue.

Tx

MW
[22 May 2007 16:13] Tonci Grgin
Bug#28246 was marked as duplicate of this one.
[22 May 2007 16:15] Tonci Grgin
Sundar, still no answer to my questions... Is this problem really important to you? Can you repeat it with MyODBC 3.51.15?
[22 May 2007 16:32] Sundar Raman
Apologies for the delay in response. 3.51.15 appears to work just fine (and it might actually be a bit faster, but that's just eyeballing what's happening).
So I'm marking the issue closed