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: 2023-01-22 03:28 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.
Comment 7 QA Administrators 2021-01-21 04:05:43 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2023-01-22 03:28:31 UTC
Dear Lionel Elie Mamane,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug