Bug Hunting Session
Bug 38286 - EDITING: Crash when inserting a constant in a query
Summary: EDITING: Crash when inserting a constant in a query
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: All All
: medium critical
Assignee: Julien Nabet
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2011-06-14 02:38 UTC by pierre-yves samyn
Modified: 2011-12-23 13:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample database (3.80 KB, application/vnd.oasis.opendocument.database)
2011-06-14 02:38 UTC, pierre-yves samyn
Details
EditQueryBeforeCrash screenshot (4.14 KB, image/png)
2011-06-14 02:39 UTC, pierre-yves samyn
Details
EditQueryExpectedResult screenshot (5.10 KB, image/png)
2011-06-14 02:40 UTC, pierre-yves samyn
Details
EditQueryRuntimeError screenshot (3.56 KB, image/png)
2011-06-14 02:40 UTC, pierre-yves samyn
Details
insert constant into query crashtrace (56.52 KB, text/plain)
2011-06-14 05:02 UTC, Alex Thurgood
Details
Complete backtrace of the pb with the symbols (6.32 KB, text/plain)
2011-10-14 16:28 UTC, Julien Nabet
Details
Screenshot Constant Alias (2.42 KB, image/png)
2011-10-15 22:20 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2011-06-14 02:38:56 UTC
Created attachment 47937 [details]
Sample database

Hello

Build Date & Platform: XP Libo BuildID 3.4 = 340m1 (Build: 12)

Steps to Reproduce:

- Open the attached database (to simplify the reproduction, but ditto on any base)
- Edit the query (right click on Requête1)
- Click in the line "Field" on a empty space to add a column
- Type 'test'
- Validate

Expected Results: constant "accepted" and after running the query we must have the constant on each record (cf. screenshot)

Actual result: runtime error => Crash

Note:
- Use quotes (single) and not the quotation marks (double) that are reserved for the names of tables / fields.
- The crash is not related to the word "test " any other text between single quotes produces the same result

Regression...

Additional Builds and Platforms: reproduced on fr-discuss with Windows 7

Best regards
Comment 1 pierre-yves samyn 2011-06-14 02:39:56 UTC
Created attachment 47941 [details]
EditQueryBeforeCrash screenshot
Comment 2 pierre-yves samyn 2011-06-14 02:40:25 UTC
Created attachment 47943 [details]
EditQueryExpectedResult screenshot
Comment 3 pierre-yves samyn 2011-06-14 02:40:59 UTC
Created attachment 47946 [details]
EditQueryRuntimeError screenshot
Comment 4 Alex Thurgood 2011-06-14 05:01:14 UTC
Confirming on MacOSX, LibO 3.4.

Adding trace from apple crash log manager.

Alex
Comment 5 Alex Thurgood 2011-06-14 05:02:25 UTC
Created attachment 47953 [details]
insert constant into query crashtrace
Comment 6 Alex Thurgood 2011-06-14 05:17:11 UTC
The constant insert works fine in :

NeoOffice 3.2p2
NeoOffice 3.1.2p8
OpenOffice.org 3.2.1

It also fails in :
OpenOffice.org 3.3.0
OpenOffice.org-dev 3.4.0
LibreOffice 3.3.2
LibreOffice 3.3.3
Comment 7 Alex Thurgood 2011-06-14 05:22:06 UTC
Regression compared to OOo 3.2.1 and NeoOffice 3.1.2p8 and 3.2p2.


Alex
Comment 8 Zoltán Reizinger 2011-06-19 07:07:59 UTC
More test on win7 reveals:
If you create new query in SQL mode with:
SELECT "ID", "MyText", 'test' FROM "Table1"
It is run as in OOo 3.2.1.
If you switch between UI and SQL mode no crash.
Comment 9 Julien Nabet 2011-10-04 14:34:58 UTC
Still there with update git version from Master.

