
|
If you were logged in you would be able to see more operations.
|
|
|
|
Issue Links:
|
Duplicate
|
|
|
|
This issue is duplicated by:
|
|
CORE-3313
Firebird 2.5 UTF8 database, WIN1250 client problem
|
|
|
|
|
|
|
| Planning Status: |
Unspecified
|
|
EXECUTE STATEMENT implementation simply calls the DSQL layer to do its job, but DSQL considers the input SQL text having the connection charset. In EXECUTE STATEMENT, however, the SQL text has the actual charset defined by the appropriate variable descriptor. If it differs from the connection charset and the SQL text contains non-ASCII characters, we get "malformed string" or "cannot transliterate" errors.
The issue can be seen if some procedure using EXECUTE STATEMENT is created in one charset, but called with another charset. Or if the dynamic SQL text is retrieved from a column which charset differs from the connection one.
I doubt it can be fixed for earlier versions (because of the layering issues), but it seems doable for v2.5 and v3.0.
|
|
Description
|
EXECUTE STATEMENT implementation simply calls the DSQL layer to do its job, but DSQL considers the input SQL text having the connection charset. In EXECUTE STATEMENT, however, the SQL text has the actual charset defined by the appropriate variable descriptor. If it differs from the connection charset and the SQL text contains non-ASCII characters, we get "malformed string" or "cannot transliterate" errors.
The issue can be seen if some procedure using EXECUTE STATEMENT is created in one charset, but called with another charset. Or if the dynamic SQL text is retrieved from a column which charset differs from the connection one.
I doubt it can be fixed for earlier versions (because of the layering issues), but it seems doable for v2.5 and v3.0. |
Show » |
|
set names win1251;
create table TestTable (
ParamName varchar(100) character set win1251,
ParamValue varchar(1000) character set win1251
);
commit;
insert into TestTable(ParamName, ParamValue)
values ('TESTSQL', 'execute block as declare variable bufStr varchar(1024); begin bufStr= ''Тест''; end');
commit;
set term ^;
create or alter procedure TESTSP
AS
declare variable SQLText varchar(1024);
begin
select ParamValue
from TestTable
where ParamName='TESTSQL'
into SQLText;
execute statement SQLText;
end^
set term ;^
commit;
-- connect using WIN1251
execute procedure TESTSP
-- no errors
-- connect using UTF8
execute procedure TESTSP
-- Invalid token.
-- Dynamic SQL Error.
-- SQL error code = -104.
-- Malformed string.
-- At procedure 'TESTSP' line: 10, col: 3.