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 127065 - select * from "PUBLIC".LEAGUE needs "" around PUBLIC
Summary: select * from "PUBLIC".LEAGUE needs "" around PUBLIC
Status: RESOLVED DUPLICATE of bug 121018
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-09 19:24 UTC by shche123
Modified: 2008-03-29 01:33 UTC (History)
0 users

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 shche123 2008-02-09 19:24:19 UTC
select * from "PUBLIC".LEAGUE needs "" around PUBLIC

select * from PUBLIC.LEAGUE needs "" around PUBLIC generates the following error:
Error code -1, SQL state 42X01: Syntax error: Encountered "PUBLIC" at line 1, column 15.
Comment 1 David Vancouvering 2008-02-09 22:03:24 UTC
Sorry, but can you tell me a little more?  I'm assuming this SQL was generated somehow, but can you tell me the steps
you followed to reproduce?  Please remove the INCOMPLETE keyword after you've answered these questions.  Thanks!

David
Comment 2 shche123 2008-02-09 23:25:31 UTC
Right mouse click over the table in the Services, Databases, ... and select view data
User/password for the database is public/public

Comment 3 David Vancouvering 2008-02-10 00:05:46 UTC
Well, it works in most cases because generally the schema is created non-quoted.  In this case your schema was probably
created quoted, so when it's referred to non-quoted it fails.  Did you create the database with an older version of NetBens?

Anyway, I agree it's a bug.
Comment 4 shche123 2008-02-10 00:26:56 UTC
Apache Derby Network Server - 10.3.1.4 - (561794)
NetBeans 6.1 (had the same issue with NetBeans 6.0 as well)

Database is created using NetBeans Tools, Java DB Database, Create Database... menu item
Comment 5 David Vancouvering 2008-03-28 08:10:06 UTC
I'm checking in a change that I am pretty confident will work.  Once I mark this as fixed (which means the change has
been integrated into the main codeline), can one of you using Access please verify?  I don't have Access set up, and
trying to do so would make it impossible for me to get this fix in in time for code freeze...

Thanks! 
Comment 6 David Vancouvering 2008-03-28 08:10:56 UTC
Sorry, that last comment was for another bug, please ignore.
Comment 7 David Vancouvering 2008-03-28 23:02:37 UTC
I just tried this and it works fine for me without quotes.  

Thinking on this further, this actually doesn't make sense to me why this should fail.  Derby upper cases all
identifiers.  So PUBLIC.LEAGUE should result in exactly the same identifier as "PUBLIC".LEAGUE.  If your schema name was
*lower* case then you would need to do "public".LEAGUE because public.LEAGUE would turn into PUBLIC.LEAGUE.

Can you show me your URL exactly as it is on the connection in DB explorer?  For example, mine says
"jdbc:derby://localhost:1527/travel [travel on TRAVEL]"

Can you explain to me exactly how you reproduce this scenario? I can't seem to make it happen, and I can't figure out
*how* to make it happen.

Thanks.
Comment 8 shche123 2008-03-29 01:25:02 UTC
select * from PUBLIC.LEAGUE
produces
Error code -1, SQL state 42X01: Syntax error: Encountered "PUBLIC" at line 1, column 15.

I have tried both lowercase public and upper case PUBLIC, with same bad results.

The way someone has explained this issue to me is that Derby has a few reserved key words and public is one of them,
which must be placed in quotes in order to be used using NetBeans...

Comment 9 David Vancouvering 2008-03-29 01:33:17 UTC
Ah, it's the reserved word problem.  This is going to take more work than I have time for (code freeze is this weekend).
 I am marking this as a duplicate of 121018, which says we need to support reserved words.  Sorry I didn't get what was
going on sooner.

*** This issue has been marked as a duplicate of 121018 ***