Bug 51404 - Libreoffice Base with Oracle - SYSDATE, ROWNUM don't work in query!
Summary: Libreoffice Base with Oracle - SYSDATE, ROWNUM don't work in query!
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
: 58796 (view as bug list)
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2012-06-25 04:54 UTC by MichaelB
Modified: 2024-07-24 03:14 UTC (History)
9 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 MichaelB 2012-06-25 04:54:15 UTC
Problem description: 
--------------------
Cannot execute some query (with sysdate, rownum) when used with Oracle database. 

There is already a bug from 2010 that refer to this problem may be (READ IT):
https://issues.apache.org/ooo/show_bug.cgi?id=108593


Steps to reproduce:
--------------------

- Add the library ojdbc6.jar

- Run query in Base 
 
- When i want retrieve the system date: SELECT TO_CHAR(sysdate, 'YYYY') FROM DUAL;

    Statut SQL: 42000 Code d'erreur: 904 / ORA-00904: "sysdate" : identificateur non valide

Or if i use "ROWNUM" to limit result in query.

    Statut SQL: 42000 Code d'erreur: 904 / ORA-00904: ROWNUM : identificateur non valide

All that query works if direcly executed in sqlplus tool from Oracle.


Current behavior:
--------------------
I got a error code, see above..

Expected behavior:
--------------------
To return the result..

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 Jochen 2012-08-29 18:47:48 UTC
@Rainer

this bugreport is confirmes on https://issues.apache.org/ooo/show_bug.cgi?id=108593
What shall we do: status changing to "NEW"?
Comment 2 Alex Thurgood 2012-12-28 13:59:37 UTC
*** Bug 58796 has been marked as a duplicate of this bug. ***
Comment 3 Alex Thurgood 2012-12-28 17:21:51 UTC
Confirming, this appears to be inherited from the OOo code, so it has probably always been present in our versions, even from LO 3.3.x.


Alex.
Comment 4 MichaelB 2013-01-12 10:19:44 UTC
Is someone can work on it or tell me where the parser file is (BUG: 108593) in the source code of Libre Office ? I really need this enhancement.
Comment 5 Rainer Bielefeld Retired 2013-01-12 11:12:12 UTC
@Lionel:
Can you help here?
Comment 6 Lionel Elie Mamane 2013-01-14 09:53:14 UTC
(In reply to comment #4)
> Is someone can work (...) tell me where the parser file is
> in the source code of Libre Office ?

The lexer/parser is in connectivity/source/parse, files sqlflex.l and sqlbison.y

I'll gladly review and apply your patch. Thanks in advance!

After making the parser able to dynamically add new keywords, we would have to initialise the list of accepted keywords.

When connecting through an ODBC driver we should initialise with:

 SQLGetInfo(,SQL_KEYWORDS,,,)

AND the value of SQL_ODBC_KEYWORDS (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms711681(v=vs.85).aspx )
 
I presume JDBC has a similar API call to get the datasource-specific keywords.


If we can design a more generic solution that would not require LibO to know the database's keywords, that would be double plus extra good. I don't have an idea out of the top of my head right now.
Comment 7 MichaelB 2013-05-17 07:39:16 UTC
I really would like help you and community but im not C++ developer. I analysed the code but is too complex for me. So if someone can work on this enhancement.. ;-)
Comment 8 Alex Thurgood 2015-01-03 17:39:07 UTC Comment hidden (no-value)
Comment 9 QA Administrators 2016-01-17 20:04:06 UTC Comment hidden (obsolete)
Comment 10 MichaelB 2016-01-18 13:38:47 UTC
Still not working on all version (current 5.0.4)
Comment 11 QA Administrators 2017-10-23 14:06:57 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2020-07-22 03:53:14 UTC Comment hidden (obsolete)
Comment 13 MichaelB 2020-07-22 11:23:19 UTC
Still not working with LibreOffice 6.4.x, i will test it with 7.0 in the next few weeks.
Comment 14 QA Administrators 2022-07-24 03:31:57 UTC Comment hidden (obsolete)
Comment 15 QA Administrators 2024-07-24 03:14:49 UTC
Dear MichaelB,

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