summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
Commit message (Collapse)AuthorAgeFilesLines
* Manual merge from mysql-trunk-merge.Alexander Nozdrin2009-10-141-1/+4
|\
| * Bug #46998 mysqlbinlog can't output BEGIN even if the database is included ↵2009-09-301-1/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in a transaction The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the database is not selected by --database option of mysqlbinlog command. This can result in problem if there are some statements in the transaction are not filtered out. To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' in regardless of the database filtering rules.
| | * Bug #46998 mysqlbinlog can't output BEGIN even if the database is included ↵2009-09-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in a transaction The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the database is not selected by --database option of mysqlbinlog command. This can result in problem if there are some statements in the transaction are not filtered out. To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' in regardless of the database filtering rules.
* | | This is the downport ofVladislav Vaintroub2009-09-111-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#24509 - 2048 file descriptor limit on windows needs increasing, also WL#3049 - improved Windows I/O The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open file is stored in the my_file_info struct, along with a flag for append mode because the Windows API does not support opening files in append mode in all cases) The default max open files has been increased to 16384 and can be increased further by setting --max-open-files=<value> during the server start. Another major change in this patch that almost all Windows specific file IO code has been moved to a new file my_winfile.c, greatly reducing the amount of code in #ifdef blocks within mysys, thus improving readability. Minor enhancements: - my_(f)stat() is changed to use __stati64 structure with 64 file size and timestamps. It will return correct file size now (C runtime implementation used to report outdated information) - my_lock on Windows is prepared to handle additional timeout parameter - after review : changed __WIN__ to _WIN32 in the new and changed code.
* | Merge bug fixesJim Winstead2009-07-131-3/+4
|\ \
| * | Add usage for --base64-output=DECODE-ROWS and note that UNSPEC isJim Winstead2009-05-151-0/+3
| | | | | | | | | | | | intentionally unmentioned (it is just a placeholder). (Bug #41403)
| * | Remove out-of-date and unnecessary comment in source code about what versionsJim Winstead2009-05-151-3/+1
| | | | | | | | | | | | are supported. (Bug #42021)
* | | merge: 5.1-bt bug branch --> 5.1-bt latestLuis Soares2009-06-301-1/+55
|\ \ \
| * | | BUG#42941: --database paramater to mysqlbinlog fails with RBRLuis Soares2009-06-071-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqlbinlog --database parameter was being ignored when processing row events. As such no event filtering would take place. This patch addresses this by deploying a call to shall_skip_database when table_map_events are handled (as these contain also the name of the database). All other rows events referencing the table id for the filtered map event, will also be skipped.
* | | | Merge from 5.0Staale Smedseng2009-06-291-2/+2
|\ \ \ \ | | |_|/ | |/| |
| * | | Merge from 5.0-btStaale Smedseng2009-06-291-2/+2
| | | |
* | | | Merge in approved bug-fixesJim Winstead2009-05-121-0/+2
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/|
| * | Various command-line utilities, including mysqlbinlog and mysqldump, don'tJim Winstead2009-05-071-0/+2
| | | | | | | | | | | | handle the --skip-password option correctly. (Bug #28479)
* | | Manual merge.Alexey Kopytov2009-05-081-2/+1
|\ \ \ | |/ / |/| / | |/
| * Bug #41943: mysqlbinlog.exe crashes if --hexdump option is used Alexey Kopytov2009-05-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --hexdump option crashed mysqlbinlog when used together with the --read-from-remote-server option due to use of uninitialized memory. Since Log_event::print_header() relies on temp_buf to be initialized when the --hexdump option is present, dump_remote_log_entries() was fixed to setup temp_buf to point to the start of a binlog event as done in dump_local_log_entries(). The root cause of this bug is identical to the one for bug #17654. The latter was fixed in 5.1 and up, so this patch is backport of the patches for bug #17654 to 5.0. Only 5.0 needs a changelog entry.
* | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-9/+9
|\ \ | |/ | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
| * Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-8/+8
| | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | Additional fix for bug#31455 (rpl decoder)Alexander Barkov2008-08-211-1/+2
| | | | | | | | | | | | | | | | | | - Implementing --base64-format=decode-rows, to display SQL-alike decoded row events without their BINLOG statements. - Adding --base64-format=decode-rows into tests when calling mysqlbinlog to avoid non-deterministic results - Removing resetting of last_table_id in "RESET MASTER", which appeared to be dangerous.
* | Bug#31455 mysqlbinlog don't print user readable info about RBR events Alexander Barkov2008-08-201-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementing -v command line parameter to mysqlbinlog to decode and print row events. mysql-test/include/mysqlbinlog_row_engine.inc mysql-test/r/mysqlbinlog_row.result mysql-test/r/mysqlbinlog_row_big.result mysql-test/r/mysqlbinlog_row_innodb.result mysql-test/r/mysqlbinlog_row_myisam.result mysql-test/r/mysqlbinlog_row_trans.result mysql-test/t/mysqlbinlog_row.test mysql-test/t/mysqlbinlog_row_big.test mysql-test/t/mysqlbinlog_row_innodb.test mysql-test/t/mysqlbinlog_row_myisam.test mysql-test/t/mysqlbinlog_row_trans.test Adding tests client/Makefile.am Adding new files to symlink client/mysqlbinlog.cc Adding -v option sql/log_event.cc Impelentations of the new methods sql/log_event.h Declaration of the new methods and member sql/mysql_priv.h Adding new function prototype sql/rpl_tblmap.cc Adding pre-processor conditions sql/rpl_tblmap.h Adding pre-processor conditions sql/rpl_utility.h Adding pre-processor conditions sql/sql_base.cc Adding reset_table_id_sequence() function. sql/sql_repl.cc Resetting table_id on "RESET MASTER" .bzrignore Ignoring new symlinked files
* | Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my50-bug26294cmiller@zippy.cornsilk.net2008-04-031-1/+1
|\ \ | |/ | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my51-bug26294
| * Bug#26294: library name conflict between MySQL 4.x, 5.0 and Qt 3.3cmiller@zippy.cornsilk.net2008-04-031-1/+1
| | | | | | | | | | | | | | | | When linking with some external programs, "multiple definition of `init_time'" Rename init_time() to my_init_time() to avoid collision with other libraries (particularly libmng).
* | BUG#33247: mysqlbinlog does not clean up after itself on abnormal terminationsven@riska.(none)2008-02-081-394/+646
| | | | | | | | | | | | | | Problem: mysqlbinlog does not free memory if an error happens. Fix: binlog-processing functions do not call exit() anymore. Instead, they print an error and return an error code. Error codes are propagated all the way back to main, and all allocated memory is freed on the way.
* | Merge riska.(none):/home/sven/bk/b34355-backslash_in_path_name_under_win/5.0-rplsven@riska.(none)2008-02-061-7/+31
|\ \ | |/ | | | | into riska.(none):/home/sven/bk/b34355-backslash_in_path_name_under_win/5.1-new-rpl
| * Replace windows path separator backslash by unix path separator forwardsven@riska.(none)2008-02-061-7/+31
| | | | | | | | slash in filenames also for Create_file_log_event.
* | Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-mergemkindahl@dl145h.mysql.com2008-02-011-0/+7
|\ \ | |/ | | | | into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
| * BUG#32205 : Replaying statements from mysqlbinlog fails with a syntax error, ↵cbell/Chuck@mysql_cab_desk.2008-02-011-0/+7
| | | | | | | | | | | | | | | | replicates fine This patch adds code to convert the path for LOAD DATA INFILE events to a Unix path which is needed for running mysql client on Windows.
* | Post-merge changes.mkindahl@dl145h.mysql.com2008-01-301-2/+2
| |
* | BUG#32407: Impossible to do point-in-time recovery from older binlogsven@riska.(none)2007-12-141-22/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: it is unsafe to read base64-printed events without first reading the Format_description_log_event (FD). Currently, mysqlbinlog cannot print the FD. As a side effect, another bug has also been fixed: When mysqlbinlog --start-position=X was specified, no ROLLBACK was printed. I changed this, so that ROLLBACK is always printed. This patch does several things: - Format_description_log_event (FD) now print themselves in base64 format. - mysqlbinlog is now able to print FD events. It has three modes: --base64-output=auto Print row events in base64 output, and print FD event. The FD event is printed even if it is outside the range specified with --start-position, because it would not be safe to read row events otherwise. This is the default. --base64-output=always Like --base64-output=auto, but also print base64 output for query events. This is like the old --base64-output flag, which is also a shorthand for --base64-output=always --base64-output=never Never print base64 output, generate error if row events occur in binlog. This is useful to suppress the FD event in binlogs known not to contain row events (e.g., because BINLOG statement is unsafe, requires root privileges, is not SQL, etc) - the BINLOG statement now handles FD events correctly, by setting the thread's rli's relay log's description_event_for_exec to the loaded event. In fact, executing a BINLOG statement is almost the same as reading an event from a relay log. Before my patch, the code for this was separated (exec_relay_log_event in slave.cc executes events from the relay log, mysql_client_binlog_statement in sql_binlog.cc executes BINLOG statements). I needed to augment mysql_client_binlog_statement to do parts of what exec_relay_log_event does. Hence, I did a small refactoring and moved parts of exec_relay_log_event to a new function, which I named apply_event_and_update_pos. apply_event_and_update_pos is called both from exec_relay_log_event and from mysql_client_binlog_statement. - When a non-FD event is executed in a BINLOG statement, without previously executing a FD event in a BINLOG statement, it generates an error, because that's unsafe. I took a new error code for that: ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENTS. In order to get a decent error message containing the name of the event, I added the class method char* Log_event::get_type_str(Log_event_type type), which returns a string name for the given Log_event_type. This is just like the existing char* Log_event::get_type_str(), except it is a class method that takes the log event type as parameter. I also added PRE_GA_*_ROWS_LOG_EVENT to Log_event::get_type_str(), so that names of old rows event are properly printed. - When reading an event, I added a check that the event type is known by the current Format_description_log_event. Without this, it may crash on bad input (and I was struck by this several times). - I patched the following test cases, which all contain BINLOG statements for row events which must be preceded by BINLOG statements for FD events: - rpl_bug31076 While I was here, I fixed some small things in log_event.cc: - replaced hard-coded 4 by EVENT_TYPE_OFFSET in 3 places - replaced return by DBUG_VOID_RETURN in one place - The name of the logfile can be '-' to indicate stdin. Before my patch, the code just checked if the first character is '-'; now it does a full strcmp(). Probably, all arguments that begin with a - are already handled somewhere else as flags, but I still think it is better that the code reflects what it is supposed to do, with as little dependencies as possible on other parts of the code. If we one day implement that all command line arguments after -- are files (as most unix tools do), then we need this. I also fixed the following in slave.cc: - next_event() was declared twice, and queue_event was not static but should be static (not used outside the file).
* | Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-mainttnurnberg@sin.intern.azundris.com2007-09-151-3/+8
|\ \ | | | | | | | | | into mysql.com:/home/tnurnberg/15327/51-15327
| * | Bug #15327: configure: --with-tcp-port option being partially ignoredtnurnberg@mysql.com/sin.intern.azundris.com2007-09-151-1/+0
| | | | | | | | | | | | after merge fix :-/
| * | Merge mysql.com:/home/tnurnberg/15327/50-15327tnurnberg@sin.intern.azundris.com2007-09-151-2/+8
| |\ \ | | |/ | | | | | | into mysql.com:/home/tnurnberg/15327/51-15327
| | * Bug #15327: configure: --with-tcp-port option being partially ignoredtnurnberg@mysql.com/sin.intern.azundris.com2007-09-131-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. if they didn't configure a value, assume "use a sensible default", which will be read from /etc/services or, failing that, from the factory default. That makes the order of preference - command-line option - my.cnf, where applicable - $MYSQL_TCP_PORT environment variable - /etc/services (unless configured --with-tcp-port) - default port (--with-tcp-port=... or factory default)
* | | Fixed problem that Start_log_event_v3::created was not set properlymonty@mysql.com/narttu.mysql.fi2007-08-141-2/+2
| | | | | | | | | | | | (This is becasue 'when' is not anymore set in constructor)
* | | Merge bk-internal:/home/bk/mysql-5.1-marveldf@pippilotta.erinye.com2007-08-031-8/+39
|\ \ \ | | | | | | | | | | | | into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines
| * | | Simplify logging code a bit (to make code smaller and faster)monty@mysql.com/nosik.monty.fi2007-08-031-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved duplicated code to inline function store_timestamp() Save thd->time_zone_used when logging to table as CSV internally cases it to be changed Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables. Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping Set TABLE->no_replicate on open
| * | | Fixes Bug#30127: --debug-info no longer prints memory usage in mysqlmonty@mysql.com/nosik.monty.fi2007-08-011-7/+16
| |/ / | | | | | | | | | | | | | | | | | | Fixed compiler warnings, errors and link errors Fixed new bug on Solaris with gethrtime() Added --debug-check option to all mysql clients to print errors and memory leaks Added --debug-info to all clients. This now works as --debug-check but also prints memory and cpu usage
* | | Makefile.am:kent@mysql.com/kent-amd64.(none)2007-08-021-8/+0
|/ / | | | | | | | | | | | | | | | | Add CMakeLists.txt to source distribution CMakeLists.txt: Added missing '${MYSQLD_EXE_SUFFIX}' to "mysqld" targets new in 5.1 Manual merge from 5.0 (bug#30118) CMakeLists.txt, mysqlbinlog.cc, lib_sql.cc: No need to test on USING_CMAKE, it is the only Windows build
* | Merge bk-internal.mysql.com:/home/bk/mysql-5.1kostja@bodhi.(none)2007-06-011-43/+43
|\ \ | | | | | | | | | into bodhi.(none):/opt/local/work/mysql-5.1-runtime
| * | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* | | bug#17654 --read-from-remote-server causes coreaelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi2007-05-301-0/+1
| | | | | | | | | | | | fixing FD event issue that showed up on pb.
* | | BUG#17654 : --read-from-remote-server causes corecbell/Chuck@mysql_cab.2007-05-221-0/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects a problem encountered when reading the binlog from a remote host. The application was crashing because the buffer variable (temp_buf) in log_event was not pointing to the incoming data. For a normal file read, this buffer is allocated by a previous call of read_log_event. However, when reading from a remote host, the first call to read_log_event is not executed therefore no buffer is allocated. Furthermore, there is no need to allocate a new buffer because the incoming stream is what needs to be read. This patch adds the call to initialize the temp_buf variable if reading from a remote host. It also adds a check at destroy time to ensure the temp_buf is not freed if reading from a remote host.
* | Merge romeo.(none):/home/bkroot/mysql-5.1-rplmats@romeo.(none)2007-04-201-13/+20
|\ \ | | | | | | | | | into romeo.(none):/home/bk/merge-mysql-5.1
| * \ Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.0-marveljani@a88-113-38-195.elisa-laajakaista.fi2007-04-131-12/+17
| |\ \ | | |/ | | | | | | into a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.1-marvel
| | * Bug#27171 mysqlbinlog produces different output depends from option -Rserg@janus.mylan2007-04-101-12/+17
| | | | | | | | | | | | | | | a better fix, that works with 4.1 servers which don't send a fake Format_description_log_event.
| * | Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marveljani@ua141d10.elisa.omakaista.fi2007-04-031-5/+12
| |\ \ | | | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel
| | * \ Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marveljani@ua141d10.elisa.omakaista.fi2007-03-291-5/+12
| | |\ \ | | | |/ | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel
| | | * Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-mainjani@ua141d10.elisa.omakaista.fi2007-03-281-1/+1
| | | |\ | | | | | | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
| | | | * Fixed compiler warnings.jani@ua141d10.elisa.omakaista.fi2007-03-221-1/+1
| | | | |
| | | * | Merge sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0-buildserg@sergbook.mysql.com2007-03-231-4/+11
| | | |\ \ | | | | | | | | | | | | | | | | | | into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
| | | | * \ Merge bk-internal.mysql.com:/home/bk/mysql-5.0-marvelserg@sergbook.mysql.com2007-03-231-4/+11
| | | | |\ \ | | | | | | | | | | | | | | | | | | | | | into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0