A with clause before create table leads to an internal server error

Details

Detail name Value
Changelog Number 7656
Type Bug
Status Resolved
Affected Versions Exasol 6.1.0
Fix Versions Exasol 6.1.3
Resolution Date 2019-03-19

Exasol throws an internal server error instead of a syntax error if a "WITH"-clause appears before "CREATE TABLE" in a SQL query.

Example:

CREATE SCHEMA test;
CREATE OR REPLACE TABLE t1(col1 int);
WITH tmp AS ( SELECT col1 from T1) CREATE OR REPLACE TABLE t2 AS SELECT 2 col2 FROM dual;

Workaround:

Move the "WITH"-clause to the select statement inside the "CREATE TABLE"-statement.

CREATE OR REPLACE TABLE t2 AS WITH tmp AS ( SELECT col1 from T1) SELECT 2 col2 FROM dual;