[MDEV-31643] Replication error in UPDATE statement Created: 2023-07-07  Updated: 2023-07-07

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.6.14
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Stepan Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Hi,

With a statement like this:

                    UPDATE fields
                    INNER JOIN
                        (WITH cte (field_id, value) AS (
                            VALUES (?, ?)
                        ) SELECT * FROM cte)
                        s
                    ON fields.field_id = s.field_id
                    SET
                        fields.value = s.value
                    WHERE fields.record_id = ?

Where `field_id` is a binary(16) value (UUID).

We get a replication error on a slave:

Read Replica Replication Error - SQLError: 1366, reason: Error 'Incorrect string value: '\xBC\xC0\x00\x921J...' for column ``.`(temporary)`.`field_id` at row 1' on query...

When using MIXED or STATEMENT binlog format. ROW format works fine.
Also, MariaDB uses actual values as column names for `VALUES` temporary table (this this query we're renaming them by using `WITH cte (field_id, value)`). Could this lead to a problem if value isn't utf-8 or too large?


Generated at Thu Feb 08 10:25:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.