Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 152107 - [65cat] Unable to create or delete tables in MySQL support with names that need quoting
[65cat] Unable to create or delete tables in MySQL support with names that ne...
Status: VERIFIED FIXED
Product: db
Classification: Unclassified
Component: Code
6.x
All All
: P2 (vote)
: 6.x
Assigned To: David Vancouvering
issues@db
http://statistics.netbeans.org/except...
EXCEPTIONS_REPORT, 65fixes1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-01 20:55 UTC by sunbiz
Modified: 2008-12-11 22:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (2.37 KB, text/plain)
2008-11-01 20:56 UTC, sunbiz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sunbiz 2008-11-01 20:55:56 UTC
Build: NetBeans IDE 6.5 RC2 (Build 20081031212129)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc2-b32
OS: Windows Vista, 6.0, x86

Stacktrace: 
java.lang.Exception: The database command createDatabase failed with the following exception:
        at org.netbeans.modules.db.mysql.impl.MySQLDatabaseServer$DatabaseCommand.run(MySQLDatabaseServer.java:970)
        at org.netbeans.modules.db.mysql.impl.ConnectionProcessor.run(ConnectionProcessor.java:111)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 1 sunbiz 2008-11-01 20:56:01 UTC
Created attachment 73056 [details]
stacktrace
Comment 2 David Vancouvering 2008-11-03 19:23:50 UTC
I can reproduce this by trying to create a database with the "*" character in it.  Such a database name needs to be
quoted.  MySQL using the backtick character (`) for quoting, see http://dev.mysql.com/doc/refman/5.0/en/identifiers.html.

When I backtick the *, the database is created correctly.  However, the database connection for this database that we
create automatically causes an error, as we directly translate the backticks to the JDBC URL, and MySQL can't find the
database `*`.

This basically means this functionality is broken for database names that have characters that must be quoted
(particularly multibyte characters). I tested with 前空幕長が会見 (a string of characters I got from
http://www.yahoo.jp) and I got the same problem.

Since this breaks international support, it's a P2, and I'm copying Ken Frank, our I18N guy.  

It would be nice if we detect that the string needs to be quoted and quote it, but at a minimum we should correctly
support quoting.
Comment 3 David Vancouvering 2008-11-03 19:25:51 UTC
Note: we also need to fix *deleting* databases that have characters that need quoting.  Right now this fails with a
syntax exception.
Comment 4 David Vancouvering 2008-11-03 20:25:29 UTC
8103d60a32dd

Used the very nice Quoter API.  Made it very easy to fix this.  Thanks to whoever wrote this API (oh, wait, it was me! :)).

Now you can use multibyte or other characters in your db name that need quoting, and you can both create and delete the
databases.  
Comment 5 Quality Engineering 2008-11-04 16:24:02 UTC
Integrated into 'main-golden', will be available in build *200811041401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8103d60a32dd
User: David Van Couvering <davidvc@netbeans.org>
Log: #152107: [65cat] Unable to create or delete tables in MySQL support with names that need quoting
Comment 6 David Vancouvering 2008-11-05 20:46:38 UTC
*** Issue 152448 has been marked as a duplicate of this issue. ***
Comment 7 David Vancouvering 2008-11-05 20:48:27 UTC
Issue 152448 is fixed as a duplicate, removing it as a depending item. I just tested 'test*1' in my sandbox and it
works, please verify.
Comment 8 Roman Mostyka 2008-11-07 08:45:16 UTC
Verified with build 081107.
Comment 9 rbalada 2008-11-18 14:22:08 UTC
I've ported the changeset http://hg.netbeans.org/main/rev/8103d60a32dd into release65_fixes repository as
http://hg.netbeans.org/release65_fixes/rev/13744aebb76d


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo