Bug Hunting Session
Bug 122811 - Base Firebird: Query broken when "Save", but not with "Save As"
Summary: Base Firebird: Query broken when "Save", but not with "Save As"
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2019-01-18 20:43 UTC by Paul Mirowsky
Modified: 2019-04-09 14:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Database prior to migration (1.32 MB, application/vnd.sun.xml.base)
2019-01-21 17:37 UTC, Paul Mirowsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Mirowsky 2019-01-18 20:43:17 UTC
Description:
Opening the "2 Amps to Volts-High by Series"
    By main "Queries", right click and choose "Edit"
        In view, changed 134 to '134'
            Message: Warning    The entered criterion cannot be compared with this field.
        Remove 134 from Series and hit enter.
            <Edit><Run Query> results in all records
        Add 134 to Series and hit enter.
            <Edit><Run Query> results in just 134 Series records.
        Query Design <Save >
    Double left click on query name "2 Amps to Volts-High by Series"
        Message: The data content could not be loaded.
                        Error code: 1
      <More>       firebird_sdbc error:
                        *Dynamic SQL Error
                        *SQL error code = -104
                        *Invalid usage of boolean expression
                        caused by
                        'isc_dsql_prepare'

By main "Queries", right click and choose "Edit in SQL view..."
        Remove AND "Amps"."Series" = '134'
            <Edit><Run Query> results in all records
        Add AND "Amps"."Series" = '134'
            <Edit><Run Query> results in just 134 Series records.
        Remove Add AND "Amps"."Series" = '134' and add Add AND "Amps"."Series" = 134
            <Edit><Run Query> results in just 134 Series records.
Saved the query in multiple states
When ever I save the Query and double left click from main Query window on "2 Amps to Volts-High by Series"
    Results in error message:
        <More>       firebird_sdbc error:
                            *Dynamic SQL Error
                            *SQL error code = -104
                            *Invalid usage of boolean expression
                            caused by
                            'isc_dsql_prepare'

In effect, in either edit mode it works correctly.
The saved query always fails.
However, when query is "Save As" it works correctly with newly named query.

Steps to Reproduce:
There seems to be something wrong in the saved query, which isn't shown
while editing the query.

For other users:
1. I have tested to execute the query.
2. Execution fails.
3. I opened the query in design-view.
4. I executed the query.
5. Execution works.
...
This is the problem, what nobody could understand ...

6. I changed something in the query (removed "Equipment"."Series" = 134
) and saved the query.
7. Closed the design-view.
8. Execution fails.
...
Then I opened the query, added the removed part again, saved ...
All the same.

...But when I open the query and save the query with a new name the
query will be saved with this new name and could be executed. So I
created, for example
"12 Amps to Volts-High by Series"
and it works.

Actual Results:

...But when I open the query and save the query with a new name the
query will be saved with this new name and could be executed. So I
created, for example
"12 Amps to Volts-High by Series"
and it works.

Expected Results:
Query "Saved" should work.


Reproducible: Always


User Profile Reset: No



Additional Info:
This was issue was originally raised on users@global.libreoffice.org
The information supplied is based on questions and answers there.
Comment 1 Julien Nabet 2019-01-19 09:38:51 UTC
Would it be possible you attach an example file so it can be reproduced easily and quickly?
Comment 2 Alex Thurgood 2019-01-21 15:04:59 UTC
@Paul : ideally, we would need a test file in order to try and repeat, otherwise we will be kind of guessing as to the structure, data content and query definitions
Comment 3 Paul Mirowsky 2019-01-21 17:37:41 UTC
Created attachment 148491 [details]
Database prior to migration

Also used to create bug 122812
Comment 4 Robert Großkopf 2019-01-22 06:39:41 UTC
Could confirm the buggy behaviour. Had tested the database, changed the original query in SQL-mode - nothing works. Then I only opened the query to edit and saved it with a new name. The new query - with the same SQL-code - could be execoted now directly from the Query-pane.

Tested with LO 6.1.4.2 on OpenSUSE 15
Comment 5 Paul Mirowsky 2019-01-22 15:17:14 UTC
Yes, I confirm that "Saved As" works correctly while "Save" does not.
Have you also noticed that the Query works in both "Edit" and "Edit in SQL View...", but not when Query is "Saved" in either?

I apologize for the random quality, but I have slowly been learning about Base over the years which has left some queries/forms/reports outdated.
Comment 6 Julien Nabet 2019-01-22 19:36:32 UTC
On pc Debian x86-64 with master sources updated some days ago, I get a crash during Firebird conversion.
Comment 7 Julien Nabet 2019-01-22 20:45:08 UTC
After having fixed the crash, I could reproduce this.
Comment 8 Julien Nabet 2019-01-22 20:49:49 UTC
Lionel: it seems to me we've already encountered this kind of problem, a different interpretation of the request depending the location we call it.
Any thoughts?