6464 * RDB$TYPES (letter to FB team 18.10.2025 20:50, created ticket #8779);
6565 Further description and notes will be later.
6666 Checked on 6.0.0.1312-efa86f3; 5.0.4.1725-85ed111; 4.0.7.3237-c6d4331; 3.0.14.33827-93a8023.
67+
68+ [31.10.2025] pzotov
69+ Adjusted expected data in etalone_gds_map{}:
70+ * table RDB$TYPES can be modified by limited set of statements:
71+ INSERT; DELETE; UPDATE - but any columns except rdb$system_flag (e.g. rdb$type, rdb$field_name)
72+ This can be done by user who was granted with system privilege 'CREATE_USER_TYPES', see test:
73+ functional/syspriv/test_create_user_types.py
74+ * 6.x+: rdb$triggers and rdb$fields are protected since commit #c77fbddc;
75+ * 6.x+: list of gdscodes for 'drop sequence <g>' depends on whether this is SYSTEM or IDENTITY generator
76+ (i.e. its rdb$system_flag is 1 or 6). We have to split gdscodes comparison for these ases:
77+ (336397303, 336068927) -- when trying to drop SYSTEM sequence;
78+ (335544351, 336397303, 336068880) -- when trying to drop IDENTITY sequence.
79+
80+ Checked on 6.0.0.1335 5.0.4.1725 4.0.7.3237 3.0.14.33827
81+
6782JIRA: CORE-4731
6883FBTEST: bugs.core_4731
6984"""
@@ -102,12 +117,11 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
102117 ,'delete from rdb$types where coalesce(rdb$system_flag,0) = 0'
103118 ,'delete from mon$attachments'
104119 ,'delete from mon$statements'
105- #------------------------------
106- # probably must NOT be allowed:
107- #------------------------------
108- #,'insert into rdb$fields'
109- #,'insert into rdb$triggers'
110120 ]
121+
122+ if act .is_version ('<6' ):
123+ ALLOWED_STTM_PREFIXES .extend ( ('insert into rdb$fields' ,'insert into rdb$triggers' ) )
124+
111125if act .is_version ('<4' ):
112126pass
113127else :
@@ -123,6 +137,9 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
123137
124138etalone_gds_map = {}
125139if act .is_version ('<4' ):
140+ ################
141+ ### 3.x ###
142+ ################
126143etalone_gds_map [ ('mon$attachments' ,'ADD_CTR' ) ]= ((335544351 ,336397287 ,335544352 ),)
127144etalone_gds_map [ ('mon$attachments' ,'ADD_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
128145etalone_gds_map [ ('mon$attachments' ,'ALT_ADC' ) ]= ((335544351 ,336397287 ,335544352 ),)
@@ -506,7 +523,8 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
506523etalone_gds_map [ ('rdb$generators' ,'DML_UPD' ) ]= ((335545030 ,),)
507524etalone_gds_map [ ('rdb$generators' ,'KIL_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
508525etalone_gds_map [ ('rdb$generators' ,'KIL_FLD' ) ]= ((335544351 ,336397287 ,335544352 ),)
509- etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)
526+ etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop SYSTEM sequence
527+ etalone_gds_map [ ('rdb$generators' ,'KIL_GID' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop IDENTITY sequence
510528etalone_gds_map [ ('rdb$generators' ,'KIL_TAB' ) ]= ((335544351 ,336397288 ,335544352 ),)
511529etalone_gds_map [ ('rdb$generators' ,'RECR_GN' ) ]= ((335544351 ,336397304 ,336068880 ),)
512530etalone_gds_map [ ('rdb$generators' ,'SET_GEN' ) ]= ((335544351 ,336397325 ,336068895 ),)
@@ -849,6 +867,9 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
849867etalone_gds_map [ ('sec$users' ,'KIL_TAB' ) ]= ((335544351 ,336397288 ,335544352 ),)
850868etalone_gds_map [ ('sec$users' ,'SET_NUL' ) ]= ((335544351 ,336397287 ,335544352 ),)
851869elif act .is_version ('<5' ):
870+ ################
871+ ### 4.x ###
872+ ################
852873etalone_gds_map [ ('mon$attachments' ,'ADD_CTR' ) ]= ((335544351 ,336397287 ,335544352 ),)
853874etalone_gds_map [ ('mon$attachments' ,'ADD_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
854875etalone_gds_map [ ('mon$attachments' ,'ALT_ADC' ) ]= ((335544351 ,336397287 ,335544352 ),)
@@ -1353,7 +1374,8 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
13531374etalone_gds_map [ ('rdb$generators' ,'DML_UPD' ) ]= ((335545030 ,),)
13541375etalone_gds_map [ ('rdb$generators' ,'KIL_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
13551376etalone_gds_map [ ('rdb$generators' ,'KIL_FLD' ) ]= ((335544351 ,336397287 ,335544352 ),)
1356- etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)
1377+ etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop SYSTEM sequence
1378+ etalone_gds_map [ ('rdb$generators' ,'KIL_GID' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop IDENTITY sequence
13571379etalone_gds_map [ ('rdb$generators' ,'KIL_TAB' ) ]= ((335544351 ,336397288 ,335544352 ),)
13581380etalone_gds_map [ ('rdb$generators' ,'PUB_DIS' ) ]= ((335544351 ,336397287 ,335544352 ),)
13591381etalone_gds_map [ ('rdb$generators' ,'PUB_ENA' ) ]= ((335544351 ,336397287 ,335544352 ),)
@@ -1850,6 +1872,9 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
18501872etalone_gds_map [ ('sec$users' ,'SQL_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
18511873etalone_gds_map [ ('sec$users' ,'SQL_INV' ) ]= ((335544351 ,336397287 ,335544352 ),)
18521874elif act .is_version ('<6' ):
1875+ ################
1876+ ### 5.x ###
1877+ ################
18531878etalone_gds_map [ ('mon$attachments' ,'ADD_CTR' ) ]= ((335544351 ,336397287 ,335544352 ),)
18541879etalone_gds_map [ ('mon$attachments' ,'ADD_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
18551880etalone_gds_map [ ('mon$attachments' ,'ALT_ADC' ) ]= ((335544351 ,336397287 ,335544352 ),)
@@ -2372,7 +2397,8 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
23722397etalone_gds_map [ ('rdb$generators' ,'DML_UPD' ) ]= ((335545030 ,),)
23732398etalone_gds_map [ ('rdb$generators' ,'KIL_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
23742399etalone_gds_map [ ('rdb$generators' ,'KIL_FLD' ) ]= ((335544351 ,336397287 ,335544352 ),)
2375- etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)
2400+ etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop SYSTEM sequence
2401+ etalone_gds_map [ ('rdb$generators' ,'KIL_GID' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop IDENTITY sequence
23762402etalone_gds_map [ ('rdb$generators' ,'KIL_TAB' ) ]= ((335544351 ,336397288 ,335544352 ),)
23772403etalone_gds_map [ ('rdb$generators' ,'PUB_DIS' ) ]= ((335544351 ,336397287 ,335544352 ),)
23782404etalone_gds_map [ ('rdb$generators' ,'PUB_ENA' ) ]= ((335544351 ,336397287 ,335544352 ),)
@@ -2887,6 +2913,9 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
28872913etalone_gds_map [ ('sec$users' ,'SQL_DEF' ) ]= ((335544351 ,336397287 ,335544352 ),)
28882914etalone_gds_map [ ('sec$users' ,'SQL_INV' ) ]= ((335544351 ,336397287 ,335544352 ),)
28892915else :
2916+ ################
2917+ ### 6.x+ ###
2918+ ################
28902919etalone_gds_map [ ('mon$attachments' ,'ADD_CTR' ) ]= ((336397287 ,336068927 ),)
28912920etalone_gds_map [ ('mon$attachments' ,'ADD_DEF' ) ]= ((336397287 ,336068927 ),)
28922921etalone_gds_map [ ('mon$attachments' ,'ALT_ADC' ) ]= ((336397287 ,336068927 ),)
@@ -3289,6 +3318,7 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
32893318etalone_gds_map [ ('rdb$fields' ,'ALT_NAM' ) ]= ((336397287 ,336068927 ),)
32903319etalone_gds_map [ ('rdb$fields' ,'ALT_POS' ) ]= ((336397287 ,336068927 ),)
32913320etalone_gds_map [ ('rdb$fields' ,'ALT_TYP' ) ]= ((336397287 ,336068927 ),)
3321+ etalone_gds_map [ ('rdb$fields' ,'DML_INS' ) ]= ((335545030 ,),)# 31.10.2025: only since commit #c77fbddc (29.10.2025)
32923322etalone_gds_map [ ('rdb$fields' ,'DML_DEL' ) ]= ((335545030 ,),)
32933323etalone_gds_map [ ('rdb$fields' ,'DML_LOK' ) ]= ((335545074 ,),)
32943324etalone_gds_map [ ('rdb$fields' ,'DML_UPD' ) ]= ((335545030 ,),)
@@ -3409,7 +3439,8 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
34093439etalone_gds_map [ ('rdb$generators' ,'DML_UPD' ) ]= ((335545030 ,),)
34103440etalone_gds_map [ ('rdb$generators' ,'KIL_DEF' ) ]= ((336397287 ,336068927 ),)
34113441etalone_gds_map [ ('rdb$generators' ,'KIL_FLD' ) ]= ((336397287 ,336068927 ),)
3412- etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((335544351 ,336397303 ,336068880 ),)
3442+ etalone_gds_map [ ('rdb$generators' ,'KIL_GEN' ) ]= ((336397303 ,336068927 ),)# 31.10.2025 errors when trying to drop SYSTEM sequence
3443+ etalone_gds_map [ ('rdb$generators' ,'KIL_GID' ) ]= ((335544351 ,336397303 ,336068880 ),)# 31.10.2025 errors when trying to drop IDENTITY sequence
34133444etalone_gds_map [ ('rdb$generators' ,'KIL_TAB' ) ]= ((336397288 ,336068927 ),)
34143445etalone_gds_map [ ('rdb$generators' ,'PUB_DIS' ) ]= ((336397287 ,336068927 ),)
34153446etalone_gds_map [ ('rdb$generators' ,'PUB_ENA' ) ]= ((336397287 ,336068927 ),)
@@ -3813,6 +3844,7 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
38133844etalone_gds_map [ ('rdb$triggers' ,'ALT_NAM' ) ]= ((336397287 ,336068927 ),)
38143845etalone_gds_map [ ('rdb$triggers' ,'ALT_POS' ) ]= ((336397287 ,336068927 ),)
38153846etalone_gds_map [ ('rdb$triggers' ,'ALT_TYP' ) ]= ((336397287 ,336068927 ),)
3847+ etalone_gds_map [ ('rdb$triggers' ,'DML_INS' ) ]= ((335545030 ,),)# only since 29.10.2025, commit #c77fbddc
38163848etalone_gds_map [ ('rdb$triggers' ,'DML_DEL' ) ]= ((335545030 ,),)
38173849etalone_gds_map [ ('rdb$triggers' ,'DML_LOK' ) ]= ((335545074 ,),)
38183850etalone_gds_map [ ('rdb$triggers' ,'DML_UPD' ) ]= ((335545030 ,),)
@@ -3952,19 +3984,27 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
39523984prep_script = (act .files_dir / 'core_4731.sql' ).read_text ()
39533985prep_script = prep_script % {'dba_privileged_name' :dba_privileged_user .name ,
39543986'non_privileged_name' :non_privileged_user .name }
3987+
3988+ #############################################################
3989+ ### QA _ H O M E / f i l e s / c o r e _ 4 7 3 1 . s q l ###
3990+ #############################################################
39553991act .isql (switches = ['-q' ],input = prep_script ,combine_output = True )
39563992assert act .clean_stdout == ''
39573993act .reset ()
39583994
3959- #Remove all attachments that can stay alive after preparing DBbecause of ExtConnPoolLifeTime > 0 :
3995+ #Auxiliary changes in the test DBusing services API :
39603996with act .connect_server ()as srv :
3961- # nbackup which will add record into rdb$backup_history table:
3997+ # nbackup which will add record into rdb$backup_history table.
3998+ # We have to check ability to run: 'delete from rdb$backup_history' (4.x+)
39623999srv .database .nbackup (database = act .db .db_path ,backup = tmp_nbk ,level = 0 )
39634000
4001+ # make DB shutdown / bring online: remove all attachments that can stay alive
4002+ # after preparing DB because of ExtConnPoolLifeTime > 0:
39644003srv .database .shutdown (database = act .db .db_path ,mode = ShutdownMode .FULL ,method = ShutdownMethod .FORCED ,timeout = 0 )
39654004srv .database .bring_online (database = act .db .db_path )
39664005#
39674006
4007+ # DO NOT DELETE! Uncomment and use this copy for misc debug purposes:
39684008#shutil.copy2(act.db.db_path, r'C:\FBTESTING\qa\misc\tmp_core_4731.fdb') # 4debug only
39694009
39704010found_mism = 0