usql icon indicating copy to clipboard operation
usql copied to clipboard

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

Open murfffi opened this issue 8 months ago • 2 comments

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 https://github.com/oracle/docker-images/issues/2925 .

murfffi avatar May 02 '25 16:05 murfffi

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

kenshaw avatar May 02 '25 23:05 kenshaw

Let me know if more changes are needed :)

murfffi avatar May 12 '25 08:05 murfffi