nakagami / firebirdsql

Firebird RDBMS sql driver for Go (golang)
MIT License
224 stars 60 forks source link

Value uint64 converts into negative int32 while stored into BIGINT field #112

Closed KenSv closed 4 years ago

KenSv commented 4 years ago

Sample code: var val uint64 val = 2147483648 tx, err := db.Begin() if err != nil { tx.Rollback() } _, err = tx.Exec("insert into test(B1) values(?)", val) if err != nil { fmt.Println(err) } tx.Commit() Firebird DDL: CREATE TABLE TEST ( B1 BIGINT ); Result: B1 = -2147483648 if value = 2147483647, result is positive = 2147483647

nakagami commented 4 years ago

use blr_int64 https://github.com/FirebirdSQL/firebird/blob/master/src/include/firebird/impl/blr.h#L44

nakagami commented 4 years ago

Thanks for your report

KenSv commented 4 years ago

Thank you so much! It's working correct