#coding:utf-8 """ ID: gtcs.dsql-domain-07 FBTEST: functional.gtcs.dsql_domain_07 TITLE: Test CREATE / ALTER domain statement with ADD/DROP CONSTRAINT clauses, together and separately. DESCRIPTION: Original test see in: https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/DSQL_DOMAIN_07.script NB: avoid usage of ISQL command 'SHOW DOMAIN' because of unstable output. We display info about domains using common VIEW based on RDB$FIELDS table. Columns with rdb$validation_source and rdb$default_source contain BLOB data thus we have to skip from showing their blob ID - see substitution. ::: NOTE ::: Added domains with datatype that did appear only in FB 4.0: DECFLOAT and TIME[STAMP] WITH TIME ZONE. For this reason only FB 4.0+ can be tested. For each base datatype we: * create domain and set initial CHECK constraint; * alter domain in order to add new constraint. This must FAIL with message "Only one constraint allowed for a domain" (SQLSTATE = 42000) * alter domain with requirement ADD CONSTRAINT and DROP it. ########## ### NB ### Clause 'DROP CONSTRAINT' will be executed FIRST in this case, regardless where it is specified. ########## For this reason such statement must PASS. * alter domain and try to add again new CHECK constraint. This thould fail again with SQLSTATE=42000. Currently following datatypes are NOT checked: blob sub_type text not null; blob sub_type binary not null; // byt test *does* check BLOB without sub_type specified long float not null; nchar not null; binary not null; varbinary not null; """ import pytest from firebird.qa import * db = db_factory(charset='utf8') test_script = """ set list on; create view v_test as select ff.rdb$field_name as dm_name ,ff.rdb$field_type as dm_type ,ff.rdb$field_sub_type as dm_subtype ,ff.rdb$field_length as dm_flen ,ff.rdb$field_scale as dm_fscale ,ff.rdb$field_precision as dm_fprec ,ff.rdb$character_set_id as dm_fcset ,ff.rdb$collation_id as dm_fcoll ,ff.rdb$character_length dm_fchrlen ,ff.rdb$null_flag as dm_fnull ,ff.rdb$validation_source as dm_fvalid_blob_id ,ff.rdb$default_source as dm_fdefault_blob_id from rdb$fields ff where ff.rdb$system_flag is distinct from 1 and ff.rdb$field_name starting with upper( 'dom0' ) ; commit; create domain dom06_01 as smallint check( value = 1 ); alter domain dom06_01 add constraint check( value = 2 ); -- must fail: "Only one constraint allowed for a domain" alter domain dom06_01 add constraint check( value = 3 ) drop constraint; -- drop will run FIRST here! Statement must PASS! alter domain dom06_01 add constraint check( value = 4 ); -- must fail ------------------------------------------------------------------------------------------------ create domain dom06_02 as int check( value = 1 ); alter domain dom06_02 add constraint check( value = 2 ); alter domain dom06_02 add constraint check( value = 3 ) drop constraint; alter domain dom06_02 add constraint check( value = 4 ); ------------------------------------------------------------------------------------------------ create domain dom06_03 as bigint check( value = 1 ); alter domain dom06_03 add constraint check( value = 2 ); alter domain dom06_03 add constraint check( value = 3 ) drop constraint; alter domain dom06_03 add constraint check( value = 4 ); ------------------------------------------------------------------------------------------------ create domain dom06_04 as date check( value <= current_date ); alter domain dom06_04 add constraint check( value = current_date ); alter domain dom06_04 add constraint check( value < current_date ) drop constraint; alter domain dom06_04 add constraint check( value > current_date ); ------------------------------------------------------------------------------------------------ create domain dom06_05 as time check( value <= current_time ); alter domain dom06_05 add constraint check( value = current_time ); alter domain dom06_05 add constraint check( value < current_time ) drop constraint; alter domain dom06_05 add constraint check( value > current_time ); ------------------------------------------------------------------------------------------------ create domain dom06_06 as time with time zone check( value >= '11:11:11.111 Indian/Cocos'); alter domain dom06_06 add constraint check( value >= '12:31:42.543 Pacific/Fiji' ); alter domain dom06_06 add constraint check( value < '23:34:45.678 Pacific/Galapagos' ) drop constraint; alter domain dom06_06 add constraint check( value > '01:02:03.456 Antarctica/South_Pole' ); ------------------------------------------------------------------------------------------------ create domain dom06_07 as time check( value <= current_timestamp ); alter domain dom06_07 add constraint check( value = current_timestamp ); alter domain dom06_07 add constraint check( value < current_timestamp ) drop constraint; alter domain dom06_07 add constraint check( value > current_timestamp ); ------------------------------------------------------------------------------------------------ create domain dom06_08 as timestamp with time zone check( value >= '21.12.2013 11:11:11.111 Indian/Cocos' ); alter domain dom06_08 add constraint check( value >= '23.01.2014 12:31:42.543 Pacific/Fiji' ); alter domain dom06_08 add constraint check( value < '27.03.2015 23:34:45.678 Pacific/Galapagos' ) drop constraint; alter domain dom06_08 add constraint check( value > '29.05.2017 01:02:03.456 Antarctica/South_Pole' ); ------------------------------------------------------------------------------------------------ create domain dom06_09 as char(1) character set utf8 check( value = '€'); alter domain dom06_09 add constraint check( value = '£' ); alter domain dom06_09 add constraint check( value = '¢' ) drop constraint; alter domain dom06_09 add constraint check( value = '¥' ); ------------------------------------------------------------------------------------------------ create domain dom06_10 as varchar(1) character set utf8 check( value = '€'); alter domain dom06_10 add constraint check( value = '£' ); alter domain dom06_10 add constraint check( value = '¢' ) drop constraint; alter domain dom06_10 add constraint check( value = '¥' ); ------------------------------------------------------------------------------------------------ create domain dom06_11 as nchar(1) check( value = 'Ž'); -- ISO8859_1 alter domain dom06_11 add constraint check( value = 'š' ); alter domain dom06_11 add constraint check( value = 'Ÿ' ) drop constraint; alter domain dom06_11 add constraint check( value = '¡' ); ------------------------------------------------------------------------------------------------ create domain dom06_12 as numeric(2,2) check(value = -327.68); alter domain dom06_12 add constraint check( value = 327.67 ); alter domain dom06_12 add constraint check( value = -327.68 ) drop constraint; alter domain dom06_12 add constraint check( value = 327.67 ); ------------------------------------------------------------------------------------------------ create domain dom06_13 as decimal(2,2) check(value = -327.68); alter domain dom06_13 add constraint check( value = 327.67 ); alter domain dom06_13 add constraint check( value = -327.68 ) drop constraint; alter domain dom06_13 add constraint check( value = 327.67 ); ------------------------------------------------------------------------------------------------ create domain dom06_14 as float check(value < 340282346638528859811704183484516925440); alter domain dom06_14 add constraint check( value = 327.67 ); alter domain dom06_14 add constraint check( value = 1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45 ) drop constraint; alter domain dom06_14 add constraint check( value = 0.999999940395355224609375 ); ------------------------------------------------------------------------------------------------ create domain dom06_15 as float check(value < 340282346638528859811704183484516925440); alter domain dom06_15 add constraint check( value = 327.67 ); alter domain dom06_15 add constraint check( value = 1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45 ) drop constraint; alter domain dom06_15 add constraint check( value = 0.999999940395355224609375 ); ------------------------------------------------------------------------------------------------ create domain dom06_16 as double precision check(value < 1.797693134862315708e308); alter domain dom06_16 add constraint check( value = 327.67 ); alter domain dom06_16 add constraint check( value >= 2e-308 ) drop constraint; alter domain dom06_16 add constraint check( value = 1.0000000000000002220446049250313080847263336181640625 ); ----------------------------------------------------------------------------------------------- create domain dom06_17 as blob check (value = ' 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 012345678901234567 ' ); alter domain dom06_17 add constraint check( value = ' '); -- several empty lines here alter domain dom06_17 add constraint check( value = ' ') drop constraint; alter domain dom06_17 add constraint check( value is not null ); ---------------------------------------------------------------------------------------------------- create domain dom06_18 as boolean check( value = false); alter domain dom06_18 add constraint check( value = true ); alter domain dom06_18 add constraint check( value is not null ) drop constraint; alter domain dom06_18 add constraint check( value = false ); ---------------------------------------------------------------------------------------------------- create domain dom06_19 as decfloat check( value >= -9.999999999999999999999999999999999E6144 ); alter domain dom06_19 add constraint check( value <= 9.999999999999999999999999999999999E6144 ); alter domain dom06_19 add constraint check( value is not null ) drop constraint; alter domain dom06_19 add constraint check( value >= -1.0E-6143 ); ---------------------------------------------------------------------------------------------------- commit; set count on; select * from v_test; """ act = isql_act('db', test_script, substitutions=[('[ \t]+', ' '), ('DM_FDEFAULT_BLOB_ID.*', ''), ('DM_FVALID_BLOB_ID.*', '')]) expected_stdout = """ DM_NAME DOM06_01 DM_TYPE 7 DM_SUBTYPE 0 DM_FLEN 2 DM_FSCALE 0 DM_FPREC 0 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1e6 check( value = 3 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_02 DM_TYPE 8 DM_SUBTYPE 0 DM_FLEN 4 DM_FSCALE 0 DM_FPREC 0 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1ea check( value = 3 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_03 DM_TYPE 16 DM_SUBTYPE 0 DM_FLEN 8 DM_FSCALE 0 DM_FPREC 0 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1ee check( value = 3 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_04 DM_TYPE 12 DM_SUBTYPE DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1f2 check( value < current_date ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_05 DM_TYPE 13 DM_SUBTYPE DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1f6 check( value < current_time ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_06 DM_TYPE 28 DM_SUBTYPE DM_FLEN 8 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1fa check( value < '23:34:45.678 Pacific/Galapagos' ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_07 DM_TYPE 13 DM_SUBTYPE DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:1fe check( value < current_timestamp ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_08 DM_TYPE 29 DM_SUBTYPE DM_FLEN 12 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:202 check( value < '27.03.2015 23:34:45.678 Pacific/Galapagos' ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_09 DM_TYPE 14 DM_SUBTYPE 0 DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET 4 DM_FCOLL 0 DM_FCHRLEN 1 DM_FNULL DM_FVALID_BLOB_ID 2:206 check( value = '¢' ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_10 DM_TYPE 37 DM_SUBTYPE 0 DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET 4 DM_FCOLL 0 DM_FCHRLEN 1 DM_FNULL DM_FVALID_BLOB_ID 2:20a check( value = '¢' ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_11 DM_TYPE 14 DM_SUBTYPE 0 DM_FLEN 1 DM_FSCALE 0 DM_FPREC DM_FCSET 21 DM_FCOLL 0 DM_FCHRLEN 1 DM_FNULL DM_FVALID_BLOB_ID 2:20e check( value = 'Ÿ' ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_12 DM_TYPE 7 DM_SUBTYPE 1 DM_FLEN 2 DM_FSCALE -2 DM_FPREC 2 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:212 check( value = -327.68 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_13 DM_TYPE 8 DM_SUBTYPE 2 DM_FLEN 4 DM_FSCALE -2 DM_FPREC 2 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:216 check( value = -327.68 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_14 DM_TYPE 10 DM_SUBTYPE DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:21a check( value = 1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_15 DM_TYPE 10 DM_SUBTYPE DM_FLEN 4 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:21e check( value = 1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125e-45 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_16 DM_TYPE 27 DM_SUBTYPE DM_FLEN 8 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:222 check( value >= 2e-308 ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_17 DM_TYPE 261 DM_SUBTYPE 0 DM_FLEN 8 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:226 check( value = ' ') DM_FDEFAULT_BLOB_ID DM_NAME DOM06_18 DM_TYPE 23 DM_SUBTYPE DM_FLEN 1 DM_FSCALE 0 DM_FPREC DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:22a check( value is not null ) DM_FDEFAULT_BLOB_ID DM_NAME DOM06_19 DM_TYPE 25 DM_SUBTYPE DM_FLEN 16 DM_FSCALE 0 DM_FPREC 34 DM_FCSET DM_FCOLL DM_FCHRLEN DM_FNULL DM_FVALID_BLOB_ID 2:22e check( value is not null ) DM_FDEFAULT_BLOB_ID Records affected: 19 """ expected_stderr = """ Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_01 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_01 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_02 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_02 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_03 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_03 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_04 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_04 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_05 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_05 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_06 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_06 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_07 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_07 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_08 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_08 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_09 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_09 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_10 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_10 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_11 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_11 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_12 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_12 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_13 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_13 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_14 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_14 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_15 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_15 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_16 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_16 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_17 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_17 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_18 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_18 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_19 failed -"Only one constraint allowed for a domain" Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DOMAIN DOM06_19 failed -"Only one constraint allowed for a domain" """ @pytest.mark.version('>=4.0') def test_1(act: Action): act.expected_stdout = expected_stdout act.expected_stderr = expected_stderr act.execute() assert (act.clean_stderr == act.clean_expected_stderr and act.clean_stdout == act.clean_expected_stdout)