Bug 82573

Summary: embedded HSQLDB treats unquoted identifiers as all caps
Product: LibreOffice Reporter: Joel Madero <jmadero.dev>
Component: BaseAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: jmadero.dev, lionel
Priority: medium    
Version: 4.3.0.4 release   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Database

Description Joel Madero 2014-08-13 17:02:06 UTC
Created attachment 104575 [details]
Database

Repro Steps:

1. Download attachment
2. Click on Tools -> SQL
3. Paste the following into top section: ALTER TABLE SeriesInformation ADD CONSTRAINT MYCONSTRAINT UNIQUE ("MainSeriesName")
4. Click on "Execute"

Observed Error:
1: Table not found: SERIESINFORMATION in statement [ALTER TABLE SeriesInformation]

Note that Base replaced my "SeriesInformation" with SERIESINFORMATION (all caps) which is where the error lies.

If you change the table name to SERIESINFORMATION and run the same command it works fine.
Comment 1 Joel Madero 2014-08-13 17:02:44 UTC
@Lionel - another base one that needs confirmed. I'm trying to recruit some people from the user list who use base to help out with at least confirming these. Thanks
Comment 2 Lionel Elie Mamane 2014-08-26 09:26:01 UTC
HSQLDB converts identifiers (names) that are not quoted to all caps. An identifier that is not all caps should be quoted. That is, your statement should be

ALTER TABLE "SeriesInformation" ADD CONSTRAINT MYCONSTRAINT UNIQUE ("MainSeriesName")

See http://hsqldb.org/doc/1.8/guide/ch09.html, SQL Expression / Components of SQL Expressions / name:

A unquoted identifier (name) starts with a letter and is followed by any number of ASCII letters or digits. When an SQL statement is issued, any lowercase characters in unquoted identifiers are converted to uppercase. Because of this, unquoted names are in fact ALL UPPERCASE when used in SQL statements.