Issue 118193

Summary: Crash when inserting constant in query
Product: Base Reporter: r4zoli <r4zoli>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: damjan, issues
Version: 3.4.0 Beta (OOo)Keywords: crash, regression
Target Milestone: ---   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---
Attachments:
Description Flags
example database
none
StackTrace.txt none

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.