dolthub / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
22 stars 20 forks source link

Bug fix: Preserve sign for integers in prepared statements #360

Closed fulghum closed 2 months ago

fulghum commented 2 months ago

Bound integer values for prepared statements are parsed from the wire and packaged into int64 values that are then passed to the SQL engine to execute with the prepared statement. For int8, int16, int24, and int32 types those bytes from the wire weren't getting cast to the correct type first, before they were cast to int64, which meant if the signed bit was set, the value was interpreted incorrectly.

Customer issue: https://github.com/dolthub/dolt/issues/8085