SeaQL / SeaQL/sea-orm

SQL type `BIGINT UNSIGNED`) is not compatible with SQL type `BIGINT`

Open
#2,399 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:schema
Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

sea-orm-cli generate entity -u mysql://XXXX --with-serde both --max-connections 5 -v -o ./entity
Connecting to MySQL ...
2024-10-25T08:19:01.887683Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2024-10-25T08:19:01.938704Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET\n sql_mode =(\n SELECT\n CONCAT(\n @ @sql_mode,\n ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'\n )\n ),\n time_zone = '+00:00',\n NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=24.467833ms elapsed_secs=0.024467833
Discovering schema ...
2024-10-25T08:19:02.024917Z DEBUG sqlx::query: summary="SELECT version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=51.282375ms elapsed_secs=0.051282375
2024-10-25T08:19:02.079147Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2024-10-25T08:19:02.131346Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET\n sql_mode =(\n SELECT\n CONCAT(\n @ @sql_mode,\n ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'\n )\n ),\n time_zone = '+00:00',\n NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=25.175959ms elapsed_secs=0.025175959
2024-10-25T08:19:02.188393Z DEBUG sqlx::query: summary="SELECT table_name, engine, auto_increment, …" db.statement="\n\nSELECT\n table_name,\n engine,\n auto_increment,\n table_collation,\n table_comment,\n create_options,\n collation_character_set_applicability.character_set_name\nFROM\n information_schema.tables\n LEFT JOIN information_schema.collation_character_set_applicability ON collation_character_set_applicability.collation_name = tables.table_collation\nWHERE\n table_schema = ?\n AND table_type IN (?, ?)\nORDER BY\n table_name ASC\n" rows_affected=0 rows_returned=14 elapsed=56.516042ms elapsed_secs=0.056516042
thread 'main' panicked at /Users/lijing/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/sqlx-core-0.7.4/src/row.rs:72:37:
called Result::unwrap() on an Err value: ColumnDecode { index: "2", source: "mismatched types; Rust type core::option::Option<u64> (as SQL type BIGINT UNSIGNED) is not compatible with SQL type BIGINT" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sea-orm-cli generate entity MySQL schema-discovery path and the SQLx row decoding error shown in the report. Reproduce against MySQL, then verify that a table query containing BIGINT UNSIGNED and BIGINT completes without the reported panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, rust, sql
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.