Commit graph

209 commits

Author SHA1 Message Date
mats@mysql.com
f6caefef2d Bug#7853 (mysqlbinlog does not accept input from stdin)
The utility 'mysqlbinlog' now accepts input from stdin. It can 
  now be used to read the output from, e.g., 'zcat' or other utility.
2005-02-04 14:29:54 +01:00
guilhem@mysql.com
ed1696f6b9 WL#1062 "log charset info into all Query_log_event":
we store 7 bytes (1 + 2*3) in every Query_log_event.
In the future if users want binlog optimized for small size and less safe,
we could add --binlog-no-charset (and binlog-no-sql-mode etc): charset info
is something by design optional (even if for now we don't offer possibility to disable it):
it's not a binlog format change.
We try to reduce the number of get_charset() calls in the slave SQL thread to a minimum
by caching the charset read from the previous event (which will often be equal to the one of the current event).
We don't use SET ONE_SHOT for charset-aware repl (we still do for timezones, will be fixed later).
No more errors if one changes the global value of charset vars on master or slave
(as we log charset info in all Query_log_event).
Not fixing Load_log_event as it will be rewritten soon by Dmitri.
Testing how mysqlbinlog behaves in rpl_charset.test.
mysqlbinlog needs to know where charset file is (to be able to convert a charset number found
in binlog (e.g. in User_var_log_event) to a charset name); mysql-test-run needs to pass
the correct value for this option to mysqlbinlog.
Many result udpates (adding charset info into every event shifts log_pos in SHOW BINLOG EVENTS).
Roughly the same job is to be done for timezones :)
2005-02-03 16:22:16 +01:00
serg@serg.mylan
76f3d6f002 merged 2005-01-25 21:11:04 +01:00
monty@mysql.com
37168015cd Cleanups during review 2005-01-25 21:27:51 +02:00
serg@serg.mylan
c76405a7ee merged 2005-01-24 19:41:42 +01:00
serg@serg.mylan
67ba2e367a fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
guilhem@mysql.com
1cbc904c59 Changing the default of libmysqlclient : it's now NO reconnection.
All our programs which use mysql_real_connect() and mysql_connect() are updated accordingly, though I have deliberately
made mysqlimport not reconnect anymore (already true for mysqldump >= 4.1.8).
All Connector devs have been warned about the change I'm doing here - which was agreed with Monty,
and fixes BUG#2555.
2004-12-09 14:44:10 +01:00
serg@serg.mylan
2d3dd65cc1 merged 2004-11-20 18:36:41 +01:00
petr@mysql.com
edc868e397 Added --disable-log-bin option to the mysqlbinlog (WL1787) 2004-11-19 18:35:36 +03:00
brian@avenger.(none)
3e4ca194f8 Mainly resolving Guilhem's 4.1 patch to 5.0 2004-11-11 19:01:46 -08:00
lars@mysql.com
0d5290fc5c BUG#6239 V2: Since uint can be shorter than ulong on 64 bit platforms,
the comparision of "packet_len" (uint) and "len" (uint) with 
"packet_error"  (ulong) was always false.
2004-11-04 15:59:19 +01:00
monty@mysql.com
054cea4ca8 Merge with 4.0 2004-09-01 04:12:09 +03:00
ram@gw.mysql.r18.ru
b93a973b12 Added global my_getopt_error_reporter function pointer which is
used in the handle_options() function (instead of using additional 
handle_option() parameter). The default value of the 
my_getopt_error_reporter is default_reporter(). One can set it to
other functions if case of need.
2004-08-31 21:27:58 +05:00
serg@serg.mylan
b4bb38e896 merged 2004-08-26 15:19:46 +02:00
vva@eagle.mysql.r18.ru
ffacc77f22 more accurate processing of find_type result
(Bug #4998 --protocol doesn't reject bad values)
2004-08-24 20:13:31 +05:00
vva@eagle.mysql.r18.ru
237615bc53 fixed a Bug #4998 "--protocol doesn't reject bad values" 2004-08-23 20:55:09 +05:00
rburnett@build.mysql.com
67003d1c98 mysql_priv.h:
Added declarations for print_msg_to_log and vprint_msg_to_log.  sql_print_error are simple functions that wrap calls to print_msg_to_log.  Define the different error types with MY_ERROR_TYPE, MY_WARNING_TYPE, and MY_INFORMATION_TYPE
gen_lex_hash.cc:
  Added NULL error reporting parameter to handle_options
log.cc:
  Add print_msg_to_log, print_buffer_to_log, and vprint_msg_to_log.  Print_msg_to_log will write the message to the windows event log if on NT.  We now have error, warning, and information versions of sql_print_xxxx.  T his is a variation of a similar changeset WAX did.
mysqld.cc:
  Added option_error_reporter callback function and pass that into handle_options
mysql.cc:
  Added NULL as error reporter arg to the end of handle_options
Many files:
  Added NULL error reporter parameter as the last paramter to handle_options
my_getopt.c:
  Added second function pointer to server as an error reporting callback.  Added local function report_option_error that will either write the error to stderr or to the error reporting callback.  changed all calls in handle_options from fprintf(stderr, ... ) to report_option_error
my_getopt.h:
  Changed declaration of handle_options to use typedefs for the two function pointers.  added second function pointer to server as an error reporting callback
mysqld.dsp:
  Added custom build step for compiling message file and added message resource file (output of mc)
2004-08-14 03:38:37 +02:00
guilhem@mysql.com
0f3e279a05 WL#1580: --start-datetime, --stop-datetime, --start-position (alias for --position) and --stop-position
options for mysqlbinlog, with a test file.
This enables user to say "recover my database to how it was this morning at 10:30"
(mysqlbinlog "--stop-datetime=2003-07-29 10:30:00").
Using time functions into client/ made me move them out of sql/ into sql-common/.
+ (small) fix for BUG#4507 "mysqlbinlog --read-from-remote-server sometimes
cannot accept 2 binlogs" (that is, on command line).
2004-07-29 23:25:58 +02:00
guilhem@mysql.com
88e00cd919 Fixes for
BUG#4506 "mysqlbinlog --position --read-from-remote-server has wrong "# at" lines",
BUG#4553 "Multi-table DROP TABLE replicates improperly for nonexistent table" with a test file.
It was not possible to add a test for BUG#4506 as in the test suite we must use --short-form
which does not display the "# at" lines.
2004-07-17 16:58:16 +02:00
konstantin@mysql.com
f08bbd1f12 assert.h needed for my_dbug.h now is included in my_dbug.h, where it for
some reason wasn't included before.
A lot of files cleaned up from #include <assert.h>
2004-06-10 23:58:39 +04:00
monty@mysql.com
390d9898f9 merge with 4.0 to get Netware patches and fixes for libmysqld.dll 2004-05-25 22:54:00 +03:00
monty@mysql.com
f2e1e3ce4c Added patches from Novell 2004-05-25 22:00:14 +03:00
dlenev@brandersnatch.localdomain
b5b4c88455 Fix of small syntax error - added missing backslash that prevented building of mysqlbinlog. 2004-05-24 14:38:55 +04:00
guilhem@mysql.com
ce1e1f4cb6 mysqlbinlog: new option --to-last-log. This option has effect only if --read-from-remote-server.
It causes mysqlbinlog to not stop after the end of the requested binlog, and instead read
until the end of the last binlog of mysqld (beware of endless loops if you pipe this
into the same mysqld).
I.e. it enables back (at customer's request) what we considered (and I still do)
as BUG#3204, but now with an option instead of being the default behaviour.
The default behaviour is still to stop after the end of the requested binlog,
whether --read-from-remote-server or not.
2004-05-23 17:42:12 +02:00
guilhem@mysql.com
34aefdf31e Fix for BUG#3214 "mysqlbinlog --read-from-remote-server --position prints wrong positions"
I am fixing it here in 4.1, not in 4.0, as it goes with another change
which I did in 4.1 (fix for BUG#3204
""mysqlbinlog --read-from-remote-server this_binlog.001" prints all binlogs").
2004-03-18 20:53:33 +02:00
guilhem@mysql.com
32feac3093 Merge gbichot@213.136.52.20:/home/bk/mysql-4.1
into mysql.com:/home/mysql_src/mysql-4.1
2004-03-18 19:31:06 +02:00
guilhem@mysql.com
244304fdbb Fix for BUG#3204 ""mysqlbinlog --read-from-remote-server this_binlog.001" prints all binlogs":
we now detect that the server is sending us a log which we did not request
by testing the info in the fake Rotate event.
I also changed code to not print the fake Rotate which describes the
log we asked for (it's always the first received event but old masters
may not send it).
2004-03-18 19:29:07 +02:00
monty@mysql.com
350b433569 merge with 4.0 2004-03-16 22:41:30 +02:00
guilhem@mysql.com
cf94cd506f Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
2004-03-12 22:03:27 +01:00
guilhem@mysql.com
c421527dee Force mysqlbinlog to require an argument if --local-load is used
(--local-load alone means "I want files to be prepared for LOAD 
DATA INFILE, in the default temp directory", and mysqlbinlog already
does this without --local-load).
2004-03-12 22:01:29 +01:00
jani@ua72d24.elisa.omakaista.fi
2bf78563f7 Fixed error in version. 2004-03-11 20:12:16 +02:00
jani@ua72d24.elisa.omakaista.fi
3b5a46939f Small fixes. 2004-03-11 15:41:07 +02:00
jani@ua72d24.elisa.omakaista.fi
58a978b900 Fixed Bug#2491, INSERT DELAYED causes binary log unusable by mysqlbinlog (replication is ok)
Setting insert delayed threads = 0 at mysql_init_command.
2004-03-04 17:58:36 +00:00
Sinisa@sinisa.nasamreza.org
74dc9f16bb A fix for double free of memory in mysqlbinlog. 2004-02-23 14:02:32 +02:00
monty@mashka.mysql.fi
e347f63192 Max open files handling moved to my_set_max_open_files()
This ensures that my_file_info takes this the max number of files into account and one can now use --open-files-limit on windows to increase number of used files up to 2048
2004-02-19 19:33:09 +02:00
monty@mysql.com
d1d48a9dd5 Merge with 4.0 to get fix for mysqlbinlog 2004-02-16 10:15:52 +02:00
monty@mysql.com
f43093ec0e After merge fixes
Added more DBUG statements
Ensure that we are comparing end space with BINARY strings
Use 'any_db' instead of '' to mean any database. (For HANDLER command)
Only strip ' ' when comparing CHAR, not other space-like characters (like \t)
2004-02-16 10:03:25 +02:00
monty@mysql.com
fb8f27f017 Always use libtool with "--preserve-dup-deps"
Always use all LOAD DATA options in replication.
Fixed problem in mysqlbinlog where LOAD DATA options could be overwritten.
2004-02-13 16:05:09 +02:00
monty@mysql.com
ce14578909 Merge with 4.0.18 2004-02-11 00:06:46 +01:00
monty@mysql.com
079edf3313 Code cleanups 2004-02-10 12:03:08 +01:00
vva@eagle.mysql.r18.ru
0333f7b10f fixed bug #1378 "mysqlbinlog for remote host is broken" 2004-02-06 20:57:11 +04:00
monty@mysql.com
f266cdabab Portability fixes (for binary build)
Added --protocol to mysqlbinlog
2003-12-01 13:13:16 +02:00
monty@narttu.mysql.fi
4e4725377d Merge with 4.0 2003-11-04 09:40:36 +02:00
guilhem@mysql.com
c93f69e9dd Fix for Bug #1595 "mysqlbinlog can't read a password from the console".
** I already fixed it in 3.23; I fix it in 4.0 separately because the
code is a bit different (so the changeset 1.1422 of 3.23 should not be
merged here) **
Make mysqlbinlog prompt for the password if
mysqlbinlog -p
instead of printing the usage().
This makes mysqlbinlog behave like other clients.
This new code was almost copied from mysqldump.
Note that before, one could use
  mysqlbinlog -p pass
and now one must use
  mysqlbinlog -ppass
(putting a space will ask for the password).
2003-10-21 12:22:24 +02:00
monty@narttu.mysql.fi
246febee42 merge with 4.0 to get fix for mysqlbinlog 2003-10-08 12:05:27 +03:00
monty@narttu.mysql.fi
d00d9110ba Fixed test case that my last patch to mysqlbinlog broke.
Changed --remote to --read-from-remote-server (mysqlbinlog)
2003-10-08 10:23:54 +03:00
monty@narttu.mysql.fi
a278a77475 Fix for option 'R' (connect to remote server) in mysqlbinlog 2003-10-08 01:30:10 +03:00
monty@narttu.mysql.fi
1f8e38d03a Merge with 4.0 to get fix for mysqlbinlog 2003-10-07 21:41:06 +03:00
monty@narttu.mysql.fi
b82b76f480 Simple cleanups 2003-10-07 15:44:31 +03:00
monty@narttu.mysql.fi
6056cfadfc Merge with 4.0.16 2003-10-07 15:42:26 +03:00
monty@narttu.mysql.fi
89f30200bc Removed random chars after filename for LOAD DATA INFILE (in mysqlbinlog)
Add quoting for use `database` for mysqlbinlog
Removed test ins0000001
Add support for --replace for exec in mysqltest
Don't refer to install dir in mysqlbinlog.result
2003-09-29 12:31:35 +03:00
monty@narttu.mysql.fi
45a41e85e3 Code cleanup of new patches 2003-09-23 17:06:44 +03:00
dlenev@mysql.com
c4384241ec Bugfix for bug #1340, style fix before push 2003-09-19 20:34:58 +04:00
dlenev@mysql.com
3c55dbe3db Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/dlenev/src/mysql-4.0-bg-1340
2003-09-19 20:34:57 +04:00
vva@eagle.mysql.r18.ru
d623fc83b1 Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_1073/mysql-4.0
2003-09-19 12:34:56 -04:00
dlenev@mysql.com
69aed374a5 Fix for bug #1340 (More careful checks if we met proper Create_file_log_event before Append or Exec event we are processing now) 2003-09-19 16:43:56 +04:00
guilhem@mysql.com
d1cd9bd498 Fix for BUG#1258 (Trying to use the mysqlbinlog with -h and -u option gives segmentation
fault). Fix is just initializing "host" (and "user") with 0, not a string.
2003-09-12 15:48:48 +02:00
vva@eagle.mysql.r18.ru
0f1cf03905 fixed bug #1073
(Replication LOAD DATA INFILE mysqlbinlog doesn't cleanup tmp files)
2003-09-01 11:15:53 -04:00
monty@narttu.mysql.fi
77a70a0a24 merge with 4.0.15 2003-08-29 13:44:35 +03:00
guilhem@mysql.com
1a5c8be408 Fix for BUG#1096 which is:
"mysqlbinlog does not comment the original LOAD DATA INFILE if it has a "use xx""
2003-08-19 15:46:47 +02:00
guilhem@mysql.com
fefa92f3a7 Fixes for BUG#1091,1092,1093. Synopsis of these bugs:
mysqlbinlog segfaults if --position is just before Exec_load event
mysqlbinlog prints uncommented warnings if --database and compiled with debug
mysqlbinlog --database does not filter LOAD DATA INFILE
2003-08-19 15:12:44 +02:00
monty@mashka.mysql.fi
2263e3e51f Merge with 4.0.14 2003-08-11 22:44:43 +03:00
vva@eagle.mysql.r18.ru
c96c87d51d fixed bug #670 2003-07-04 16:06:17 -04:00
vva@eagle.mysql.r18.ru
da9d454cc3 Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_672/mysql-4.0
2003-07-02 17:37:23 -04:00
vva@eagle.mysql.r18.ru
55e046a807 fixed bug #672 2003-07-02 16:56:27 -04:00
vva@eagle.mysql.r18.ru
c34eec515e made error output more detailed 2003-07-01 14:00:57 -04:00
vva@eagle.mysql.r18.ru
a86d23b93a Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_671/mysql-4.0
2003-07-01 13:21:35 -04:00
vva@eagle.mysql.r18.ru
20081b6293 removed --table option (fixed Bug #671) 2003-07-01 13:17:03 -04:00
guilhem@mysql.com
e8a8b8c346 fix for BUG#691 (4.0 mysqlbinlog couldn't read 3.23 binlog).
Safe parenthesis.
2003-06-20 15:48:52 +02:00
serg@serg.mylan
9f67e10d0d consistency fix - all help texts for command-line options should end with a dot. 2003-06-13 10:59:02 +02:00
monty@mashka.mysql.fi
cb7061ebe4 merge 2003-05-22 02:57:27 +03:00
vva@eagle.mysql.r18.ru
ec247fd6af changed processing of LOAD DATA in mysqlbinlog 2003-05-20 17:03:18 -04:00
monty@narttu.mysql.fi
dd2b7918cd Merge with 4.0.13 2003-05-19 16:35:49 +03:00
gluh@gluh.mysql.r18.ru
e6fe7d1bed Task 761:'mysqlbinlog should not die when reading
unknown event'
2003-04-23 18:00:07 +05:00
monty@narttu.mysql.fi
a434bca704 Merge with 4.0 2003-03-16 19:17:54 +02:00
monty@mashka.mysql.fi
d56e2acf50 Merge to get fix for LOCK TABLES + DROP TABLE in another thread 2003-03-07 01:20:56 +02:00
Sinisa@sinisa.nasamreza.org
9034ed296b A better, but larger fix for server_id bug .. 2003-03-05 15:34:58 +02:00
bar@bar.mysql.r18.ru
37fdb93d7c Gluh asked me to do it 2003-01-31 11:41:39 +04:00
monty@mashka.mysql.fi
25c393a12e Portability fixes (for windows)
Some changes to the prepared statement protocol to make it easier to use and faster.
2003-01-21 21:07:59 +02:00
vva@eagle.mysql.r18.ru
4b5a313c1a new option --local-load in mysqlbinlog 2003-01-17 21:52:56 +04:00
monty@mashka.mysql.fi
7a70332836 Portability fix when using -DBIG_TABLES 2002-11-14 12:21:36 +02:00
monty@hundin.mysql.fi
aa4e165808 Portability fix extern "C" static -> extern "C" 2002-11-07 12:49:02 +02:00
monty@butch.
a2bdf9265f Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes. 2002-11-07 03:54:00 +02:00
lenz@mysql.com
019b5ab7b4 - backported gcc 3.0 linking fix from 4.0
- some cosmetical fixups (typos, comments)
2002-09-24 22:24:30 +02:00
monty@mashka.mysql.fi
ce4b584a85 Increased max possible max_allowed_packet to 1G
Small optimization to not do external locking of temporary MyISAM tables.
2002-09-19 17:49:41 +03:00
jcole@mugatu.spaceapes.com
969c6b876e mysqlbinlog.cc:
a few changes to test resolving
2002-09-14 11:26:40 -05:00
jcole@mugatu.spaceapes.com
1f1603ab4a mysqlbinlog.cc:
fixed typo
2002-09-14 11:12:02 -05:00
monty@mashka.mysql.fi
f3a186c905 Portability fixes.
Improve mysql-test to be more robust.
Fix that GRANT doesn't delete SSL options
Change innobase_flush_log_at_trx_commit to uint.
Don't rotate logs if we read a rotate log entry from the master.
2002-09-11 06:40:08 +03:00
monty@hundin.mysql.fi
f87efa928b Update for running gcc 3.x (mainly on HPUX)
Portability fixes for HPUX
Rename of CHECK_LOCK to IS_FREE_LOCK
Apply lower_case_table_names also to databases
Cleanup of describe code
Don't allow \ in database names
2002-06-30 18:57:21 +03:00
monty@mashka.mysql.fi
2aecdd1a91 Big code cleanup/review before 4.0.2 release.
(All commit emails since 4.0.1 checked)
This had to be done now, before the 4.1 tree changes to much, to make it easy to propagate bug fixes to the 4.1 tree.
2002-06-11 11:20:31 +03:00
jani@hynda.(none)
c961494444 Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.

Changed some exit code names and corresponding numbers.

Fixed a bug in mysqld.cc, in replication related options.

Added a global flag in my_getopt, which can be set by any program
that is using my_getopt, which tells whether the client should
print the error message itself, or whether my_getopt should do it.
The default is that my_getopt will print the error messages.
2002-05-29 15:07:30 +03:00
jani@hynda.(none)
a5ec0a90ea moved my_getopt.h under client_priv.h
Changed my_print_defaults, mysql_install, perror, resolve_stack_dump,
resolveip and pack_isam to use my_getopt.
2002-05-22 23:54:24 +03:00
jani@hynda.(none)
c66162b464 my_getopt:
- some minor bugfixes
- made code more readable
- support for printing GET_BOOL type options in my_print_variables(),
  value is either TRUE or FALSE
2002-05-22 20:45:19 +03:00
jani@hynda.(none)
c2205c75ca Changed mysqlbinlog, mysqlmanager-pwgen, mysqlmanagerc, mysqltest,
thread_test and isamchk to use my_getopt.

Fixed a bug in my_getopt.
2002-05-22 00:05:05 +03:00
monty@hundin.mysql.fi
0c5c517db6 Fixed some compilation problems in last changeset 2002-05-16 23:35:09 +03:00
sasha@mysql.sashanet.com
4bc5d43b9c mysqlbinlog bug fixed 2002-04-23 09:17:00 -06:00
monty@hundin.mysql.fi
0048a58f03 Updated benchmarks
Portability fixes.
Fixed bug in mysqlbinlog when detecting binary log version
2001-12-18 05:34:00 +02:00
monty@hundin.mysql.fi
6b02f13cf3 Removed compiler warnings.
Added new operators to be used with gcc 3.0.x
Update of query cache code.
Added semaphores for Windows (not yet in use)
Added pthread_mutex_trylock for windows.
2001-12-10 00:08:24 +02:00
monty@hundin.mysql.fi
b658662ae4 Update copyright
Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
2001-12-06 14:10:51 +02:00
sasha@mysql.sashanet.com
beaf95b09d work to enable reading 3.23 logs - not yet finished
moved fail-safe replication routines from sql_repl.cc to repl_failsafe.cc
write start event only in the first log
2001-11-10 22:24:12 -07:00
monty@hundin.mysql.fi
62c8014171 Fixed some build problems.
Fix that compressed packets and normal packets looks indentical before calling net_real_write()
(Needed for query cache)
Optimize IS NULL handling
2001-10-04 02:44:18 +03:00
monty@hundin.mysql.fi
5a14bb2a7e Integrated table->ref_primary_key into table->part_of_key
Fixed bug in UNION
2001-09-21 03:38:35 +03:00
monty@hundin.mysql.fi
7a19987805 OS2 patch 2001-09-12 23:53:31 +03:00
monty@hundin.mysql.fi
91db5836e0 Portability fixes 2001-08-30 21:16:39 +03:00
tim@white.box
f811aa44b1 Merge 2001-08-21 19:24:35 -04:00
tim@white.box
c8e078263f Portability fix in mysqlbinlog.cc (include my_pthread.h)
Clean up 'unused argument' warnings

Add extern "C" { ... } in my_pthread.h
2001-08-21 19:14:04 -04:00
monty@hundin.mysql.fi
063a1a6557 Portability fixes.
Patches required by Gemini
Fix to properly detect if there is an active transaction in InnoDB
Fix to not lock thread structure when doing automatic rollback when thread ends
Allow -O lower_case_names=0 on UNIX
2001-08-21 20:06:00 +03:00
sasha@mysql.sashanet.com
5b7da4267e Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
2001-08-11 15:27:10 -06:00
sasha@mysql.sashanet.com
681cdbbdf9 mysqlbinlog->client 2001-08-09 18:16:43 -06:00
Renamed from sql/mysqlbinlog.cc (Browse further)