Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41046

Quoted CREATE SERVER PORT silently saturates on overflow

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 13.0.1
    • 11.8.9, 12.3.3, 13.0.2
    • Server
    • None
    • Docker-based MariaDB 13.0.1 runtime (exact image ID, host OS/architecture, compiler/build information, and my.cnf not retained; not an exact current-HEAD build)
    • Not for Release Notes

    Description

      Description

      `CREATE SERVER` applies inconsistent range validation to numeric and quoted `PORT` values. The numeric value `2147483648` is rejected as out of range, while the quoted value `'2147483648'` is accepted without a warning and stored in `mysql.servers.Port` as `2147483647`.

      The behavior was reproduced twice. The quoted boundary value `'2147483647'` is the control and is preserved without loss.

      How to Repeat

      DROP SERVER IF EXISTS port_numeric;
      DROP SERVER IF EXISTS port_quoted;
       
      CREATE SERVER port_numeric
      FOREIGN DATA WRAPPER mysql
      OPTIONS (HOST '', PORT 2147483648);
       
      CREATE SERVER port_quoted
      FOREIGN DATA WRAPPER mysql
      OPTIONS (HOST '', PORT '2147483648');
       
      SHOW COUNT(*) WARNINGS;
      SHOW WARNINGS;
      SELECT Server_name, Port
      FROM mysql.servers
      WHERE Server_name IN ('port_numeric', 'port_quoted');
      

      For the non-triggering control, repeat the quoted case with `PORT '2147483647'`.

      Actual Result

      The numeric form returns ERROR 1690: port value is out of range in 'INT'.
      The quoted form succeeds, produces zero warnings, and stores 2147483647.
      

      Expected Result

      Numeric and quoted forms should receive equivalent range validation. `'2147483648'` should be rejected rather than silently changed to a different port.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Mizuki Zhang Baoren
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.