Description: Simple example: SELECT * FROM "MediaInfo" WHERE "aid" = :P1 The "aid" column is integer and has some negative integers in it. When I run the query and enter a positive integer it works but finds no records if I enter a negative. It does work when I replace :P1 with either '-1030' or just -1030. Sliderule gave two workarounds: SELECT * FROM "MediaInfo" WHERE "aid" = :P1*1 or SELECT * FROM "MediaInfo" WHERE "aid" IN ( :P1 ) He says it's an issue with Base OpenOffice / LibreOffice database parser. Steps to Reproduce: 1. Create table1 with "ID", "AID" columns, both integer. Create data rows, with negative numbers for "aid", ex: ID AID 123 -1030 124 235 666 -9999 2. Create query SELECT * FROM "table1" WHERE "aid" = :P1 3. Run query, enter -1030 for prompt. Actual Results: No records found. Expected Results: 123, -1030 Reproducible: Always User Profile Reset: No Additional Info: Version: 6.3.4.2 (x64) Build ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; Locale: en-US (en_US); UI-Language: en-US Calc: threaded
Could confirm the buggy behavior with the internal database HSQLDB. Seems the parameter isn't set as Integer. SELECT * FROM "table1" WHERE "aid" = CAST(:P1 AS INTEGER) will work. Multiplication with '1' will do the same. SELECT "aid", :P1 AS "T" FROM "table1" WHERE "aid" = :P1 will work also. With internal Firebird the bug appears also, but there is no known workaround. Tested with LO 6.4.0.3 on OpenSUSE 15.1 64bit rpm Linux
(In reply to Robert Großkopf from comment #1) > > With internal Firebird the bug appears also, but there is no known > workaround. Workaround with Firebird: SELECT * FROM "table1" WHERE CAST("aid" AS VARCHAR(10)) = :P1
Dear Wayne Davis, 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
Bug still exists in LO 7.3.1.1 on OpenSUSE 64bit rpm Linux. Seems the parser sets negative values to "VARCHAR". Its a typical bug of the dialog for the parameter. In older versions before LO 4.4 it also set empty strings instead of NULL. See bug 86852
Bug still exists in LO 24.2.0.3 on OpenSUSE 64bit rpm Linux.
On pc Debian x86-64 with master sources updated today, I could reproduce this. Lionel: I could make it work with 2 changes: 1) diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index c4360f981222..9eefddba525f 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -250,6 +250,7 @@ namespace dbtools sTransformedText, m_xConnection, m_xFormatter, _rxField, OUString(), rParseContext.getPreferredLocale(), OUString(nDecSeparator), &rParseContext ); + sTransformedText = sTransformedText.replaceAll(" ", ""); _rPredicateValue = sTransformedText; bSuccess = true; I noticed that, after having typed "-2" for example, if I switch to another appli and go back to LO, "-2" is automatically changed into "- 2" (with a space) normalizePredicateString is called from OParameterDialog::CheckValueForError() (see https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/dlg/paramdialog.cxx?r=d52a4dba#157) I tried this to avoid modifying sqlnode.cxx (a bit afraid about regressions) 2) diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index ad1c23baa9f4..934ea809d09d 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -215,10 +215,11 @@ namespace dbaui { Reference< XPropertySet > xParamAsSet; m_xParams->getByIndex(i) >>= xParamAsSet; - +/* OUString sValue; pValues->Value >>= sValue; pValues->Value = m_aPredicateInput.getPredicateValue( sValue, xParamAsSet ); +*/ } } catch(Exception&) This one replaces too "-2" by "- 2". I must recognize I don't understand what's the use of the block I commented knowing that CheckValueForError from 1) already made the check. Any thoughts here?