Crash may occur in prepared statement when parameter is used inside with clause

Details

Detail name Value
Changelog Number 4903
Type Bug
Status Resolved
Affected Versions EXASolution 5.0.19, EXASOL 6.0.2
Fix Versions EXASOL 6.0.3, EXASolution 5.0.21
Resolution Date 2017-08-29

Short Description

When using prepared statements where parameters are used inside temporary views (created using WITH Clause), a crash may occur if the view is chosen to be materialized. A segmentation fault can be seen in the logs, which occurs during View Materialization Optimization. The user session will receive the error message

Successfully reconnected after internal server error. Transaction has been rolled back.

Details

This problem will occur when the prepared statement is used as follows:

create schema sch;
create table t1 (i int, d decimal);
create table t2 (i int, d decimal);

SELECT * FROM (
	WITH tv1 AS (
		SELECT t1.*
		FROM sch.t1 
		LEFT JOIN sch.t2 
			ON t1.i = t2.i
		WHERE t1.k = ?
	) 
	SELECT * FROM (
		SELECT * FROM tv1
	) tv11 
	LEFT JOIN (
		SELECT * FROM tv1
	) tv12
	ON tv11.i = tv12.k
);

Here, the parameter ('?') is used inside a temporary view (create using WITH Clause), which is used twice in the query in a way that will lead to materialization of the view.

Workaround
No workaround is known for this situation.