DATA-DOG / go-sqlmock

Sql mock driver for golang to test database interactions
Other
5.95k stars 404 forks source link

CSVColumnParser returns []byte instead of driver.Value #298

Closed vasyvasilie closed 1 month ago

vasyvasilie commented 1 year ago

Operating system and Go Version

linux, 1.18.4

Issue

In 2018 this bug already appeared and was fixed in https://github.com/DATA-DOG/go-sqlmock/issues/140 v2 branch only, but last commit of v2 was on 14 Sep 2018 Can you support same behaviour in master?

Reproduction steps

https://go.dev/play/p/J5GC6fgNrYv

Expected Result

there is a remaining expectation which was not matched: ExpectedQuery => expecting Query, QueryContext or QueryRow which:
  - matches sql: 'SELECT '
  - is without arguments
  - should return rows:
    row 0 - [[49 50 51] <nil>]

Actual Result

there is a remaining expectation which was not matched: ExpectedQuery => expecting Query, QueryContext or QueryRow which:
  - matches sql: 'SELECT '
  - is without arguments
  - should return rows:
    row 0 - [[49 50 51] []]
diegommm commented 1 month ago

Hi @vasyvasilie! Thank you for the great report :heart: From what I see it's fixed in https://github.com/DATA-DOG/go-sqlmock/commit/fd971def423315aacad9923a9a9eb8e4ab86ce11 and it no longer reproduces, so closing. But please, feel free to reopen if this happens again!