include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] ######## Configure ######## [connection master] include/begin_replace_combination.inc [BOTH.BINLOG_FORMAT=ROW,MIXED,STATEMENT -> GLOBAL.SLAVE_ROWS_SEARCH_ALGORITHMS=INDEX_SCAN,HASH_SCAN,TABLE_SCAN] Warnings: Warning 1287 '@@slave_rows_search_algorithms' is deprecated and will be removed in a future release. SET @old_binlog_row_image= @@SESSION.BINLOG_ROW_IMAGE; SET @old_binlog_row_value_options= @@SESSION.BINLOG_ROW_VALUE_OPTIONS; SET @@SESSION.BINLOG_ROW_IMAGE= MINIMAL; SET @@SESSION.BINLOG_ROW_VALUE_OPTIONS= PARTIAL_JSON; [connection slave] include/stop_slave_sql.inc include/begin_replace_combination.inc [BOTH.BINLOG_FORMAT=ROW,MIXED,STATEMENT -> GLOBAL.SLAVE_ROWS_SEARCH_ALGORITHMS=INDEX_SCAN,HASH_SCAN,TABLE_SCAN] Warnings: Warning 1287 '@@slave_rows_search_algorithms' is deprecated and will be removed in a future release. include/start_slave_sql.inc SET @old_binlog_row_image= @@GLOBAL.BINLOG_ROW_IMAGE; SET @old_binlog_row_value_options= @@GLOBAL.BINLOG_ROW_VALUE_OPTIONS; SET @@GLOBAL.BINLOG_ROW_IMAGE= MINIMAL; SET @@GLOBAL.BINLOG_ROW_VALUE_OPTIONS= PARTIAL_JSON; include/stop_slave.inc include/start_slave.inc ######## Initialize ######## [connection master] CREATE TABLE t (i INT, j JSON, v VARCHAR(256) AS (JSON_PRETTY(j)) VIRTUAL, s VARCHAR(256) AS (JSON_PRETTY(j)) STORED); INSERT INTO t (j) VALUES ('[{"a":"abc"},{"b":"abcd"}]'), ('{"key":[{"key":"value"},{"key":"value2"}]}'); ######## Test ######## include/sync_slave_sql_with_master.inc [connection master] include/diff_tables.inc [master:t, slave:t] UPDATE t SET j= JSON_REPLACE(j, '$[0].a',"a"); include/sync_slave_sql_with_master.inc [connection master] include/diff_tables.inc [master:t, slave:t] UPDATE t SET j= JSON_SET(j, '$.key[0]', "a"); include/sync_slave_sql_with_master.inc [connection master] include/diff_tables.inc [master:t, slave:t] UPDATE t SET j= JSON_REMOVE(j, '$.key[0].key'); include/sync_slave_sql_with_master.inc [connection master] include/diff_tables.inc [master:t, slave:t] ######## Clean up ######## DROP TABLE t; SET @@SESSION.BINLOG_ROW_VALUE_OPTIONS= @old_binlog_row_value_options; SET @@SESSION.BINLOG_ROW_IMAGE= @old_binlog_row_image; include/end_replace_combination.inc [BOTH.BINLOG_FORMAT=ROW,MIXED,STATEMENT -> GLOBAL.SLAVE_ROWS_SEARCH_ALGORITHMS=INDEX_SCAN,HASH_SCAN,TABLE_SCAN] Warnings: Warning 1287 '@@slave_rows_search_algorithms' is deprecated and will be removed in a future release. include/sync_slave_sql_with_master.inc SET @@GLOBAL.BINLOG_ROW_VALUE_OPTIONS= @old_binlog_row_value_options; SET @@GLOBAL.BINLOG_ROW_IMAGE= @old_binlog_row_image; include/stop_slave_sql.inc include/end_replace_combination.inc [BOTH.BINLOG_FORMAT=ROW,MIXED,STATEMENT -> GLOBAL.SLAVE_ROWS_SEARCH_ALGORITHMS=INDEX_SCAN,HASH_SCAN,TABLE_SCAN] Warnings: Warning 1287 '@@slave_rows_search_algorithms' is deprecated and will be removed in a future release. include/rpl_end.inc