1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/client/mysqlbinlog-engine.h
Kristian Nielsen fb216395ed Fix mariadb-binlog for InnoDB binlog in Windows
Do not use the dup() call from the IO-cache fd to initialize the
binlog reader, it does not work on Windows. This was probably intended
to easily open the binlog file both from a filename and from stdin.

However, reading InnoDB binlog files requires a seekable fd for
pread() anyway and access to other binlog files from their original
filename in case of OOB references, reading from stdin via a pipe eg.
does not work anyway.

So just open the binlog by name and disallow reading from stdin explicitly.

Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-09-02 23:00:14 +02:00

33 lines
1.2 KiB
C

/* Copyright (c) 2025, Kristian Nielsen.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include <stdint.h>
#include <atomic>
#include "handler_binlog_reader.h"
static constexpr uint32_t BINLOG_HEADER_PAGE_SIZE= 512;
static constexpr uint32_t BINLOG_PAGE_SIZE= ((uint32_t)1 << 14);
extern const char *INNODB_BINLOG_MAGIC;
extern handler_binlog_reader *get_binlog_reader_innodb();
extern bool open_engine_binlog(handler_binlog_reader *reader,
ulonglong start_position, const char *filename);
/* Shared functions defined in mysqlbinlog.cc */
extern void error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);