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

Insert failing for columns having zero value #28

Open
archit4077sh opened this issue Oct 29, 2021 · 1 comment
Open

Insert failing for columns having zero value #28

archit4077sh opened this issue Oct 29, 2021 · 1 comment

Comments

@archit4077sh
Copy link

archit4077sh commented Oct 29, 2021

Code used to insert row(values are having numeric data type in database):
db.Exec("INSERT INTO table_name (col_a, col_b) VALUES (?, ?)", 1.23, 0)

Error Received: tds: error while scanning array of bytes to numeric: tds: could not parse string . to number

Debugged further and found that num.String() in line below is returning value = .

tds/num.go

Line 202 in 1a2d89f

return []byte(num.String()), err

On further debugging into num.String() function, we found that the following IsInt() check is getting failed:

tds/num.go

Line 116 in 1a2d89f

if n.r.IsInt() {

@thda
Copy link
Owner

thda commented Nov 1, 2021

Thanks for the report.
I'll check it tomorrow. It should be fixed shortly.

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

2 participants