During the process of decoding the binary log using 'mysqlbinlog', the client
tool stores the events into an IO_CACHE and when the IO_CACHE is full its
contents are flushed into a temporary file. The temporary file creation is
attempted using 'O_TMPFILE' flag. If the underlying filesystem doesn't support
this operation, a note is printed on the standard output as shown below. It is
not an error.
MDEV-23846-10.4/bld/mysql-test$ ../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 > out.sql
|
../client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts)
|
The file creation is done without O_TMPFILE' flag, hence it doesn't alter
the binlog events. 'mysqlbinlog' tool exits gracefully. Please find the command
exit status being '0'.
MDEV-23846-10.4/bld/mysql-test$ ../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 > out.sql
|
../client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts)
|
|
MDEV-23846-10.4/bld/mysql-test$ echo $?
|
0
|
Restore operation also works fine. Please find the following test results
MariaDB [(none)]> use test;
|
Database changed
|
MariaDB [test]> create table t(f text) engine=innodb;
|
Query OK, 0 rows affected (0.020 sec)
|
MariaDB [test]> insert into t values (repeat('x',4096));
|
Query OK, 1 row affected (0.061 sec)
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 1 row affected (0.059 sec)
|
Records: 1 Duplicates: 0 Warnings: 0
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 2 rows affected (0.008 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 4 rows affected (0.009 sec)
|
Records: 4 Duplicates: 0 Warnings: 0
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 8 rows affected (0.011 sec)
|
Records: 8 Duplicates: 0 Warnings: 0
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 16 rows affected (0.020 sec)
|
Records: 16 Duplicates: 0 Warnings: 0
|
MariaDB [test]> insert into t select * from t;
|
Query OK, 32 rows affected (0.055 sec)
|
Records: 32 Duplicates: 0 Warnings: 0
|
MariaDB [test]> exit
|
Bye
|
Generate 'test.sql' file:
MDEV-23846-10.4/bld/mysql-test$ ../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 > test.sql
|
../client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts)
|
Start mysql client and drop the table 't'. Restore the test.sql file.
MariaDB [(none)]> use test;
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Database changed
|
MariaDB [test]> DROP TABLE t;
|
Query OK, 0 rows affected (0.065 sec)
|
Source 'test.sql' to mysql client.
MDEV-23846-10.4/bld/mysql-test$ ../client/mysql -uroot -S/home/sujatha/bug_repo/MDEV-23846-10.4/bld/mysql-test/var/tmp/mysqld.1.sock < test.sql
|
|
MariaDB [test]> show tables;
|
+----------------+
|
| Tables_in_test |
|
+----------------+
|
| t |
|
+----------------+
|
1 row in set (0.002 sec)
|
|
MariaDB [test]> select count(*) from t;
|
+----------+
|
| count(*) |
|
+----------+
|
| 64 |
|
+----------+
|
1 row in set (0.006 sec)
|
From support case, found the following information:
$ mysqlbinlog -u**** -p --start-position=397 --base64-output=decode-rows bin_log.000404 > /mariadb/backup/test.sql 2>&1
|
Enter password:
|
$ mysql -u**** -p < /mariadb/backup/test.sql
|
Enter password:
|
ERROR 1064 (42000) at line 382: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts)
|
Users should not use '2>&1'. With this redirection, the information displayed on screen gets written to 'test.sql'.
Since it is not a valid 'SQL' statement the above error 'ERROR 1064' is returned by mysql client.
Incorrect usage: mysqlbinlog -u**** -p --start-position=397 --base64-output=decode-rows bin_log.000404 > /mariadb/backup/test.sql 2>&1
Correct usage : mysqlbinlog -u**** -p --start-position=397 --base64-output=decode-rows bin_log.000404 > /mariadb/backup/test.sql
Hence it is not a bug.
Reproduced the issue on 10.5.
test-10.5/bld/mysql-test$ ../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 -v -v > test.sql
../client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts)
Will have to reproduce the same on lower version as well.