Skip to content

fix(oracle): use view available for all users for driver.Version #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release-19
Choose a base branch
from

Conversation

murfffi
Copy link
Contributor

@murfffi murfffi commented May 2, 2025

Closes #489

Use v$version instead of v$instance because it is available to all users.
Like v$instance, v$version is available in all non-ancient oracle versions.
Both are available in the earliest documentation I could find: 10g, released 2003.

Testing Done: Oracle Express 21c (as in the reported issue) and 11g

For 11g:

docker run -d -p 1521:1521 -e ORACLE_PASSWORD=foobar gvenzl/oracle-xe:11-slim 
./usql oracle://sys:foobar@localhost/xe
# version is shown correctly
create user test identified by test;
GRANT CREATE SESSION to test;
\connect oracle://test:test@localhost/xe
# version is still shown correctly, despite minimal privileges

21c in the issue was also tested that way.

Also tested with contrib/usql-test.sh using docker as a workaround for oracle/docker-images#2925 .

@kenshaw
Copy link
Member

kenshaw commented May 2, 2025

@murfffi can you please also modify contrib/oracle*/usql-config (there are two directories) with this revised query?

Use v$version instead of v$instance because it is available to all users.
Like v$instance, v$version is available in all oracle versions from the past 20+ years.

Typical Version() output is "Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production"

Testing Done: Oracle Express 21c and 11g

For 11g:

docker run -d -p 1521:1521 -e ORACLE_PASSWORD=foobar gvenzl/oracle-xe:11-slim
./usql oracle://sys:foobar@localhost/xe
# version is shown correctly
create user test identified by test;
GRANT CREATE SESSION to test;
\connect oracle://test:test@localhost/xe
# version is still shown correctly, despite minimal privileges

21c in the issue was also tested that way.
@murfffi
Copy link
Contributor Author

murfffi commented May 12, 2025

Let me know if more changes are needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants