Oracle : Local Naming Method #1515

Merged
lunny merged 6 commits from tomoyamachi/xorm:fix-oracle-db into master 3 years ago

What did you implement:

Type : Bugfix

Before : Return dbname is empty error when using a Local Naming Method.

After : Return dbname is empty error when dbhost is empty and not using a Local Naming Method

description

Oracle can set net service names.
https://docs.oracle.com/cd/B13789_01/network.101/b10775/naming.htm#i448220

tnsnames.ora

sales=
(DESCRIPTION= 
(ADDRESS=(PROTOCOL=tcp)(HOST=server)(PORT=1521))
  (CONNECT_DATA= 
     (SERVICE_NAME=sample)))

then, user/pass@sales is an alias for user/pass@tcp(server:1521)/sample.

But, xorm can't parse user/pass@sales and return a error for now.

How Has This Been Tested?

  • worked: user/pass@server:1521/sample
  • worked: user/pass@sample
  • return dbname is empty: user/pass@
# What did you implement: Type : Bugfix Before : Return `dbname is empty` error when using a Local Naming Method. After : Return `dbname is empty` error when dbhost is empty and not using a Local Naming Method ## description Oracle can set net service names. https://docs.oracle.com/cd/B13789_01/network.101/b10775/naming.htm#i448220 `tnsnames.ora` ``` sales= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=server)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=sample))) ``` then, `user/pass@sales` is an alias for `user/pass@tcp(server:1521)/sample`. But, xorm can't parse `user/pass@sales` and return a error for now. # How Has This Been Tested? - worked: `user/pass@server:1521/sample` - worked: `user/pass@sample` - return `dbname is empty`: `user/pass@`
lunny commented 3 years ago
Owner

@tomoyamachi Thanks for you contribution. Could you add your tests on the patch?

@tomoyamachi Thanks for you contribution. Could you add your tests on the patch?
Poster

@lunny
Sorry for the late reply.

Currently, xorm does not have any tests for Oracle DB.
An Oracle DB container image is over 5GB and we have to download tar files from official oracle site. It is difficult to use the same method so far.

Please let me know if you have any oracle database environments we can use.

@lunny Sorry for the late reply. Currently, `xorm` does not have any tests for Oracle DB. An Oracle DB container image is over 5GB and we have to download tar files from official oracle site. It is difficult to use the same method so far. Please let me know if you have any oracle database environments we can use.
lunny commented 3 years ago
Owner

@tomoyamachi In fact I have sent a PR #1463 to add a tests for oracle and in that PR I'm running an oralce container to tests xorm.

@tomoyamachi In fact I have sent a PR #1463 to add a tests for oracle and in that PR I'm running an oralce container to tests xorm.
lunny commented 3 years ago
Owner

And for your PR, you just need a TestParseOracleConnStr(t *testing.T) that's OK.

And for your PR, you just need a `TestParseOracleConnStr(t *testing.T)` that's OK.
Poster

@lunny
Thank you for the reply.
I create a TestParseOracleConnStr(t *testing.T).

@lunny Thank you for the reply. I create a `TestParseOracleConnStr(t *testing.T)`.
lunny approved these changes 3 years ago
Dismissed
lunny added this to the 1.1.1 milestone 3 years ago
lunny closed this pull request 3 years ago
lunny commented 3 years ago
Owner

@tomoyamachi Thanks!

@tomoyamachi Thanks!
lunny modified the milestone from 1.1.1 to 1.0.1 3 years ago
lunny added the
kind
bug
label 3 years ago
tomoyamachi deleted branch fix-oracle-db 3 years ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 2ece3bacbb.
Sign in to join this conversation.
Loading…
There is no content yet.