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 174715 - mysql tables with "-" not visible
Summary: mysql tables with "-" not visible
Status: RESOLVED INCOMPLETE
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-16 08:45 UTC by bartvdc
Modified: 2009-11-18 02:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (18.83 KB, image/jpeg)
2009-10-20 13:15 UTC, bartvdc
Details
screenshot show tables (44.03 KB, image/jpeg)
2009-11-10 00:31 UTC, bartvdc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bartvdc 2009-10-16 08:45:20 UTC
In a connection with a mysql db, the tables with a - in the name are not shown in the db explorer.Perhaps a back-tick ` 
issue ?
Comment 1 Jiri Rechtacek 2009-10-16 09:23:03 UTC
bartvdc, could you please add a create table statement/script which create such problematic table? I need more
information to reproduce the problem and realize what's wrong. Thanks
Comment 2 bartvdc 2009-10-16 17:04:37 UTC
fi :
CREATE TABLE `invisible-table` (id INT);

I didn't try this one out, but so you get the idea. I've got some db where I can see all tables exept those with the - in 
the name.
Comment 3 Jiri Rechtacek 2009-10-19 15:04:00 UTC
It works for me in NB6.8M2. When I ran
---
create table `table-invisible` (id varchar(8))
--- and then call Refresh on Tables node. The 'invisible' table was there.
Comment 4 bartvdc 2009-10-20 07:52:58 UTC
I've tried it in 6.7.1 and it doesn't work. What's the difference between the versions?
Can't we get a patch on 6.7.1 ?
Comment 5 bartvdc 2009-10-20 13:14:35 UTC
I just tried it with 6.8M2, it doesn't work. I can't see the tables. In the screen shot on the right a view in phpadmin, 
left NB 6.8M2. 
Comment 6 bartvdc 2009-10-20 13:15:54 UTC
Created attachment 89760 [details]
screenshot
Comment 7 bartvdc 2009-10-30 08:46:06 UTC
The problem does not appear with every mysql server. I only get it with a mysql server installed on windows server 2003.
even with one installed on winxp it works.
The same problem occurs in SQLYog and SQL-Workbench, but in phpadmin and the mysql gui tools it works.
The problem has to be a mismatch between a setting of my mysql server and the jdbc driver.
Comment 8 bartvdc 2009-10-30 10:13:37 UTC
Posted on mysql forum : http://forums.mysql.com/read.php?10,288652,288652#msg-288652
Comment 9 bartvdc 2009-11-10 00:30:03 UTC
The sql command "show tables" shows all tables. How does NB gets the tables in the db explorer view ?
Comment 10 bartvdc 2009-11-10 00:31:05 UTC
Created attachment 90661 [details]
screenshot show tables
Comment 11 Jiri Skrivanek 2009-11-10 01:46:53 UTC
The IDE gets tables through JDBC driver. If the code below (customized for your connection and with driver jar on classpath), doesn't show all tables then something is wrong with your driver or MySQL installation.

        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", null);
        ResultSet tablesRS = connection.getMetaData().getTables(null, null, "%", new String[] { "TABLE", "SYSTEM TABLE" });
        while (tablesRS.next()) {
            System.out.println("TABLE_NAME=" + tablesRS.getObject("TABLE_NAME"));
        }
Comment 12 bartvdc 2009-11-18 02:07:14 UTC
When I add this :
        System.out.println("****************");
        Statement statement = connection.createStatement();
        java.sql.ResultSet resultSet = statement.executeQuery("SHOW TABLES");
        while (resultSet.next()) {
            System.out.println("SHOW TABLE= " + resultSet.getObject("Tables_in_minusdb"));
        }

The output is 

TABLE_NAME=t_with_underscore
****************
SHOW TABLE= t-with-minus
SHOW TABLE= t_with_underscore

With show tables the table is shown, not with "connection.getMetaData().getTables()"

I'll add the info in the mysql forum.

Bart