Oracle : Local Naming Method #1515

Merged
lunny merged 6 commits from tomoyamachi/xorm:fix-oracle-db into master 2020-03-23 02:03:08 +00:00
Contributor

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@`
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?
Author
Contributor

@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.
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.
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.
Author
Contributor

@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 2020-03-23 02:02:50 +00:00
Dismissed
lunny added this to the 1.1.1 milestone 2020-03-23 02:02:58 +00:00
lunny closed this pull request 2020-03-23 02:03:08 +00:00
Owner

@tomoyamachi Thanks!

@tomoyamachi Thanks!
lunny modified the milestone from 1.1.1 to 1.0.1 2020-03-23 12:53:39 +00:00
lunny added the
kind
bug
label 2020-03-23 12:53:51 +00:00
tomoyamachi deleted branch fix-oracle-db 2020-03-23 14:39:31 +00:00
Sign in to join this conversation.
No description provided.