sijms / go-ora

Pure go oracle client
MIT License
800 stars 177 forks source link

Regression since v2.7.14 with some data types #442

Closed robstradling closed 1 year ago

robstradling commented 1 year ago

The udt_array example is no longer working correctly for me since v2.7.14. It's erroring with "server requested charset id: 0 which is not supported by the driver".

> cd examples/udt_array
> go get github.com/sijms/go-ora/v2@v2.7.13
go: downgraded github.com/sijms/go-ora/v2 v2.7.17 => v2.7.13

> env DSN="<redacted>" go run main.go
Finish create UDT:  604.864794ms
Finish create UDT Array:  86.201067ms
finish create table:  90.379925ms
finish insert:  2.095609628s
finish create package:  178.559807ms
result:  [{1 name_1 DATA 2023-09-13 12:23:33 +0000 UTC} {3 name_3 DATA 2023-09-13 12:23:33 +0000 UTC} {5 name_5 DATA 2023-09-13 12:23:34 +0000 UTC} {7 name_7 DATA 2023-09-13 12:23:34 +0000 UTC}]
finish query:  253.954624ms
finish get2:  539.249198ms
Drop package:  96.057779ms
finish drop table:  103.745066ms
Finish drop UDT Array:  90.500359ms
Finish drop UDT:  86.973247ms

> go get github.com/sijms/go-ora/v2@v2.7.14
go: upgraded github.com/sijms/go-ora/v2 v2.7.13 => v2.7.14

> env DSN="<redacted>" go run main.go
Finish create UDT:  932.082194ms
Finish create UDT Array:  359.016ms
finish create table:  99.336293ms
finish insert:  1.711706877s
finish create package:  184.288253ms
can't query:  server requested charset id: 0 which is not supported by the driver
Drop package:  92.009185ms
finish drop table:  99.603794ms
Finish drop UDT Array:  89.975317ms
Finish drop UDT:  86.14454ms

I'm also seeing the same error in one of my own projects, when (1) using a UDT array and when (2) using go-ora v2.7.14+ to scan DBMS_LOB.SUBSTR(<blob>) into a go_ora.Blob variable (although, interestingly, changing DBMS_LOB.SUBSTR(<blob>) to <blob> makes that error go away).

The root cause of these errors appears to be https://github.com/sijms/go-ora/commit/f8b95b2be7456996bd068c4502add61a908fe63e#diff-5dcbbead479983393e7178a4edb17361807ea5fd5530aa9c7e863b97831c5642L328.

(To workaround these problems, I'm temporarily using a fork of go-ora v2.7.17 that reverts that part of that commit)

sijms commented 1 year ago

fixed in next release

robstradling commented 1 year ago

fixed in next release

Thanks @sijms. Do you plan to push that fix soon?

sijms commented 1 year ago

solved in v2.7.18

robstradling commented 1 year ago

@sijms: Many thanks! I can confirm that v2.7.18 fixes these issues for me.