Bug Hunting Session
Bug 46207 - SQL parser: accept an expression instead of only literal where makes sense
Summary: SQL parser: accept an expression instead of only literal where makes sense
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 46198
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2012-02-16 21:01 UTC by Lionel Elie Mamane
Modified: 2019-01-21 18:51 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2012-02-16 21:01:20 UTC
The SQL parser (for no good reason?) in a few places accepts only a very restricted notion of literal where an arbitrary expression should be allowed.

The most prominent place is in a column's value definition in a SELECT statement (where one usually has a column name reference to a table in the FROM clause).


Don't forget to adapt OQueryDesignView::fillFunctionInfo in  dbaccess/source/ui/querydesign/QueryDesignView.cxx.
Comment 1 Lionel Elie Mamane 2012-02-16 21:06:46 UTC
Interesting parse nodes:

boolean_primary, value_exp_primary, num_primary, datetime_primary, char_primary, bit_primary and related.
Comment 2 Lionel Elie Mamane 2012-02-16 21:09:12 UTC
Also look at what is accepted within a subclause of a WHERE clause, e.g. as left/right handsides of operators such as equality; that should be a good start for a general notion of "expression".
Comment 3 Lionel Elie Mamane 2012-02-16 21:20:34 UTC
(In reply to comment #0)

> The SQL parser (for no good reason?) in a few places accepts only a very restricted notion of literal where an arbitrary expression should be allowed.
 
> The most prominent place is in a column's value definition in a SELECT statement (where one usually has a column name reference to a table in the FROM clause).

But also e.g. in arguments to many functions, such as BIT_LENGTH, etc.
Comment 4 Alex Thurgood 2015-01-03 17:40:13 UTC Comment hidden (no-value)
Comment 5 Thomas Lendo 2018-10-19 22:15:26 UTC
Lionel, are you still working on this? You're assignee until 2012.
Comment 6 Xisco Faulí 2019-01-21 18:51:02 UTC
Dear Lionel Elie Mamane,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.