Bug 219524 - Cannot view tables in a MS SQL 2000 database under the dbo schema
Summary: Cannot view tables in a MS SQL 2000 database under the dbo schema
Status: CLOSED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: Enablement (show other bugs)
Version: Ganymede   Edit
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Target Milestone: 1.6M6   Edit
Assignee: Brian Fitzpatrick CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-19 18:46 EST by Adrian Pang CLA
Modified: 2008-07-01 17:42 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch for plugin.xml (1.04 KB, patch)
2008-02-19 22:00 EST, Adrian Pang CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Pang CLA 2008-02-19 18:46:09 EST
Build ID: I20080207-1530

Steps To Reproduce:
1. Create a guest user on a MS SQL 2000.
2. Create a database in the same server, and give the user created in step 1 db_owner rights.  Create tables in the database using the dbo schema
3. Add a connection to the server in the DSE.  Expand the Schemas tab -- note that the "dbo" schema is not found, only the "guest" schema is found.  Therefore, the tables are not shown.


More information:
This used to work in M4.
Comment 1 Adrian Pang CLA 2008-02-19 22:00:15 EST
Created attachment 90138 [details]
Proposed patch for plugin.xml

I suspect I have found the problem.  In the plugin.xml, we override the schema loader with the SQL2005 loader even when we are connecting to a SQL server 2000 server, which uses a SQL statement that do not return all schemas available under SQL server 2000.  Removing the schema loader for SQL server 2000 should fix the problem.

I've tested this under SQL2000 and 2005 using the MS SQL Server JDBC drivers for each, respectively.
Comment 2 Adrian Pang CLA 2008-02-19 22:22:44 EST
The patch in comment #2 should be applied to the org.eclipse.datatools.enablement.msft.sqlserver plugin.  It appears that the problem was introduced as part of the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=209104 -- which rolled the second patch for https://bugs.eclipse.org/bugs/show_bug.cgi?id=208776.  However, it seems like the patch works for jTDS driver, but not the MS SQL Server 2000 JDBC drivers at http://www.microsoft.com/downloads/details.aspx?FamilyID=9f1874b6-f8e1-4bd6-947c-0fc5bf05bf71&displaylang=en

Given that there is already another fix for 208776 delivered to 1.5.2 stream, I believe we should roll back the changes made to the plugin.xml, so both the jTDS and the MS SQL JDBC drivers could be supported.
Comment 3 Brian Fitzpatrick CLA 2008-02-21 13:15:58 EST
We can't make any further changes to 1.5.2 obviously, but can look at this for Ganymede.
Comment 4 Brian Fitzpatrick CLA 2008-02-21 13:24:01 EST
I don't have the facilities (i.e. admin rights to a SQL Server 2000 database) to test this, but I'm still not sure I follow what's going on here.

We had to create a custom catalog loader for SQL2k vs. 2005 because their drivers were returning different things. And then Jesper came up with other odds and ends that were delivered to 1.5.2 and 1.6.

I'm not exactly sure what removing the specialized catalog loader is going to do to help either you or Jesper. I don't want to break one to satisfy the other and unfortunately I don't have the specialized knowledge about SQL Server (I'm not a DBA) to verify what you are proposing. 

Can you and Jesper work this out and provide a solution that works for both of you? 

--Fitz
Comment 5 Jesper Moller CLA 2008-02-21 18:01:53 EST
(In reply to comment #4)
> Can you and Jesper work this out and provide a solution that works for both of
> you? 

Sure, I will try out the proposed patch. I believe that Adrian is right that the proposed solution should cover both driver types.
Comment 6 Brian Fitzpatrick CLA 2008-02-28 10:07:47 EST
Jesper, have you had a chance to try Adrian's patch?
Comment 7 Brian Fitzpatrick CLA 2008-03-10 14:11:06 EDT
Since I haven't heard anything from you guys on this (and that tentatively indicates that the patch works for both of you), should I go ahead and deliver this fix?
Comment 8 Adrian Pang CLA 2008-03-12 22:05:04 EDT
My patch works for me =)  In case anyone is trying this, there's another issue (which I guess I'll enter as a separate bug) such that if the connection profile's database name is not equal to the database name in the database (matching the case, even in case insensitive databases), the schemas will not be displayed.
Comment 9 Brian Fitzpatrick CLA 2008-03-20 21:36:03 EDT
That's an entertaining bug. Have you added it as a separate BZ?

Jesper, I'm going to deliver this fix this coming week so it makes it into DTP 1.6M6 unless I hear otherwise from you... So just let me know if you have any issues. I'll probably deliver it Weds or Thurs next week.
Comment 10 Adrian Pang CLA 2008-03-24 20:42:32 EDT
Yes, I just submitted 223755 for the other issue.  That is not as critical as this issue for me because that's a feasible workaround =)  Thanks for your help!
Comment 11 Jesper Moller CLA 2008-03-25 06:24:54 EDT
(In reply to comment #6)
> Jesper, have you had a chance to try Adrian's patch?

This patch is good from my point of view, i.e. it does not cause regressions in my setup DTP 1.6M6 against SQL Server 2000 under jTDS.

Sorry for the long response time.
Comment 12 Brian Fitzpatrick CLA 2008-03-25 12:44:45 EDT
No worries. I'll get this in today or tomorrow. Thanks to both of you for your patience and for looking at it!
Comment 13 Brian Fitzpatrick CLA 2008-03-25 13:36:35 EDT
Delivered fix.
Comment 14 Brian Fitzpatrick CLA 2008-07-01 17:42:49 EDT
Closing bugs