Skip to content
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

TestPlSqlTypes/Osh test is failing #253

Closed
SonalMahambrey1 opened this issue Oct 6, 2022 · 11 comments
Closed

TestPlSqlTypes/Osh test is failing #253

SonalMahambrey1 opened this issue Oct 6, 2022 · 11 comments

Comments

@SonalMahambrey1
Copy link

On linux with 0.34.0 ,TestPlSqlTypes/Osh is failing with following error
z_plsql_types_test.go:405: begin test_pkg_sample.test_osh(:1, :2); end;: 1. get[0]: GetAttribute("ID"): getAttributeValue("ID", obj=MY_RECORD, attr=&{typeDef:0x107efb30 checkInt:3933035998 refCount:1 env:0x34e30b90 belongsToType:0x7daae41b52e0 name:0x7daae40c3960 nameLength:2 typeInfo:{oracleTypeNum:2010 defaultNativeTypeNum:3000 ociTypeCode:2 dbSizeInBytes:0 clientSizeInBytes:0 sizeInChars:0 precision:5 scale:0 fsPrecision:0 objectType:}}, typ=3000): ORA-22060: OCI-22060: argument [2] is an invalid or uninitialized number

@tgulacsi
Copy link
Contributor

tgulacsi commented Oct 7, 2022

Go version, DB version, Instant Client version?

current HEAD does pass with client 21.4, Server 19.17:

$ go test -run=TestPlSqlTypes
eDSN: 
Using default database for tests:  /home/gthomas/src/github.com/godror/godror/contrib/free.db/env.sh
export TNS_ADMIN="/home/gthomas/src/github.com/godror/godror/contrib/free.db"
export GODROR_TEST_DSN="user=test password=r97oUPimsmTOIcBaeeDF connectString=db201911301540_high\nconfigDir=/tmp/godror_drv_test-1221133564 connectionClass=TestClassName enableEvents=1\nexternalAuth=0 heterogeneousPool=0 libDir= newPassword= noTimezoneCheck=0\npoolIncrement=2 poolMaxSessions=16 poolMinSessions=2 poolSessionMaxLifetime=5m0s\npoolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0 standaloneConnection=1\nsysasm=0 sysdba=0 sysoper=0 timezone=UTC"
# user=test password=SECRET-*** connectString=db201911301540_high configDir=/tmp/godror_drv_test-1221133564
connectionClass=TestClassName enableEvents=1 externalAuth=0 heterogeneousPool=0
libDir= noTimezoneCheck=0 poolIncrement=2 poolMaxSessions=16 poolMinSessions=2
poolSessionMaxLifetime=5m0s poolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0
standaloneConnection=1 sysasm=0 sysdba=0 sysoper=0 timezone=UTC
Version: v0.34.1
Client: 21.4.0.0.0 Timezone: Local
Server: 19.17.0.1.0 [Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production; Version 19.17.0.1.0] Timezone: UTC
PASS
ok      github.com/godror/godror        7.615s

@tgulacsi
Copy link
Contributor

tgulacsi commented Oct 7, 2022

It does pass on v0.34.0, too:

$ go test -run=TestPlSqlTypes
eDSN: 
Using default database for tests:  /home/gthomas/src/github.com/godror/godror/contrib/free.db/env.sh
export TNS_ADMIN="/home/gthomas/src/github.com/godror/godror/contrib/free.db"
export GODROR_TEST_DSN="user=test password=r97oUPimsmTOIcBaeeDF connectString=db201911301540_high\nconfigDir=/tmp/godror_drv_test-1620620462 connectionClass=TestClassName enableEvents=1\nexternalAuth=0 heterogeneousPool=0 libDir= newPassword= noTimezoneCheck=0\npoolIncrement=2 poolMaxSessions=16 poolMinSessions=2 poolSessionMaxLifetime=5m0s\npoolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0 standaloneConnection=1\nsysasm=0 sysdba=0 sysoper=0 timezone=UTC"
# user=test password=SECRET-*** connectString=db201911301540_high configDir=/tmp/godror_drv_test-1620620462
connectionClass=TestClassName enableEvents=1 externalAuth=0 heterogeneousPool=0
libDir= noTimezoneCheck=0 poolIncrement=2 poolMaxSessions=16 poolMinSessions=2
poolSessionMaxLifetime=5m0s poolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0
standaloneConnection=1 sysasm=0 sysdba=0 sysoper=0 timezone=UTC
Version: v0.34.0
Client: 21.4.0.0.0 Timezone: Local
Server: 19.17.0.1.0 [Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production; Version 19.17.0.1.0] Timezone: UTC
PASS
ok      github.com/godror/godror        5.909s

