FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 217 forks source link

RDB$SQL.EXPLAIN failed with "Data type unknown" error #7801

Open AlexBekhtin opened 1 year ago

AlexBekhtin commented 1 year ago
select * from RDB$SQL.EXPLAIN(q'{
select 
  cast('' as char(32000))
from rdb$database
}');

Statement failed, SQLSTATE = HY004
Dynamic SQL Error
-SQL error code = -204
-Data type unknown
-Implementation limit exceeded
-COLUMN
-At procedure 'RDB$SQL.EXPLAIN'

by API:

Select Expression
    -> Procedure "RDB$SQL.EXPLAIN" Scan

Firebird-6.0.0.71-0-Initial-windows-x86

asfernandes commented 1 year ago

It causes an error because the query statement causes an error when running with UTF-8 connection charset. The system packages are using UTF-8 connection charset, for example, in the profiler it makes a lot of sense. But maybe this is not the case for RDB$SQL.