pip-services3-go / pip-services3-postgres-go

Postresql components for Pip.Services in Golang
MIT License
0 stars 0 forks source link

Parameter Generation is throwing error when we have more than 9 params #1

Closed dthomas26 closed 3 years ago

dthomas26 commented 3 years ago

We are noticing an issue at "GenerateParameters" and "GenerateSetParameters" method which is not generating param values appropriately. For example if we have more than 10 params "GenerateParameters" is returning this "$1,$2,$3,$4,$5,$6,$7,$8,$9,$a,$b,$c,$d" which is throwing error when this param gets into the sql query. Likewise happening for "GenerateSetParameters" as well.

Code function's which need to be addressed. In my opinion, it should use conversion to base 10 not 16. strconv.FormatInt((int64)(index), 16)) >>> should be replaced with strconv.FormatInt((int64)(index), 10))

(https://github.com/pip-services3-go/pip-services3-postgres-go/blob/main/persistence/PostgresPersistence.go#L529 https://github.com/pip-services3-go/pip-services3-postgres-go/blob/main/persistence/PostgresPersistence.go#L494

levichevdmitry commented 3 years ago

Thanks for the comment, this problem has been resolved in the new release v1.2.5