You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider script (i've checked on 2.5.9, 3.0.6 and 4.0.0 -- result the same):
-- set names utf8;
shell del c:\temp\tmp4t_blob.fdb 2>nul;
create database 'localhost:c:\temp\tmp4t_blob.fdb' user 'SYSDBA' password 'masterkey';
show version;
set blob all;
set list on;
create domain dm_char as varchar(1) default 'W' check( value in ('W', 'R') );
create domain dm_blob as blob sub_type text default 'W' check( value in ('W', 'R') );
insert into t_char default values returning fld_char;
insert into t_blob default values returning fld_blob;
rollback;
alter domain dm_char set default 'A'; -- new default value VIOLATES domain constraint
alter domain dm_blob set default 'A'; -- new default value VIOLATES domain constraint
Statement marked as [ 1 ] raises: "SQLSTATE = 23000 ... for column "T_CHAR"."FLD_CHAR", value "A", i.e. all OK
Statement marked as [ 2 ] raises: "SQLSTATE = 22018 / conversion error from string "BLOB"", but character 'A' belongs to the same ASCII-list as those which are in CHECK-list: 'W' , R'
IMO, it will be good if message in this case will be equal to [ 1 ].
The text was updated successfully, but these errors were encountered:
It would require to implement implicit cast from BLOB to varchar. The error you see is exactly result of the attempt to show content of BLOB in message.
Submitted by: @pavel-zotov
Consider script (i've checked on 2.5.9, 3.0.6 and 4.0.0 -- result the same):
-- set names utf8;
shell del c:\temp\tmp4t_blob.fdb 2>nul;
create database 'localhost:c:\temp\tmp4t_blob.fdb' user 'SYSDBA' password 'masterkey';
show version;
set blob all;
set list on;
create domain dm_char as varchar(1) default 'W' check( value in ('W', 'R') );
create domain dm_blob as blob sub_type text default 'W' check( value in ('W', 'R') );
recreate table t_char( fld_char dm_char );
recreate table t_blob( fld_blob dm_blob );
commit;
insert into t_char default values returning fld_char;
insert into t_blob default values returning fld_blob;
rollback;
alter domain dm_char set default 'A'; -- new default value VIOLATES domain constraint
alter domain dm_blob set default 'A'; -- new default value VIOLATES domain constraint
insert into t_char default values returning fld_char; -- [ 1 ]
insert into t_blob default values returning fld_blob; -- [ 2 ]
rollback;
Statement marked as [ 1 ] raises: "SQLSTATE = 23000 ... for column "T_CHAR"."FLD_CHAR", value "A", i.e. all OK
Statement marked as [ 2 ] raises: "SQLSTATE = 22018 / conversion error from string "BLOB"", but character 'A' belongs to the same ASCII-list as those which are in CHECK-list: 'W' , R'
IMO, it will be good if message in this case will be equal to [ 1 ].
The text was updated successfully, but these errors were encountered: