In FB2.5 I sometimes construct exception messages with newline like this
  EXCEPTION E_ERROR 'msg-á' || x'0A0D' || 'msg-é';

In FB3 and FB4 it can cause error
  Statement failed, SQLSTATE = 22000
  Malformed string
  -At block line: 4, col: 3

Problem is caused by the fact that x'0A0D' is OCTETS.
Normally character set of concatenation is derived from first not-NONE character set,
except when any part is OCTETS (then the result is OCTETS too).
Althought workaround is easy, just change character set of the literal like this
  EXCEPTION E_ERROR 'msg-á' || _WIN1250 x'0A0D' || 'msg-é';
it can cause problems with upgrading Firebird server (now I need to fix lots of procedures/triggers/execute blocks).
Should I put it into tracker, or is it just as designed/expected?

Example:

CREATE DATABASE 'localhost/3050:Z:\testDB.fdb' USER 'SYSDBA' PASSWORD 'masterkey' DEFAULT CHARACTER SET WIN1250;

CREATE EXCEPTION  E_ERROR 'err';

set term ^;
EXECUTE BLOCK AS
BEGIN
  EXCEPTION E_ERROR 'msg-á' || x'0A0D' || 'msg-é';
END^
set term ;^



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to