# title: User can grant usage privilege by himself
# decription:
# Confirmed bug on: 4.0.0.890; 3.0.4.32912
# Works fine on:
# 3.0.4.32917: OK, 1.891s.
# 4.0.0.907: OK, 1.765s.
# Note: beside generator we also have to check the same issue about grant usage on exception.
#
# tracker_id: CORE-5747
# min_versions: ['3.0.4']
# versions: 3.0.4, 4.0
# qmid: None
importpytest
fromfirebird.qaimportdb_factory,isql_act,Action
# version: 3.0.4
# resources: None
substitutions_1=[('no G privilege with grant option on object .*','no USAGE privilege with grant option on object'),('GEN_FOR_DBA_ONLY',''),('EXC_FOR_DBA_ONLY','')]
init_script_1=""""""
db_1=db_factory(sql_dialect=3,init=init_script_1)
test_script_1="""
commit;
connect'$(DSN)'usersysdbapassword'masterkey';
createoralterusertmp$c5747password'123';
commit;
recreatesequencegen_for_dba_only;
recreateexceptionexc_for_dba_only'Your names is: @1 - and you should not be able to use this exception!';
substitutions_2=[('no G privilege with grant option on object .*','no USAGE privilege with grant option on object'),('GEN_FOR_DBA_ONLY',''),('EXC_FOR_DBA_ONLY','')]
init_script_2=""""""
db_2=db_factory(sql_dialect=3,init=init_script_2)
test_script_2="""
commit;
connect'$(DSN)'usersysdbapassword'masterkey';
createoralterusertmp$c5747password'123';
commit;
recreatesequencegen_for_dba_only;
recreateexceptionexc_for_dba_only'Your names is: @1 - and you should not be able to use this exception!';