JSON_EXTRACT in invalid views causes Internal Server Error

Details

Detail name Value
Changelog Number 10610
Type Bug
Status Resolved
Affected Versions Exasol 6.2.7, Exasol 6.2.8, Exasol 7.0.rc2
Fix Versions Exasol 7.0.0, Exasol 6.2.11
Resolution Date 2020-09-11

Description

If a view uses JSON_EXTRACT and this view becomes invalid (e.g., due to a deleted referenced table), accessing the view causes an Internal Server Error.
Example:

CREATE SCHEMA test;
OPEN SCHEMA test;
CREATE OR REPLACE TABLE t(txt varchar(1000));
INSERT INTO t VALUES ('"string"');

CREATE OR REPLACE VIEW 
    test.v1 AS 
    ( SELECT JSON_EXTRACT(txt, '$' ) EMITS( Region_Typ VARCHAR(16)) FROM t
    );


CREATE OR REPLACE TABLE t(txt varchar(1000));
INSERT INTO t VALUES ('"string"');
--This invalidates the view

SELECT * FROM test.v1; 

Workaround

Recreate the view with "CREATE OR REPLACE VIEW [...]".

Fix

An internal server error will no longer be thrown, and instead, the view will be re-validated during the next SELECT, similar to other views.