prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 62 forks source link

fix(mysql): unsigned ints should be coerced as i64 #407

Closed Weakky closed 2 years ago

Weakky commented 2 years ago

Overview

fixes https://github.com/prisma/prisma/issues/15264 follow-up QE PR: https://github.com/prisma/prisma-engines/pull/3233

The match on ColumnFlags::UNSIGNED_FLAG would only work if UNSIGNED_FLAG was the only flag set. If any other flag were set, such as the NOT_NULL flag, then it wouldn't match and the value would thus be coerced as an i32 instead. In the case of a u32, it would overflow, leading to upsert issues in the QE (and probably more issues).