Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test_11g.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
- name: Create database user
run: |
./ci/setup_accounts.sh
- name: Grant execute on DBMS_LOCK for Oracle 11g
run: |
echo "GRANT EXECUTE ON DBMS_LOCK TO hr;" | sqlplus system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME}
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step may not actually fail the workflow if the GRANT errors. SQLPlus commonly exits with status 0 unless instructed otherwise, so an ORA- error (e.g., insufficient privileges) could be missed and the job would proceed. Consider running SQL*Plus with a script that includes whenever sqlerror exit sql.sqlcode; (and an explicit exit;) so the step reliably fails on grant errors.

Suggested change
echo "GRANT EXECUTE ON DBMS_LOCK TO hr;" | sqlplus system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME}
cat <<'SQL' | sqlplus system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME}
whenever sqlerror exit sql.sqlcode;
GRANT EXECUTE ON DBMS_LOCK TO hr;
exit;
SQL

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GRANT is executed while connected as system but uses a variable named DATABASE_SYS_PASSWORD, which is inconsistent and can be incorrect for granting on SYS-owned packages in some Oracle setups. If this grant requires SYS/SYSDBA in your 11g environment, connect as sys ... as sysdba (or use the correct credential variable for system) to avoid privilege-related flakiness.

Suggested change
echo "GRANT EXECUTE ON DBMS_LOCK TO hr;" | sqlplus system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME}
echo "GRANT EXECUTE ON DBMS_LOCK TO hr;" | sqlplus "sys/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} as sysdba"

Copilot uses AI. Check for mistakes.
- name: Bundle install
run: |
bundle install --jobs 4 --retry 3
Expand Down
1 change: 0 additions & 1 deletion spec/support/unlock_and_setup_hr_user.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
create user hr identified by hr;
alter user hr identified by hr account unlock;
grant dba to hr;
grant execute on dbms_lock to hr;