Issue 118193 - Crash when inserting constant in query
Summary: Crash when inserting constant in query
Status: CONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: 3.4.0 Beta (OOo)
Hardware: PC All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: crash, regression
Depends on:
Blocks:
 
Reported: 2011-06-19 14:15 UTC by r4zoli
Modified: 2015-08-15 02:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
example database (3.88 KB, application/vnd.sun.xml.base)
2011-11-10 08:30 UTC, r4zoli
no flags Details
StackTrace.txt (5.53 KB, text/plain)
2015-08-15 02:22 UTC, damjan
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description r4zoli 2011-06-19 14:15:07 UTC
Open any database with query.
Open query in edit mode.
Add to the next Field 'test'.
Click out from Field, OOo crash. 


If you  create same query in SQL mode, and switch to edit mode, no crash.
Example:
SELECT "ID", "MyText", 'test' FROM "Table1"
It is same in OOo 3.3.
In OOo 3.2.1 it is working, regression.
see example file: https://bugs.freedesktop.org/show_bug.cgi?id=38286
Comment 1 r4zoli 2011-06-19 14:17:12 UTC
change platform.
Comment 2 r4zoli 2011-11-10 08:27:12 UTC
In OOo 3.2.1:

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

gives :

ID MyText Expression 1   Expression 1   Expression 1
0  zero   Test           Test           Test

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

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

gives :

ID MyText  (empty)        1              2
0  zero    Test           Test1           Test2


In other words, it appears that it is the OOo parser that can not handle
the constants.
Comment 3 r4zoli 2011-11-10 08:30:17 UTC
Created attachment 76994 [details]
example database
Comment 4 r4zoli 2011-11-10 08:34:50 UTC
In AOOo 3.4 debug version, when added 'test' to Query1 in edit mode, and run query  I get this output: 

---------------------------
Debug Output
---------------------------
Error: Invalid Position
From File ../../inc\connectivity/sqlnode.hxx at Line 463
Abort ? (Yes=abort / No=ignore / Cancel=core dump)
---------------------------
Igen   Nem   Mégse   
---------------------------

The AOOo crashed.
Comment 5 Oliver-Rainer Wittmann 2012-06-13 12:18:13 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.
Comment 6 damjan 2015-08-15 02:22:24 UTC
Created attachment 84878 [details]
StackTrace.txt

Confirming. Stack trace attached.
Comment 7 damjan 2015-08-15 02:27:39 UTC
The failed assert is on:
OSL_ENSURE(nPos < m_aChildren.size(), "Invalid Position");
in main/connectivity/inc/connectivity/sqlnode.hxx.

A regression test would help, but this regression happened in the old OO.o.