This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145271 - "Schemas" drop down list is disabled for MySQL
Summary: "Schemas" drop down list is disabled for MySQL
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rob Englander
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2008-08-27 11:41 UTC by Roman Mostyka
Modified: 2008-09-10 17:47 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-08-27 11:41:14 UTC
1. Rightclick "Databases" node and choose "New Database Connection...".
2. Specify parameters for MySQL server. Click "OK".

Result: "Advanced" tab is opened for choosing schema, but "Schemas" drop down list is disabled.
Comment 1 Rob Englander 2008-08-27 21:03:53 UTC
Schemas drop down is disabled because MySQL driver (and I suppose MySQL itself) doesn't properly support schemas.  The
code is doing the right thing.  The driver is returning an empty result set.  Maybe we should be requiring the Database
field from the base panel?  That's actually what I proposed in issue 145201.  This won't give us schemas, but the
overall result will be correct and consistent with what the driver (and the RDBMS?) supports.
Comment 2 David Vancouvering 2008-08-27 21:27:20 UTC
I think you'll notice that there are some databases that don't bring up the schema window, because schemas don't make
sense.  This is true for MySQL because schemas are the same as databases.

The whole schema thing needs to be reworked - what we really want actually is to just show all the schemas for a
database, which each schema showing as a folder.

For now, however, I suggest we at least don't bring up the schemas dialog for MySQL after connecting.
Comment 3 John Baker 2008-08-27 21:48:05 UTC
 > For now, however, I suggest we at least don't bring up the schemas dialog for MySQL after connecting.
+1
Comment 4 Rob Englander 2008-08-29 15:10:44 UTC
What I plan to do is to close the dialog if the list of retrieved schemas is empty.  This way we don't need to add any
new configuration data for defining which database types support schemas.  If there are no schemas, the connection
process is complete.
Comment 5 Rob Englander 2008-08-29 15:53:55 UTC
I also don't see any reason to allow the user to go to the Advanced (aka Schema) tab before a connection is established.
 So I want to prevent that while I'm at it.  

Any objections?
Comment 6 David Vancouvering 2008-08-29 17:58:45 UTC
Yes, this all make sense, thanks Rob.
Comment 7 Rob Englander 2008-08-29 21:23:25 UTC
020b66411f2b

The Advanced (Schema) tab of the New Connection dialog is now disabled until a connection is established.  If the
connection has no schemas, that's the end of the process and the dialog is closed.  Otherwise the user is taken
to the Advanced tab as before.  If the user goes back to the Basic tab and changes any parameters, the connection is
dropped and the Advanced tab is once again disabled until the connection is established.

Fixed the Basic panel so that it doesn't redraw and flicker when the error message line is shown.
Comment 8 Quality Engineering 2008-08-30 05:29:15 UTC
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/020b66411f2b
User: Rob Englander <mindstream@netbeans.org>
Log: #145271 Do not show the Advanced (Schema) tab after a new connection is made and there are no available schemas.  The Advanced tab is no longer available unless a connection is established (and there are schemas).  If a connection is established and the user modifies any of the parameters, the connection is dropped.

Also modified the connection panel so that showing the error message line doesn't cause the entire panel to redraw and flicker.
Comment 9 Andrei Badea 2008-09-01 16:23:27 UTC
This is not right. After connecting to the database, the New DB Connection dialog selects a schema by default -- it is
the schema with the same name as the user name. When such a schema cannot be found, the dialog switches to the Advanced
tab and lets the user choose the schema. But only when a schema cannot be found -- otherwise the dialog selects the
default one and closes. Before the fix, it was possible for the user to override the default selection mechanism by
switching to the Advanced tab and pressing the Get Schemas button *before connecting*. This is not possible anymore.

Now, this behavior is not very intuitive either. So I suggest that the dialog *always* switch to the Advanced tab after
connecting (with the default schema selection mechanism left in place, of course). IIRC that was what we planned to do
when we were considering to rewrite the New DB Connection dialog to a wizard.
Comment 10 Rob Englander 2008-09-01 17:18:35 UTC
I don't agree.  I do not find it intuitive at all to switch to the Advanced tab 1) before I make the connection, or 2)
if there won't be any schemas to choose from.  This approach still allows the user to override the default schema, if
there are any schemas to choose from.  Otherwise, why offer the user a screen where nothing can be accomplished.

I can revert the behavior.  Not a big deal.  But I don't agree with doing so.
Comment 11 Andrei Badea 2008-09-01 22:55:19 UTC
I should have made it clear that you should only switch to the Advanced tab if there are any schemas -- of course! Also,
the Advanced tab should not be selectable before the connection is made.

Here's another attempt to explain the problem. In the current version, there is no way to connect to the sample Derby
database with the app user name and *to the NULLID schema* directly from the dialog. At least I didn't find a one. You
always get the APP schema (and you can modify it something else in the connection properties, which is clumsy). This was
possible before your change. 

I am not proposing to revert your change, but to modify it -- cf. the second paragraph in desc2.
Comment 12 Rob Englander 2008-09-02 05:16:23 UTC
I think I see what you mean.  Let me stare at it tomorrow and I'll propose a change.
Comment 13 Rob Englander 2008-09-02 15:54:47 UTC
Ok, this is due to my rather dumb mistake.  The fix is complete and I'll commit after I finish local testing.

BTW, I've removed the Get Schemas button from the Advanced panel as it is no longer needed.  If the user is on
the Advanced tab then the schemas have already been retrieved.
Comment 14 Andrei Badea 2008-09-02 16:40:52 UTC
Right, that makes sense.
Comment 15 Rob Englander 2008-09-02 17:22:51 UTC
bb67d48d5c0a

Fixed bug that prevented Advanced tab from being shown for connections that have schemas.

There's a late UI change in this fix as well, which removed the Get Schemas button from the 
advanced tab of the New Connection dialog.  That button is never needed and would just requery
for schemas that have already been retrieved.

Comment 16 Quality Engineering 2008-09-03 17:16:31 UTC
Integrated into 'main-golden', will be available in build *200809031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bb67d48d5c0a
User: Rob Englander <mindstream@netbeans.org>
Log: #145271 Fixed bug that prevented Advanced (Schemas) tab from being displayed.

Also removed Get Schemas button since it's not needed.
Comment 17 Roman Mostyka 2008-09-10 17:47:54 UTC
Verified with build 080909.