summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-11-21 21:12:22 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-11-23 12:16:45 +0530
commit7effcb8ed6a9fd75452535490af425270d6416bf (patch)
treec796bd0157baafea1de000ad69b45de8fb87566b /mysys
parent031e1427ed9a7b939323f353c7aa037b8a74247c (diff)
downloadmariadb-git-7effcb8ed6a9fd75452535490af425270d6416bf.tar.gz
MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restore
Problem: ======== When O_TMPFILE is not supported mysqlbinlog outputs the error to standard stream as a warning which breaks PITR: 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) Analysis: ========= 'mysqlbinlog' utility is used to perform point-in-time-recovery based on binary log. It converts the events in the binary log files, from binary format to text so that they can be viewed or applied. This output can be saved to a file and it can be sourced back to mysql client. The mysqlbinlog utility stores the text output into IO_CACHE and when it is full the data is written to a temp 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 to standard error and file creation is done without O_TMPFILE' flag. If standard error is redirected to standard output the note gets written to the sql file as shown below. /bld/client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts) table id 32 When the sql file is used for PITR, it leads to a syntax error as it is not a valid sql command. Fix: ==== Make 'my_message_stderr' to ignore messages which are flagged as ME_NOTE and ME_ERROR_LOG_ONLY. ME_ERROR_LOG_ONLY flag is applicable to server. In order to print an informational note to stderr stream, ME_NOTE flag without ME_ERROR_LOG_ONLY flag should be specified. 'my_message_stderr' should print messages flagged with ME_WARNING or ME_FATAL to stderr stream.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_mess.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/my_mess.c b/mysys/my_mess.c
index 7bc4c038cb6..c9a1aee64b6 100644
--- a/mysys/my_mess.c
+++ b/mysys/my_mess.c
@@ -21,6 +21,8 @@ void my_message_stderr(uint error __attribute__((unused)),
DBUG_ENTER("my_message_stderr");
DBUG_PRINT("enter",("message: %s",str));
(void) fflush(stdout);
+ if (MyFlags & (ME_NOTE | ME_ERROR_LOG_ONLY))
+ DBUG_VOID_RETURN;
if (MyFlags & ME_BELL)
(void) fputc('\007', stderr);
if (my_progname)