In #1139 I introduced support for the WITH clause. My implementation contains a bug: preparing a query containing a SELECT * preceded by a WITH causes an error to be thrown.
Consider the following statement:
WITH temp AS ( SELECT id, email from users) SELECT * from temp
An error is thrown when preparing this statement because the glob expansion procedure tries to determine the column names for the result by looking up the column names for the query SELECT * from temp. This does not work because temp is a temporary view defined in the WITH clause.
To fix this, I modified the glob expansion procedure to include the WITH clause in the query used to look up the result column names.
In #1139 I introduced support for the
WITH
clause. My implementation contains a bug: preparing a query containing aSELECT *
preceded by aWITH
causes an error to be thrown.Consider the following statement:
An error is thrown when preparing this statement because the glob expansion procedure tries to determine the column names for the result by looking up the column names for the query
SELECT * from temp
. This does not work becausetemp
is a temporary view defined in theWITH
clause.To fix this, I modified the glob expansion procedure to include the
WITH
clause in the query used to look up the result column names.