Sample Header Ad - 728x90

When is INDEX included in Row-Based Binary Log using "full-image"

0 votes
0 answers
42 views
## MariaDB Config ## version:
> mysql -V
mysql  Ver 15.1 Distrib 10.4.27-MariaDB, for Win64 (AMD64), source revision 0946c99e7d6f7ac9dfcf3e60dae6ae85161d5ef2
my.ini:
[mysqld]
log-bin=bin.log
log-bin-index=bin-log.index
max_binlog_size=100M
binlog_format=row
socket=mysql.sock
binlog_row_image=full (as default)
## MariaDB Tables ## I have tested more tables, but I will only include 2 of them.
CREATE TABLE use_all_in_one_btree (
  primary_key_1 int(11) NOT NULL,
  primary_key_2 varchar(128) NOT NULL,
  unique_key_1 int(11) NOT NULL,
  unique_key_2 varchar(128) NOT NULL,
  index_key_1 int(11) NOT NULL,
  index_key_2 varchar(128) NOT NULL,
  fulltext_key_1 text NOT NULL,
  fulltext_key_2 varchar(128) NOT NULL,
  PRIMARY KEY (primary_key_1,primary_key_2),
  UNIQUE KEY unique_key_1 (unique_key_1,unique_key_2),
  KEY index_key_1 (index_key_1,index_key_2),
  FULLTEXT KEY fulltext_key_1 (fulltext_key_1,fulltext_key_2)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci

CREATE TABLE use_all_in_one_hash (
  primary_key_1 int(11) NOT NULL,
  primary_key_2 varchar(128) NOT NULL,
  unique_key_1 text NOT NULL,
  unique_key_2 varchar(128) NOT NULL,
  unique_key_3 varchar(255) NOT NULL,
  fulltext_key_1 text NOT NULL,
  fulltext_key_2 varchar(128) NOT NULL,
  PRIMARY KEY (primary_key_1,primary_key_2),
  UNIQUE KEY unique_key_1 (unique_key_1,unique_key_2) USING HASH,
  UNIQUE KEY unique_key_3 (unique_key_3) USING HASH,
  FULLTEXT KEY fulltext_key_1 (fulltext_key_1,fulltext_key_2)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
## Problem ## In reality I'm reading "TABLE_MAP" event that takes place before any of row modification events, but the columns are same for both. Link to MariaDB TABLE_MAP_EVENT docs **I have edited question 16.11.2023** When I "read" changes to these tables (insert/write_row) in binlog, for example using _"mysqlbinlog"_ tool. **Table "use_all_in_one_btree" will have 8 columns**, which corresponds to the number of its physical columns.

But when it comes to **table "use_all_in_one_hash" it has 9 columns**, while it only has 7 physical columns. I presume it's caused by HASH index, both of those columns has a type 8 (LONGLONG) in binlog. tried googling and reading many pages of mysql/mariadb docs but wasn't able to find any information about it. ## Question ## How do you tell if INDEX will be part of binlog, is it every HASH index or can it happen for any other index types too? (Wasn't able to test spatial).
Asked by Jiří Žák (1 rep)
Nov 15, 2023, 08:35 PM
Last activity: Nov 16, 2023, 09:22 AM