Here are some console logs (debug mode on a Debian Wheezy x86-32) :
Error: Invalid Position From File /home/maryline/compile-libreoffice/libo/solver/unxlngi6/inc/connectivity/sqlnode.hxx at Line 459
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_chec
Comment 10 Julien Nabet 2011-10-14 16:28:33 UTC
Created attachment 52352 [details]
Complete backtrace of the pb with the symbols
Comment 11 Julien Nabet 2011-10-15 07:43:38 UTC
Hello,

I'm preparing a fix but I found a pb.
If I add 1 column with 'test', it works
If I add 2 columns with 'test' and 'test1', it shows 'test' for the last columns instead of 'test' and 'test1'.

Is there this pb on :
NeoOffice 3.2p2
NeoOffice 3.1.2p8
OpenOffice.org 3.2.1
?
Comment 12 Julien Nabet 2011-10-15 09:49:53 UTC
(In reply to comment #11)
> Hello,
> 
> I'm preparing a fix but I found a pb.
> If I add 1 column with 'test', it works
> If I add 2 columns with 'test' and 'test1', it shows 'test' for the last
> columns instead of 'test' and 'test1'.
> 
> Is there this pb on :
> NeoOffice 3.2p2
> NeoOffice 3.1.2p8
> OpenOffice.org 3.2.1
> ?

I just tested on OpenOffice 3.1 with Win2k, I've got the same result with twice 'test' instead of 'test' then 'test1'.
Comment 13 pierre-yves samyn 2011-10-15 22:18:19 UTC
(In reply to comment #11)
> I'm preparing a fix but I found a pb.

Thank you !

> If I add 1 column with 'test', it works
> If I add 2 columns with 'test' and 'test1', it shows 'test' for the last
> columns instead of 'test' and 'test1'.

Same with OOo 3.2.1 & XP

But no problem if you define an alias for the columns (cf. screenshot)
Comment 14 pierre-yves samyn 2011-10-15 22:20:44 UTC
Created attachment 52372 [details]
Screenshot Constant Alias
Comment 15 Alex Thurgood 2011-10-17 01:25:33 UTC
(In reply to comment #11)

Hi Julien,

Mac testing.

On NeoOffice 3.2p5 :

In SQL Mode with SQL Parser ON :
SELECT "ID", "MyText", 'Test', 'Test1', 'Test2' FROM "Table1"

gives :

Expression 1   Expression 1   Expression 1
Test           Test           Test

With SQL Parser OFF (i.e. direct SQL code execution) :

SELECT "ID", "MyText", 'Test', 'Test1', 'Test2' FROM "Table1"

gives :

               1              2
Test           Test1           Test2


In other words, it appears that it is the OOo/LibO parser that can not handle the constants.


No crashes whatsoever.


On NeoOffice 3.1.2p8 :
Exactly the same results as for NeoOffice 3.2p5 - no crash, but same display problems with parser.


On OOo 3.2.1 :
Same results as for NeoOffice 3.2p5 and 3.1.2p8




Alex
Comment 16 Alex Thurgood 2011-10-17 01:31:07 UTC
The Query Design mode always has OOo/LibO SQL Parsing 'ON', this is not the only problem with the parser (unfortunately), but obviously doesn't help you when trying to resolve the current crash problem. So the answer to Julien's question is that the SQL parser misinterpretation error has been there for a long time already (since it is present in OOo 3.2.1).


Alex
Comment 17 Julien Nabet 2011-10-22 02:32:29 UTC
This bug has been fixed on Master (3.5) with the commit 48cdc0318b348c51742339b243dc05546148b335

For 3.4 part, it depends if there are enough review.

There's still the pb of duplicate column when there are several constants and no alias but it's another bug.
Comment 18 Julien Nabet 2011-10-24 07:25:55 UTC
FYI, the fix has been pushed on 3.4 branch by Petr Mladek. Thank you everyone for your help on this bug.
Comment 19 Björn Michaelsen 2011-12-23 13:24:21 UTC
Since all new unconfirmed bugs start in state UNCONFIRMED now and old unconfirmed bugs were moved to NEEDINFO with a explanatory comment, all bugs promoted above those bug states to NEW and later are automatically confirmed making the CONFIRMED whiteboard status redundant. Thus it will be removed.