Skip to content

MysqlColumnTypeEnum buildDataType drops DECIMAL precision when scale is null (dead branch, same as Sqlite) #2180

Description

@Aias00

Chat2DB Edition

Chat2DB Community

Chat2DB Version

5.3.0

Deployment

Web

Operating System

macOS

Operating System Version

12

Database and Version

MySQL

Problem Summary

MysqlColumnTypeEnum.buildDataType guards with if (columnSize == null || decimalDigits == null) return columnType — the || causes an early return for DECIMAL(10) (precision set, scale null), dropping the precision and emitting bare DECIMAL (which MySQL defaults to DECIMAL(10,0)). The size-only branch is unreachable dead code. Every sibling (Oracle/DM/DB2/Oscar) guards on columnSize == null only. Same bug class as the already-fixed Sqlite #2167.

Expected Behavior

Guard on columnSize == null only, making the size-only branch reachable.

Actual Behavior

MysqlColumnTypeEnum.java:379,394 — if (columnSize == null || decimalDigits == null) return columnType.

Impact

Limited or cosmetic impact

Workaround

N/A

Submission Checklist

  • I reproduced this on the selected Chat2DB edition.
  • I searched existing issues for duplicates.
  • I removed credentials and private data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions