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

INET6 does not accept default value under binary client charset, breaks replication

    XMLWordPrintable

Details

    Description

      SET NAMES 'binary';
      CREATE TABLE t1 (f INET6 DEFAULT '::');
      

      main 6660d0bdd7c8bdca9ec4e4e7e0f11df4e22c30f1

      SET NAMES 'binary';
      CREATE TABLE t1 (f INET6 DEFAULT '::');
      bug.446-106a 'row'                       [ fail ]
              Test ended at 2026-04-02 19:04:14
       
      CURRENT_TEST: bug.446-106a
      mysqltest: At line 2: query 'CREATE TABLE t1 (f INET6 DEFAULT '::')' failed: ER_INVALID_DEFAULT (1067): Invalid default value for 'f'
      

      I don't know if it's supposed to fail this way; but if it is, then it becomes a replication problem:

      --source include/have_binlog_format_row.inc
      --source include/master-slave.inc
       
      CREATE TABLE t1 (f INET6 DEFAULT '::');
      SET NAMES 'binary';
      CREATE TABLE t2 AS SELECT * FROM t1;
       
      --sync_slave_with_master
       
      --connection master
      DROP TABLE IF EXISTS t1, t2;
      --source include/rpl_end.inc
      

      CREATE ... SELECT works on the master, but it's written as plain CREATE into the binary log under RBR, so it fails on the slave.

      2026-04-02 19:07:06 7 [ERROR] Slave SQL: Error 'Invalid default value for 'f'' on query. Default database:
       'test'. Query: 'CREATE TABLE `t2` (
        `f` inet6 DEFAULT '::'
      )', Gtid 0-1-2, Internal MariaDB error code: 1067
      2026-04-02 19:07:06 7 [Warning] Slave: Incorrect inet6 value: '::' for column ``.``.`f` at row 0 Error_code: 1292
      2026-04-02 19:07:06 7 [Warning] Slave: Invalid default value for 'f' Error_code: 1067
      

      I've added both charset/datatypes and replication to the component list, please adjust as needed.

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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