Commit 476bdd2
Grant execute on dbms_lock as SYS
Since Oracle 12c, SYSTEM cannot grant EXECUTE on SYS-owned packages
like DBMS_LOCK; only SYS (or a user with GRANT ANY OBJECT PRIVILEGE)
can. The grant in spec/support/unlock_and_setup_hr_user.sql therefore
fails on gvenzl/oracle-free with
grant execute on dbms_lock to hr
*
ERROR at line 1:
ORA-01031: insufficient privileges
sqlplus does not propagate the error, so the failure has been
silently logged in CI.
The hr user happens not to need DBMS_LOCK on modern Oracle: the
threaded-cursor spec in spec/plsql/schema_spec.rb uses
DBMS_SESSION.sleep on 18c+ and only falls back to DBMS_LOCK.sleep on
older versions. DBMS_SESSION.sleep was introduced in 18c specifically
as a relocation of DBMS_LOCK.sleep so that callers no longer need
EXECUTE on DBMS_LOCK just to pause execution. On 11.2 there is no
equivalent in DBMS_SESSION (and no clean alternative outside of
DBMS_PIPE.RECEIVE_MESSAGE-on-a-nonexistent-pipe hacks), so the grant
remains necessary for the 11g matrix.
Move the grant into a separate "as sysdba" sqlplus session in
ci/setup_accounts.sh so it succeeds on both gvenzl/oracle-xe:11 and
gvenzl/oracle-free, and add "whenever sqlerror exit failure" so any
future grant failure surfaces instead of being hidden.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d096dd5 commit 476bdd2
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
0 commit comments