Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit62b51aa

Browse files
committed
Added/Updated tests\bugs\core_4731_test.py: Adjusted expected data, see notes and files/core_4731.sql (CTE 'ddl_gen': one need to allow recreate sequence on 6.x because sequences will be created in PUBLIC schema; explained by dimitr).
1 parentd4b6222 commit62b51aa

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

‎tests/bugs/core_4731_test.py‎

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@
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+
6782
JIRA: CORE-4731
6883
FBTEST: 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+
ifact.is_version('<6'):
123+
ALLOWED_STTM_PREFIXES.extend( ('insert into rdb$fields','insert into rdb$triggers') )
124+
111125
ifact.is_version('<4'):
112126
pass
113127
else:
@@ -123,6 +137,9 @@ def test_1(act: Action, tmp_nbk: Path, dba_privileged_user: User, non_privileged
123137

124138
etalone_gds_map= {}
125139
ifact.is_version('<4'):
140+
################
141+
### 3.x ###
142+
################
126143
etalone_gds_map[ ('mon$attachments','ADD_CTR') ]= ((335544351,336397287,335544352),)
127144
etalone_gds_map[ ('mon$attachments','ADD_DEF') ]= ((335544351,336397287,335544352),)
128145
etalone_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
506523
etalone_gds_map[ ('rdb$generators','DML_UPD') ]= ((335545030,),)
507524
etalone_gds_map[ ('rdb$generators','KIL_DEF') ]= ((335544351,336397287,335544352),)
508525
etalone_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
510528
etalone_gds_map[ ('rdb$generators','KIL_TAB') ]= ((335544351,336397288,335544352),)
511529
etalone_gds_map[ ('rdb$generators','RECR_GN') ]= ((335544351,336397304,336068880),)
512530
etalone_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
849867
etalone_gds_map[ ('sec$users','KIL_TAB') ]= ((335544351,336397288,335544352),)
850868
etalone_gds_map[ ('sec$users','SET_NUL') ]= ((335544351,336397287,335544352),)
851869
elifact.is_version('<5'):
870+
################
871+
### 4.x ###
872+
################
852873
etalone_gds_map[ ('mon$attachments','ADD_CTR') ]= ((335544351,336397287,335544352),)
853874
etalone_gds_map[ ('mon$attachments','ADD_DEF') ]= ((335544351,336397287,335544352),)
854875
etalone_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
13531374
etalone_gds_map[ ('rdb$generators','DML_UPD') ]= ((335545030,),)
13541375
etalone_gds_map[ ('rdb$generators','KIL_DEF') ]= ((335544351,336397287,335544352),)
13551376
etalone_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
13571379
etalone_gds_map[ ('rdb$generators','KIL_TAB') ]= ((335544351,336397288,335544352),)
13581380
etalone_gds_map[ ('rdb$generators','PUB_DIS') ]= ((335544351,336397287,335544352),)
13591381
etalone_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
18501872
etalone_gds_map[ ('sec$users','SQL_DEF') ]= ((335544351,336397287,335544352),)
18511873
etalone_gds_map[ ('sec$users','SQL_INV') ]= ((335544351,336397287,335544352),)
18521874
elifact.is_version('<6'):
1875+
################
1876+
### 5.x ###
1877+
################
18531878
etalone_gds_map[ ('mon$attachments','ADD_CTR') ]= ((335544351,336397287,335544352),)
18541879
etalone_gds_map[ ('mon$attachments','ADD_DEF') ]= ((335544351,336397287,335544352),)
18551880
etalone_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
23722397
etalone_gds_map[ ('rdb$generators','DML_UPD') ]= ((335545030,),)
23732398
etalone_gds_map[ ('rdb$generators','KIL_DEF') ]= ((335544351,336397287,335544352),)
23742399
etalone_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
23762402
etalone_gds_map[ ('rdb$generators','KIL_TAB') ]= ((335544351,336397288,335544352),)
23772403
etalone_gds_map[ ('rdb$generators','PUB_DIS') ]= ((335544351,336397287,335544352),)
23782404
etalone_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
28872913
etalone_gds_map[ ('sec$users','SQL_DEF') ]= ((335544351,336397287,335544352),)
28882914
etalone_gds_map[ ('sec$users','SQL_INV') ]= ((335544351,336397287,335544352),)
28892915
else:
2916+
################
2917+
### 6.x+ ###
2918+
################
28902919
etalone_gds_map[ ('mon$attachments','ADD_CTR') ]= ((336397287,336068927),)
28912920
etalone_gds_map[ ('mon$attachments','ADD_DEF') ]= ((336397287,336068927),)
28922921
etalone_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
32893318
etalone_gds_map[ ('rdb$fields','ALT_NAM') ]= ((336397287,336068927),)
32903319
etalone_gds_map[ ('rdb$fields','ALT_POS') ]= ((336397287,336068927),)
32913320
etalone_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)
32923322
etalone_gds_map[ ('rdb$fields','DML_DEL') ]= ((335545030,),)
32933323
etalone_gds_map[ ('rdb$fields','DML_LOK') ]= ((335545074,),)
32943324
etalone_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
34093439
etalone_gds_map[ ('rdb$generators','DML_UPD') ]= ((335545030,),)
34103440
etalone_gds_map[ ('rdb$generators','KIL_DEF') ]= ((336397287,336068927),)
34113441
etalone_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
34133444
etalone_gds_map[ ('rdb$generators','KIL_TAB') ]= ((336397288,336068927),)
34143445
etalone_gds_map[ ('rdb$generators','PUB_DIS') ]= ((336397287,336068927),)
34153446
etalone_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
38133844
etalone_gds_map[ ('rdb$triggers','ALT_NAM') ]= ((336397287,336068927),)
38143845
etalone_gds_map[ ('rdb$triggers','ALT_POS') ]= ((336397287,336068927),)
38153846
etalone_gds_map[ ('rdb$triggers','ALT_TYP') ]= ((336397287,336068927),)
3847+
etalone_gds_map[ ('rdb$triggers','DML_INS') ]= ((335545030,),)# only since 29.10.2025, commit #c77fbddc
38163848
etalone_gds_map[ ('rdb$triggers','DML_DEL') ]= ((335545030,),)
38173849
etalone_gds_map[ ('rdb$triggers','DML_LOK') ]= ((335545074,),)
38183850
etalone_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
39523984
prep_script= (act.files_dir/'core_4731.sql').read_text()
39533985
prep_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+
#############################################################
39553991
act.isql(switches=['-q'],input=prep_script,combine_output=True)
39563992
assertact.clean_stdout==''
39573993
act.reset()
39583994

3959-
#Remove all attachments that can stay alive after preparingDBbecause of ExtConnPoolLifeTime > 0:
3995+
#Auxiliary changes in the testDBusing services API:
39603996
withact.connect_server()assrv:
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+)
39623999
srv.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:
39644003
srv.database.shutdown(database=act.db.db_path,mode=ShutdownMode.FULL,method=ShutdownMethod.FORCED,timeout=0)
39654004
srv.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

39704010
found_mism=0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp