Issue 121695 - SQL Queries: Using aliases "t" and "d" leads to syntax error
Summary: SQL Queries: Using aliases "t" and "d" leads to syntax error
Status: CONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: 3.4.1
Hardware: PC Windows 7
: P3 Minor (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact: Javier Lopez
URL:
Keywords: needhelp
Depends on:
Blocks:
 
Reported: 2013-01-31 13:47 UTC by Wolfgang Jacques
Modified: 2013-02-11 03:08 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 3.4.1
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Wolfgang Jacques 2013-01-31 13:47:31 UTC
The following statements in the SQL-Query-Window lead to an error:

select d.ID from tbladressen d
select t.Hurz from Tabelle1 t

    Syntax error in SQL expression

    SQL-Status: HY000
    Fehler-Code: 1000

    syntax error, unxpected $end,
    expecting BETWEEN or IN or
    SQL_TOKEN_LIKE

The error occurs no matter if I use the internal HSQLDB engine or an external mySQL database attached via Oracle MySQL Connector 1.0.1.

The problem seems to appear with the single letters "d" and "t" only, all other combinations work fine. The problem still appears when using "AS".

With an external database, the problem does not appear when using direct mode.

Issue was discussed here (in German): http://de.openoffice.info/viewtopic.php?f=8&t=61053
Comment 1 Wolfgang Jacques 2013-01-31 13:49:05 UTC
"d" and "t" sounds like "Date" and "Time" - this might add to the solution.
Comment 2 Fred Toussi 2013-02-01 13:30:35 UTC
Confirmed. Also happens when you use ts instead of t.

The workaround is to use any of the following forms:

select d.ID from tbladressen "d"
select t.Hurz from Tabelle1 "t"
select d.ID from tbladressen "D"
select t.Hurz from Tabelle1 "T"
Comment 3 Javier Lopez 2013-02-11 03:08:31 UTC
Hello
I was checking your bug and it's true. We'll try to repair soon.

Javier Lopez