1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-31761: mariadb-binlog prints fractional timestamp part incorrectly

Fractional part < 100000 microseconds was printed without leading zeros,
causing such timestamps to be applied incorrectly in mariadb-binlog | mysql

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2024-11-28 11:11:03 +01:00
parent 673936173f
commit daea59a81d
3 changed files with 67 additions and 2 deletions

View File

@@ -1286,3 +1286,31 @@ ERROR: Bad syntax in rewrite-db: empty FROM db
ERROR: Bad syntax in rewrite-db: empty FROM db
#
# MDEV-31761: mariadb-binlog prints fractional timestamp part incorrectly
#
SET SESSION binlog_format= MIXED;
RESET MASTER;
SET time_zone= '+02:00';
CREATE TABLE t (a INT,
b TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
set SESSION timestamp= 1689978980.012345;
INSERT INTO t (a) VALUES (1);
SELECT * from t;
a b
1 2023-07-22 00:36:20.012345
FLUSH BINARY LOGS;
SET SESSION timestamp= 1689978980.567890;
SET SESSION binlog_format= ROW;
UPDATE t SET a = 2;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
DROP TABLE t;
SELECT * FROM t;
a b
1 2023-07-22 00:36:20.012345
SELECT * FROM t;
a b
2 2023-07-22 00:36:20.567890
DROP TABLE t;
SET time_zone= default;