@SonalMahambrey1
Copy link
Author

SonalMahambrey1 commented Oct 7, 2022

Go Version: go1.18.5
Server: 19.17.0.1.0
Client: 19.3.0.0.0

go test -run=TestPlSqlTypes
eDSN:
Using default database for tests: /github.com/godror/godror/contrib/free.db/env.sh
export TNS_ADMIN="/github.com/godror/godror/contrib/free.db"
export GODROR_TEST_DSN="user=test password=r97oUPimsmTOIcBaeeDF connectString=db201911301540_high\nconfigDir=/tmp/godror_drv_test-2074419129 connectionClass=TestClassName enableEvents=1\nexternalAuth=0 heterogeneousPool=0 libDir= newPassword= noTimezoneCheck=0\npoolIncrement=2 poolMaxSessions=16 poolMinSessions=2 poolSessionMaxLifetime=5m0s\npoolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0 standaloneConnection=1\nsysasm=0 sysdba=0 sysoper=0 timezone=UTC"

user=test password=SECRET-*** connectString=db201911301540_high configDir=/tmp/godror_drv_test-2074419129

connectionClass=TestClassName enableEvents=1 externalAuth=0 heterogeneousPool=0
libDir= noTimezoneCheck=0 poolIncrement=2 poolMaxSessions=16 poolMinSessions=2
poolSessionMaxLifetime=5m0s poolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0
standaloneConnection=1 sysasm=0 sysdba=0 sysoper=0 timezone=UTC
Version: v0.34.0
Client: 19.3.0.0.0 Timezone: Local
Server: 19.17.0.1.0 [Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production; Version 19.17.0.1.0] Timezone: UTC
--- FAIL: TestPlSqlTypes (3.76s)
--- FAIL: TestPlSqlTypes/Osh (0.81s)
z_plsql_types_test.go:405: begin test_pkg_sample.test_osh(:1, :2); end;: 1. get[0]: GetAttribute("ID"): getAttributeValue("ID", obj=MY_RECORD, attr=&{typeDef:0x107efb30 checkInt:3933035998 refCount:1 env:0x4f990ff0 belongsToType:0x4fae6f90 name:0x4fae7060 nameLength:2 typeInfo:{oracleTypeNum:2010 defaultNativeTypeNum:3000 ociTypeCode:2 dbSizeInBytes:0 clientSizeInBytes:0 sizeInChars:0 precision:5 scale:0 fsPrecision:0 objectType:}}, typ=3000): ORA-22060: OCI-22060: argument [2] is an invalid or uninitialized number
FAIL
exit status 1
FAIL github.com/godror/godror 5.391s

@SonalMahambrey1
Copy link
Author

TestPlSqlTypes passes with Client: 21.7.0.0.0

go test -run=TestPlSqlTypes
eDSN:
Using default database for tests: /github.com/godror/godror/contrib/free.db/env.sh
export TNS_ADMIN="/github.com/godror/godror/contrib/free.db"
export GODROR_TEST_DSN="user=test password=r97oUPimsmTOIcBaeeDF connectString=db201911301540_high\nconfigDir=/tmp/godror_drv_test-4010182059 connectionClass=TestClassName enableEvents=1\nexternalAuth=0 heterogeneousPool=0 libDir= newPassword= noTimezoneCheck=0\npoolIncrement=2 poolMaxSessions=16 poolMinSessions=2 poolSessionMaxLifetime=5m0s\npoolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0 standaloneConnection=1\nsysasm=0 sysdba=0 sysoper=0 timezone=UTC"

