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: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Database (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Lionel Elie Mamane
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 46198
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-16 21:01 UTC by Lionel Elie Mamane
Modified: 2015-01-07 11:05 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

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
Adding self to CC if not already on


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.