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

FLOAT DEFAULT rounded in binlog's generated CREATE TABLE; replica diverges

    XMLWordPrintable

Details

    Description

      The binary log's generated CREATE TABLE says DEFAULT 1; the replica stores a truncated value, because it actually overflows FLOAT.
      UUID converts the query to be logged in row format, triggering a show_create_table call, that's where FLOAT DEFAULT is truncated.

      --source include/have_binlog_format_mixed.inc
      --source include/master-slave.inc
      CREATE TABLE t (f FLOAT DEFAULT 1.0000001) SELECT LENGTH(UUID()) AS u;
      INSERT INTO t (u) VALUES (0);
      SELECT COUNT(*) FROM t WHERE f = 1;
      --sync_slave_with_master
      SELECT COUNT(*) FROM t WHERE f = 1;
      --connection master
      DROP TABLE t;
      --source include/rpl_end.inc
      

      Result (11.8.9):

      include/master-slave.inc
      [connection master]
      CREATE TABLE t (f FLOAT DEFAULT 1.0000001) SELECT LENGTH(UUID()) AS u;
      INSERT INTO t (u) VALUES (0);
      SELECT COUNT(*) FROM t WHERE f = 1;
      COUNT(*)
      0
      connection slave;
      SELECT COUNT(*) FROM t WHERE f = 1;
      COUNT(*)
      1
      connection master;
      DROP TABLE t;
      include/rpl_end.inc
      

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              nikitamalyavin Nikita Malyavin
              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.