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

Querying NULL image field causes driver to hang #207

Open
hqin opened this issue Jul 26, 2021 · 0 comments
Open

Querying NULL image field causes driver to hang #207

hqin opened this issue Jul 26, 2021 · 0 comments

Comments

@hqin
Copy link

hqin commented Jul 26, 2021

Description

Querying NULL image field causes driver to hang

Expected behaviour

Querying NULL image field should return []byte(nil)

Querying NULL image field causes driver to hang

A clear and concise description of what currently happens.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a test table with a row with a NULL image field
create table DATATYPE_IMAGE_NULL_TEST(Id int primary key, ImageFld image NULL)
go

insert into DATATYPE_IMAGE_NULL_TEST values(1, NULL)
go
  1. export environment variables "DB_USERNAME", "DB_PASSWORD", "DB_DATABASE", "DB_HOSTNAME", "DB_PORT",
  2. Run the attached code image_null_validate.go using tds driver returns correct value
DB_DRIVER=tds go run image_null_validate.go
Connected to database using tds driver
select ImageFld from DATATYPE_IMAGE_NULL_TEST where Id=1
column[0]
	column name: ImageFld
	type: image
	length = 2147483647
	nullable = true
scan type: []uint8
ImageFld: []byte(nil)
  1. Run the attached code image_null_validate.go using go-ase driver hangs
DB_DRIVER=ase go run image_null_validate.go
Connected to database using ase driver
select ImageFld from DATATYPE_IMAGE_NULL_TEST where Id=1
column[0]
	column name: ImageFld
	type: IMAGE
	length = 32768
	nullable = true
scan type: []uint8

Environment

Client:
OS: MacOS or Centos-7
go version: 1.16
go-ase version / commit hash: v0.0.0-20210611100756-1778dda08c18
go-dblib version / commit hash: v0.0.0-20210610133137-f25b0f0fced0
tds driver version: github.com/thda/tds v0.1.7

Server:
OS: Centos-7
ASE version: 16.0_SP03PL09_EBF29247

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.
image_null_validate.go.gz

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

1 participant