{"record":{"id":"a37df81100798ab4","repo":"SeaQL/sea-orm","slug":"failed-to-get-big-integer-a37df8","errorCode":null,"errorMessage":"Failed to get big integer","messagePattern":"Failed to get big integer","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/driver/sqlx_mysql.rs","lineNumber":427,"sourceCode":"                                .expect(\"Failed to get unsigned integer\"),\n                        ),\n                        \"MEDIUMINT UNSIGNED\" | \"BIGINT UNSIGNED\" => Value::BigUnsigned(\n                            row.try_get(c.ordinal())\n                                .expect(\"Failed to get unsigned big integer\"),\n                        ),\n                        \"TINYINT\" => Value::TinyInt(\n                            row.try_get(c.ordinal())\n                                .expect(\"Failed to get tiny integer\"),\n                        ),\n                        \"SMALLINT\" => Value::SmallInt(\n                            row.try_get(c.ordinal())\n                                .expect(\"Failed to get small integer\"),\n                        ),\n                        \"INT\" => {\n                            Value::Int(row.try_get(c.ordinal()).expect(\"Failed to get integer\"))\n                        }\n                        \"MEDIUMINT\" | \"BIGINT\" => Value::BigInt(\n                            row.try_get(c.ordinal()).expect(\"Failed to get big integer\"),\n                        ),\n                        \"FLOAT\" => {\n                            Value::Float(row.try_get(c.ordinal()).expect(\"Failed to get float\"))\n                        }\n                        \"DOUBLE\" => {\n                            Value::Double(row.try_get(c.ordinal()).expect(\"Failed to get double\"))\n                        }\n\n                        \"BIT\" | \"BINARY\" | \"VARBINARY\" | \"TINYBLOB\" | \"BLOB\" | \"MEDIUMBLOB\"\n                        | \"LONGBLOB\" => Value::Bytes(\n                            row.try_get::<Option<Vec<u8>>, _>(c.ordinal())\n                                .expect(\"Failed to get bytes\")\n                                .map(Box::new),\n                        ),\n\n                        \"CHAR\" | \"VARCHAR\" | \"TINYTEXT\" | \"TEXT\" | \"MEDIUMTEXT\" | \"LONGTEXT\" => {\n                            Value::String(\n                                row.try_get::<Option<String>, _>(c.ordinal())","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/SeaQL/sea-orm/blob/e29bcd1b417c41a553b386fe94511d7c64a1c8ec/src/driver/sqlx_mysql.rs#L409-L445","documentation":"In `ProxyRow`, MySQL `MEDIUMINT` and `BIGINT` columns are fetched as `i64` via `row.try_get` and unwrapped with `.expect(\"Failed to get big integer\")`. If sqlx cannot decode the value as i64 (NULL, or a value type inconsistent with the described metadata), the expect panics with this message.","triggerScenarios":"A MEDIUMINT/BIGINT column containing NULL, or a value whose real type differs from the described metadata (e.g. BIGINT UNSIGNED handled by a different arm, or mocked value), decoded through the proxy driver.","commonSituations":"NULL bigint from aggregate subqueries or LEFT JOINs; schema drift where BIGINT became nullable; proxy-driver mocks returning f64 or string for BIGINT columns.","solutions":["Change the entity field to `Option<i64>` or enforce NOT NULL on the column","Regenerate entities after migrations to eliminate type/nullability drift","Correct mock/proxy handlers to supply `i64` values for BIGINT/MEDIUMINT columns","Inspect the SELECT list for expressions that change type or nullability"],"exampleFix":"// before\npub total: i64,\n// after\npub total: Option<i64>,","handlingStrategy":"validation","validationCode":"// Verify MEDIUMINT/BIGINT columns before decoding\nSELECT COLUMN_TYPE, IS_NULLABLE FROM information_schema.COLUMNS\nWHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND COLUMN_NAME = ?;","typeGuard":"fn is_i64_compatible(col_type: &str, nullable: bool, value_is_null: bool) -> bool {\n    matches!(col_type.to_ascii_lowercase().as_str(), \"bigint\" | \"mediumint\")\n        && !nullable && !value_is_null\n}","tryCatchPattern":null,"preventionTips":["Use Option<i64> for nullable bigint fields","Beware aggregate expressions (SUM/MAX over empty sets) yielding NULL","Keep proxy mock values as i64 for BIGINT columns","Regenerate entities after migrations"],"tags":["mysql","sqlx","decoding","bigint"],"backgroundTag":"type-mismatch","analyzedSha":"e29bcd1b417c41a553b386fe94511d7c64a1c8ec","analyzedAt":"2026-09-10T11:31:52.468Z","contentChangedAt":"2026-09-10T11:31:52.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}