user=test password=SECRET-*** connectString=db201911301540_high configDir=/tmp/godror_drv_test-4010182059

connectionClass=TestClassName enableEvents=1 externalAuth=0 heterogeneousPool=0
libDir= noTimezoneCheck=0 poolIncrement=2 poolMaxSessions=16 poolMinSessions=2
poolSessionMaxLifetime=5m0s poolSessionTimeout=1m0s poolWaitTimeout=5s prelim=0
standaloneConnection=1 sysasm=0 sysdba=0 sysoper=0 timezone=UTC
Version: v0.34.0
Client: 21.7.0.0.0 Timezone: Local
Server: 19.17.0.1.0 [Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production; Version 19.17.0.1.0] Timezone: UTC
PASS

@sudarshan12s
Copy link
Collaborator

Thanks for the test. looks its fixed in latest instant client versions, I shall check and get back.

@sudarshan12s
Copy link
Collaborator

The RCA seems related to null values for un-initialized members in the nested structure inside an object which is getting returned.

So for the test, z_plsql_types_test.go can you try initializing the nested structure, rec before returning.

diff --git a/z_plsql_types_test.go b/z_plsql_types_test.go
index 34a5dcc..478628e 100644
--- a/z_plsql_types_test.go
+++ b/z_plsql_types_test.go
@@ -286,6 +286,8 @@ func createPackages(ctx context.Context) error {
                FOR i IN 1..3 LOOP
                        res_list.extend();
                        rec.id := i;
+                       rec.rec.id := i;
+                 DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);
                        --test_record(rec.id, rec.id, rec.rec);
                        res_list(res_list.count) := rec;
                END LOOP;

@SonalMahambrey1
Copy link
Author

Tried following changes in v0.34.0
--- a/z_plsql_types_test.go
+++ b/z_plsql_types_test.go
@@ -280,6 +280,8 @@ func createPackages(ctx context.Context) error {
FOR i IN 1..3 LOOP
res_list.extend();
rec.id := i;

  •                   rec.rec.id := i;
    
  •           DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);
                      res_list(res_list.count) := rec;
              END LOOP;
    

Following error is seen
FAIL: TestPlSqlTypes (3.89s)
--- FAIL: TestPlSqlTypes/Struct (1.00s)
z_plsql_types_test.go:386: begin test_pkg_sample.test_record(:1, :2, :3); end;: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Slice (0.63s)
z_plsql_types_test.go:396: begin test_pkg_sample.test_table_in(:1); end;: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Osh (0.91s)
z_plsql_types_test.go:407: begin test_pkg_sample.test_osh(:1, :2); end;: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Record (0.18s)
z_plsql_types_test.go:455: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Record_IN_OUT (0.18s)
z_plsql_types_test.go:497: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Table (0.18s)
z_plsql_types_test.go:543: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1
--- FAIL: TestPlSqlTypes/Table_IN (0.18s)
z_plsql_types_test.go:614: ORA-04063: package body "TEST.TEST_PKG_SAMPLE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "TEST.TEST_PKG_SAMPLE"
ORA-06512: at line 1

@sudarshan12s
Copy link
Collaborator

DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);

I was checking on latest code. For the version v34.0 , aclob is not a member in my_record in test sample, so you can remove this line from z_plsql_types_test.go and try it.

DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);

tgulacsi added a commit that referenced this issue Oct 10, 2022
@SonalMahambrey1
Copy link
Author

DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);

I was checking on latest code. For the version v34.0 , aclob is not a member in my_record in test sample, so you can remove this line from z_plsql_types_test.go and try it.

DBMS_LOB.createtemporary(rec.rec.aclob, TRUE);

Thanks , this worked

@sudarshan12s
Copy link
Collaborator

The issue is in 19c release. You can apply the work around if you want to use 19c or upgrade the client to 21c.

@SonalMahambrey1
Copy link
Author

ok,thanks

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

No branches or pull requests

3 participants