« Return to Thread: [67cat][other] DB Explorer bug + fix
I have discovered a bug in the database explorer and I believe that I now have a fix for it.
Opening up a SQLServer database connection in the database explorer presents the users with a list of all catalogs on that server under which may be any number of schemas. The catalog and schema that was specified with the connection acts as a default and it shown in bold. Right-clicking a table in the database explorer lets the user view the contents of the table (via "View data...". This fails for non-default catalogs because netbeans never qualifies the table name with the catalog. The catalog can be pre-pended to the table name in the SQL editor to retrieve the table contents.
At this point I should note that netbeans always prepends the table name with the schema even when it is not needed. Moreover the code contains a hack so that if the database variant (such as MySQL) does not have a schema then the catalog is always prepended, thereby ensuring that table data can always be retrieved against MySQL. That the schema is always pre-pended is however due to some incorrect code as the logic in the NB code suggests that it should only be conditionally pre-pended!
I have fixed the above problems in my check-out of the development version of NB (last updated yesterday). The fix is in a single small Java class and so should be fairly straightforward to review. I need a final test against SQLServer before I am completely satisfied with it, which I can do when I get into work on Monday. But what next? My understanding is that there is no longer a team developing the database functionality. So is there anyone who would verify and apply the fix?
Daniel Sheppard
PS: By way of illustration using the sakila sample database (aka catalog), NB gives
select * from sakila.city
when all that is needed is
select * from city
« Return to Thread: [67cat][other] DB Explorer bug + fix
| Free embeddable forum powered by Nabble | Forum Help |