rana/ora

Query Result NOT Identical to Records In DB

Opened this issue · 4 comments

we found that when query using multiple go routine, the query result is not identical to that in database.

reproduction environment:

  1. we have a table hs_his.his_ofdeliver, with 4 columns, FUND_ACCOUNT NOT NULL VARCHAR2(18),FUND_CODE NOT NULL VARCHAR2(6), BUSINESS_FLAG NOT NULL NUMBER(10), MONEY_TYPE NOT NULL VARCHAR2(3)
  2. insert 4 records into hs_his.his_ofdeliver, ('14900666', '270004', '143', '0'), ('1868091', '270004', '143', '0'),('1898964', '270004', '143', '0'),('14900397', '270004', '143', '0'),
  3. run the code in attachment, we expect that the query result should be identical to records in db, but actually not.

sample output:
image
main.go.txt

No idea. Have you tried with the race detector?
What if you limit the number of goroutines to 1?

we have try these three cases:

  1. ora version v4.1.15, 64 go routines, errors are detected in a few seconds
  2. ora version v4.1.15, 1 go routine, the first error is detected in about 10 min
  3. ora version v4.1.9, 64 go routines, no errors are detected in 2 hours

I'll try to create a reproducer, but if you use only database/sql, you could easily try my other driver, gopkg.in/goracle.v2 .

70733b7 has a reproducer

go test -race -run=244

But couldn't find a solution yet.
gopkg.in/goracle.v2 does not have this error (with the same test).