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

mysqlbinlog --print-table-metadata is missing LF after INVALID_TYPE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6.17
    • None
    • None
    • None

    Description

      When trying to debug a different issue – mysqlbinlog --verbose stopping early – I noticed the following behaviour:

      When doing mysqlbinlog --print-table-metadata, it prints table info, like this:

      $ mysqlbinlog --print-table-metadata mariadb-bin.094672 | grep INVALID_TYPE -C50
      ...
      #240408  2:00:04 server id 1  end_log_pos 31362 CRC32 0x5450e817 	Table_map: `db`.`table` mapped to number 83867293
      # Columns(VARBINARY(93) NOT NULL,
      #         BIGINT NOT NULL,
      #         VARBINARY(120),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(120),
      #         INVALID_TYPE(12)BLOB,
      #         VARBINARY(765),
      #         LONGBLOB,
      #         LONGBLOB,
      #         LONGBLOB,
      #         BIGINT,
      #         LONGBLOB,
      #         LONGBLOB,
      #         BIT(1) NOT NULL,
      #         VARBINARY(120),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         INVALID_TYPE(12)BIT(1) NOT NULL,
      #         BIT(1) NOT NULL,
      #         BIT(1) NOT NULL,
      #         BIT(1) NOT NULL,
      #         BIT(1) NOT NULL,
      #         VARBINARY(765),
      #         BLOB,
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(765),
      #         VARBINARY(150),
      #         VARBINARY(765),
      #         LONGBLOB,
      #         VARBINARY(765),
      #         VARBINARY(180),
      #         INVALID_TYPE(12)BIT(1) NOT NULL,
      #         INVALID_TYPE(12)VARBINARY(120),
      #         VARBINARY(600),
      #         BIT(1),
      #         BIT(1) NOT NULL)
      # at 31362
      #240408  2:00:04 server id 1  end_log_pos 31913 CRC32 0xa5e6c067 	Update_rows: table id 83867293 flags: STMT_END_F
      ...
      

      Ignoring the INVALID_TYPE itself for now, the following thing stands out and is easy to fix:

      There is no line feed (LF) after the INVALID_TYPE.

      Possible fix:

      diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
      index 69f29cb09e7..d78e284b4ee 100644
      --- a/sql/log_event_client.cc
      +++ b/sql/log_event_client.cc
      @@ -3528,6 +3528,7 @@ void Table_map_log_event::print_columns(IO_CACHE *file,
           if (type_name[0] == '\0')
           {
             my_b_printf(file, "INVALID_TYPE(%d)", real_type);
      +      if (i != m_colcnt - 1) my_b_printf(file, ",\n#         ");
             continue;
           }
           my_b_printf(file, "%s", type_name);
      

      Cheers,
      Walter Doekes
      OSSO B.V.

      (edit, 2024-04-12)
      P.S. The INVALID_TYPE(12) columns were all datetime's according to mysqldump --no-data:

        `timestamp` datetime /* mariadb-5.3 */ DEFAULT NULL,
        `deleted_date` datetime /* mariadb-5.3 */ DEFAULT NULL,
        `mutation_date` datetime /* mariadb-5.3 */ DEFAULT NULL,
        `modification_date` datetime(3) /* mariadb-5.3 */ DEFAULT NULL,
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            wdoekes Walter Doekes
            Votes:
            1 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.