2006-12-31 01:02:27 +01:00
|
|
|
/* Copyright (C) 2000-2006 MySQL AB & Sasha
|
2000-10-02 05:28:21 +02:00
|
|
|
|
|
|
|
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
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2000-10-02 05:28:21 +02:00
|
|
|
|
|
|
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
#include "mysql_priv.h"
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
|
|
|
|
2007-04-12 08:58:04 +02:00
|
|
|
#include "rpl_mi.h"
|
2000-10-02 05:28:21 +02:00
|
|
|
#include "sql_repl.h"
|
|
|
|
#include "log_event.h"
|
2005-03-21 22:09:42 +01:00
|
|
|
#include "rpl_filter.h"
|
2000-10-02 06:52:36 +02:00
|
|
|
#include <my_dir.h>
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2001-06-29 02:22:29 +02:00
|
|
|
int max_binlog_dump_events = 0; // unlimited
|
2002-08-22 15:50:58 +02:00
|
|
|
my_bool opt_sporadic_binlog_dump_fail = 0;
|
2007-02-27 10:27:04 +01:00
|
|
|
#ifndef DBUG_OFF
|
2001-06-29 02:22:29 +02:00
|
|
|
static int binlog_dump_count = 0;
|
2007-02-27 10:27:04 +01:00
|
|
|
#endif
|
2001-06-29 17:55:21 +02:00
|
|
|
|
XA (not completely polished out yet)
include/my_pthread.h:
cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
test fix
mysql-test/r/ctype_ucs.result:
new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
test fix
mysql-test/r/rpl000015.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
new log event - all binlog positions are changed :(
mysys/hash.c:
typo fixed
sql/ha_berkeley.cc:
handlerton framework
sql/ha_berkeley.h:
handlerton framework
sql/ha_innodb.cc:
handlerton framework
sql/ha_innodb.h:
handlerton framework
sql/handler.cc:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
XA commands
sql/log.cc:
new transaction handling, handlerton framework, two-phase commit,
XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
Xid_log_event
sql/log_event.h:
Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
wrapper for query_id++
sql/mysqld.cc:
new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
init/stop tc logging
sql/set_var.h:
warning fixed
sql/share/errmsg.txt:
XA error messages
sql/sp_head.cc:
s/query_id++/next_query_id()/
sql/sql_base.cc:
typo fixed. new transaction handling.
sql/sql_class.cc:
cleanup of THD.transaction
sql/sql_class.h:
TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
comments
sql/sql_lex.cc:
s/found_colon/found_semicolon/
sql/sql_lex.h:
SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
two functions moved to log.cc
sql/sql_repl.h:
two functions moved to log.cc
sql/sql_trigger.cc:
s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
XA commands, cleanup
2005-01-16 13:16:23 +01:00
|
|
|
/*
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
fake_rotate_event() builds a fake (=which does not exist physically in any
|
|
|
|
binlog) Rotate event, which contains the name of the binlog we are going to
|
|
|
|
send to the slave (because the slave may not know it if it just asked for
|
|
|
|
MASTER_LOG_FILE='', MASTER_LOG_POS=4).
|
2005-02-09 20:04:28 +01:00
|
|
|
< 4.0.14, fake_rotate_event() was called only if the requested pos was 4.
|
|
|
|
After this version we always call it, so that a 3.23.58 slave can rely on
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
it to detect if the master is 4.0 (and stop) (the _fake_ Rotate event has
|
|
|
|
zeros in the good positions which, by chance, make it possible for the 3.23
|
|
|
|
slave to detect that this event is unexpected) (this is luck which happens
|
|
|
|
because the master and slave disagree on the size of the header of
|
|
|
|
Log_event).
|
2005-02-09 20:04:28 +01:00
|
|
|
|
|
|
|
Relying on the event length of the Rotate event instead of these
|
|
|
|
well-placed zeros was not possible as Rotate events have a variable-length
|
|
|
|
part.
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
|
|
|
|
2001-01-17 13:47:33 +01:00
|
|
|
static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
|
2005-02-17 13:52:16 +01:00
|
|
|
ulonglong position, const char** errmsg)
|
2001-01-17 13:47:33 +01:00
|
|
|
{
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
DBUG_ENTER("fake_rotate_event");
|
2005-02-09 20:04:28 +01:00
|
|
|
char header[LOG_EVENT_HEADER_LEN], buf[ROTATE_HEADER_LEN+100];
|
|
|
|
/*
|
|
|
|
'when' (the timestamp) is set to 0 so that slave could distinguish between
|
|
|
|
real and fake Rotate events (if necessary)
|
|
|
|
*/
|
|
|
|
memset(header, 0, 4);
|
2001-01-17 13:47:33 +01:00
|
|
|
header[EVENT_TYPE_OFFSET] = ROTATE_EVENT;
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
char* p = log_file_name+dirname_length(log_file_name);
|
2001-01-17 13:47:33 +01:00
|
|
|
uint ident_len = (uint) strlen(p);
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
ulong event_len = ident_len + LOG_EVENT_HEADER_LEN + ROTATE_HEADER_LEN;
|
2001-06-19 23:03:48 +02:00
|
|
|
int4store(header + SERVER_ID_OFFSET, server_id);
|
2001-01-17 13:47:33 +01:00
|
|
|
int4store(header + EVENT_LEN_OFFSET, event_len);
|
2008-09-28 09:34:25 +02:00
|
|
|
int2store(header + FLAGS_OFFSET, LOG_EVENT_ARTIFICIAL_F);
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
// TODO: check what problems this may cause and fix them
|
|
|
|
int4store(header + LOG_POS_OFFSET, 0);
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2001-01-17 13:47:33 +01:00
|
|
|
packet->append(header, sizeof(header));
|
2003-06-22 14:10:46 +02:00
|
|
|
int8store(buf+R_POS_OFFSET,position);
|
2001-06-27 01:02:33 +02:00
|
|
|
packet->append(buf, ROTATE_HEADER_LEN);
|
2001-01-17 13:47:33 +01:00
|
|
|
packet->append(p,ident_len);
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
|
2001-07-10 14:53:08 +02:00
|
|
|
{
|
|
|
|
*errmsg = "failed on my_net_write()";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
DBUG_RETURN(-1);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
DBUG_RETURN(0);
|
2001-01-17 13:47:33 +01:00
|
|
|
}
|
|
|
|
|
2000-10-02 05:28:21 +02:00
|
|
|
static int send_file(THD *thd)
|
|
|
|
{
|
|
|
|
NET* net = &thd->net;
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
int fd = -1, error = 1;
|
|
|
|
size_t bytes;
|
2000-10-02 05:28:21 +02:00
|
|
|
char fname[FN_REFLEN+1];
|
|
|
|
const char *errmsg = 0;
|
2000-12-15 01:43:13 +01:00
|
|
|
int old_timeout;
|
2005-06-03 11:16:37 +02:00
|
|
|
unsigned long packet_len;
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar buf[IO_SIZE]; // It's safe to alloc this
|
2000-10-02 05:28:21 +02:00
|
|
|
DBUG_ENTER("send_file");
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
The client might be slow loading the data, give him wait_timeout to do
|
|
|
|
the job
|
|
|
|
*/
|
2007-01-29 14:31:48 +01:00
|
|
|
old_timeout= net->read_timeout;
|
2007-05-24 11:21:27 +02:00
|
|
|
my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
|
2002-07-23 17:31:22 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
We need net_flush here because the client will not know it needs to send
|
|
|
|
us the file name until it has processed the load event entry
|
|
|
|
*/
|
2000-12-11 21:09:01 +01:00
|
|
|
if (net_flush(net) || (packet_len = my_net_read(net)) == packet_error)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
errmsg = "while reading file name";
|
2000-10-02 05:28:21 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
// terminate with \0 for fn_format
|
|
|
|
*((char*)net->read_pos + packet_len) = 0;
|
|
|
|
fn_format(fname, (char*) net->read_pos + 1, "", "", 4);
|
2000-10-02 05:28:21 +02:00
|
|
|
// this is needed to make replicate-ignore-db
|
|
|
|
if (!strcmp(fname,"/dev/null"))
|
|
|
|
goto end;
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if ((fd = my_open(fname, O_RDONLY, MYF(0))) < 0)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
errmsg = "on open of file";
|
2000-10-02 05:28:21 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
while ((long) (bytes= my_read(fd, buf, IO_SIZE, MYF(0))) > 0)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
|
|
|
if (my_net_write(net, buf, bytes))
|
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
errmsg = "while writing data to client";
|
2000-10-02 05:28:21 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
end:
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
if (my_net_write(net, (uchar*) "", 0) || net_flush(net) ||
|
2000-10-02 05:28:21 +02:00
|
|
|
(my_net_read(net) == packet_error))
|
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
errmsg = "while negotiating file transfer close";
|
2000-10-02 05:28:21 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
error = 0;
|
|
|
|
|
|
|
|
err:
|
2007-05-24 11:21:27 +02:00
|
|
|
my_net_set_read_timeout(net, old_timeout);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (fd >= 0)
|
|
|
|
(void) my_close(fd, MYF(0));
|
2000-10-02 05:28:21 +02:00
|
|
|
if (errmsg)
|
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
sql_print_error("Failed in send_file() %s", errmsg);
|
2009-06-29 15:17:01 +02:00
|
|
|
DBUG_PRINT("error", ("%s", errmsg));
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
DBUG_RETURN(error);
|
|
|
|
}
|
|
|
|
|
2000-11-15 22:00:06 +01:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
Adjust the position pointer in the binary log file for all running slaves
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
adjust_linfo_offsets()
|
|
|
|
purge_offset Number of bytes removed from start of log index file
|
|
|
|
|
|
|
|
NOTES
|
|
|
|
- This is called when doing a PURGE when we delete lines from the
|
|
|
|
index log file
|
|
|
|
|
|
|
|
REQUIREMENTS
|
|
|
|
- Before calling this function, we have to ensure that no threads are
|
|
|
|
using any binary log file before purge_offset.a
|
|
|
|
|
|
|
|
TODO
|
|
|
|
- Inform the slave threads that they should sync the position
|
|
|
|
in the binary log file with flush_relay_log_info.
|
|
|
|
Now they sync is done for next read.
|
|
|
|
*/
|
|
|
|
|
2000-10-27 06:11:55 +02:00
|
|
|
void adjust_linfo_offsets(my_off_t purge_offset)
|
|
|
|
{
|
|
|
|
THD *tmp;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2000-10-27 06:11:55 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
I_List_iterator<THD> it(threads);
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
while ((tmp=it++))
|
|
|
|
{
|
|
|
|
LOG_INFO* linfo;
|
|
|
|
if ((linfo = tmp->current_linfo))
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&linfo->lock);
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
Index file offset can be less that purge offset only if
|
|
|
|
we just started reading the index file. In that case
|
|
|
|
we have nothing to adjust
|
2001-07-11 02:08:37 +02:00
|
|
|
*/
|
2001-07-10 14:53:08 +02:00
|
|
|
if (linfo->index_file_offset < purge_offset)
|
|
|
|
linfo->fatal = (linfo->index_file_offset != 0);
|
|
|
|
else
|
|
|
|
linfo->index_file_offset -= purge_offset;
|
|
|
|
pthread_mutex_unlock(&linfo->lock);
|
|
|
|
}
|
|
|
|
}
|
2000-10-27 06:11:55 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
|
|
|
}
|
|
|
|
|
2000-11-15 23:24:11 +01:00
|
|
|
|
2000-10-27 06:11:55 +02:00
|
|
|
bool log_in_use(const char* log_name)
|
|
|
|
{
|
2009-02-10 23:47:54 +01:00
|
|
|
size_t log_name_len = strlen(log_name) + 1;
|
2000-10-27 06:11:55 +02:00
|
|
|
THD *tmp;
|
|
|
|
bool result = 0;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2000-10-27 06:11:55 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
I_List_iterator<THD> it(threads);
|
2001-07-10 14:53:08 +02:00
|
|
|
|
|
|
|
while ((tmp=it++))
|
|
|
|
{
|
|
|
|
LOG_INFO* linfo;
|
|
|
|
if ((linfo = tmp->current_linfo))
|
2000-10-27 06:11:55 +02:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
pthread_mutex_lock(&linfo->lock);
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
result = !bcmp((uchar*) log_name, (uchar*) linfo->log_file_name,
|
|
|
|
log_name_len);
|
2001-07-10 14:53:08 +02:00
|
|
|
pthread_mutex_unlock(&linfo->lock);
|
2002-08-22 15:50:58 +02:00
|
|
|
if (result)
|
|
|
|
break;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
}
|
2000-10-27 06:11:55 +02:00
|
|
|
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2004-10-20 03:04:37 +02:00
|
|
|
bool purge_error_message(THD* thd, int res)
|
2000-10-27 06:11:55 +02:00
|
|
|
{
|
2004-10-20 03:04:37 +02:00
|
|
|
uint errmsg= 0;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2003-08-11 21:44:43 +02:00
|
|
|
switch (res) {
|
2001-07-10 14:53:08 +02:00
|
|
|
case 0: break;
|
2004-10-20 03:04:37 +02:00
|
|
|
case LOG_INFO_EOF: errmsg= ER_UNKNOWN_TARGET_BINLOG; break;
|
|
|
|
case LOG_INFO_IO: errmsg= ER_IO_ERR_LOG_INDEX_READ; break;
|
|
|
|
case LOG_INFO_INVALID:errmsg= ER_BINLOG_PURGE_PROHIBITED; break;
|
|
|
|
case LOG_INFO_SEEK: errmsg= ER_FSEEK_FAIL; break;
|
|
|
|
case LOG_INFO_MEM: errmsg= ER_OUT_OF_RESOURCES; break;
|
|
|
|
case LOG_INFO_FATAL: errmsg= ER_BINLOG_PURGE_FATAL_ERR; break;
|
|
|
|
case LOG_INFO_IN_USE: errmsg= ER_LOG_IN_USE; break;
|
2006-10-13 06:48:05 +02:00
|
|
|
case LOG_INFO_EMFILE: errmsg= ER_BINLOG_PURGE_EMFILE; break;
|
2004-10-20 03:04:37 +02:00
|
|
|
default: errmsg= ER_LOG_PURGE_UNKNOWN_ERR; break;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (errmsg)
|
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(errmsg, ER(errmsg), MYF(0));
|
2004-10-20 03:04:37 +02:00
|
|
|
return TRUE;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2004-10-20 03:04:37 +02:00
|
|
|
return FALSE;
|
2000-10-27 06:11:55 +02:00
|
|
|
}
|
|
|
|
|
2003-08-11 21:44:43 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a PURGE BINARY LOGS TO <log> command.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@param to_log Name of the last log to purge.
|
|
|
|
|
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE failure
|
|
|
|
*/
|
2004-10-20 03:04:37 +02:00
|
|
|
bool purge_master_logs(THD* thd, const char* to_log)
|
2003-02-16 17:39:12 +01:00
|
|
|
{
|
|
|
|
char search_file_name[FN_REFLEN];
|
2003-08-11 21:44:43 +02:00
|
|
|
if (!mysql_bin_log.is_open())
|
|
|
|
{
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2004-10-20 03:04:37 +02:00
|
|
|
return FALSE;
|
2003-08-11 21:44:43 +02:00
|
|
|
}
|
2003-02-16 17:39:12 +01:00
|
|
|
|
|
|
|
mysql_bin_log.make_log_name(search_file_name, to_log);
|
2003-08-11 21:44:43 +02:00
|
|
|
return purge_error_message(thd,
|
|
|
|
mysql_bin_log.purge_logs(search_file_name, 0, 1,
|
2003-08-18 23:08:08 +02:00
|
|
|
1, NULL));
|
2003-02-16 17:39:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a PURGE BINARY LOGS BEFORE <date> command.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@param purge_time Date before which logs should be purged.
|
|
|
|
|
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE failure
|
|
|
|
*/
|
2004-10-20 03:04:37 +02:00
|
|
|
bool purge_master_logs_before_date(THD* thd, time_t purge_time)
|
2003-02-16 17:39:12 +01:00
|
|
|
{
|
2004-09-14 14:30:57 +02:00
|
|
|
if (!mysql_bin_log.is_open())
|
|
|
|
{
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2004-09-14 14:30:57 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return purge_error_message(thd,
|
|
|
|
mysql_bin_log.purge_logs_before_date(purge_time));
|
2003-02-16 17:39:12 +01:00
|
|
|
}
|
|
|
|
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
int test_for_non_eof_log_read_errors(int error, const char **errmsg)
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
{
|
2005-02-09 20:04:28 +01:00
|
|
|
if (error == LOG_READ_EOF)
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
return 0;
|
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
|
|
|
switch (error) {
|
|
|
|
case LOG_READ_BOGUS:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "bogus data in log event";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
break;
|
|
|
|
case LOG_READ_TOO_LARGE:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "log event entry exceeded max_allowed_packet; \
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
Increase max_allowed_packet on master";
|
|
|
|
break;
|
|
|
|
case LOG_READ_IO:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "I/O error reading log event";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
break;
|
|
|
|
case LOG_READ_MEM:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "memory allocation failed reading log event";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
break;
|
|
|
|
case LOG_READ_TRUNC:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "binlog truncated in the middle of event";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
break;
|
|
|
|
default:
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
*errmsg = "unknown error reading log event on the master";
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-21 21:04:22 +02:00
|
|
|
/*
|
|
|
|
TODO: Clean up loop to only have one call to send_file()
|
|
|
|
*/
|
2000-11-15 23:24:11 +01:00
|
|
|
|
2002-08-21 21:04:22 +02:00
|
|
|
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
|
|
|
|
ushort flags)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
|
|
|
LOG_INFO linfo;
|
|
|
|
char *log_file_name = linfo.log_file_name;
|
2002-08-08 02:12:02 +02:00
|
|
|
char search_file_name[FN_REFLEN], *name;
|
2000-11-15 22:00:06 +01:00
|
|
|
IO_CACHE log;
|
|
|
|
File file = -1;
|
2000-10-02 05:28:21 +02:00
|
|
|
String* packet = &thd->packet;
|
|
|
|
int error;
|
|
|
|
const char *errmsg = "Unknown error";
|
|
|
|
NET* net = &thd->net;
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
pthread_mutex_t *log_lock;
|
2005-02-17 13:52:16 +01:00
|
|
|
bool binlog_can_be_corrupted= FALSE;
|
2001-06-29 02:22:29 +02:00
|
|
|
#ifndef DBUG_OFF
|
|
|
|
int left_events = max_binlog_dump_events;
|
2001-07-10 14:53:08 +02:00
|
|
|
#endif
|
2000-10-02 05:28:21 +02:00
|
|
|
DBUG_ENTER("mysql_binlog_send");
|
2002-08-21 21:04:22 +02:00
|
|
|
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
|
|
|
|
|
2001-07-11 04:35:42 +02:00
|
|
|
bzero((char*) &log,sizeof(log));
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2001-06-29 03:17:04 +02:00
|
|
|
#ifndef DBUG_OFF
|
2001-06-29 02:22:29 +02:00
|
|
|
if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2))
|
|
|
|
{
|
|
|
|
errmsg = "Master failed COM_BINLOG_DUMP to test if slave can recover";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2001-06-29 02:22:29 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
#endif
|
2001-06-29 02:22:29 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (!mysql_bin_log.is_open())
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
errmsg = "Binary log is not open";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
if (!server_id_supplied)
|
|
|
|
{
|
|
|
|
errmsg = "Misconfigured master - server id was not set";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2001-07-10 14:53:08 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
name=search_file_name;
|
2000-11-15 22:00:06 +01:00
|
|
|
if (log_ident[0])
|
2000-10-02 05:28:21 +02:00
|
|
|
mysql_bin_log.make_log_name(search_file_name, log_ident);
|
|
|
|
else
|
2002-08-08 02:12:02 +02:00
|
|
|
name=0; // Find first log
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2000-10-27 06:11:55 +02:00
|
|
|
linfo.index_file_offset = 0;
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2002-08-22 15:50:58 +02:00
|
|
|
if (mysql_bin_log.find_log_pos(&linfo, name, 1))
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
2002-08-08 02:12:02 +02:00
|
|
|
errmsg = "Could not find first log file name in binary log index file";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2007-10-03 11:57:14 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
thd->current_linfo = &linfo;
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
|
|
|
|
2001-04-25 01:39:26 +02:00
|
|
|
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
|
2002-08-21 21:04:22 +02:00
|
|
|
{
|
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
2002-08-21 21:04:22 +02:00
|
|
|
}
|
|
|
|
if (pos < BIN_LOG_HEADER_SIZE || pos > my_b_filelength(&log))
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
2002-06-08 20:02:01 +02:00
|
|
|
errmsg= "Client requested master to start replication from \
|
2001-06-21 21:19:24 +02:00
|
|
|
impossible position";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
We need to start a packet with something other than 255
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
to distinguish it from error
|
2002-08-08 02:12:02 +02:00
|
|
|
*/
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
packet->set("\0", 1, &my_charset_bin); /* This is the start of a new packet */
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2003-06-21 18:10:59 +02:00
|
|
|
/*
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
Tell the client about the log name with a fake Rotate event;
|
2005-02-09 20:04:28 +01:00
|
|
|
this is needed even if we also send a Format_description_log_event
|
|
|
|
just after, because that event does not contain the binlog's name.
|
|
|
|
Note that as this Rotate event is sent before
|
|
|
|
Format_description_log_event, the slave cannot have any info to
|
|
|
|
understand this event's format, so the header len of
|
|
|
|
Rotate_log_event is FROZEN (so in 5.0 it will have a header shorter
|
|
|
|
than other events except FORMAT_DESCRIPTION_EVENT).
|
|
|
|
Before 4.0.14 we called fake_rotate_event below only if (pos ==
|
|
|
|
BIN_LOG_HEADER_SIZE), because if this is false then the slave
|
2003-06-21 18:10:59 +02:00
|
|
|
already knows the binlog's name.
|
2005-02-09 20:04:28 +01:00
|
|
|
Since, we always call fake_rotate_event; if the slave already knew
|
|
|
|
the log's name (ex: CHANGE MASTER TO MASTER_LOG_FILE=...) this is
|
|
|
|
useless but does not harm much. It is nice for 3.23 (>=.58) slaves
|
|
|
|
which test Rotate events to see if the master is 4.0 (then they
|
|
|
|
choose to stop because they can't replicate 4.0); by always calling
|
|
|
|
fake_rotate_event we are sure that 3.23.58 and newer will detect the
|
|
|
|
problem as soon as replication starts (BUG#198).
|
2003-06-21 18:10:59 +02:00
|
|
|
Always calling fake_rotate_event makes sending of normal
|
2005-02-09 20:04:28 +01:00
|
|
|
(=from-binlog) Rotate events a priori unneeded, but it is not so
|
|
|
|
simple: the 2 Rotate events are not equivalent, the normal one is
|
|
|
|
before the Stop event, the fake one is after. If we don't send the
|
|
|
|
normal one, then the Stop event will be interpreted (by existing 4.0
|
|
|
|
slaves) as "the master stopped", which is wrong. So for safety,
|
|
|
|
given that we want minimum modification of 4.0, we send the normal
|
|
|
|
and fake Rotates.
|
2003-06-21 18:10:59 +02:00
|
|
|
*/
|
2005-02-17 13:52:16 +01:00
|
|
|
if (fake_rotate_event(net, packet, log_file_name, pos, &errmsg))
|
2001-01-22 03:46:32 +01:00
|
|
|
{
|
2005-02-09 20:04:28 +01:00
|
|
|
/*
|
|
|
|
This error code is not perfect, as fake_rotate_event() does not
|
|
|
|
read anything from the binlog; if it fails it's because of an
|
|
|
|
error in my_net_write(), fortunately it will say so in errmsg.
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
2003-06-21 18:10:59 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
|
|
|
goto err;
|
2001-01-22 03:46:32 +01:00
|
|
|
}
|
2003-08-11 21:44:43 +02:00
|
|
|
packet->set("\0", 1, &my_charset_bin);
|
2006-11-12 19:01:58 +01:00
|
|
|
/*
|
|
|
|
Adding MAX_LOG_EVENT_HEADER_LEN, since a binlog event can become
|
|
|
|
this larger than the corresponding packet (query) sent
|
|
|
|
from client to master.
|
|
|
|
*/
|
BUG#19402 SQL close to the size of the max_allowed_packet fails on the slave
A communication packet can also be a binlog event sent from the master to the slave.
To be sent by master dump and accepted by slave io thread both have to have
the value of max_allowed_packet bigger than one that client connection had.
In the patch there is the MAX possible replicatio header size estimation for events
in binlog that embedded user query. Only these events of query_log_event type, i.e
just plain queries, require attention.
sql/log_event.h:
MAX value of the header of the replication packet, i.e the value of exceeding
the query string part.
sql/slave.cc:
Private value of max allowed packet slave io, sql threads can accept from master.
The value is increased by the MAX possible size of replication event header.
Note, that my_net_init is redundant for slave io because the thread uses instance of
NET struct, embedded into MYSQL, as a client to server. We have left old code and even
increment, redundantly as well, thd->net.max_packet_size just for the sake of
consistency. TODO: eliminate my_net_init from execution path of slave io.
sql/sql_repl.cc:
Increasing the private max allowed packet that the dump thread reads from master
binlog and sends to net. Note, that happened prior this writting to binlog is
safe from the current artifact because it is done by steps that each chunk can not
exceed @@global.max_allowed_packet.
mysql-test/r/rpl_packet.result:
BitKeeper file /home/elkin/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/r/rpl_packet.result
mysql-test/t/rpl_packet-master.opt:
BitKeeper file /net/koti/usr_rh9/home/elkin.rh9/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/t/rpl_packet-master.opt
mysql-test/t/rpl_packet-slave.opt:
BitKeeper file /net/koti/usr_rh9/home/elkin.rh9/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/t/rpl_packet-slave.opt
mysql-test/t/rpl_packet.test:
test examines repliation of a max-sized query when database name is set to have
NAME_LEN bytes. This makes replication header size the maximum.
2006-09-11 23:19:05 +02:00
|
|
|
thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
|
2001-01-17 13:47:33 +01:00
|
|
|
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/*
|
2005-02-09 20:04:28 +01:00
|
|
|
We can set log_lock now, it does not move (it's a member of
|
|
|
|
mysql_bin_log, and it's already inited, and it will be destroyed
|
|
|
|
only at shutdown).
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
2005-02-09 20:04:28 +01:00
|
|
|
log_lock = mysql_bin_log.get_log_lock();
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
if (pos > BIN_LOG_HEADER_SIZE)
|
2005-02-09 20:04:28 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
Try to find a Format_description_log_event at the beginning of
|
|
|
|
the binlog
|
|
|
|
*/
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
if (!(error = Log_event::read_log_event(&log, packet, log_lock)))
|
|
|
|
{
|
|
|
|
/*
|
2005-02-09 20:04:28 +01:00
|
|
|
The packet has offsets equal to the normal offsets in a binlog
|
|
|
|
event +1 (the first character is \0).
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
|
|
|
DBUG_PRINT("info",
|
|
|
|
("Looked for a Format_description_log_event, found event type %d",
|
|
|
|
(*packet)[EVENT_TYPE_OFFSET+1]));
|
|
|
|
if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
|
|
|
|
{
|
2005-02-21 13:47:57 +01:00
|
|
|
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
|
|
|
|
LOG_EVENT_BINLOG_IN_USE_F);
|
2005-03-14 17:53:24 +01:00
|
|
|
(*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F;
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/*
|
|
|
|
mark that this event with "log_pos=0", so the slave
|
|
|
|
should not increment master's binlog position
|
|
|
|
(rli->group_master_log_pos)
|
|
|
|
*/
|
2005-02-21 13:47:57 +01:00
|
|
|
int4store((char*) packet->ptr()+LOG_POS_OFFSET+1, 0);
|
2006-04-07 19:44:37 +02:00
|
|
|
/*
|
|
|
|
if reconnect master sends FD event with `created' as 0
|
|
|
|
to avoid destroying temp tables.
|
|
|
|
*/
|
|
|
|
int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+
|
|
|
|
ST_CREATED_OFFSET+1, (ulong) 0);
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/* send it */
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
{
|
|
|
|
errmsg = "Failed on my_net_write()";
|
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
|
|
|
goto err;
|
|
|
|
}
|
Many files:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/mysqld.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/set_var.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/sql_repl.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
2005-04-20 18:27:46 +02:00
|
|
|
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/*
|
2005-02-09 20:04:28 +01:00
|
|
|
No need to save this event. We are only doing simple reads
|
|
|
|
(no real parsing of the events) so we don't need it. And so
|
|
|
|
we don't need the artificial Format_description_log_event of
|
|
|
|
3.23&4.x.
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2005-02-21 13:47:57 +01:00
|
|
|
{
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
if (test_for_non_eof_log_read_errors(error, &errmsg))
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
goto err;
|
2005-02-21 13:47:57 +01:00
|
|
|
/*
|
|
|
|
It's EOF, nothing to do, go on reading next events, the
|
|
|
|
Format_description_log_event will be found naturally if it is written.
|
|
|
|
*/
|
|
|
|
}
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/* reset the packet as we wrote to it in any case */
|
|
|
|
packet->set("\0", 1, &my_charset_bin);
|
2005-02-21 13:47:57 +01:00
|
|
|
} /* end of if (pos > BIN_LOG_HEADER_SIZE); */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* The Format_description_log_event event will be found naturally. */
|
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
/* seek to the requested position, to start the requested dump */
|
|
|
|
my_b_seek(&log, pos); // Seek will done on next read
|
|
|
|
|
2001-01-22 03:46:32 +01:00
|
|
|
while (!net->error && net->vio != 0 && !thd->killed)
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
|
|
|
|
{
|
2001-06-29 02:22:29 +02:00
|
|
|
#ifndef DBUG_OFF
|
2001-07-10 14:53:08 +02:00
|
|
|
if (max_binlog_dump_events && !left_events--)
|
2001-06-29 02:22:29 +02:00
|
|
|
{
|
|
|
|
net_flush(net);
|
|
|
|
errmsg = "Debugging binlog dump abort";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2001-06-29 02:22:29 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
#endif
|
2005-02-09 20:04:28 +01:00
|
|
|
|
|
|
|
if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
|
2005-03-14 17:53:24 +01:00
|
|
|
{
|
2005-02-21 13:47:57 +01:00
|
|
|
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
|
|
|
|
LOG_EVENT_BINLOG_IN_USE_F);
|
2005-03-14 17:53:24 +01:00
|
|
|
(*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F;
|
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
|
|
|
|
binlog_can_be_corrupted= FALSE;
|
|
|
|
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
errmsg = "Failed on my_net_write()";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
Many files:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/mysqld.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/set_var.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/sql_repl.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
2005-04-20 18:27:46 +02:00
|
|
|
|
2000-11-15 22:00:06 +01:00
|
|
|
DBUG_PRINT("info", ("log event code %d",
|
|
|
|
(*packet)[LOG_EVENT_OFFSET+1] ));
|
2001-01-22 03:46:32 +01:00
|
|
|
if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
if (send_file(thd))
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2000-11-15 22:00:06 +01:00
|
|
|
errmsg = "failed in send_file()";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2000-10-02 05:28:21 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2000-11-15 22:00:06 +01:00
|
|
|
}
|
2003-03-18 08:34:19 +01:00
|
|
|
packet->set("\0", 1, &my_charset_bin);
|
2000-11-15 22:00:06 +01:00
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
here we were reading binlog that was not closed properly (as a result
|
|
|
|
of a crash ?). treat any corruption as EOF
|
|
|
|
*/
|
|
|
|
if (binlog_can_be_corrupted && error != LOG_READ_MEM)
|
|
|
|
error=LOG_READ_EOF;
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
TODO: now that we are logging the offset, check to make sure
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
the recorded offset and the actual match.
|
2005-02-09 20:04:28 +01:00
|
|
|
Guilhem 2003-06: this is not true if this master is a slave
|
|
|
|
<4.0.15 running with --log-slave-updates, because then log_pos may
|
|
|
|
be the offset in the-master-of-this-master's binlog.
|
2002-08-08 02:12:02 +02:00
|
|
|
*/
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
if (test_for_non_eof_log_read_errors(error, &errmsg))
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
|
2005-11-14 14:01:10 +01:00
|
|
|
mysql_bin_log.is_active(log_file_name))
|
2001-07-10 14:53:08 +02:00
|
|
|
{
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
Block until there is more data in the log
|
|
|
|
*/
|
2001-07-10 14:53:08 +02:00
|
|
|
if (net_flush(net))
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
errmsg = "failed on net_flush()";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
We may have missed the update broadcast from the log
|
|
|
|
that has just happened, let's try to catch it if it did.
|
|
|
|
If we did not miss anything, we just wait for other threads
|
|
|
|
to signal us.
|
|
|
|
*/
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
log.error=0;
|
|
|
|
bool read_packet = 0, fatal_error = 0;
|
|
|
|
|
2001-06-29 02:22:29 +02:00
|
|
|
#ifndef DBUG_OFF
|
2001-07-10 14:53:08 +02:00
|
|
|
if (max_binlog_dump_events && !left_events--)
|
2001-06-29 02:22:29 +02:00
|
|
|
{
|
|
|
|
errmsg = "Debugging binlog dump abort";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2001-06-29 02:22:29 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
#endif
|
2001-06-29 02:22:29 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
No one will update the log while we are reading
|
|
|
|
now, but we'll be quick and just read one record
|
|
|
|
|
2002-08-21 21:04:22 +02:00
|
|
|
TODO:
|
2005-02-09 20:04:28 +01:00
|
|
|
Add an counter that is incremented for each time we update the
|
|
|
|
binary log. We can avoid the following read if the counter
|
|
|
|
has not been updated since last read.
|
2002-08-08 02:12:02 +02:00
|
|
|
*/
|
2002-08-21 21:04:22 +02:00
|
|
|
|
2001-01-22 03:46:32 +01:00
|
|
|
pthread_mutex_lock(log_lock);
|
2002-08-08 02:12:02 +02:00
|
|
|
switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0)) {
|
2000-11-15 22:00:06 +01:00
|
|
|
case 0:
|
2002-08-08 02:12:02 +02:00
|
|
|
/* we read successfully, so we'll need to send it to the slave */
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_unlock(log_lock);
|
2000-11-15 22:00:06 +01:00
|
|
|
read_packet = 1;
|
|
|
|
break;
|
2002-08-08 02:12:02 +02:00
|
|
|
|
2000-11-15 22:00:06 +01:00
|
|
|
case LOG_READ_EOF:
|
2002-01-20 03:16:52 +01:00
|
|
|
DBUG_PRINT("wait",("waiting for data in binary log"));
|
2003-07-03 01:08:31 +02:00
|
|
|
if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0)
|
2003-07-02 22:56:27 +02:00
|
|
|
{
|
|
|
|
pthread_mutex_unlock(log_lock);
|
|
|
|
goto end;
|
|
|
|
}
|
2001-09-01 09:38:16 +02:00
|
|
|
if (!thd->killed)
|
2002-08-22 15:50:58 +02:00
|
|
|
{
|
|
|
|
/* Note that the following call unlocks lock_log */
|
2003-08-25 14:13:58 +02:00
|
|
|
mysql_bin_log.wait_for_update(thd, 0);
|
2002-08-22 15:50:58 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
pthread_mutex_unlock(log_lock);
|
2001-10-23 21:28:03 +02:00
|
|
|
DBUG_PRINT("wait",("binary log received update"));
|
2000-11-15 22:00:06 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_unlock(log_lock);
|
2000-11-15 22:00:06 +01:00
|
|
|
fatal_error = 1;
|
|
|
|
break;
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2002-08-22 15:50:58 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (read_packet)
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Sending binlog event to slave");
|
WL#3817: Simplify string / memory area types and make things more consistent (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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
errmsg = "Failed on my_net_write()";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
2000-10-06 01:58:16 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
if (send_file(thd))
|
2000-10-06 01:58:16 +02:00
|
|
|
{
|
2000-11-15 22:00:06 +01:00
|
|
|
errmsg = "failed in send_file()";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_UNKNOWN_ERROR;
|
2000-10-06 01:58:16 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2003-03-18 08:34:19 +01:00
|
|
|
packet->set("\0", 1, &my_charset_bin);
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
No need to net_flush because we will get to flush later when
|
|
|
|
we hit EOF pretty quick
|
|
|
|
*/
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2000-11-15 22:00:06 +01:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (fatal_error)
|
2000-11-15 22:00:06 +01:00
|
|
|
{
|
|
|
|
errmsg = "error reading log entry";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2000-11-15 22:00:06 +01:00
|
|
|
log.error=0;
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2000-11-15 22:00:06 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
bool loop_breaker = 0;
|
2005-11-14 14:01:10 +01:00
|
|
|
/* need this to break out of the for loop from switch */
|
2005-10-03 18:34:42 +02:00
|
|
|
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Finished reading one binlog; switching to next binlog");
|
2002-08-22 15:50:58 +02:00
|
|
|
switch (mysql_bin_log.find_next_log(&linfo, 1)) {
|
2000-11-15 22:00:06 +01:00
|
|
|
case LOG_INFO_EOF:
|
|
|
|
loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
errmsg = "could not find next log";
|
2002-08-21 21:04:22 +02:00
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2000-11-15 22:00:06 +01:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2005-11-14 14:01:10 +01:00
|
|
|
if (loop_breaker)
|
|
|
|
break;
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2005-11-14 14:01:10 +01:00
|
|
|
end_io_cache(&log);
|
|
|
|
(void) my_close(file, MYF(MY_WME));
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2003-06-21 18:10:59 +02:00
|
|
|
/*
|
2005-02-09 20:04:28 +01:00
|
|
|
Call fake_rotate_event() in case the previous log (the one which
|
|
|
|
we have just finished reading) did not contain a Rotate event
|
|
|
|
(for example (I don't know any other example) the previous log
|
|
|
|
was the last one before the master was shutdown & restarted).
|
|
|
|
This way we tell the slave about the new log's name and
|
|
|
|
position. If the binlog is 5.0, the next event we are going to
|
|
|
|
read and send is Format_description_log_event.
|
2003-06-21 18:10:59 +02:00
|
|
|
*/
|
2001-04-25 01:39:26 +02:00
|
|
|
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0 ||
|
2005-02-09 20:04:28 +01:00
|
|
|
fake_rotate_event(net, packet, log_file_name, BIN_LOG_HEADER_SIZE,
|
|
|
|
&errmsg))
|
2002-08-21 21:04:22 +02:00
|
|
|
{
|
|
|
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
2001-01-17 13:47:33 +01:00
|
|
|
goto err;
|
2002-08-21 21:04:22 +02:00
|
|
|
}
|
Many files:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/mysqld.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/set_var.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/sql_repl.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
2005-04-20 18:27:46 +02:00
|
|
|
|
2001-01-17 13:47:33 +01:00
|
|
|
packet->length(0);
|
2003-10-30 11:57:26 +01:00
|
|
|
packet->append('\0');
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2000-11-15 22:00:06 +01:00
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2003-07-02 22:56:27 +02:00
|
|
|
end:
|
2000-11-15 22:00:06 +01:00
|
|
|
end_io_cache(&log);
|
|
|
|
(void)my_close(file, MYF(MY_WME));
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2008-02-19 13:58:08 +01:00
|
|
|
my_eof(thd);
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Waiting to finalize termination");
|
2000-10-27 06:11:55 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
thd->current_linfo = 0;
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
2000-10-02 05:28:21 +02:00
|
|
|
DBUG_VOID_RETURN;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2003-07-02 22:56:27 +02:00
|
|
|
err:
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Waiting to finalize termination");
|
2000-11-15 22:00:06 +01:00
|
|
|
end_io_cache(&log);
|
2002-06-12 14:04:18 +02:00
|
|
|
/*
|
|
|
|
Exclude iteration through thread list
|
|
|
|
this is needed for purge_logs() - it will iterate through
|
|
|
|
thread list and update thd->current_linfo->index_file_offset
|
|
|
|
this mutex will make sure that it never tried to update our linfo
|
|
|
|
after we return from this stack frame
|
|
|
|
*/
|
2002-08-08 02:12:02 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
2000-10-27 06:11:55 +02:00
|
|
|
thd->current_linfo = 0;
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
2000-11-15 22:00:06 +01:00
|
|
|
if (file >= 0)
|
|
|
|
(void) my_close(file, MYF(MY_WME));
|
2005-10-03 18:34:42 +02:00
|
|
|
|
2004-10-20 03:04:37 +02:00
|
|
|
my_message(my_errno, errmsg, MYF(0));
|
2000-10-02 05:28:21 +02:00
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
Execute a START SLAVE statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@param mi Pointer to Master_info object for the slave's IO thread.
|
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
@param net_report If true, saves the exit status into thd->stmt_da.
|
2009-01-09 13:49:24 +01:00
|
|
|
|
|
|
|
@retval 0 success
|
|
|
|
@retval 1 error
|
|
|
|
*/
|
2007-08-16 08:52:50 +02:00
|
|
|
int start_slave(THD* thd , Master_info* mi, bool net_report)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2003-09-13 22:13:41 +02:00
|
|
|
int slave_errno= 0;
|
2002-01-20 03:16:52 +01:00
|
|
|
int thread_mask;
|
2002-08-08 02:12:02 +02:00
|
|
|
DBUG_ENTER("start_slave");
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2005-09-13 13:07:38 +02:00
|
|
|
if (check_access(thd, SUPER_ACL, any_db,0,0,0,0))
|
2002-08-08 02:12:02 +02:00
|
|
|
DBUG_RETURN(1);
|
2002-01-20 03:16:52 +01:00
|
|
|
lock_slave_threads(mi); // this allows us to cleanly read slave_running
|
2003-03-03 23:12:17 +01:00
|
|
|
// Get a mask of _stopped_ threads
|
2002-01-20 03:16:52 +01:00
|
|
|
init_thread_mask(&thread_mask,mi,1 /* inverse */);
|
2003-03-03 23:12:17 +01:00
|
|
|
/*
|
2005-02-09 20:04:28 +01:00
|
|
|
Below we will start all stopped threads. But if the user wants to
|
|
|
|
start only one thread, do as if the other thread was running (as we
|
|
|
|
don't wan't to touch the other thread), so set the bit to 0 for the
|
|
|
|
other thread
|
2003-03-03 23:12:17 +01:00
|
|
|
*/
|
2003-05-05 20:54:37 +02:00
|
|
|
if (thd->lex->slave_thd_opt)
|
2003-12-19 18:52:13 +01:00
|
|
|
thread_mask&= thd->lex->slave_thd_opt;
|
2003-03-03 23:12:17 +01:00
|
|
|
if (thread_mask) //some threads are stopped, start them
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
2004-11-25 09:26:45 +01:00
|
|
|
if (init_master_info(mi,master_info_file,relay_log_info_file, 0,
|
|
|
|
thread_mask))
|
2002-08-08 02:12:02 +02:00
|
|
|
slave_errno=ER_MASTER_INFO;
|
|
|
|
else if (server_id_supplied && *mi->host)
|
2003-09-13 22:13:41 +02:00
|
|
|
{
|
2005-02-09 20:04:28 +01:00
|
|
|
/*
|
2005-02-21 13:47:57 +01:00
|
|
|
If we will start SQL thread we will care about UNTIL options If
|
|
|
|
not and they are specified we will ignore them and warn user
|
|
|
|
about this fact.
|
2003-09-13 22:13:41 +02:00
|
|
|
*/
|
|
|
|
if (thread_mask & SLAVE_SQL)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&mi->rli.data_lock);
|
|
|
|
|
2003-09-24 15:26:20 +02:00
|
|
|
if (thd->lex->mi.pos)
|
2003-09-13 22:13:41 +02:00
|
|
|
{
|
2007-08-16 07:37:50 +02:00
|
|
|
mi->rli.until_condition= Relay_log_info::UNTIL_MASTER_POS;
|
2003-09-24 15:26:20 +02:00
|
|
|
mi->rli.until_log_pos= thd->lex->mi.pos;
|
2005-02-09 20:04:28 +01:00
|
|
|
/*
|
|
|
|
We don't check thd->lex->mi.log_file_name for NULL here
|
2003-09-13 22:13:41 +02:00
|
|
|
since it is checked in sql_yacc.yy
|
|
|
|
*/
|
2003-09-24 15:26:20 +02:00
|
|
|
strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
|
2005-02-21 13:47:57 +01:00
|
|
|
sizeof(mi->rli.until_log_name)-1);
|
2005-02-09 20:04:28 +01:00
|
|
|
}
|
2003-09-24 15:26:20 +02:00
|
|
|
else if (thd->lex->mi.relay_log_pos)
|
2003-09-13 22:13:41 +02:00
|
|
|
{
|
2007-08-16 07:37:50 +02:00
|
|
|
mi->rli.until_condition= Relay_log_info::UNTIL_RELAY_POS;
|
2003-09-24 15:26:20 +02:00
|
|
|
mi->rli.until_log_pos= thd->lex->mi.relay_log_pos;
|
|
|
|
strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name,
|
2005-02-21 13:47:57 +01:00
|
|
|
sizeof(mi->rli.until_log_name)-1);
|
2003-09-13 22:13:41 +02:00
|
|
|
}
|
|
|
|
else
|
2006-10-31 12:23:14 +01:00
|
|
|
mi->rli.clear_until_condition();
|
2003-09-13 22:13:41 +02:00
|
|
|
|
2007-08-16 07:37:50 +02:00
|
|
|
if (mi->rli.until_condition != Relay_log_info::UNTIL_NONE)
|
2003-09-13 22:13:41 +02:00
|
|
|
{
|
|
|
|
/* Preparing members for effective until condition checking */
|
|
|
|
const char *p= fn_ext(mi->rli.until_log_name);
|
|
|
|
char *p_end;
|
|
|
|
if (*p)
|
|
|
|
{
|
|
|
|
//p points to '.'
|
|
|
|
mi->rli.until_log_name_extension= strtoul(++p,&p_end, 10);
|
|
|
|
/*
|
|
|
|
p_end points to the first invalid character. If it equals
|
|
|
|
to p, no digits were found, error. If it contains '\0' it
|
|
|
|
means conversion went ok.
|
2005-02-09 20:04:28 +01:00
|
|
|
*/
|
2003-10-08 20:50:05 +02:00
|
|
|
if (p_end==p || *p_end)
|
2003-09-13 22:13:41 +02:00
|
|
|
slave_errno=ER_BAD_SLAVE_UNTIL_COND;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
slave_errno=ER_BAD_SLAVE_UNTIL_COND;
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2003-09-13 22:13:41 +02:00
|
|
|
/* mark the cached result of the UNTIL comparison as "undefined" */
|
2005-02-09 20:04:28 +01:00
|
|
|
mi->rli.until_log_names_cmp_result=
|
2007-08-16 07:37:50 +02:00
|
|
|
Relay_log_info::UNTIL_LOG_NAMES_CMP_UNKNOWN;
|
2003-09-13 22:13:41 +02:00
|
|
|
|
|
|
|
/* Issuing warning then started without --skip-slave-start */
|
|
|
|
if (!opt_skip_slave_start)
|
2005-02-21 13:47:57 +01:00
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
2006-04-13 09:50:33 +02:00
|
|
|
ER_MISSING_SKIP_SLAVE,
|
2003-09-13 22:13:41 +02:00
|
|
|
ER(ER_MISSING_SKIP_SLAVE));
|
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2003-09-13 22:13:41 +02:00
|
|
|
pthread_mutex_unlock(&mi->rli.data_lock);
|
|
|
|
}
|
2003-09-24 15:26:20 +02:00
|
|
|
else if (thd->lex->mi.pos || thd->lex->mi.relay_log_pos)
|
2003-09-13 22:13:41 +02:00
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_UNTIL_COND_IGNORED,
|
2005-02-21 13:47:57 +01:00
|
|
|
ER(ER_UNTIL_COND_IGNORED));
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2003-10-08 20:50:05 +02:00
|
|
|
if (!slave_errno)
|
2003-09-13 22:13:41 +02:00
|
|
|
slave_errno = start_slave_threads(0 /*no mutex */,
|
2002-01-20 03:16:52 +01:00
|
|
|
1 /* wait for start */,
|
|
|
|
mi,
|
|
|
|
master_info_file,relay_log_info_file,
|
|
|
|
thread_mask);
|
2003-09-13 22:13:41 +02:00
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
else
|
|
|
|
slave_errno = ER_BAD_SLAVE;
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
else
|
2005-02-21 13:47:57 +01:00
|
|
|
{
|
|
|
|
/* no error if all threads are already started, only a warning */
|
2003-03-03 23:12:17 +01:00
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_RUNNING,
|
|
|
|
ER(ER_SLAVE_WAS_RUNNING));
|
2005-02-21 13:47:57 +01:00
|
|
|
}
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
unlock_slave_threads(mi);
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (slave_errno)
|
|
|
|
{
|
2002-01-20 03:16:52 +01:00
|
|
|
if (net_report)
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(slave_errno, ER(slave_errno), MYF(0));
|
2002-08-08 02:12:02 +02:00
|
|
|
DBUG_RETURN(1);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
else if (net_report)
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
DBUG_RETURN(0);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2002-10-02 12:33:08 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a STOP SLAVE statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@param mi Pointer to Master_info object for the slave's IO thread.
|
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
@param net_report If true, saves the exit status into thd->stmt_da.
|
2009-01-09 13:49:24 +01:00
|
|
|
|
|
|
|
@retval 0 success
|
|
|
|
@retval 1 error
|
|
|
|
*/
|
2007-08-16 08:52:50 +02:00
|
|
|
int stop_slave(THD* thd, Master_info* mi, bool net_report )
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2007-02-03 20:14:16 +01:00
|
|
|
DBUG_ENTER("stop_slave");
|
|
|
|
|
2003-03-03 23:12:17 +01:00
|
|
|
int slave_errno;
|
2002-10-02 12:33:08 +02:00
|
|
|
if (!thd)
|
|
|
|
thd = current_thd;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2005-09-13 13:07:38 +02:00
|
|
|
if (check_access(thd, SUPER_ACL, any_db,0,0,0,0))
|
2007-02-03 20:14:16 +01:00
|
|
|
DBUG_RETURN(1);
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Killing slave");
|
2002-01-20 03:16:52 +01:00
|
|
|
int thread_mask;
|
|
|
|
lock_slave_threads(mi);
|
2003-03-03 23:12:17 +01:00
|
|
|
// Get a mask of _running_ threads
|
2002-01-20 03:16:52 +01:00
|
|
|
init_thread_mask(&thread_mask,mi,0 /* not inverse*/);
|
2003-03-03 23:12:17 +01:00
|
|
|
/*
|
|
|
|
Below we will stop all running threads.
|
|
|
|
But if the user wants to stop only one thread, do as if the other thread
|
|
|
|
was stopped (as we don't wan't to touch the other thread), so set the
|
|
|
|
bit to 0 for the other thread
|
|
|
|
*/
|
2003-05-05 20:54:37 +02:00
|
|
|
if (thd->lex->slave_thd_opt)
|
|
|
|
thread_mask &= thd->lex->slave_thd_opt;
|
2003-03-03 23:12:17 +01:00
|
|
|
|
|
|
|
if (thread_mask)
|
|
|
|
{
|
|
|
|
slave_errno= terminate_slave_threads(mi,thread_mask,
|
|
|
|
1 /*skip lock */);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//no error if both threads are already stopped, only a warning
|
|
|
|
slave_errno= 0;
|
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_NOT_RUNNING,
|
|
|
|
ER(ER_SLAVE_WAS_NOT_RUNNING));
|
|
|
|
}
|
2002-01-20 03:16:52 +01:00
|
|
|
unlock_slave_threads(mi);
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, 0);
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (slave_errno)
|
|
|
|
{
|
|
|
|
if (net_report)
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(slave_errno, ER(slave_errno), MYF(0));
|
2007-02-03 20:14:16 +01:00
|
|
|
DBUG_RETURN(1);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
else if (net_report)
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2007-02-03 20:14:16 +01:00
|
|
|
DBUG_RETURN(0);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a RESET SLAVE statement.
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
@param thd Pointer to THD object of the client thread executing the
|
|
|
|
statement.
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
@param mi Pointer to Master_info object for the slave.
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
@retval 0 success
|
|
|
|
@retval 1 error
|
|
|
|
*/
|
2007-08-16 08:52:50 +02:00
|
|
|
int reset_slave(THD *thd, Master_info* mi)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
|
|
|
MY_STAT stat_area;
|
|
|
|
char fname[FN_REFLEN];
|
2002-12-13 11:05:24 +01:00
|
|
|
int thread_mask= 0, error= 0;
|
|
|
|
uint sql_errno=0;
|
2002-01-20 03:16:52 +01:00
|
|
|
const char* errmsg=0;
|
2002-06-05 22:04:38 +02:00
|
|
|
DBUG_ENTER("reset_slave");
|
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
lock_slave_threads(mi);
|
2002-12-13 11:05:24 +01:00
|
|
|
init_thread_mask(&thread_mask,mi,0 /* not inverse */);
|
|
|
|
if (thread_mask) // We refuse if any slave thread is running
|
|
|
|
{
|
|
|
|
sql_errno= ER_SLAVE_MUST_STOP;
|
|
|
|
error=1;
|
|
|
|
goto err;
|
|
|
|
}
|
2006-01-12 19:51:02 +01:00
|
|
|
|
|
|
|
ha_reset_slave(thd);
|
|
|
|
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
// delete relay logs, clear relay log coordinates
|
2002-12-13 11:05:24 +01:00
|
|
|
if ((error= purge_relay_logs(&mi->rli, thd,
|
|
|
|
1 /* just reset */,
|
|
|
|
&errmsg)))
|
2009-04-30 14:28:07 +02:00
|
|
|
{
|
|
|
|
sql_errno= ER_RELAY_LOG_FAIL;
|
2002-01-20 03:16:52 +01:00
|
|
|
goto err;
|
2009-04-30 14:28:07 +02:00
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2003-08-04 10:59:44 +02:00
|
|
|
/*
|
|
|
|
Clear master's log coordinates and reset host/user/etc to the values
|
|
|
|
specified in mysqld's options (only for good display of SHOW SLAVE STATUS;
|
|
|
|
next init_master_info() (in start_slave() for example) would have set them
|
|
|
|
the same way; but here this is for the case where the user does SHOW SLAVE
|
|
|
|
STATUS; before doing START SLAVE;
|
|
|
|
*/
|
|
|
|
init_master_info_with_options(mi);
|
2005-02-09 20:04:28 +01:00
|
|
|
/*
|
A change of behaviour of Seconds_Behind_Master from SHOW SLAVE STATUS. It's going into 4.1
because old behaviour was somewhat nonsensical (kind of bug). Changes are that if repl threads are
down or disconnected the column will be NULL, and if master is idle the column will not grow indefinitely anymore.
sql/slave.cc:
mi->slave_running and rli->slave_running now uints (was needed only for mi but because of start_slave_thread() usage,
had to change both).
So mi->slave_running can now take 3 values: not running, running & not connected, running and connected.
The last value serves for calculation of Seconds_Behind_Master in SHOW SLAVE STATUS.
Changing this column's behaviour: if SQL or I/O thread is not running, or if I/O thread is not connected
(for example if it is reconnecting), it's NULL (to mean "unknown"). And if master is idle, the column will
not grow indefinitely like it used to (that was meaningless); this is fixed by forcing a value of 0
when the slave SQL thread has hit EOF of relay log (which has only a limited number of caveats explained
in comments in code).
sql/slave.h:
slave_running used to be bool but we need to distinguish, for the I/O slave thread, between
"running & connected" and "running & not connected" ("running" means the thread exists).
sql/sql_repl.cc:
we don't need anymore to set rli->last_master_timestamp to 0 (we used that to make Seconds_Behind_Master
be NULL) in RESET SLAVE and CHANGE MASTER, as these commands imply that slave threads are not running
and so Seconds_Behind_Master is already NULL because of that.
2004-12-16 18:12:22 +01:00
|
|
|
Reset errors (the idea is that we forget about the
|
2003-10-09 00:06:21 +02:00
|
|
|
old master).
|
|
|
|
*/
|
2009-06-03 16:14:18 +02:00
|
|
|
mi->clear_error();
|
2007-06-09 07:19:37 +02:00
|
|
|
mi->rli.clear_error();
|
2006-10-31 12:23:14 +01:00
|
|
|
mi->rli.clear_until_condition();
|
2005-02-09 20:04:28 +01:00
|
|
|
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
|
2002-01-20 03:16:52 +01:00
|
|
|
end_master_info(mi);
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
// and delete these two files
|
2002-01-20 03:16:52 +01:00
|
|
|
fn_format(fname, master_info_file, mysql_data_home, "", 4+32);
|
|
|
|
if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME)))
|
2001-07-10 14:53:08 +02:00
|
|
|
{
|
2002-01-20 03:16:52 +01:00
|
|
|
error=1;
|
|
|
|
goto err;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
// delete relay_log_info_file
|
2002-01-20 03:16:52 +01:00
|
|
|
fn_format(fname, relay_log_info_file, mysql_data_home, "", 4+32);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME)))
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
|
|
|
error=1;
|
|
|
|
goto err;
|
|
|
|
}
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
err:
|
|
|
|
unlock_slave_threads(mi);
|
2004-11-12 13:34:00 +01:00
|
|
|
if (error)
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(sql_errno, MYF(0), errmsg);
|
2002-06-05 22:04:38 +02:00
|
|
|
DBUG_RETURN(error);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2003-07-03 01:08:36 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
Kill all Binlog_dump threads which previously talked to the same slave
|
|
|
|
("same" means with the same server id). Indeed, if the slave stops, if the
|
|
|
|
Binlog_dump thread is waiting (pthread_cond_wait) for binlog update, then it
|
|
|
|
will keep existing until a query is written to the binlog. If the master is
|
|
|
|
idle, then this could last long, and if the slave reconnects, we could have 2
|
|
|
|
Binlog_dump threads in SHOW PROCESSLIST, until a query is written to the
|
|
|
|
binlog. To avoid this, when the slave reconnects and sends COM_BINLOG_DUMP,
|
|
|
|
the master kills any existing thread with the slave's server id (if this id is
|
|
|
|
not zero; it will be true for real slaves, but false for mysqlbinlog when it
|
|
|
|
sends COM_BINLOG_DUMP to get a remote binlog dump).
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
kill_zombie_dump_threads()
|
|
|
|
slave_server_id the slave's server id
|
|
|
|
|
|
|
|
*/
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2002-12-13 11:05:24 +01:00
|
|
|
|
2000-10-02 05:28:21 +02:00
|
|
|
void kill_zombie_dump_threads(uint32 slave_server_id)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
2000-10-03 01:59:12 +02:00
|
|
|
I_List_iterator<THD> it(threads);
|
|
|
|
THD *tmp;
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
while ((tmp=it++))
|
|
|
|
{
|
|
|
|
if (tmp->command == COM_BINLOG_DUMP &&
|
|
|
|
tmp->server_id == slave_server_id)
|
2000-10-03 01:59:12 +02:00
|
|
|
{
|
2009-07-24 17:58:58 +02:00
|
|
|
pthread_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete
|
2002-08-22 15:50:58 +02:00
|
|
|
break;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
2002-08-22 15:50:58 +02:00
|
|
|
if (tmp)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Here we do not call kill_one_thread() as
|
|
|
|
it will be slow because it will iterate through the list
|
|
|
|
again. We just to do kill the thread ourselves.
|
|
|
|
*/
|
2003-03-31 10:39:46 +02:00
|
|
|
tmp->awake(THD::KILL_QUERY);
|
2009-07-24 17:58:58 +02:00
|
|
|
pthread_mutex_unlock(&tmp->LOCK_thd_data);
|
2002-08-22 15:50:58 +02:00
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a CHANGE MASTER statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@param mi Pointer to Master_info object belonging to the slave's IO
|
|
|
|
thread.
|
|
|
|
|
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE error
|
|
|
|
*/
|
2007-08-16 08:52:50 +02:00
|
|
|
bool change_master(THD* thd, Master_info* mi)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2002-12-13 11:05:24 +01:00
|
|
|
int thread_mask;
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
const char* errmsg= 0;
|
|
|
|
bool need_relay_log_purge= 1;
|
2002-06-08 20:02:01 +02:00
|
|
|
DBUG_ENTER("change_master");
|
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
lock_slave_threads(mi);
|
2002-12-13 11:05:24 +01:00
|
|
|
init_thread_mask(&thread_mask,mi,0 /*not inverse*/);
|
|
|
|
if (thread_mask) // We refuse if any slave thread is running
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
|
2002-01-20 03:16:52 +01:00
|
|
|
unlock_slave_threads(mi);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
2002-12-13 11:05:24 +01:00
|
|
|
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Changing master");
|
2003-12-19 18:52:13 +01:00
|
|
|
LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
|
2002-01-20 03:16:52 +01:00
|
|
|
// TODO: see if needs re-write
|
2004-11-25 09:26:45 +01:00
|
|
|
if (init_master_info(mi, master_info_file, relay_log_info_file, 0,
|
|
|
|
thread_mask))
|
2001-07-10 14:53:08 +02:00
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_MASTER_INFO, ER(ER_MASTER_INFO), MYF(0));
|
2002-01-20 03:16:52 +01:00
|
|
|
unlock_slave_threads(mi);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
Data lock not needed since we have already stopped the running threads,
|
|
|
|
and we have the hold on the run locks which will keep all threads that
|
|
|
|
could possibly modify the data structures from running
|
2002-03-30 20:36:05 +01:00
|
|
|
*/
|
2003-07-24 22:29:09 +02:00
|
|
|
|
|
|
|
/*
|
2006-04-13 09:50:33 +02:00
|
|
|
If the user specified host or port without binlog or position,
|
2003-07-24 22:29:09 +02:00
|
|
|
reset binlog's name to FIRST and position to 4.
|
2006-04-13 09:50:33 +02:00
|
|
|
*/
|
2003-07-24 22:29:09 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if ((lex_mi->host || lex_mi->port) && !lex_mi->log_file_name && !lex_mi->pos)
|
|
|
|
{
|
2002-01-20 03:16:52 +01:00
|
|
|
mi->master_log_name[0] = 0;
|
2002-06-08 20:02:01 +02:00
|
|
|
mi->master_log_pos= BIN_LOG_HEADER_SIZE;
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->log_file_name)
|
2002-01-20 03:16:52 +01:00
|
|
|
strmake(mi->master_log_name, lex_mi->log_file_name,
|
2003-07-04 02:18:15 +02:00
|
|
|
sizeof(mi->master_log_name)-1);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->pos)
|
2001-06-01 00:54:16 +02:00
|
|
|
{
|
2002-06-08 20:02:01 +02:00
|
|
|
mi->master_log_pos= lex_mi->pos;
|
2001-06-01 00:54:16 +02:00
|
|
|
}
|
2006-11-20 21:42:06 +01:00
|
|
|
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
|
2001-07-10 14:53:08 +02:00
|
|
|
|
|
|
|
if (lex_mi->host)
|
2003-07-04 02:18:15 +02:00
|
|
|
strmake(mi->host, lex_mi->host, sizeof(mi->host)-1);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->user)
|
2003-07-04 02:18:15 +02:00
|
|
|
strmake(mi->user, lex_mi->user, sizeof(mi->user)-1);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->password)
|
2003-07-04 02:18:15 +02:00
|
|
|
strmake(mi->password, lex_mi->password, sizeof(mi->password)-1);
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->port)
|
2002-01-20 03:16:52 +01:00
|
|
|
mi->port = lex_mi->port;
|
2001-07-10 14:53:08 +02:00
|
|
|
if (lex_mi->connect_retry)
|
2002-01-20 03:16:52 +01:00
|
|
|
mi->connect_retry = lex_mi->connect_retry;
|
2006-04-13 09:50:33 +02:00
|
|
|
|
2003-09-01 13:16:20 +02:00
|
|
|
if (lex_mi->ssl != LEX_MASTER_INFO::SSL_UNCHANGED)
|
|
|
|
mi->ssl= (lex_mi->ssl == LEX_MASTER_INFO::SSL_ENABLE);
|
2007-03-29 15:09:57 +02:00
|
|
|
|
|
|
|
if (lex_mi->ssl_verify_server_cert != LEX_MASTER_INFO::SSL_UNCHANGED)
|
|
|
|
mi->ssl_verify_server_cert=
|
|
|
|
(lex_mi->ssl_verify_server_cert == LEX_MASTER_INFO::SSL_ENABLE);
|
|
|
|
|
2003-09-01 13:16:20 +02:00
|
|
|
if (lex_mi->ssl_ca)
|
|
|
|
strmake(mi->ssl_ca, lex_mi->ssl_ca, sizeof(mi->ssl_ca)-1);
|
|
|
|
if (lex_mi->ssl_capath)
|
|
|
|
strmake(mi->ssl_capath, lex_mi->ssl_capath, sizeof(mi->ssl_capath)-1);
|
|
|
|
if (lex_mi->ssl_cert)
|
|
|
|
strmake(mi->ssl_cert, lex_mi->ssl_cert, sizeof(mi->ssl_cert)-1);
|
|
|
|
if (lex_mi->ssl_cipher)
|
|
|
|
strmake(mi->ssl_cipher, lex_mi->ssl_cipher, sizeof(mi->ssl_cipher)-1);
|
|
|
|
if (lex_mi->ssl_key)
|
|
|
|
strmake(mi->ssl_key, lex_mi->ssl_key, sizeof(mi->ssl_key)-1);
|
|
|
|
#ifndef HAVE_OPENSSL
|
|
|
|
if (lex_mi->ssl || lex_mi->ssl_ca || lex_mi->ssl_capath ||
|
2007-03-29 15:09:57 +02:00
|
|
|
lex_mi->ssl_cert || lex_mi->ssl_cipher || lex_mi->ssl_key ||
|
|
|
|
lex_mi->ssl_verify_server_cert )
|
2006-04-13 09:50:33 +02:00
|
|
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
2003-09-01 13:16:20 +02:00
|
|
|
ER_SLAVE_IGNORED_SSL_PARAMS, ER(ER_SLAVE_IGNORED_SSL_PARAMS));
|
|
|
|
#endif
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-03-16 02:44:44 +01:00
|
|
|
if (lex_mi->relay_log_name)
|
|
|
|
{
|
2003-03-17 22:51:56 +01:00
|
|
|
need_relay_log_purge= 0;
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
strmake(mi->rli.group_relay_log_name,lex_mi->relay_log_name,
|
|
|
|
sizeof(mi->rli.group_relay_log_name)-1);
|
|
|
|
strmake(mi->rli.event_relay_log_name,lex_mi->relay_log_name,
|
|
|
|
sizeof(mi->rli.event_relay_log_name)-1);
|
2002-03-16 02:44:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (lex_mi->relay_log_pos)
|
|
|
|
{
|
2003-03-17 22:51:56 +01:00
|
|
|
need_relay_log_purge= 0;
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
mi->rli.group_relay_log_pos= mi->rli.event_relay_log_pos= lex_mi->relay_log_pos;
|
2002-03-16 02:44:44 +01:00
|
|
|
}
|
|
|
|
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
/*
|
|
|
|
If user did specify neither host nor port nor any log name nor any log
|
|
|
|
pos, i.e. he specified only user/password/master_connect_retry, he probably
|
|
|
|
wants replication to resume from where it had left, i.e. from the
|
|
|
|
coordinates of the **SQL** thread (imagine the case where the I/O is ahead
|
|
|
|
of the SQL; restarting from the coordinates of the I/O would lose some
|
|
|
|
events which is probably unwanted when you are just doing minor changes
|
|
|
|
like changing master_connect_retry).
|
|
|
|
A side-effect is that if only the I/O thread was started, this thread may
|
|
|
|
restart from ''/4 after the CHANGE MASTER. That's a minor problem (it is a
|
|
|
|
much more unlikely situation than the one we are fixing here).
|
|
|
|
Note: coordinates of the SQL thread must be read here, before the
|
|
|
|
'if (need_relay_log_purge)' block which resets them.
|
|
|
|
*/
|
|
|
|
if (!lex_mi->host && !lex_mi->port &&
|
|
|
|
!lex_mi->log_file_name && !lex_mi->pos &&
|
|
|
|
need_relay_log_purge)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Sometimes mi->rli.master_log_pos == 0 (it happens when the SQL thread is
|
|
|
|
not initialized), so we use a max().
|
|
|
|
What happens to mi->rli.master_log_pos during the initialization stages
|
|
|
|
of replication is not 100% clear, so we guard against problems using
|
|
|
|
max().
|
|
|
|
*/
|
2003-11-21 00:53:01 +01:00
|
|
|
mi->master_log_pos = max(BIN_LOG_HEADER_SIZE,
|
|
|
|
mi->rli.group_master_log_pos);
|
|
|
|
strmake(mi->master_log_name, mi->rli.group_master_log_name,
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
sizeof(mi->master_log_name)-1);
|
|
|
|
}
|
2003-11-23 17:02:59 +01:00
|
|
|
/*
|
|
|
|
Relay log's IO_CACHE may not be inited, if rli->inited==0 (server was never
|
|
|
|
a slave before).
|
|
|
|
*/
|
2006-01-03 17:54:54 +01:00
|
|
|
if (flush_master_info(mi, 0))
|
|
|
|
{
|
|
|
|
my_error(ER_RELAY_LOG_INIT, MYF(0), "Failed to flush master info file");
|
|
|
|
unlock_slave_threads(mi);
|
|
|
|
DBUG_RETURN(TRUE);
|
|
|
|
}
|
2002-03-16 02:44:44 +01:00
|
|
|
if (need_relay_log_purge)
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
relay_log_purge= 1;
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, "Purging old relay logs");
|
2002-08-08 02:12:02 +02:00
|
|
|
if (purge_relay_logs(&mi->rli, thd,
|
|
|
|
0 /* not only reset, but also reinit */,
|
2002-03-16 02:44:44 +01:00
|
|
|
&errmsg))
|
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_RELAY_LOG_FAIL, MYF(0), errmsg);
|
2002-12-13 11:05:24 +01:00
|
|
|
unlock_slave_threads(mi);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2002-03-16 02:44:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char* msg;
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
relay_log_purge= 0;
|
2002-08-08 02:12:02 +02:00
|
|
|
/* Relay log is already initialized */
|
|
|
|
if (init_relay_log_pos(&mi->rli,
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
mi->rli.group_relay_log_name,
|
|
|
|
mi->rli.group_relay_log_pos,
|
2002-03-16 02:44:44 +01:00
|
|
|
0 /*no data lock*/,
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
&msg, 0))
|
2002-03-16 02:44:44 +01:00
|
|
|
{
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_RELAY_LOG_INIT, MYF(0), msg);
|
2002-03-16 02:44:44 +01:00
|
|
|
unlock_slave_threads(mi);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2002-03-16 02:44:44 +01:00
|
|
|
}
|
2002-01-20 03:16:52 +01:00
|
|
|
}
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
/*
|
|
|
|
Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block,
|
|
|
|
so restore them to good values. If we left them to ''/0, that would work;
|
|
|
|
but that would fail in the case of 2 successive CHANGE MASTER (without a
|
|
|
|
START SLAVE in between): because first one would set the coords in mi to
|
|
|
|
the good values of those in rli, the set those in rli to ''/0, then
|
|
|
|
second CHANGE MASTER would set the coords in mi to those of rli, i.e. to
|
|
|
|
''/0: we have lost all copies of the original good coordinates.
|
|
|
|
That's why we always save good coords in rli.
|
|
|
|
*/
|
2003-08-18 23:08:08 +02:00
|
|
|
mi->rli.group_master_log_pos= mi->master_log_pos;
|
2007-12-21 09:13:54 +01:00
|
|
|
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
strmake(mi->rli.group_master_log_name,mi->master_log_name,
|
|
|
|
sizeof(mi->rli.group_master_log_name)-1);
|
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
And a new test for this bug.
mysql-test/r/rpl_loaddata.result:
Now, after CHANGE MASTER the coordinates of the I/O thread are the last ones of the SQL thread, so result update.
sql/sql_repl.cc:
Fix for BUG#1870
"CHANGE MASTER makes SQL thread restart from coordinates of I/O thread".
So, in CHANGE MASTER:
when it seems reasonable that the user did not want to discontinue
its replication (i.e. when he is not specifying host or port or master_log_file
or master_log_pos; this will be documented), set the coordinates of the
I/O thread to those of the SQL thread. This way, the SQL thread will see
no discontinuity in the relay log (i.e. will skip no events), because
the I/O thread will fill the brand new relay log with the events which
are just after the position where the SQL thread had stopped
(before CHANGE MASTER was issued).
2003-11-18 17:31:17 +01:00
|
|
|
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
if (!mi->rli.group_master_log_name[0]) // uninitialized case
|
|
|
|
mi->rli.group_master_log_pos=0;
|
2002-03-30 20:36:05 +01:00
|
|
|
|
|
|
|
pthread_mutex_lock(&mi->rli.data_lock);
|
2003-07-24 22:29:09 +02:00
|
|
|
mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */
|
A change of behaviour of Seconds_Behind_Master from SHOW SLAVE STATUS. It's going into 4.1
because old behaviour was somewhat nonsensical (kind of bug). Changes are that if repl threads are
down or disconnected the column will be NULL, and if master is idle the column will not grow indefinitely anymore.
sql/slave.cc:
mi->slave_running and rli->slave_running now uints (was needed only for mi but because of start_slave_thread() usage,
had to change both).
So mi->slave_running can now take 3 values: not running, running & not connected, running and connected.
The last value serves for calculation of Seconds_Behind_Master in SHOW SLAVE STATUS.
Changing this column's behaviour: if SQL or I/O thread is not running, or if I/O thread is not connected
(for example if it is reconnecting), it's NULL (to mean "unknown"). And if master is idle, the column will
not grow indefinitely like it used to (that was meaningless); this is fixed by forcing a value of 0
when the slave SQL thread has hit EOF of relay log (which has only a limited number of caveats explained
in comments in code).
sql/slave.h:
slave_running used to be bool but we need to distinguish, for the I/O slave thread, between
"running & connected" and "running & not connected" ("running" means the thread exists).
sql/sql_repl.cc:
we don't need anymore to set rli->last_master_timestamp to 0 (we used that to make Seconds_Behind_Master
be NULL) in RESET SLAVE and CHANGE MASTER, as these commands imply that slave threads are not running
and so Seconds_Behind_Master is already NULL because of that.
2004-12-16 18:12:22 +01:00
|
|
|
/* Clear the errors, for a clean start */
|
2007-06-09 07:19:37 +02:00
|
|
|
mi->rli.clear_error();
|
2006-10-31 12:23:14 +01:00
|
|
|
mi->rli.clear_until_condition();
|
2003-08-11 21:44:43 +02:00
|
|
|
/*
|
|
|
|
If we don't write new coordinates to disk now, then old will remain in
|
|
|
|
relay-log.info until START SLAVE is issued; but if mysqld is shutdown
|
|
|
|
before START SLAVE, then old will remain in relay-log.info, and will be the
|
|
|
|
in-memory value at restart (thus causing errors, as the old relay log does
|
|
|
|
not exist anymore).
|
2003-07-24 22:29:09 +02:00
|
|
|
*/
|
2003-08-11 21:44:43 +02:00
|
|
|
flush_relay_log_info(&mi->rli);
|
2002-03-30 20:36:05 +01:00
|
|
|
pthread_cond_broadcast(&mi->data_cond);
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_mutex_unlock(&mi->rli.data_lock);
|
2000-10-02 05:28:21 +02:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
unlock_slave_threads(mi);
|
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE
Profiling is only partially functional on some architectures. Where
there is no getrusage() system call, presently Null values are
returned where it would be required. Notably, Windows needs some love
applied to make it as useful.
Syntax this adds:
SHOW PROFILES
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
where "n" is an integer
and "types" is zero or many (comma-separated) of
"CPU"
"MEMORY" (not presently supported)
"BLOCK IO"
"CONTEXT SWITCHES"
"PAGE FAULTS"
"IPC"
"SWAPS"
"SOURCE"
"ALL"
It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by
default.
This patch abstracts setting THDs' "proc_info" behind a macro that
can be used as a hook into the profiling code when profiling
support is compiled in. All future code in this line should use
that mechanism for setting thd->proc_info.
---
Tests are now set to omit the statistics.
---
Adds an Information_schema table, "profiling" for access to
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.
Updated test results.
---
Include more thorough profiling tests.
Improve support for prepared statements.
Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
BitKeeper/deleted/.del-profile.result:
Rename: mysql-test/r/profile.result -> BitKeeper/deleted/.del-profile.result
BitKeeper/deleted/.del-profile.test:
Rename: mysql-test/t/profile.test -> BitKeeper/deleted/.del-profile.test
BitKeeper/deleted/.del-sql_profile.cc:
Rename: sql/sql_profile.cc -> BitKeeper/deleted/.del-sql_profile.cc
BitKeeper/deleted/.del-sql_profile.h:
Rename: sql/sql_profile.h -> BitKeeper/deleted/.del-sql_profile.h
configure.in:
Add a configure-time option to enable/disable query profiling. The
default is enabled.
include/my_dbug.h:
DBUG_* statements should be syntactically equivalent to a single
statement.
myisam/mi_open.c:
DBUG_* statements should be syntactically equivalent to a single
statement.
mysql-test/r/information_schema.result:
Updated (re-recorded) tests that I missed somehow. I verified these
for correctness.
mysql-test/r/information_schema_db.result:
Updated test results I missed.
mysql-test/r/mysqlshow.result:
Fix merge problems.
ndb/src/ndbapi/DictCache.cpp:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_archive.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_berkeley.cc:
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/ha_myisam.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/ha_myisammrg.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/ha_ndbcluster.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_cmpfunc.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
sql/item_func.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/lock.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/log_event.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/mysql_priv.h:
Use 64-bit constants for the 64-bit bit field.
Add a new option bit for whether profiling is active or not.
sql/mysqld.cc:
Add semicolon to DBUG statement.
Add a new system variable and set it.
---
Set the minimum, which is zero and not 50.
sql/repl_failsafe.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/set_var.cc:
Make a new system global variable and session variable, to determine
behavior of profiling.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/set_var.h:
The THD::options bit field is ulonglong, not ulong.
sql/slave.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sp_head.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_base.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_cache.cc:
DBUG_* statements should be syntactically equivalent to a single
statement.
---
Fix merge problems.
sql/sql_class.cc:
Insert a pointer to the current thread in the profiling code.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_class.h:
Create a new system variable, profiling_history_size, and add a
member to THD to hold profiling information about this thread's
execution.
---
Manual merge, undoing first patch.
sql/sql_delete.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_insert.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_lex.cc:
Initialize profiling options to empty.
---
Manual merge, undoing first patch.
sql/sql_lex.h:
Add info to the lexer object so that we can hold data that comes from
parsing statements.
Reuse memory addresses of uints that can't occur in the same state-
ment.
This is dangerous because it involves knowledge of what symbols are
never used together, which is information stored obliquely in another
file.
---
Manual merge, undoing first patch.
sql/sql_parse.cc:
Add hooks to the parser to jump to profiling code.
If profiling is not present, then return an error message upon being
used.
---
Manual merge, undoing first patch.
---
Fix merge problems.
---
Include patch backported to 5.0-global.
THD::options is a ulonglong, not ulong.
sql/sql_prepare.cc:
From prepared statement execution, set the query source in the
profiler, as we can't get it from thd .
---
Make it less expensive to limit the size of the queries.
sql/sql_repl.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_select.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/sql_show.cc:
Abstract setting thread-info into a function or macro.
Also, remove "static" qualification on schema_table_store_record()
so that external functions may use it.
---
Manual merge, undoing first patch.
sql/sql_table.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_update.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_view.cc:
Abstract setting thread-info into a function or macro.
---
Manual merge, undoing first patch.
sql/sql_yacc.yy:
Add new lexer symbols and insert new grammatical rules necessary to
retreive profiling information.
---
Manual merge, undoing first patch.
---
Fix merge problems.
sql/table.h:
Add enum item for query profiling.
BitKeeper/deleted/.del-profiling-master.opt:
New BitKeeper file ``mysql-test/t/profiling-master.opt''
mysql-test/r/profiling.result:
New BitKeeper file ``mysql-test/r/profiling.result''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
mysql-test/t/profiling.test:
New BitKeeper file ``mysql-test/t/profiling.test''
---
Include more verbose that describes the queries so far.
Include Giuseppe's tests.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
sql/sql_profile.cc:
New BitKeeper file ``sql/sql_profile.cc''
---
If query_source is NULL, as can sometimes happen, then don't try
to copy that memory.
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.
Limit the size of captured query text.
No longer log queries that are zero length.
sql/sql_profile.h:
New BitKeeper file ``sql/sql_profile.h''
---
Make each new session use its own numbering of query_ids, and not
show the global-pool numbers to the user.
Provide a way for prepared statements to set the query_source.
---
Make it less expensive to limit the size of the queries.
2007-02-22 16:03:08 +01:00
|
|
|
thd_proc_info(thd, 0);
|
2008-02-19 13:45:21 +01:00
|
|
|
my_ok(thd);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(FALSE);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
Execute a RESET MASTER statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object of the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@retval 0 success
|
|
|
|
@retval 1 error
|
|
|
|
*/
|
2002-01-20 03:16:52 +01:00
|
|
|
int reset_master(THD* thd)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2001-07-10 14:53:08 +02:00
|
|
|
if (!mysql_bin_log.is_open())
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_FLUSH_MASTER_BINLOG_CLOSED,
|
|
|
|
ER(ER_FLUSH_MASTER_BINLOG_CLOSED), MYF(ME_BELL+ME_WAITTANG));
|
2002-01-20 03:16:52 +01:00
|
|
|
return 1;
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2002-01-20 03:16:52 +01:00
|
|
|
return mysql_bin_log.reset_logs(thd);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
|
|
|
|
2001-07-05 01:14:31 +02:00
|
|
|
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
|
|
|
|
const char* log_file_name2, ulonglong log_pos2)
|
|
|
|
{
|
|
|
|
int res;
|
2009-02-10 23:47:54 +01:00
|
|
|
size_t log_file_name1_len= strlen(log_file_name1);
|
|
|
|
size_t log_file_name2_len= strlen(log_file_name2);
|
2002-09-11 05:40:08 +02:00
|
|
|
|
2003-01-25 14:07:51 +01:00
|
|
|
// We assume that both log names match up to '.'
|
|
|
|
if (log_file_name1_len == log_file_name2_len)
|
|
|
|
{
|
|
|
|
if ((res= strcmp(log_file_name1, log_file_name2)))
|
|
|
|
return res;
|
|
|
|
return (log_pos1 < log_pos2) ? -1 : (log_pos1 == log_pos2) ? 0 : 1;
|
|
|
|
}
|
|
|
|
return ((log_file_name1_len < log_file_name2_len) ? -1 : 1);
|
2001-07-05 01:14:31 +02:00
|
|
|
}
|
|
|
|
|
2002-09-11 05:40:08 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a SHOW BINLOG EVENTS statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE failure
|
|
|
|
*/
|
XA (not completely polished out yet)
include/my_pthread.h:
cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
test fix
mysql-test/r/ctype_ucs.result:
new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
test fix
mysql-test/r/rpl000015.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
new log event - all binlog positions are changed :(
mysys/hash.c:
typo fixed
sql/ha_berkeley.cc:
handlerton framework
sql/ha_berkeley.h:
handlerton framework
sql/ha_innodb.cc:
handlerton framework
sql/ha_innodb.h:
handlerton framework
sql/handler.cc:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
XA commands
sql/log.cc:
new transaction handling, handlerton framework, two-phase commit,
XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
Xid_log_event
sql/log_event.h:
Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
wrapper for query_id++
sql/mysqld.cc:
new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
init/stop tc logging
sql/set_var.h:
warning fixed
sql/share/errmsg.txt:
XA error messages
sql/sp_head.cc:
s/query_id++/next_query_id()/
sql/sql_base.cc:
typo fixed. new transaction handling.
sql/sql_class.cc:
cleanup of THD.transaction
sql/sql_class.h:
TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
comments
sql/sql_lex.cc:
s/found_colon/found_semicolon/
sql/sql_lex.h:
SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
two functions moved to log.cc
sql/sql_repl.h:
two functions moved to log.cc
sql/sql_trigger.cc:
s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
XA commands, cleanup
2005-01-16 13:16:23 +01:00
|
|
|
bool mysql_show_binlog_events(THD* thd)
|
2001-06-21 21:19:24 +02:00
|
|
|
{
|
2002-12-11 08:17:51 +01:00
|
|
|
Protocol *protocol= thd->protocol;
|
2001-06-21 21:19:24 +02:00
|
|
|
List<Item> field_list;
|
2002-12-11 08:17:51 +01:00
|
|
|
const char *errmsg = 0;
|
2005-02-28 16:34:02 +01:00
|
|
|
bool ret = TRUE;
|
2001-06-21 21:19:24 +02:00
|
|
|
IO_CACHE log;
|
|
|
|
File file = -1;
|
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),
- New optional handler function introduced: reset()
This is called after every DML statement to make it easy for a handler to
statement specific cleanups.
(The only case it's not called is if force the file to be closed)
- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
should be moved to handler::reset()
- table->read_set contains a bitmap over all columns that are needed
in the query. read_row() and similar functions only needs to read these
columns
- table->write_set contains a bitmap over all columns that will be updated
in the query. write_row() and update_row() only needs to update these
columns.
The above bitmaps should now be up to date in all context
(including ALTER TABLE, filesort()).
The handler is informed of any changes to the bitmap after
fix_fields() by calling the virtual function
handler::column_bitmaps_signal(). If the handler does caching of
these bitmaps (instead of using table->read_set, table->write_set),
it should redo the caching in this code. as the signal() may be sent
several times, it's probably best to set a variable in the signal
and redo the caching on read_row() / write_row() if the variable was
set.
- Removed the read_set and write_set bitmap objects from the handler class
- Removed all column bit handling functions from the handler class.
(Now one instead uses the normal bitmap functions in my_bitmap.c instead
of handler dedicated bitmap functions)
- field->query_id is removed. One should instead instead check
table->read_set and table->write_set if a field is used in the query.
- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
instead use table->read_set to check for which columns to retrieve.
- If a handler needs to call Field->val() or Field->store() on columns
that are not used in the query, one should install a temporary
all-columns-used map while doing so. For this, we provide the following
functions:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
field->val();
dbug_tmp_restore_column_map(table->read_set, old_map);
and similar for the write map:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
field->val();
dbug_tmp_restore_column_map(table->write_set, old_map);
If this is not done, you will sooner or later hit a DBUG_ASSERT
in the field store() / val() functions.
(For not DBUG binaries, the dbug_tmp_restore_column_map() and
dbug_tmp_restore_column_map() are inline dummy functions and should
be optimized away be the compiler).
- If one needs to temporary set the column map for all binaries (and not
just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
methods) one should use the functions tmp_use_all_columns() and
tmp_restore_column_map() instead of the above dbug_ variants.
- All 'status' fields in the handler base class (like records,
data_file_length etc) are now stored in a 'stats' struct. This makes
it easier to know what status variables are provided by the base
handler. This requires some trivial variable names in the extra()
function.
- New virtual function handler::records(). This is called to optimize
COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
(stats.records is not supposed to be an exact value. It's only has to
be 'reasonable enough' for the optimizer to be able to choose a good
optimization path).
- Non virtual handler::init() function added for caching of virtual
constants from engine.
- Removed has_transactions() virtual method. Now one should instead return
HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
transactions.
- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
that is to be used with 'new handler_name()' to allocate the handler
in the right area. The xxxx_create_handler() function is also
responsible for any initialization of the object before returning.
For example, one should change:
static handler *myisam_create_handler(TABLE_SHARE *table)
{
return new ha_myisam(table);
}
->
static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
return new (mem_root) ha_myisam(table);
}
- New optional virtual function: use_hidden_primary_key().
This is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key. This allows the handler to take precisions
in remembering any hidden primary key to able to update/delete any
found row. The default handler marks all columns to be read.
- handler::table_flags() now returns a ulonglong (to allow for more flags).
- New/changed table_flags()
- HA_HAS_RECORDS Set if ::records() is supported
- HA_NO_TRANSACTIONS Set if engine doesn't support transactions
- HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
Set if we should mark all primary key columns for
read when reading rows as part of a DELETE
statement. If there is no primary key,
all columns are marked for read.
- HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some
cases (based on table->read_set)
- HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- HA_DUPP_POS Renamed to HA_DUPLICATE_POS
- HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
Set this if we should mark ALL key columns for
read when when reading rows as part of a DELETE
statement. In case of an update we will mark
all keys for read for which key part changed
value.
- HA_STATS_RECORDS_IS_EXACT
Set this if stats.records is exact.
(This saves us some extra records() calls
when optimizing COUNT(*))
- Removed table_flags()
- HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if
handler::records() gives an exact count() and
HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
- HA_READ_RND_SAME Removed (no one supported this one)
- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()
- Renamed handler::dupp_pos to handler::dup_pos
- Removed not used variable handler::sortkey
Upper level handler changes:
- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
cache is updated on engine creation time and updated on open.
MySQL level changes (not obvious from the above):
- DBUG_ASSERT() added to check that column usage matches what is set
in the column usage bit maps. (This found a LOT of bugs in current
column marking code).
- In 5.1 before, all used columns was marked in read_set and only updated
columns was marked in write_set. Now we only mark columns for which we
need a value in read_set.
- Column bitmaps are created in open_binary_frm() and open_table_from_share().
(Before this was in table.cc)
- handler::table_flags() calls are replaced with handler::ha_table_flags()
- For calling field->val() you must have the corresponding bit set in
table->read_set. For calling field->store() you must have the
corresponding bit set in table->write_set. (There are asserts in
all store()/val() functions to catch wrong usage)
- thd->set_query_id is renamed to thd->mark_used_columns and instead
of setting this to an integer value, this has now the values:
MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
Changed also all variables named 'set_query_id' to mark_used_columns.
- In filesort() we now inform the handler of exactly which columns are needed
doing the sort and choosing the rows.
- The TABLE_SHARE object has a 'all_set' column bitmap one can use
when one needs a column bitmap with all columns set.
(This is used for table->use_all_columns() and other places)
- The TABLE object has 3 column bitmaps:
- def_read_set Default bitmap for columns to be read
- def_write_set Default bitmap for columns to be written
- tmp_set Can be used as a temporary bitmap when needed.
The table object has also two pointer to bitmaps read_set and write_set
that the handler should use to find out which columns are used in which way.
- count() optimization now calls handler::records() instead of using
handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).
- Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
- Added TABLE parameter to cp_buffer_from_ref()
- Don't close tables created with CREATE ... SELECT but keep them in
the table cache. (Faster usage of newly created tables).
New interfaces:
- table->clear_column_bitmaps() to initialize the bitmaps for tables
at start of new statements.
- table->column_bitmaps_set() to set up new column bitmaps and signal
the handler about this.
- table->column_bitmaps_set_no_signal() for some few cases where we need
to setup new column bitmaps but don't signal the handler (as the handler
has already been signaled about these before). Used for the momement
only in opt_range.cc when doing ROR scans.
- table->use_all_columns() to install a bitmap where all columns are marked
as use in the read and the write set.
- table->default_column_bitmaps() to install the normal read and write
column bitmaps, but not signaling the handler about this.
This is mainly used when creating TABLE instances.
- table->mark_columns_needed_for_delete(),
table->mark_columns_needed_for_delete() and
table->mark_columns_needed_for_insert() to allow us to put additional
columns in column usage maps if handler so requires.
(The handler indicates what it neads in handler->table_flags())
- table->prepare_for_position() to allow us to tell handler that it
needs to read primary key parts to be able to store them in
future table->position() calls.
(This replaces the table->file->ha_retrieve_all_pk function)
- table->mark_auto_increment_column() to tell handler are going to update
columns part of any auto_increment key.
- table->mark_columns_used_by_index() to mark all columns that is part of
an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
it to quickly know that it only needs to read colums that are part
of the key. (The handler can also use the column map for detecting this,
but simpler/faster handler can just monitor the extra() call).
- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
also mark all columns that is used by the given key.
- table->restore_column_maps_after_mark_index() to restore to default
column maps after a call to table->mark_columns_used_by_index().
- New item function register_field_in_read_map(), for marking used columns
in table->read_map. Used by filesort() to mark all used columns
- Maintain in TABLE->merge_keys set of all keys that are used in query.
(Simplices some optimization loops)
- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
but the field in the clustered key is not assumed to be part of all index.
(used in opt_range.cc for faster loops)
- dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
mark all columns as usable. The 'dbug_' version is primarily intended
inside a handler when it wants to just call Field:store() & Field::val()
functions, but don't need the column maps set for any other usage.
(ie:: bitmap_is_set() is never called)
- We can't use compare_records() to skip updates for handlers that returns
a partial column set and the read_set doesn't cover all columns in the
write set. The reason for this is that if we have a column marked only for
write we can't in the MySQL level know if the value changed or not.
The reason this worked before was that MySQL marked all to be written
columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
bug'.
- open_table_from_share() does not anymore setup temporary MEM_ROOT
object as a thread specific variable for the handler. Instead we
send the to-be-used MEMROOT to get_new_handler().
(Simpler, faster code)
Bugs fixed:
- Column marking was not done correctly in a lot of cases.
(ALTER TABLE, when using triggers, auto_increment fields etc)
(Could potentially result in wrong values inserted in table handlers
relying on that the old column maps or field->set_query_id was correct)
Especially when it comes to triggers, there may be cases where the
old code would cause lost/wrong values for NDB and/or InnoDB tables.
- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
This allowed me to remove some wrong warnings about:
"Some non-transactional changed tables couldn't be rolled back"
- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
(thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
some warnings about
"Some non-transactional changed tables couldn't be rolled back")
- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
which could cause delete_table to report random failures.
- Fixed core dumps for some tests when running with --debug
- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after
crash)
- slow_logs was not properly initialized, which could maybe cause
extra/lost entries in slow log.
- If we get an duplicate row on insert, change column map to read and
write all columns while retrying the operation. This is required by
the definition of REPLACE and also ensures that fields that are only
part of UPDATE are properly handled. This fixed a bug in NDB and
REPLACE where REPLACE wrongly copied some column values from the replaced
row.
- For table handler that doesn't support NULL in keys, we would give an error
when creating a primary key with NULL fields, even after the fields has been
automaticly converted to NOT NULL.
- Creating a primary key on a SPATIAL key, would fail if field was not
declared as NOT NULL.
Cleanups:
- Removed not used condition argument to setup_tables
- Removed not needed item function reset_query_id_processor().
- Field->add_index is removed. Now this is instead maintained in
(field->flags & FIELD_IN_ADD_INDEX)
- Field->fieldnr is removed (use field->field_index instead)
- New argument to filesort() to indicate that it should return a set of
row pointers (not used columns). This allowed me to remove some references
to sql_command in filesort and should also enable us to return column
results in some cases where we couldn't before.
- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
bitmap, which allowed me to use bitmap functions instead of looping over
all fields to create some needed bitmaps. (Faster and smaller code)
- Broke up found too long lines
- Moved some variable declaration at start of function for better code
readability.
- Removed some not used arguments from functions.
(setup_fields(), mysql_prepare_insert_check_table())
- setup_fields() now takes an enum instead of an int for marking columns
usage.
- For internal temporary tables, use handler::write_row(),
handler::delete_row() and handler::update_row() instead of
handler::ha_xxxx() for faster execution.
- Changed some constants to enum's and define's.
- Using separate column read and write sets allows for easier checking
of timestamp field was set by statement.
- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()
- Don't build table->normalized_path as this is now identical to table->path
(after bar's fixes to convert filenames)
- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
do comparision with the 'convert-dbug-for-diff' tool.
Things left to do in 5.1:
- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
Mats has promised to look into this.
- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
(I added several test cases for this, but in this case it's better that
someone else also tests this throughly).
Lars has promosed to do this.
BitKeeper/etc/ignore:
added mysys/test_bitmap
include/base64.h:
Removed my_global.h, as this must be included first in any program
include/heap.h:
Added heap_reset() (Required by new handler interface)
include/my_base.h:
Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
Remove my_pthread.h (should be included at upper level)
Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
Simplify ldata usage
Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
Use copy instead of INSTALL_DB for master and slave databases.
(Speeds up startup time a lot!)
Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
Added drop of test function
mysql-test/r/innodb_mysql.result:
Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
More tests
Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
Better error message
mysql-test/r/ndb_replace.result:
New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
Drop used views
mysql-test/t/create.test:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
Added drop of test function
mysql-test/t/innodb_mysql.test:
Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
More tests
Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
Drop used views
mysql-test/valgrind.supp:
Added supression of not needed warnings when printing stack trace
mysys/base64.c:
Include my_global.h first
mysys/my_bitmap.c:
Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
Ensure 'use_all_columns()' is used for event tables
Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
(Rest of changes are only indentation cleanups)
sql/field.h:
Removed Field->query_id (replaced by table->read_set and table->write_set)
Removed Field->fieldnr (use Field->field_index instead)
Removed Field->add_index (Use Field->flags instead)
Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
This allowed me to remove checking of sql_command.
Create a temporary column bitmap for fields that are used by the sorting process.
Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
Update to 'newer' table handler interface
sql/ha_berkeley.h:
Update to 'newer' table handler interface
sql/ha_federated.cc:
Update to 'newer' table handler interface
Only read columns that are needed from remote server.
In case of eq ranges, don't generate two conditions in the WHERE clause
(this can still be optimized, but would require a bigger code change)
Use 'simpler to use' XXXX_LEN' macros
A bit simpler logic in ::write_row() when creating statements.
In update, only include test of fields actually read.
(This greatly simplifies the queries sent by the federated engine)
Similar changes done for delete_row()
sql/ha_federated.h:
Update to 'newer' table handler interface
Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
Update to 'newer' table handler interface
sql/ha_heap.h:
Update to 'newer' table handler interface
sql/ha_innodb.cc:
Update to 'newer' table handler interface
- Update innobase_create_handler() to new interface
- Removed HA_NOT_EXACT_COUNT (not needed)
- Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- Prefixed base status variables with 'stats'
- Use table column bitmaps instead of ha_get_bit_in_read_set()
- Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
- Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
Update to 'newer' table handler interface
- table_flags are now ulonglong
- Added reset() method
- Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
- Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
Update to 'newer' table handler interface
sql/ha_myisam.h:
Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
Update to 'newer' table handler interface
sql/ha_myisammrg.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
Update to 'newer' table handler interface
Fixed use_blob_value() to be accurate
In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
Correct dumping of field data with DBUG_DUMP
Prefix addresses in DBUG_PRINT with 0x
Fixed usage of not initialized memory
Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
Mark usage of all columns in ndbcluster binlog tables
false -> FALSE, true -> TRUE
Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
Update to 'newer' table handler interface
Added memroot to initialise_partitions() and related functions to get faster memory allocation.
partition_create_handler() is now responsible for initialisation of the partition object
Some trivial optimizations and indentation fixes
Ensure that table_flags() are up to date
Removed documentation for removed HA_EXTRA flags
Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
Update to 'newer' table handler interface
sql/handler.cc:
create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
Much simpler get_new_handler()
(Initialization of the object is now handled by the create method for the engine)
Moved all allocation of bitmap handling to the TABLE object (in table.cc)
Added column_bitmaps_signal() to signal column usage changes.
Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
HA_DUPP_POS -> HA_DUPLICATE_POS
HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Added future row type 'ROW_TYPE_PAGES'
Added MEM_ROOT to handlerton 'create' function
Added ha_statistics, a structure for all status variable in the base handler class.
Moved all status variables in the handler class into a stats structs to improve readability.
ha_table_flags() is now a cached (not virtual) version of table_flags()
reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
Renamed dupp_ref to dup_ref
Renamed not used handler::sortkey
Moved read_set and write_set to TABLE structure
handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
Added register_field_in_read_map() for marking used columns in expression.
This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
Initalize value.cs_info.character_set_client to fix core dump bug with --debug
set_query_id -> mark_used_columns
Mark used columns in read_set OR write_set.
sql/item.h:
Removed reset_query_id_processor() as it's not needed anymore.
Added register_field_in_read_map()
Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
sql/item_cmpfunc.cc:
Temporary mark used columns to be read/writable
Update Item::walk to new interface
sql/item_cmpfunc.h:
Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
Update Item::walk() to new interface
table_flags() -> ha_table_flags()
sql/item_func.h:
Update Item::walk() to new interface
sql/item_row.cc:
Update Item::walk() to new interface
sql/item_row.h:
Update Item::walk() to new interface
sql/item_strfunc.h:
Update Item::walk() to new interface
sql/item_subselect.cc:
Added Item_subselect::walk()
(It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
Update Item::walk() to new interface
sql/item_sum.cc:
Update Item::walk() to new interface
Updates for new handler interace
sql/item_sum.h:
Update Item::walk() to new interface
sql/key.cc:
Updates for new handler interace
sql/log.cc:
Mark all columns used for log tables
Split options flag
Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
Fixed comments to be withing 79 characters
Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
Updates for new handler interface
Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
Indentation fixes and removed old comment
sql/opt_range.cc:
Update to new handler and bitmap interface.
Fixed calls to cp_buffer_from_ref() and walk() (new argument).
Create new temporary bitmaps for ror scans.
(Needed because of handler changes and to get more accurate column bitmaps than before)
Remove not needed file->ha_reset() call before file->close().
Some trivial optimization and indentation fixes.
Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
(This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
Optimized bitmap handling in ror scans:
- Start bitmap at position 0, not 1
- Use same bitmap size as in TABLE
- Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
Updates for new handler interface
sql/set_var.cc:
Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
Fixed wrong
sql/sp.cc:
Mark that we are using all columns for the proc table
Update call to setup_tables() to use new prototype
sql/sp_head.cc:
Removed QQ comment
sql/spatial.cc:
Removed wrong QQ comment
sql/sql_acl.cc:
Mark that we need all columns for acl tables
Supply memroot to some 'new' calls.
Indentation fixes
sql/sql_base.cc:
set_query_id removed
Ensure we call ha_reset() at end of each statement
Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
Fixed marking of some columns that was not proplerly marked before
Maintain in TABLE->merge_keys set of all keys that are used in some way
Removed not used 'conds' argument from setup_tables()
Remove not used setting of 'dupp_field' in insert_fields()
Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
Added is_overlapping()
sql/sql_class.cc:
Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
set_query_id -> mark_used_columns
Simpler variable usage in pack_row() (cleanup)
Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
Added enum_mark_columns
Updated comments
Renamed dupp_field -> dup_field
Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
(This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
Updates to new handler interface
Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
Call table->prepare_for_position() to tell handler that we are going to call ha_position().
Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
Fixed calls to setup_tables()
sql/sql_do.cc:
Update call to setup_fields()
sql/sql_handler.cc:
Tell handler tables to always read all columns.
Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
Makr all used fields to be read
Update call to setup_fields()
sql/sql_insert.cc:
Tell handler we are going to update the auto_increment column
dupp_field -> dup_field
Set column usage bits for timestamp field.
Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
Removed not used argument from mysql_prepare_insert_check_table().
If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
Setup new bitmaps for delayed insert rows
Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
The issue was that one should not to reset this flag as it may be set by a previous statement.
The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
Don't close tables created with CREATE ... SELECT but keep them in the table cache.
Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
Update to use new handler and column marking interface
Update using setup_tables()
sql/sql_olap.cc:
Update calls to setup_tables
Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
Handle OPTION_KEEP_LOG:
- Set it on CREATE TEMPORARY TABLE / DROP TABLE
- Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
- Don't set it for CREATE ... SELECT (this is handled in select_create class)
Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
Update walk() usage
Trivial indentation fixes
sql/sql_plugin.cc:
Mark all columns as used for plugins
sql/sql_prepare.cc:
Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
Updates for new handler interface
Update calls to setup_fields()
sql/sql_repl.cc:
Indentation fixes
sql/sql_select.cc:
Update call to setup_tables() and setup_fields()
Remove some old disabled code
Update to new hadler interface
Indentation cleanups
Added column bitmaps for temporary tables.
Remove updating of the removed slots in the Field class
Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
Indentaition fixes.
Install temporary column usage maps when needed
Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
Update to new handler interface
Mark all columns used for internal tables.
Style fixes.
Added support for 'future' ROW_TYPE_PAGES.
Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
Update to new handler interface
Simple my_snprintf -> strmake()
Changed some constants to defines
Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
Mark all columns as used for ALTER TABLE
Style fixes
Update call to filesort()
sql/sql_trigger.h:
Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
Mark all columns as used for udf system table.
sql/sql_union.cc:
Update call to walk()
Update to new handler interface
sql/sql_update.cc:
Remove query_id argument from compare_record()
Use column bitmaps instead of query_id.
We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
Update call to setup_fields()
Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
Removed call to free_io_cache() as this is now done in ha_reset()
Call table->mark_columns_needed_for_update() and table->prepare_for_position()
Style fixes
sql/sql_view.cc:
Style fixes
sql/table.cc:
Remove implicitely include 'errno.h'
Remove code for building normalized path, as this is now identical to 'path'
Remove field->fieldnr
Added update of field->part_of_key_not_clustered()
Create column bitmaps in TABLE and TABLE_SHARE
Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
Update to new handler interface
Update call to walk()
Added new functions:
- st_table::clear_column_bitmaps()
- st_table::prepare_for_position()
- st_table::mark_columns_used_by_index()
- st_table::restore_column_maps_after_mark_index()
- st_table::mark_columns_used_by_index_no_reset()
- st_table::mark_auto_increment_column()
- st_table::mark_columns_needed_for_delete()
- st_table::mark_columns_needed_for_update()
- st_table::mark_columns_needed_for_insert()
sql/table.h:
Moved column usage bitmaps from handler to TABLE
Added to TABLE_SHARE all_set and column_bitmap_size
Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
Declared all new table column bitmap functions
Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
Update to new handler interface
storage/archive/ha_archive.h:
Update to new handler interface
storage/blackhole/ha_blackhole.cc:
Update to new handler interface
storage/blackhole/ha_blackhole.h:
Update to new handler interface
removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
Update to new handler interface
storage/csv/ha_tina.h:
Update to new handler interface
storage/example/ha_example.cc:
Update to new handler interface
storage/example/ha_example.h:
Update to new handler interface
storage/heap/hp_extra.c:
Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
Use heap_reset()
storage/myisam/ft_boolean_search.c:
Fixed compiler warning
storage/myisam/mi_extra.c:
Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
Use mi_reset()
storage/myisam/myisampack.c:
Use mi_reset()
storage/myisammrg/myrg_extra.c:
Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
Include my_global.h
Don't include implictely include file 'stdlib.h'
2006-06-04 17:52:22 +02:00
|
|
|
DBUG_ENTER("mysql_show_binlog_events");
|
2001-07-10 14:53:08 +02:00
|
|
|
|
|
|
|
Log_event::init_show_field_list(&field_list);
|
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
include/mysql.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new statement attribute STMT_ATTR_CURSOR_TYPE
- MYSQL_STMT::flags to store statement cursor type
- MYSQL_STMT::server_status to store server status (i. e. if the server
was able to open a cursor for this query).
include/mysql_com.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new COMmand, COM_FETCH, to fetch K rows from read-only cursor.
By design should support scrollable cursors as well.
- a few new server statuses:
SERVER_STATUS_CURSOR_EXISTS is sent by server in reply to COM_EXECUTE,
when cursor was successfully opened for this query
SERVER_STATUS_LAST_ROW_SENT is sent along with the last row to prevent one
more round trip just for finding out that all rows were fetched from
this cursor (this is server mem savier also).
- and finally, all possible values of STMT_ATTR_CURSOR_TYPE,
while now we support only CURSORT_TYPE_NO_CURSOR and
CURSOR_TYPE_READ_ONLY
libmysql/libmysql.c:
Cursor patch to push into the main tree, client library part (considered
stable):
- simple additions to mysql_stmt_fetch implementation to read data
from an opened cursor: we can read up to iteration count rows per
one request; read rows are buffered in the same way as rows of
mysql_stmt_store_result.
- now send stmt->flags to server to let him now if we wish to have
a cursor for this statement.
- support for setting/getting statement cursor type.
libmysqld/examples/Makefile.am:
Testing cursors was originally implemented in C++. Now when these tests
go into client_test, it's time to convert it to C++ as well.
libmysqld/lib_sql.cc:
- cleanup: send_fields flags are now named.
sql/ha_innodb.cc:
- cleanup: send_fields flags are now named.
sql/mysql_priv.h:
- cursors support: declaration for server-side handler of COM_FETCH
sql/protocol.cc:
- cleanup: send_fields flags are now named.
- we can't anymore assert that field_types[field_pos] is sensible:
if we have COM_EXCUTE(stmt1), COM_EXECUTE(stmt2), COM_FETCH(stmt1)
field_types[field_pos] will point to fields of stmt2.
sql/protocol.h:
- cleanup: send_fields flag_s_ are now named.
sql/protocol_cursor.cc:
- cleanup: send_fields flags are now named.
sql/repl_failsafe.cc:
- cleanup: send_fields flags are now named.
sql/slave.cc:
- cleanup: send_fields flags are now named.
sql/sp.cc:
- cleanup: send_fields flags are now named.
sql/sp_head.cc:
- cleanup: send_fields flags are now named.
sql/sql_acl.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.h:
- cleanup: send_fields flags are now named.
sql/sql_error.cc:
- cleanup: send_fields flags are now named.
sql/sql_handler.cc:
- cleanup: send_fields flags are now named.
sql/sql_help.cc:
- cleanup: send_fields flags are now named.
sql/sql_parse.cc:
Server side support for cursors:
- handle COM_FETCH
- enforce assumption that whenever we free thd->free_list,
we reset it to zero. This way it's much easier to handle free_list
in prepared statements implementation.
sql/sql_prepare.cc:
Server side support for cursors:
- implementation of mysql_stmt_fetch (fetch some rows from open cursor).
- management of cursors memory is quite tricky now.
- execute_stmt can't be reused anymore in mysql_stmt_execute and
mysql_sql_stmt_execute
sql/sql_repl.cc:
- cleanup: send_fields flags are now named.
sql/sql_select.cc:
Server side support for cursors:
- implementation of Cursor::open, Cursor::fetch (buggy when it comes to
non-equi joins), cursor cleanups.
- -4 -3 -0 constants indicating return value of sub_select and end_send are
to be renamed to something more readable:
it turned out to be not so simple, so it should come with the other patch.
sql/sql_select.h:
Server side support for cursors:
- declaration of Cursor class.
- JOIN::fetch_limit contains runtime value of rows fetched via cursor.
sql/sql_show.cc:
- cleanup: send_fields flags are now named.
sql/sql_table.cc:
- cleanup: send_fields flags are now named.
sql/sql_union.cc:
- if there was a cursor, don't cleanup unit: we'll need it to fetch
the rest of the rows.
tests/Makefile.am:
Now client_test is in C++.
tests/client_test.cc:
A few elementary tests for cursors.
BitKeeper/etc/ignore:
Added libmysqld/examples/client_test.cc to the ignore list
2004-08-03 12:32:21 +02:00
|
|
|
if (protocol->send_fields(&field_list,
|
|
|
|
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2006-01-03 17:54:54 +01:00
|
|
|
Format_description_log_event *description_event= new
|
|
|
|
Format_description_log_event(3); /* MySQL 4.0 by default */
|
|
|
|
|
2006-01-12 19:51:02 +01:00
|
|
|
/*
|
|
|
|
Wait for handlers to insert any pending information
|
|
|
|
into the binlog. For e.g. ndb which updates the binlog asynchronously
|
|
|
|
this is needed so that the uses sees all its own commands in the binlog
|
|
|
|
*/
|
|
|
|
ha_binlog_wait(thd);
|
|
|
|
|
2001-06-21 21:19:24 +02:00
|
|
|
if (mysql_bin_log.is_open())
|
|
|
|
{
|
2003-12-19 18:52:13 +01:00
|
|
|
LEX_MASTER_INFO *lex_mi= &thd->lex->mi;
|
Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
mysql-test/include/ps_modify.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/include/ps_query.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/r/ps.result:
Add basic test coverage for LIMIT ?, ? and fix test results.
mysql-test/r/ps_2myisam.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_3innodb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_4heap.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_5merge.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_6bdb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_7ndb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/t/ps.test:
Add basic test coverage for LIMIT ?, ?.
sql/item.h:
Add a short-cut for (ulonglong) val_int() to Item.
Add a constructor to Item_int() that accepts ulonglong.
Simplify Item_uint constructor by using the c-tor above.
sql/item_subselect.cc:
Now select_limit has type Item *.
We can safely create an Item in Item_exists_subselect::fix_length_and_dec():
it will be allocated in runtime memory root and freed in the end of
execution.
sql/sp_head.cc:
Add a special initalization state for stored procedures to
be able to easily distinguish the first execution of a stored procedure
from prepared statement prepare.
sql/sql_class.h:
Introduce new state 'INITIALIZED_FOR_SP' to be able to easily distinguish
the first execution of a stored procedure from prepared statement prepare.
sql/sql_derived.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace. Add a warning about use of set_limit in
mysql_derived_filling.
sql/sql_error.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace.
- this change is also aware of bug#11095 "show warnings limit 0 returns
all rows instead of zero rows", so the one who merges the bugfix from
4.1 can use local version of sql_error.cc.
sql/sql_handler.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
sql/sql_lex.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_lex.h:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_parse.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
- we can create an Item_int to set global limit of a statement:
it will be created in the runtime mem root and freed in the end of
execution.
sql/sql_repl.cc:
Use unit->set_limit to initialize limits.
sql/sql_select.cc:
- select_limit is now Item* so the proper way to check for default value
is to compare it with NULL.
sql/sql_union.cc:
Evaluate offset_limit_cnt using the new type of ST_SELECT_LEX::offset_limit
sql/sql_view.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_yacc.yy:
Add grammar support for LIMIT ?, ? clause.
2005-06-07 12:11:36 +02:00
|
|
|
SELECT_LEX_UNIT *unit= &thd->lex->unit;
|
2002-11-14 11:21:36 +01:00
|
|
|
ha_rows event_count, limit_start, limit_end;
|
2003-06-03 23:13:06 +02:00
|
|
|
my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly
|
2002-08-08 02:12:02 +02:00
|
|
|
char search_file_name[FN_REFLEN], *name;
|
|
|
|
const char *log_file_name = lex_mi->log_file_name;
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
|
2002-08-08 02:12:02 +02:00
|
|
|
LOG_INFO linfo;
|
|
|
|
Log_event* ev;
|
2005-02-09 20:04:28 +01:00
|
|
|
|
Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
mysql-test/include/ps_modify.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/include/ps_query.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/r/ps.result:
Add basic test coverage for LIMIT ?, ? and fix test results.
mysql-test/r/ps_2myisam.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_3innodb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_4heap.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_5merge.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_6bdb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_7ndb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/t/ps.test:
Add basic test coverage for LIMIT ?, ?.
sql/item.h:
Add a short-cut for (ulonglong) val_int() to Item.
Add a constructor to Item_int() that accepts ulonglong.
Simplify Item_uint constructor by using the c-tor above.
sql/item_subselect.cc:
Now select_limit has type Item *.
We can safely create an Item in Item_exists_subselect::fix_length_and_dec():
it will be allocated in runtime memory root and freed in the end of
execution.
sql/sp_head.cc:
Add a special initalization state for stored procedures to
be able to easily distinguish the first execution of a stored procedure
from prepared statement prepare.
sql/sql_class.h:
Introduce new state 'INITIALIZED_FOR_SP' to be able to easily distinguish
the first execution of a stored procedure from prepared statement prepare.
sql/sql_derived.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace. Add a warning about use of set_limit in
mysql_derived_filling.
sql/sql_error.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace.
- this change is also aware of bug#11095 "show warnings limit 0 returns
all rows instead of zero rows", so the one who merges the bugfix from
4.1 can use local version of sql_error.cc.
sql/sql_handler.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
sql/sql_lex.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_lex.h:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_parse.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
- we can create an Item_int to set global limit of a statement:
it will be created in the runtime mem root and freed in the end of
execution.
sql/sql_repl.cc:
Use unit->set_limit to initialize limits.
sql/sql_select.cc:
- select_limit is now Item* so the proper way to check for default value
is to compare it with NULL.
sql/sql_union.cc:
Evaluate offset_limit_cnt using the new type of ST_SELECT_LEX::offset_limit
sql/sql_view.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_yacc.yy:
Add grammar support for LIMIT ?, ? clause.
2005-06-07 12:11:36 +02:00
|
|
|
unit->set_limit(thd->lex->current_select);
|
|
|
|
limit_start= unit->offset_limit_cnt;
|
|
|
|
limit_end= unit->select_limit_cnt;
|
2001-06-21 21:19:24 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
name= search_file_name;
|
2001-06-21 21:19:24 +02:00
|
|
|
if (log_file_name)
|
|
|
|
mysql_bin_log.make_log_name(search_file_name, log_file_name);
|
|
|
|
else
|
2002-08-08 02:12:02 +02:00
|
|
|
name=0; // Find first log
|
2001-06-21 21:19:24 +02:00
|
|
|
|
|
|
|
linfo.index_file_offset = 0;
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2002-08-22 15:50:58 +02:00
|
|
|
if (mysql_bin_log.find_log_pos(&linfo, name, 1))
|
2001-06-21 21:19:24 +02:00
|
|
|
{
|
|
|
|
errmsg = "Could not find target log";
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2007-10-03 11:57:14 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
thd->current_linfo = &linfo;
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
|
|
|
|
2001-06-21 21:19:24 +02:00
|
|
|
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
|
|
|
|
goto err;
|
|
|
|
|
2007-12-21 21:34:43 +01:00
|
|
|
/*
|
|
|
|
to account binlog event header size
|
|
|
|
*/
|
|
|
|
thd->variables.max_allowed_packet += MAX_LOG_EVENT_HEADER;
|
|
|
|
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_lock(log_lock);
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
|
2005-02-09 20:04:28 +01:00
|
|
|
/*
|
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),
- New optional handler function introduced: reset()
This is called after every DML statement to make it easy for a handler to
statement specific cleanups.
(The only case it's not called is if force the file to be closed)
- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
should be moved to handler::reset()
- table->read_set contains a bitmap over all columns that are needed
in the query. read_row() and similar functions only needs to read these
columns
- table->write_set contains a bitmap over all columns that will be updated
in the query. write_row() and update_row() only needs to update these
columns.
The above bitmaps should now be up to date in all context
(including ALTER TABLE, filesort()).
The handler is informed of any changes to the bitmap after
fix_fields() by calling the virtual function
handler::column_bitmaps_signal(). If the handler does caching of
these bitmaps (instead of using table->read_set, table->write_set),
it should redo the caching in this code. as the signal() may be sent
several times, it's probably best to set a variable in the signal
and redo the caching on read_row() / write_row() if the variable was
set.
- Removed the read_set and write_set bitmap objects from the handler class
- Removed all column bit handling functions from the handler class.
(Now one instead uses the normal bitmap functions in my_bitmap.c instead
of handler dedicated bitmap functions)
- field->query_id is removed. One should instead instead check
table->read_set and table->write_set if a field is used in the query.
- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
instead use table->read_set to check for which columns to retrieve.
- If a handler needs to call Field->val() or Field->store() on columns
that are not used in the query, one should install a temporary
all-columns-used map while doing so. For this, we provide the following
functions:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
field->val();
dbug_tmp_restore_column_map(table->read_set, old_map);
and similar for the write map:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
field->val();
dbug_tmp_restore_column_map(table->write_set, old_map);
If this is not done, you will sooner or later hit a DBUG_ASSERT
in the field store() / val() functions.
(For not DBUG binaries, the dbug_tmp_restore_column_map() and
dbug_tmp_restore_column_map() are inline dummy functions and should
be optimized away be the compiler).
- If one needs to temporary set the column map for all binaries (and not
just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
methods) one should use the functions tmp_use_all_columns() and
tmp_restore_column_map() instead of the above dbug_ variants.
- All 'status' fields in the handler base class (like records,
data_file_length etc) are now stored in a 'stats' struct. This makes
it easier to know what status variables are provided by the base
handler. This requires some trivial variable names in the extra()
function.
- New virtual function handler::records(). This is called to optimize
COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
(stats.records is not supposed to be an exact value. It's only has to
be 'reasonable enough' for the optimizer to be able to choose a good
optimization path).
- Non virtual handler::init() function added for caching of virtual
constants from engine.
- Removed has_transactions() virtual method. Now one should instead return
HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
transactions.
- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
that is to be used with 'new handler_name()' to allocate the handler
in the right area. The xxxx_create_handler() function is also
responsible for any initialization of the object before returning.
For example, one should change:
static handler *myisam_create_handler(TABLE_SHARE *table)
{
return new ha_myisam(table);
}
->
static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
return new (mem_root) ha_myisam(table);
}
- New optional virtual function: use_hidden_primary_key().
This is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key. This allows the handler to take precisions
in remembering any hidden primary key to able to update/delete any
found row. The default handler marks all columns to be read.
- handler::table_flags() now returns a ulonglong (to allow for more flags).
- New/changed table_flags()
- HA_HAS_RECORDS Set if ::records() is supported
- HA_NO_TRANSACTIONS Set if engine doesn't support transactions
- HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
Set if we should mark all primary key columns for
read when reading rows as part of a DELETE
statement. If there is no primary key,
all columns are marked for read.
- HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some
cases (based on table->read_set)
- HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- HA_DUPP_POS Renamed to HA_DUPLICATE_POS
- HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
Set this if we should mark ALL key columns for
read when when reading rows as part of a DELETE
statement. In case of an update we will mark
all keys for read for which key part changed
value.
- HA_STATS_RECORDS_IS_EXACT
Set this if stats.records is exact.
(This saves us some extra records() calls
when optimizing COUNT(*))
- Removed table_flags()
- HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if
handler::records() gives an exact count() and
HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
- HA_READ_RND_SAME Removed (no one supported this one)
- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()
- Renamed handler::dupp_pos to handler::dup_pos
- Removed not used variable handler::sortkey
Upper level handler changes:
- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
cache is updated on engine creation time and updated on open.
MySQL level changes (not obvious from the above):
- DBUG_ASSERT() added to check that column usage matches what is set
in the column usage bit maps. (This found a LOT of bugs in current
column marking code).
- In 5.1 before, all used columns was marked in read_set and only updated
columns was marked in write_set. Now we only mark columns for which we
need a value in read_set.
- Column bitmaps are created in open_binary_frm() and open_table_from_share().
(Before this was in table.cc)
- handler::table_flags() calls are replaced with handler::ha_table_flags()
- For calling field->val() you must have the corresponding bit set in
table->read_set. For calling field->store() you must have the
corresponding bit set in table->write_set. (There are asserts in
all store()/val() functions to catch wrong usage)
- thd->set_query_id is renamed to thd->mark_used_columns and instead
of setting this to an integer value, this has now the values:
MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
Changed also all variables named 'set_query_id' to mark_used_columns.
- In filesort() we now inform the handler of exactly which columns are needed
doing the sort and choosing the rows.
- The TABLE_SHARE object has a 'all_set' column bitmap one can use
when one needs a column bitmap with all columns set.
(This is used for table->use_all_columns() and other places)
- The TABLE object has 3 column bitmaps:
- def_read_set Default bitmap for columns to be read
- def_write_set Default bitmap for columns to be written
- tmp_set Can be used as a temporary bitmap when needed.
The table object has also two pointer to bitmaps read_set and write_set
that the handler should use to find out which columns are used in which way.
- count() optimization now calls handler::records() instead of using
handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).
- Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
- Added TABLE parameter to cp_buffer_from_ref()
- Don't close tables created with CREATE ... SELECT but keep them in
the table cache. (Faster usage of newly created tables).
New interfaces:
- table->clear_column_bitmaps() to initialize the bitmaps for tables
at start of new statements.
- table->column_bitmaps_set() to set up new column bitmaps and signal
the handler about this.
- table->column_bitmaps_set_no_signal() for some few cases where we need
to setup new column bitmaps but don't signal the handler (as the handler
has already been signaled about these before). Used for the momement
only in opt_range.cc when doing ROR scans.
- table->use_all_columns() to install a bitmap where all columns are marked
as use in the read and the write set.
- table->default_column_bitmaps() to install the normal read and write
column bitmaps, but not signaling the handler about this.
This is mainly used when creating TABLE instances.
- table->mark_columns_needed_for_delete(),
table->mark_columns_needed_for_delete() and
table->mark_columns_needed_for_insert() to allow us to put additional
columns in column usage maps if handler so requires.
(The handler indicates what it neads in handler->table_flags())
- table->prepare_for_position() to allow us to tell handler that it
needs to read primary key parts to be able to store them in
future table->position() calls.
(This replaces the table->file->ha_retrieve_all_pk function)
- table->mark_auto_increment_column() to tell handler are going to update
columns part of any auto_increment key.
- table->mark_columns_used_by_index() to mark all columns that is part of
an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
it to quickly know that it only needs to read colums that are part
of the key. (The handler can also use the column map for detecting this,
but simpler/faster handler can just monitor the extra() call).
- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
also mark all columns that is used by the given key.
- table->restore_column_maps_after_mark_index() to restore to default
column maps after a call to table->mark_columns_used_by_index().
- New item function register_field_in_read_map(), for marking used columns
in table->read_map. Used by filesort() to mark all used columns
- Maintain in TABLE->merge_keys set of all keys that are used in query.
(Simplices some optimization loops)
- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
but the field in the clustered key is not assumed to be part of all index.
(used in opt_range.cc for faster loops)
- dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
mark all columns as usable. The 'dbug_' version is primarily intended
inside a handler when it wants to just call Field:store() & Field::val()
functions, but don't need the column maps set for any other usage.
(ie:: bitmap_is_set() is never called)
- We can't use compare_records() to skip updates for handlers that returns
a partial column set and the read_set doesn't cover all columns in the
write set. The reason for this is that if we have a column marked only for
write we can't in the MySQL level know if the value changed or not.
The reason this worked before was that MySQL marked all to be written
columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
bug'.
- open_table_from_share() does not anymore setup temporary MEM_ROOT
object as a thread specific variable for the handler. Instead we
send the to-be-used MEMROOT to get_new_handler().
(Simpler, faster code)
Bugs fixed:
- Column marking was not done correctly in a lot of cases.
(ALTER TABLE, when using triggers, auto_increment fields etc)
(Could potentially result in wrong values inserted in table handlers
relying on that the old column maps or field->set_query_id was correct)
Especially when it comes to triggers, there may be cases where the
old code would cause lost/wrong values for NDB and/or InnoDB tables.
- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
This allowed me to remove some wrong warnings about:
"Some non-transactional changed tables couldn't be rolled back"
- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
(thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
some warnings about
"Some non-transactional changed tables couldn't be rolled back")
- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
which could cause delete_table to report random failures.
- Fixed core dumps for some tests when running with --debug
- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after
crash)
- slow_logs was not properly initialized, which could maybe cause
extra/lost entries in slow log.
- If we get an duplicate row on insert, change column map to read and
write all columns while retrying the operation. This is required by
the definition of REPLACE and also ensures that fields that are only
part of UPDATE are properly handled. This fixed a bug in NDB and
REPLACE where REPLACE wrongly copied some column values from the replaced
row.
- For table handler that doesn't support NULL in keys, we would give an error
when creating a primary key with NULL fields, even after the fields has been
automaticly converted to NOT NULL.
- Creating a primary key on a SPATIAL key, would fail if field was not
declared as NOT NULL.
Cleanups:
- Removed not used condition argument to setup_tables
- Removed not needed item function reset_query_id_processor().
- Field->add_index is removed. Now this is instead maintained in
(field->flags & FIELD_IN_ADD_INDEX)
- Field->fieldnr is removed (use field->field_index instead)
- New argument to filesort() to indicate that it should return a set of
row pointers (not used columns). This allowed me to remove some references
to sql_command in filesort and should also enable us to return column
results in some cases where we couldn't before.
- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
bitmap, which allowed me to use bitmap functions instead of looping over
all fields to create some needed bitmaps. (Faster and smaller code)
- Broke up found too long lines
- Moved some variable declaration at start of function for better code
readability.
- Removed some not used arguments from functions.
(setup_fields(), mysql_prepare_insert_check_table())
- setup_fields() now takes an enum instead of an int for marking columns
usage.
- For internal temporary tables, use handler::write_row(),
handler::delete_row() and handler::update_row() instead of
handler::ha_xxxx() for faster execution.
- Changed some constants to enum's and define's.
- Using separate column read and write sets allows for easier checking
of timestamp field was set by statement.
- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()
- Don't build table->normalized_path as this is now identical to table->path
(after bar's fixes to convert filenames)
- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
do comparision with the 'convert-dbug-for-diff' tool.
Things left to do in 5.1:
- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
Mats has promised to look into this.
- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
(I added several test cases for this, but in this case it's better that
someone else also tests this throughly).
Lars has promosed to do this.
BitKeeper/etc/ignore:
added mysys/test_bitmap
include/base64.h:
Removed my_global.h, as this must be included first in any program
include/heap.h:
Added heap_reset() (Required by new handler interface)
include/my_base.h:
Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
Remove my_pthread.h (should be included at upper level)
Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
Simplify ldata usage
Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
Use copy instead of INSTALL_DB for master and slave databases.
(Speeds up startup time a lot!)
Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
Added drop of test function
mysql-test/r/innodb_mysql.result:
Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
More tests
Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
Better error message
mysql-test/r/ndb_replace.result:
New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
Drop used views
mysql-test/t/create.test:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
Added drop of test function
mysql-test/t/innodb_mysql.test:
Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
More tests
Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
Drop used views
mysql-test/valgrind.supp:
Added supression of not needed warnings when printing stack trace
mysys/base64.c:
Include my_global.h first
mysys/my_bitmap.c:
Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
Ensure 'use_all_columns()' is used for event tables
Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
(Rest of changes are only indentation cleanups)
sql/field.h:
Removed Field->query_id (replaced by table->read_set and table->write_set)
Removed Field->fieldnr (use Field->field_index instead)
Removed Field->add_index (Use Field->flags instead)
Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
This allowed me to remove checking of sql_command.
Create a temporary column bitmap for fields that are used by the sorting process.
Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
Update to 'newer' table handler interface
sql/ha_berkeley.h:
Update to 'newer' table handler interface
sql/ha_federated.cc:
Update to 'newer' table handler interface
Only read columns that are needed from remote server.
In case of eq ranges, don't generate two conditions in the WHERE clause
(this can still be optimized, but would require a bigger code change)
Use 'simpler to use' XXXX_LEN' macros
A bit simpler logic in ::write_row() when creating statements.
In update, only include test of fields actually read.
(This greatly simplifies the queries sent by the federated engine)
Similar changes done for delete_row()
sql/ha_federated.h:
Update to 'newer' table handler interface
Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
Update to 'newer' table handler interface
sql/ha_heap.h:
Update to 'newer' table handler interface
sql/ha_innodb.cc:
Update to 'newer' table handler interface
- Update innobase_create_handler() to new interface
- Removed HA_NOT_EXACT_COUNT (not needed)
- Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- Prefixed base status variables with 'stats'
- Use table column bitmaps instead of ha_get_bit_in_read_set()
- Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
- Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
Update to 'newer' table handler interface
- table_flags are now ulonglong
- Added reset() method
- Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
- Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
Update to 'newer' table handler interface
sql/ha_myisam.h:
Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
Update to 'newer' table handler interface
sql/ha_myisammrg.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
Update to 'newer' table handler interface
Fixed use_blob_value() to be accurate
In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
Correct dumping of field data with DBUG_DUMP
Prefix addresses in DBUG_PRINT with 0x
Fixed usage of not initialized memory
Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
Mark usage of all columns in ndbcluster binlog tables
false -> FALSE, true -> TRUE
Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
Update to 'newer' table handler interface
Added memroot to initialise_partitions() and related functions to get faster memory allocation.
partition_create_handler() is now responsible for initialisation of the partition object
Some trivial optimizations and indentation fixes
Ensure that table_flags() are up to date
Removed documentation for removed HA_EXTRA flags
Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
Update to 'newer' table handler interface
sql/handler.cc:
create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
Much simpler get_new_handler()
(Initialization of the object is now handled by the create method for the engine)
Moved all allocation of bitmap handling to the TABLE object (in table.cc)
Added column_bitmaps_signal() to signal column usage changes.
Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
HA_DUPP_POS -> HA_DUPLICATE_POS
HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Added future row type 'ROW_TYPE_PAGES'
Added MEM_ROOT to handlerton 'create' function
Added ha_statistics, a structure for all status variable in the base handler class.
Moved all status variables in the handler class into a stats structs to improve readability.
ha_table_flags() is now a cached (not virtual) version of table_flags()
reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
Renamed dupp_ref to dup_ref
Renamed not used handler::sortkey
Moved read_set and write_set to TABLE structure
handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
Added register_field_in_read_map() for marking used columns in expression.
This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
Initalize value.cs_info.character_set_client to fix core dump bug with --debug
set_query_id -> mark_used_columns
Mark used columns in read_set OR write_set.
sql/item.h:
Removed reset_query_id_processor() as it's not needed anymore.
Added register_field_in_read_map()
Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
sql/item_cmpfunc.cc:
Temporary mark used columns to be read/writable
Update Item::walk to new interface
sql/item_cmpfunc.h:
Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
Update Item::walk() to new interface
table_flags() -> ha_table_flags()
sql/item_func.h:
Update Item::walk() to new interface
sql/item_row.cc:
Update Item::walk() to new interface
sql/item_row.h:
Update Item::walk() to new interface
sql/item_strfunc.h:
Update Item::walk() to new interface
sql/item_subselect.cc:
Added Item_subselect::walk()
(It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
Update Item::walk() to new interface
sql/item_sum.cc:
Update Item::walk() to new interface
Updates for new handler interace
sql/item_sum.h:
Update Item::walk() to new interface
sql/key.cc:
Updates for new handler interace
sql/log.cc:
Mark all columns used for log tables
Split options flag
Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
Fixed comments to be withing 79 characters
Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
Updates for new handler interface
Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
Indentation fixes and removed old comment
sql/opt_range.cc:
Update to new handler and bitmap interface.
Fixed calls to cp_buffer_from_ref() and walk() (new argument).
Create new temporary bitmaps for ror scans.
(Needed because of handler changes and to get more accurate column bitmaps than before)
Remove not needed file->ha_reset() call before file->close().
Some trivial optimization and indentation fixes.
Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
(This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
Optimized bitmap handling in ror scans:
- Start bitmap at position 0, not 1
- Use same bitmap size as in TABLE
- Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
Updates for new handler interface
sql/set_var.cc:
Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
Fixed wrong
sql/sp.cc:
Mark that we are using all columns for the proc table
Update call to setup_tables() to use new prototype
sql/sp_head.cc:
Removed QQ comment
sql/spatial.cc:
Removed wrong QQ comment
sql/sql_acl.cc:
Mark that we need all columns for acl tables
Supply memroot to some 'new' calls.
Indentation fixes
sql/sql_base.cc:
set_query_id removed
Ensure we call ha_reset() at end of each statement
Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
Fixed marking of some columns that was not proplerly marked before
Maintain in TABLE->merge_keys set of all keys that are used in some way
Removed not used 'conds' argument from setup_tables()
Remove not used setting of 'dupp_field' in insert_fields()
Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
Added is_overlapping()
sql/sql_class.cc:
Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
set_query_id -> mark_used_columns
Simpler variable usage in pack_row() (cleanup)
Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
Added enum_mark_columns
Updated comments
Renamed dupp_field -> dup_field
Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
(This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
Updates to new handler interface
Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
Call table->prepare_for_position() to tell handler that we are going to call ha_position().
Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
Fixed calls to setup_tables()
sql/sql_do.cc:
Update call to setup_fields()
sql/sql_handler.cc:
Tell handler tables to always read all columns.
Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
Makr all used fields to be read
Update call to setup_fields()
sql/sql_insert.cc:
Tell handler we are going to update the auto_increment column
dupp_field -> dup_field
Set column usage bits for timestamp field.
Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
Removed not used argument from mysql_prepare_insert_check_table().
If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
Setup new bitmaps for delayed insert rows
Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
The issue was that one should not to reset this flag as it may be set by a previous statement.
The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
Don't close tables created with CREATE ... SELECT but keep them in the table cache.
Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
Update to use new handler and column marking interface
Update using setup_tables()
sql/sql_olap.cc:
Update calls to setup_tables
Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
Handle OPTION_KEEP_LOG:
- Set it on CREATE TEMPORARY TABLE / DROP TABLE
- Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
- Don't set it for CREATE ... SELECT (this is handled in select_create class)
Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
Update walk() usage
Trivial indentation fixes
sql/sql_plugin.cc:
Mark all columns as used for plugins
sql/sql_prepare.cc:
Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
Updates for new handler interface
Update calls to setup_fields()
sql/sql_repl.cc:
Indentation fixes
sql/sql_select.cc:
Update call to setup_tables() and setup_fields()
Remove some old disabled code
Update to new hadler interface
Indentation cleanups
Added column bitmaps for temporary tables.
Remove updating of the removed slots in the Field class
Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
Indentaition fixes.
Install temporary column usage maps when needed
Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
Update to new handler interface
Mark all columns used for internal tables.
Style fixes.
Added support for 'future' ROW_TYPE_PAGES.
Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
Update to new handler interface
Simple my_snprintf -> strmake()
Changed some constants to defines
Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
Mark all columns as used for ALTER TABLE
Style fixes
Update call to filesort()
sql/sql_trigger.h:
Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
Mark all columns as used for udf system table.
sql/sql_union.cc:
Update call to walk()
Update to new handler interface
sql/sql_update.cc:
Remove query_id argument from compare_record()
Use column bitmaps instead of query_id.
We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
Update call to setup_fields()
Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
Removed call to free_io_cache() as this is now done in ha_reset()
Call table->mark_columns_needed_for_update() and table->prepare_for_position()
Style fixes
sql/sql_view.cc:
Style fixes
sql/table.cc:
Remove implicitely include 'errno.h'
Remove code for building normalized path, as this is now identical to 'path'
Remove field->fieldnr
Added update of field->part_of_key_not_clustered()
Create column bitmaps in TABLE and TABLE_SHARE
Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
Update to new handler interface
Update call to walk()
Added new functions:
- st_table::clear_column_bitmaps()
- st_table::prepare_for_position()
- st_table::mark_columns_used_by_index()
- st_table::restore_column_maps_after_mark_index()
- st_table::mark_columns_used_by_index_no_reset()
- st_table::mark_auto_increment_column()
- st_table::mark_columns_needed_for_delete()
- st_table::mark_columns_needed_for_update()
- st_table::mark_columns_needed_for_insert()
sql/table.h:
Moved column usage bitmaps from handler to TABLE
Added to TABLE_SHARE all_set and column_bitmap_size
Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
Declared all new table column bitmap functions
Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
Update to new handler interface
storage/archive/ha_archive.h:
Update to new handler interface
storage/blackhole/ha_blackhole.cc:
Update to new handler interface
storage/blackhole/ha_blackhole.h:
Update to new handler interface
removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
Update to new handler interface
storage/csv/ha_tina.h:
Update to new handler interface
storage/example/ha_example.cc:
Update to new handler interface
storage/example/ha_example.h:
Update to new handler interface
storage/heap/hp_extra.c:
Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
Use heap_reset()
storage/myisam/ft_boolean_search.c:
Fixed compiler warning
storage/myisam/mi_extra.c:
Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
Use mi_reset()
storage/myisam/myisampack.c:
Use mi_reset()
storage/myisammrg/myrg_extra.c:
Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
Include my_global.h
Don't include implictely include file 'stdlib.h'
2006-06-04 17:52:22 +02:00
|
|
|
open_binlog() sought to position 4.
|
|
|
|
Read the first event in case it's a Format_description_log_event, to
|
|
|
|
know the format. If there's no such event, we are 3.23 or 4.x. This
|
|
|
|
code, like before, can't read 3.23 binlogs.
|
|
|
|
This code will fail on a mixed relay log (one which has Format_desc then
|
|
|
|
Rotate then Format_desc).
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
*/
|
|
|
|
ev = Log_event::read_log_event(&log,(pthread_mutex_t*)0,description_event);
|
|
|
|
if (ev)
|
|
|
|
{
|
|
|
|
if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT)
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
{
|
|
|
|
delete description_event;
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
description_event= (Format_description_log_event*) ev;
|
This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl_change_master.result:
result update
mysql-test/r/rpl_error_ignored_table.result:
result update
mysql-test/r/rpl_flush_log_loop.result:
result update
mysql-test/r/rpl_flush_tables.result:
result update
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_loaddata_rule_m.result:
result update
mysql-test/r/rpl_loaddata_rule_s.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/r/rpl_log_pos.result:
result update
mysql-test/r/rpl_max_relay_size.result:
result update
mysql-test/r/rpl_relayrotate.result:
result update
mysql-test/r/rpl_replicate_do.result:
result update
mysql-test/r/rpl_reset_slave.result:
result update
mysql-test/r/rpl_rotate_logs.result:
result update
mysql-test/r/rpl_session_var.result:
result update
mysql-test/r/rpl_temporary.result:
result update
mysql-test/r/rpl_trunc_binlog.result:
result update
mysql-test/r/rpl_until.result:
result update
mysql-test/r/rpl_user_variables.result:
result update
mysql-test/t/rpl000010-slave.opt:
need to wait 2 events, because now we receive a Format_desc on top of the Rotate,
when replication starts.
mysql-test/t/rpl000015.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_change_master.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_empty_master_crash.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_error_ignored_table.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_flush_log_loop.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_loaddata.test:
position update
mysql-test/t/rpl_loaddata_rule_m.test:
position update
mysql-test/t/rpl_loaddata_rule_s.test:
position update
mysql-test/t/rpl_log.test:
position update
mysql-test/t/rpl_log_pos.test:
position update
mysql-test/t/rpl_max_relay_size.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_openssl.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_redirect.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_relayrotate-slave.opt:
better options for this test
mysql-test/t/rpl_relayrotate.test:
using max() is better for debugging (it shows at which place the slave
SQL thread resumed)
mysql-test/t/rpl_replicate_do.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_reset_slave.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_rotate_logs.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_session_var.test:
100 because password() is longer than 10 chars
mysql-test/t/rpl_trunc_binlog.test:
relay log information is not repeatable in general (if a reconnection
happens because --sleep=10 for example), so we hide these columns.
mysql-test/t/rpl_until.test:
position update
mysql-test/t/rpl_user_variables.test:
position update
sql/log.cc:
Ensure that the Format_desc propagated on next relay logs does not trigger
undue actions (like incrementing some positions or clearing some files).
sql/log_event.cc:
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
* When the slave SQL thread finds a Format_desc not to be ignored (not
the same server id as the slave's), if it has log_pos==0 it must not trigger
"unfinished transaction in master's binlog" (log_pos==0 is always a marker
in the relay log to mean "this event was not at this place in the master's
binlog": it's for fake Rotate events, and for Format_description events which the master had
to send us for replication to start).
* In the Query_log_event on disk, catalog is now terminated by '\0'.
* thd->catalog must be set to 0 when some exec_event() terminate (otherwise
double free).
sql/slave.cc:
* Fixes for a few bugs when ignoring events in the slave SQL thread:
- do not decrement rli->slave_skip_counter if the event is an event
related to the binlog or relay log itself (FORMAT_DESCRIPTION,
ROTATE, STOP) because these events should never be skipped (or the slave
will be confused). Usually the user wants to skip a query, not a Rotate...
- when we (re)connect to the master, we must free description_event_for_queue
(otherwise memory leak when we reconnect).
* Changed a bit the code where we change description_event_for_queue,
to make it look "safer".
* Moved 'created=0' to log.cc where it is safer.
* When the slave SQL thread finds a Rotate/Format_desc/Stop in the middle of
a transaction (then these were written by the slave itself to its relay log),
it should not increment rli->group* variables, but only rli->event* ones.
sql/sql_class.h:
a warning comment
sql/sql_repl.cc:
A mistake: I had passed a char* instead of char**
2003-12-19 22:40:23 +01:00
|
|
|
}
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
else
|
|
|
|
delete ev;
|
|
|
|
}
|
|
|
|
|
2001-06-21 21:19:24 +02:00
|
|
|
my_b_seek(&log, pos);
|
|
|
|
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
if (!description_event->is_valid())
|
|
|
|
{
|
|
|
|
errmsg="Invalid Format_description event; could be out of memory";
|
|
|
|
goto err;
|
|
|
|
}
|
2005-02-09 20:04:28 +01:00
|
|
|
|
2001-11-11 06:24:12 +01:00
|
|
|
for (event_count = 0;
|
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),
- New optional handler function introduced: reset()
This is called after every DML statement to make it easy for a handler to
statement specific cleanups.
(The only case it's not called is if force the file to be closed)
- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
should be moved to handler::reset()
- table->read_set contains a bitmap over all columns that are needed
in the query. read_row() and similar functions only needs to read these
columns
- table->write_set contains a bitmap over all columns that will be updated
in the query. write_row() and update_row() only needs to update these
columns.
The above bitmaps should now be up to date in all context
(including ALTER TABLE, filesort()).
The handler is informed of any changes to the bitmap after
fix_fields() by calling the virtual function
handler::column_bitmaps_signal(). If the handler does caching of
these bitmaps (instead of using table->read_set, table->write_set),
it should redo the caching in this code. as the signal() may be sent
several times, it's probably best to set a variable in the signal
and redo the caching on read_row() / write_row() if the variable was
set.
- Removed the read_set and write_set bitmap objects from the handler class
- Removed all column bit handling functions from the handler class.
(Now one instead uses the normal bitmap functions in my_bitmap.c instead
of handler dedicated bitmap functions)
- field->query_id is removed. One should instead instead check
table->read_set and table->write_set if a field is used in the query.
- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
instead use table->read_set to check for which columns to retrieve.
- If a handler needs to call Field->val() or Field->store() on columns
that are not used in the query, one should install a temporary
all-columns-used map while doing so. For this, we provide the following
functions:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
field->val();
dbug_tmp_restore_column_map(table->read_set, old_map);
and similar for the write map:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
field->val();
dbug_tmp_restore_column_map(table->write_set, old_map);
If this is not done, you will sooner or later hit a DBUG_ASSERT
in the field store() / val() functions.
(For not DBUG binaries, the dbug_tmp_restore_column_map() and
dbug_tmp_restore_column_map() are inline dummy functions and should
be optimized away be the compiler).
- If one needs to temporary set the column map for all binaries (and not
just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
methods) one should use the functions tmp_use_all_columns() and
tmp_restore_column_map() instead of the above dbug_ variants.
- All 'status' fields in the handler base class (like records,
data_file_length etc) are now stored in a 'stats' struct. This makes
it easier to know what status variables are provided by the base
handler. This requires some trivial variable names in the extra()
function.
- New virtual function handler::records(). This is called to optimize
COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
(stats.records is not supposed to be an exact value. It's only has to
be 'reasonable enough' for the optimizer to be able to choose a good
optimization path).
- Non virtual handler::init() function added for caching of virtual
constants from engine.
- Removed has_transactions() virtual method. Now one should instead return
HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
transactions.
- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
that is to be used with 'new handler_name()' to allocate the handler
in the right area. The xxxx_create_handler() function is also
responsible for any initialization of the object before returning.
For example, one should change:
static handler *myisam_create_handler(TABLE_SHARE *table)
{
return new ha_myisam(table);
}
->
static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
return new (mem_root) ha_myisam(table);
}
- New optional virtual function: use_hidden_primary_key().
This is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key. This allows the handler to take precisions
in remembering any hidden primary key to able to update/delete any
found row. The default handler marks all columns to be read.
- handler::table_flags() now returns a ulonglong (to allow for more flags).
- New/changed table_flags()
- HA_HAS_RECORDS Set if ::records() is supported
- HA_NO_TRANSACTIONS Set if engine doesn't support transactions
- HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
Set if we should mark all primary key columns for
read when reading rows as part of a DELETE
statement. If there is no primary key,
all columns are marked for read.
- HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some
cases (based on table->read_set)
- HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- HA_DUPP_POS Renamed to HA_DUPLICATE_POS
- HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
Set this if we should mark ALL key columns for
read when when reading rows as part of a DELETE
statement. In case of an update we will mark
all keys for read for which key part changed
value.
- HA_STATS_RECORDS_IS_EXACT
Set this if stats.records is exact.
(This saves us some extra records() calls
when optimizing COUNT(*))
- Removed table_flags()
- HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if
handler::records() gives an exact count() and
HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
- HA_READ_RND_SAME Removed (no one supported this one)
- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()
- Renamed handler::dupp_pos to handler::dup_pos
- Removed not used variable handler::sortkey
Upper level handler changes:
- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
cache is updated on engine creation time and updated on open.
MySQL level changes (not obvious from the above):
- DBUG_ASSERT() added to check that column usage matches what is set
in the column usage bit maps. (This found a LOT of bugs in current
column marking code).
- In 5.1 before, all used columns was marked in read_set and only updated
columns was marked in write_set. Now we only mark columns for which we
need a value in read_set.
- Column bitmaps are created in open_binary_frm() and open_table_from_share().
(Before this was in table.cc)
- handler::table_flags() calls are replaced with handler::ha_table_flags()
- For calling field->val() you must have the corresponding bit set in
table->read_set. For calling field->store() you must have the
corresponding bit set in table->write_set. (There are asserts in
all store()/val() functions to catch wrong usage)
- thd->set_query_id is renamed to thd->mark_used_columns and instead
of setting this to an integer value, this has now the values:
MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
Changed also all variables named 'set_query_id' to mark_used_columns.
- In filesort() we now inform the handler of exactly which columns are needed
doing the sort and choosing the rows.
- The TABLE_SHARE object has a 'all_set' column bitmap one can use
when one needs a column bitmap with all columns set.
(This is used for table->use_all_columns() and other places)
- The TABLE object has 3 column bitmaps:
- def_read_set Default bitmap for columns to be read
- def_write_set Default bitmap for columns to be written
- tmp_set Can be used as a temporary bitmap when needed.
The table object has also two pointer to bitmaps read_set and write_set
that the handler should use to find out which columns are used in which way.
- count() optimization now calls handler::records() instead of using
handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).
- Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
- Added TABLE parameter to cp_buffer_from_ref()
- Don't close tables created with CREATE ... SELECT but keep them in
the table cache. (Faster usage of newly created tables).
New interfaces:
- table->clear_column_bitmaps() to initialize the bitmaps for tables
at start of new statements.
- table->column_bitmaps_set() to set up new column bitmaps and signal
the handler about this.
- table->column_bitmaps_set_no_signal() for some few cases where we need
to setup new column bitmaps but don't signal the handler (as the handler
has already been signaled about these before). Used for the momement
only in opt_range.cc when doing ROR scans.
- table->use_all_columns() to install a bitmap where all columns are marked
as use in the read and the write set.
- table->default_column_bitmaps() to install the normal read and write
column bitmaps, but not signaling the handler about this.
This is mainly used when creating TABLE instances.
- table->mark_columns_needed_for_delete(),
table->mark_columns_needed_for_delete() and
table->mark_columns_needed_for_insert() to allow us to put additional
columns in column usage maps if handler so requires.
(The handler indicates what it neads in handler->table_flags())
- table->prepare_for_position() to allow us to tell handler that it
needs to read primary key parts to be able to store them in
future table->position() calls.
(This replaces the table->file->ha_retrieve_all_pk function)
- table->mark_auto_increment_column() to tell handler are going to update
columns part of any auto_increment key.
- table->mark_columns_used_by_index() to mark all columns that is part of
an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
it to quickly know that it only needs to read colums that are part
of the key. (The handler can also use the column map for detecting this,
but simpler/faster handler can just monitor the extra() call).
- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
also mark all columns that is used by the given key.
- table->restore_column_maps_after_mark_index() to restore to default
column maps after a call to table->mark_columns_used_by_index().
- New item function register_field_in_read_map(), for marking used columns
in table->read_map. Used by filesort() to mark all used columns
- Maintain in TABLE->merge_keys set of all keys that are used in query.
(Simplices some optimization loops)
- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
but the field in the clustered key is not assumed to be part of all index.
(used in opt_range.cc for faster loops)
- dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
mark all columns as usable. The 'dbug_' version is primarily intended
inside a handler when it wants to just call Field:store() & Field::val()
functions, but don't need the column maps set for any other usage.
(ie:: bitmap_is_set() is never called)
- We can't use compare_records() to skip updates for handlers that returns
a partial column set and the read_set doesn't cover all columns in the
write set. The reason for this is that if we have a column marked only for
write we can't in the MySQL level know if the value changed or not.
The reason this worked before was that MySQL marked all to be written
columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
bug'.
- open_table_from_share() does not anymore setup temporary MEM_ROOT
object as a thread specific variable for the handler. Instead we
send the to-be-used MEMROOT to get_new_handler().
(Simpler, faster code)
Bugs fixed:
- Column marking was not done correctly in a lot of cases.
(ALTER TABLE, when using triggers, auto_increment fields etc)
(Could potentially result in wrong values inserted in table handlers
relying on that the old column maps or field->set_query_id was correct)
Especially when it comes to triggers, there may be cases where the
old code would cause lost/wrong values for NDB and/or InnoDB tables.
- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
This allowed me to remove some wrong warnings about:
"Some non-transactional changed tables couldn't be rolled back"
- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
(thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
some warnings about
"Some non-transactional changed tables couldn't be rolled back")
- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
which could cause delete_table to report random failures.
- Fixed core dumps for some tests when running with --debug
- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after
crash)
- slow_logs was not properly initialized, which could maybe cause
extra/lost entries in slow log.
- If we get an duplicate row on insert, change column map to read and
write all columns while retrying the operation. This is required by
the definition of REPLACE and also ensures that fields that are only
part of UPDATE are properly handled. This fixed a bug in NDB and
REPLACE where REPLACE wrongly copied some column values from the replaced
row.
- For table handler that doesn't support NULL in keys, we would give an error
when creating a primary key with NULL fields, even after the fields has been
automaticly converted to NOT NULL.
- Creating a primary key on a SPATIAL key, would fail if field was not
declared as NOT NULL.
Cleanups:
- Removed not used condition argument to setup_tables
- Removed not needed item function reset_query_id_processor().
- Field->add_index is removed. Now this is instead maintained in
(field->flags & FIELD_IN_ADD_INDEX)
- Field->fieldnr is removed (use field->field_index instead)
- New argument to filesort() to indicate that it should return a set of
row pointers (not used columns). This allowed me to remove some references
to sql_command in filesort and should also enable us to return column
results in some cases where we couldn't before.
- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
bitmap, which allowed me to use bitmap functions instead of looping over
all fields to create some needed bitmaps. (Faster and smaller code)
- Broke up found too long lines
- Moved some variable declaration at start of function for better code
readability.
- Removed some not used arguments from functions.
(setup_fields(), mysql_prepare_insert_check_table())
- setup_fields() now takes an enum instead of an int for marking columns
usage.
- For internal temporary tables, use handler::write_row(),
handler::delete_row() and handler::update_row() instead of
handler::ha_xxxx() for faster execution.
- Changed some constants to enum's and define's.
- Using separate column read and write sets allows for easier checking
of timestamp field was set by statement.
- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()
- Don't build table->normalized_path as this is now identical to table->path
(after bar's fixes to convert filenames)
- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
do comparision with the 'convert-dbug-for-diff' tool.
Things left to do in 5.1:
- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
Mats has promised to look into this.
- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
(I added several test cases for this, but in this case it's better that
someone else also tests this throughly).
Lars has promosed to do this.
BitKeeper/etc/ignore:
added mysys/test_bitmap
include/base64.h:
Removed my_global.h, as this must be included first in any program
include/heap.h:
Added heap_reset() (Required by new handler interface)
include/my_base.h:
Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
Remove my_pthread.h (should be included at upper level)
Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
Simplify ldata usage
Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
Use copy instead of INSTALL_DB for master and slave databases.
(Speeds up startup time a lot!)
Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
Added drop of test function
mysql-test/r/innodb_mysql.result:
Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
More tests
Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
Better error message
mysql-test/r/ndb_replace.result:
New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
Drop used views
mysql-test/t/create.test:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
Added drop of test function
mysql-test/t/innodb_mysql.test:
Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
More tests
Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
Drop used views
mysql-test/valgrind.supp:
Added supression of not needed warnings when printing stack trace
mysys/base64.c:
Include my_global.h first
mysys/my_bitmap.c:
Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
Ensure 'use_all_columns()' is used for event tables
Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
(Rest of changes are only indentation cleanups)
sql/field.h:
Removed Field->query_id (replaced by table->read_set and table->write_set)
Removed Field->fieldnr (use Field->field_index instead)
Removed Field->add_index (Use Field->flags instead)
Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
This allowed me to remove checking of sql_command.
Create a temporary column bitmap for fields that are used by the sorting process.
Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
Update to 'newer' table handler interface
sql/ha_berkeley.h:
Update to 'newer' table handler interface
sql/ha_federated.cc:
Update to 'newer' table handler interface
Only read columns that are needed from remote server.
In case of eq ranges, don't generate two conditions in the WHERE clause
(this can still be optimized, but would require a bigger code change)
Use 'simpler to use' XXXX_LEN' macros
A bit simpler logic in ::write_row() when creating statements.
In update, only include test of fields actually read.
(This greatly simplifies the queries sent by the federated engine)
Similar changes done for delete_row()
sql/ha_federated.h:
Update to 'newer' table handler interface
Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
Update to 'newer' table handler interface
sql/ha_heap.h:
Update to 'newer' table handler interface
sql/ha_innodb.cc:
Update to 'newer' table handler interface
- Update innobase_create_handler() to new interface
- Removed HA_NOT_EXACT_COUNT (not needed)
- Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- Prefixed base status variables with 'stats'
- Use table column bitmaps instead of ha_get_bit_in_read_set()
- Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
- Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
Update to 'newer' table handler interface
- table_flags are now ulonglong
- Added reset() method
- Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
- Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
Update to 'newer' table handler interface
sql/ha_myisam.h:
Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
Update to 'newer' table handler interface
sql/ha_myisammrg.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
Update to 'newer' table handler interface
Fixed use_blob_value() to be accurate
In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
Correct dumping of field data with DBUG_DUMP
Prefix addresses in DBUG_PRINT with 0x
Fixed usage of not initialized memory
Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
Mark usage of all columns in ndbcluster binlog tables
false -> FALSE, true -> TRUE
Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
Update to 'newer' table handler interface
Added memroot to initialise_partitions() and related functions to get faster memory allocation.
partition_create_handler() is now responsible for initialisation of the partition object
Some trivial optimizations and indentation fixes
Ensure that table_flags() are up to date
Removed documentation for removed HA_EXTRA flags
Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
Update to 'newer' table handler interface
sql/handler.cc:
create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
Much simpler get_new_handler()
(Initialization of the object is now handled by the create method for the engine)
Moved all allocation of bitmap handling to the TABLE object (in table.cc)
Added column_bitmaps_signal() to signal column usage changes.
Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
HA_DUPP_POS -> HA_DUPLICATE_POS
HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Added future row type 'ROW_TYPE_PAGES'
Added MEM_ROOT to handlerton 'create' function
Added ha_statistics, a structure for all status variable in the base handler class.
Moved all status variables in the handler class into a stats structs to improve readability.
ha_table_flags() is now a cached (not virtual) version of table_flags()
reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
Renamed dupp_ref to dup_ref
Renamed not used handler::sortkey
Moved read_set and write_set to TABLE structure
handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
Added register_field_in_read_map() for marking used columns in expression.
This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
Initalize value.cs_info.character_set_client to fix core dump bug with --debug
set_query_id -> mark_used_columns
Mark used columns in read_set OR write_set.
sql/item.h:
Removed reset_query_id_processor() as it's not needed anymore.
Added register_field_in_read_map()
Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
sql/item_cmpfunc.cc:
Temporary mark used columns to be read/writable
Update Item::walk to new interface
sql/item_cmpfunc.h:
Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
Update Item::walk() to new interface
table_flags() -> ha_table_flags()
sql/item_func.h:
Update Item::walk() to new interface
sql/item_row.cc:
Update Item::walk() to new interface
sql/item_row.h:
Update Item::walk() to new interface
sql/item_strfunc.h:
Update Item::walk() to new interface
sql/item_subselect.cc:
Added Item_subselect::walk()
(It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
Update Item::walk() to new interface
sql/item_sum.cc:
Update Item::walk() to new interface
Updates for new handler interace
sql/item_sum.h:
Update Item::walk() to new interface
sql/key.cc:
Updates for new handler interace
sql/log.cc:
Mark all columns used for log tables
Split options flag
Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
Fixed comments to be withing 79 characters
Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
Updates for new handler interface
Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
Indentation fixes and removed old comment
sql/opt_range.cc:
Update to new handler and bitmap interface.
Fixed calls to cp_buffer_from_ref() and walk() (new argument).
Create new temporary bitmaps for ror scans.
(Needed because of handler changes and to get more accurate column bitmaps than before)
Remove not needed file->ha_reset() call before file->close().
Some trivial optimization and indentation fixes.
Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
(This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
Optimized bitmap handling in ror scans:
- Start bitmap at position 0, not 1
- Use same bitmap size as in TABLE
- Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
Updates for new handler interface
sql/set_var.cc:
Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
Fixed wrong
sql/sp.cc:
Mark that we are using all columns for the proc table
Update call to setup_tables() to use new prototype
sql/sp_head.cc:
Removed QQ comment
sql/spatial.cc:
Removed wrong QQ comment
sql/sql_acl.cc:
Mark that we need all columns for acl tables
Supply memroot to some 'new' calls.
Indentation fixes
sql/sql_base.cc:
set_query_id removed
Ensure we call ha_reset() at end of each statement
Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
Fixed marking of some columns that was not proplerly marked before
Maintain in TABLE->merge_keys set of all keys that are used in some way
Removed not used 'conds' argument from setup_tables()
Remove not used setting of 'dupp_field' in insert_fields()
Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
Added is_overlapping()
sql/sql_class.cc:
Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
set_query_id -> mark_used_columns
Simpler variable usage in pack_row() (cleanup)
Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
Added enum_mark_columns
Updated comments
Renamed dupp_field -> dup_field
Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
(This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
Updates to new handler interface
Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
Call table->prepare_for_position() to tell handler that we are going to call ha_position().
Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
Fixed calls to setup_tables()
sql/sql_do.cc:
Update call to setup_fields()
sql/sql_handler.cc:
Tell handler tables to always read all columns.
Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
Makr all used fields to be read
Update call to setup_fields()
sql/sql_insert.cc:
Tell handler we are going to update the auto_increment column
dupp_field -> dup_field
Set column usage bits for timestamp field.
Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
Removed not used argument from mysql_prepare_insert_check_table().
If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
Setup new bitmaps for delayed insert rows
Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
The issue was that one should not to reset this flag as it may be set by a previous statement.
The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
Don't close tables created with CREATE ... SELECT but keep them in the table cache.
Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
Update to use new handler and column marking interface
Update using setup_tables()
sql/sql_olap.cc:
Update calls to setup_tables
Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
Handle OPTION_KEEP_LOG:
- Set it on CREATE TEMPORARY TABLE / DROP TABLE
- Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
- Don't set it for CREATE ... SELECT (this is handled in select_create class)
Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
Update walk() usage
Trivial indentation fixes
sql/sql_plugin.cc:
Mark all columns as used for plugins
sql/sql_prepare.cc:
Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
Updates for new handler interface
Update calls to setup_fields()
sql/sql_repl.cc:
Indentation fixes
sql/sql_select.cc:
Update call to setup_tables() and setup_fields()
Remove some old disabled code
Update to new hadler interface
Indentation cleanups
Added column bitmaps for temporary tables.
Remove updating of the removed slots in the Field class
Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
Indentaition fixes.
Install temporary column usage maps when needed
Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
Update to new handler interface
Mark all columns used for internal tables.
Style fixes.
Added support for 'future' ROW_TYPE_PAGES.
Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
Update to new handler interface
Simple my_snprintf -> strmake()
Changed some constants to defines
Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
Mark all columns as used for ALTER TABLE
Style fixes
Update call to filesort()
sql/sql_trigger.h:
Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
Mark all columns as used for udf system table.
sql/sql_union.cc:
Update call to walk()
Update to new handler interface
sql/sql_update.cc:
Remove query_id argument from compare_record()
Use column bitmaps instead of query_id.
We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
Update call to setup_fields()
Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
Removed call to free_io_cache() as this is now done in ha_reset()
Call table->mark_columns_needed_for_update() and table->prepare_for_position()
Style fixes
sql/sql_view.cc:
Style fixes
sql/table.cc:
Remove implicitely include 'errno.h'
Remove code for building normalized path, as this is now identical to 'path'
Remove field->fieldnr
Added update of field->part_of_key_not_clustered()
Create column bitmaps in TABLE and TABLE_SHARE
Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
Update to new handler interface
Update call to walk()
Added new functions:
- st_table::clear_column_bitmaps()
- st_table::prepare_for_position()
- st_table::mark_columns_used_by_index()
- st_table::restore_column_maps_after_mark_index()
- st_table::mark_columns_used_by_index_no_reset()
- st_table::mark_auto_increment_column()
- st_table::mark_columns_needed_for_delete()
- st_table::mark_columns_needed_for_update()
- st_table::mark_columns_needed_for_insert()
sql/table.h:
Moved column usage bitmaps from handler to TABLE
Added to TABLE_SHARE all_set and column_bitmap_size
Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
Declared all new table column bitmap functions
Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
Update to new handler interface
storage/archive/ha_archive.h:
Update to new handler interface
storage/blackhole/ha_blackhole.cc:
Update to new handler interface
storage/blackhole/ha_blackhole.h:
Update to new handler interface
removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
Update to new handler interface
storage/csv/ha_tina.h:
Update to new handler interface
storage/example/ha_example.cc:
Update to new handler interface
storage/example/ha_example.h:
Update to new handler interface
storage/heap/hp_extra.c:
Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
Use heap_reset()
storage/myisam/ft_boolean_search.c:
Fixed compiler warning
storage/myisam/mi_extra.c:
Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
Use mi_reset()
storage/myisam/myisampack.c:
Use mi_reset()
storage/myisammrg/myrg_extra.c:
Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
Include my_global.h
Don't include implictely include file 'stdlib.h'
2006-06-04 17:52:22 +02:00
|
|
|
(ev = Log_event::read_log_event(&log,(pthread_mutex_t*) 0,
|
|
|
|
description_event)); )
|
2001-06-21 21:19:24 +02:00
|
|
|
{
|
|
|
|
if (event_count >= limit_start &&
|
2002-12-11 08:17:51 +01:00
|
|
|
ev->net_send(protocol, linfo.log_file_name, pos))
|
2001-07-10 14:53:08 +02:00
|
|
|
{
|
|
|
|
errmsg = "Net error";
|
|
|
|
delete ev;
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_unlock(log_lock);
|
2001-07-10 14:53:08 +02:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
pos = my_b_tell(&log);
|
2001-06-21 21:19:24 +02:00
|
|
|
delete ev;
|
|
|
|
|
|
|
|
if (++event_count >= limit_end)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event_count < limit_end && log.error)
|
|
|
|
{
|
|
|
|
errmsg = "Wrong offset or I/O error";
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_unlock(log_lock);
|
2001-06-21 21:19:24 +02:00
|
|
|
goto err;
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2002-08-22 15:50:58 +02:00
|
|
|
pthread_mutex_unlock(log_lock);
|
2001-06-21 21:19:24 +02:00
|
|
|
}
|
|
|
|
|
2005-02-28 16:34:02 +01:00
|
|
|
ret= FALSE;
|
|
|
|
|
2001-06-21 21:19:24 +02:00
|
|
|
err:
|
This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
* Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
client/Makefile.am:
mysqlbinlog.cc depends slightly on sql/mysql_priv.h
client/mysqlbinlog.cc:
Make mysqlbinlog able to read the new binlog format,
by seeking to the start and reading the first few events, to
detect the format of the binlog.
include/my_sys.h:
a correct tell() for SEQ_READ_APPEND caches.
mysys/mf_iocache2.c:
a correct tell() for SEQ_READ_APPEND caches
(my_b_tell() is not working for such caches).
sql/ha_innodb.cc:
we are getting rid of event lengthes here and there, which is good.
sql/log.cc:
Start events will have created==0 if generated by rotation (like in 3.23).
In 5.0 we always write a Format_description_log_event at the beginning of
every master's binary log and of every slave's relay log.
We also add Rotate and Stop to relay logs (like there already was in
master's binary logs).
When we rotate a relay log, we write the previous relay log's Start event
(the one which was sent from the master) to the beginning of the new log,
so that we don't need the previous relay log to understand the new one;
that's the purpose of MYSQL_LOG::description_event_for_queue.
Removed logging of SET FOREIGN_KEY_CHECKS, because we handle it as flags
in the Query event now.
sql/log_event.cc:
New event type: Format_description_log_event, to describe the log's format.
read_log_event() needs to be passed this event to be able to read 5.0 events.
Query_log_event has new members flags2 and sql_mode for replication of session
variables (except charsets which are WL#1062) and SQL_MODE.
flags2 is in fact a kind of copy of thd->options (&'d with a mask).
Now with this replication of FOREIGN_KEY_CHECKS, SQL_AUTO_IS_NULL, UNIQUE_CHECKS
and SQL_MODE work; with mysqlbinlog too.
sql/log_event.h:
Binlog version is changed to 4.
New classes (details in sql/log_event.cc).
Removing some useless #defines.
sql/mysql_priv.h:
Definition of SELECT_DISTINCT and others must be visible in client/mysqlbinlog.cc,
so adding #ifdefs.
sql/mysqld.cc:
update for prototype change
sql/slave.cc:
When the slave opens a relay log, it reads the first few events to know the format.
When slave I/O thread receives a Rotate from the master, it rotates its relay log
(to avoid mixed format in the relay log).
sql/slave.h:
in the slave we avoid lengthes and rely on absolute positions instead;
hence the introduction of future_group_master_log_pos and future_event_relay_log_pos
(explained in code).
sql/sql_class.cc:
catalog in THD
sql/sql_class.h:
catalog, and new members in MYSQL_LOG
sql/sql_repl.cc:
When the master starts sending binlog to slave, it must
first read the first few events to detect the binlog's format.
Same for SHOW BINLOG EVENTS.
2003-12-18 01:09:05 +01:00
|
|
|
delete description_event;
|
2001-06-21 21:19:24 +02:00
|
|
|
if (file >= 0)
|
|
|
|
{
|
|
|
|
end_io_cache(&log);
|
|
|
|
(void) my_close(file, MYF(MY_WME));
|
|
|
|
}
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2001-06-21 21:19:24 +02:00
|
|
|
if (errmsg)
|
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
2004-11-13 18:35:51 +01:00
|
|
|
my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
|
|
|
|
"SHOW BINLOG EVENTS", errmsg);
|
2007-07-05 10:09:56 +02:00
|
|
|
else
|
2008-02-19 13:58:08 +01:00
|
|
|
my_eof(thd);
|
2001-06-21 21:19:24 +02:00
|
|
|
|
2003-04-27 21:12:08 +02:00
|
|
|
pthread_mutex_lock(&LOCK_thread_count);
|
|
|
|
thd->current_linfo = 0;
|
|
|
|
pthread_mutex_unlock(&LOCK_thread_count);
|
2005-02-28 16:34:02 +01:00
|
|
|
DBUG_RETURN(ret);
|
2001-06-21 21:19:24 +02:00
|
|
|
}
|
|
|
|
|
2002-09-11 05:40:08 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a SHOW MASTER STATUS statement.
|
|
|
|
|
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
|
|
|
|
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE failure
|
|
|
|
*/
|
2004-10-20 03:04:37 +02:00
|
|
|
bool show_binlog_info(THD* thd)
|
2000-10-02 05:28:21 +02:00
|
|
|
{
|
2002-12-11 08:17:51 +01:00
|
|
|
Protocol *protocol= thd->protocol;
|
2000-10-02 05:28:21 +02:00
|
|
|
DBUG_ENTER("show_binlog_info");
|
|
|
|
List<Item> field_list;
|
|
|
|
field_list.push_back(new Item_empty_string("File", FN_REFLEN));
|
2002-12-11 08:17:51 +01:00
|
|
|
field_list.push_back(new Item_return_int("Position",20,
|
|
|
|
MYSQL_TYPE_LONGLONG));
|
2003-11-20 20:49:05 +01:00
|
|
|
field_list.push_back(new Item_empty_string("Binlog_Do_DB",255));
|
|
|
|
field_list.push_back(new Item_empty_string("Binlog_Ignore_DB",255));
|
2000-10-02 05:28:21 +02:00
|
|
|
|
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
include/mysql.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new statement attribute STMT_ATTR_CURSOR_TYPE
- MYSQL_STMT::flags to store statement cursor type
- MYSQL_STMT::server_status to store server status (i. e. if the server
was able to open a cursor for this query).
include/mysql_com.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new COMmand, COM_FETCH, to fetch K rows from read-only cursor.
By design should support scrollable cursors as well.
- a few new server statuses:
SERVER_STATUS_CURSOR_EXISTS is sent by server in reply to COM_EXECUTE,
when cursor was successfully opened for this query
SERVER_STATUS_LAST_ROW_SENT is sent along with the last row to prevent one
more round trip just for finding out that all rows were fetched from
this cursor (this is server mem savier also).
- and finally, all possible values of STMT_ATTR_CURSOR_TYPE,
while now we support only CURSORT_TYPE_NO_CURSOR and
CURSOR_TYPE_READ_ONLY
libmysql/libmysql.c:
Cursor patch to push into the main tree, client library part (considered
stable):
- simple additions to mysql_stmt_fetch implementation to read data
from an opened cursor: we can read up to iteration count rows per
one request; read rows are buffered in the same way as rows of
mysql_stmt_store_result.
- now send stmt->flags to server to let him now if we wish to have
a cursor for this statement.
- support for setting/getting statement cursor type.
libmysqld/examples/Makefile.am:
Testing cursors was originally implemented in C++. Now when these tests
go into client_test, it's time to convert it to C++ as well.
libmysqld/lib_sql.cc:
- cleanup: send_fields flags are now named.
sql/ha_innodb.cc:
- cleanup: send_fields flags are now named.
sql/mysql_priv.h:
- cursors support: declaration for server-side handler of COM_FETCH
sql/protocol.cc:
- cleanup: send_fields flags are now named.
- we can't anymore assert that field_types[field_pos] is sensible:
if we have COM_EXCUTE(stmt1), COM_EXECUTE(stmt2), COM_FETCH(stmt1)
field_types[field_pos] will point to fields of stmt2.
sql/protocol.h:
- cleanup: send_fields flag_s_ are now named.
sql/protocol_cursor.cc:
- cleanup: send_fields flags are now named.
sql/repl_failsafe.cc:
- cleanup: send_fields flags are now named.
sql/slave.cc:
- cleanup: send_fields flags are now named.
sql/sp.cc:
- cleanup: send_fields flags are now named.
sql/sp_head.cc:
- cleanup: send_fields flags are now named.
sql/sql_acl.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.h:
- cleanup: send_fields flags are now named.
sql/sql_error.cc:
- cleanup: send_fields flags are now named.
sql/sql_handler.cc:
- cleanup: send_fields flags are now named.
sql/sql_help.cc:
- cleanup: send_fields flags are now named.
sql/sql_parse.cc:
Server side support for cursors:
- handle COM_FETCH
- enforce assumption that whenever we free thd->free_list,
we reset it to zero. This way it's much easier to handle free_list
in prepared statements implementation.
sql/sql_prepare.cc:
Server side support for cursors:
- implementation of mysql_stmt_fetch (fetch some rows from open cursor).
- management of cursors memory is quite tricky now.
- execute_stmt can't be reused anymore in mysql_stmt_execute and
mysql_sql_stmt_execute
sql/sql_repl.cc:
- cleanup: send_fields flags are now named.
sql/sql_select.cc:
Server side support for cursors:
- implementation of Cursor::open, Cursor::fetch (buggy when it comes to
non-equi joins), cursor cleanups.
- -4 -3 -0 constants indicating return value of sub_select and end_send are
to be renamed to something more readable:
it turned out to be not so simple, so it should come with the other patch.
sql/sql_select.h:
Server side support for cursors:
- declaration of Cursor class.
- JOIN::fetch_limit contains runtime value of rows fetched via cursor.
sql/sql_show.cc:
- cleanup: send_fields flags are now named.
sql/sql_table.cc:
- cleanup: send_fields flags are now named.
sql/sql_union.cc:
- if there was a cursor, don't cleanup unit: we'll need it to fetch
the rest of the rows.
tests/Makefile.am:
Now client_test is in C++.
tests/client_test.cc:
A few elementary tests for cursors.
BitKeeper/etc/ignore:
Added libmysqld/examples/client_test.cc to the ignore list
2004-08-03 12:32:21 +02:00
|
|
|
if (protocol->send_fields(&field_list,
|
|
|
|
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2002-12-11 08:17:51 +01:00
|
|
|
protocol->prepare_for_resend();
|
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
if (mysql_bin_log.is_open())
|
|
|
|
{
|
|
|
|
LOG_INFO li;
|
|
|
|
mysql_bin_log.get_current_log(&li);
|
|
|
|
int dir_len = dirname_length(li.log_file_name);
|
2003-03-18 08:34:19 +01:00
|
|
|
protocol->store(li.log_file_name + dir_len, &my_charset_bin);
|
2002-12-11 08:17:51 +01:00
|
|
|
protocol->store((ulonglong) li.pos);
|
2005-03-08 21:12:35 +01:00
|
|
|
protocol->store(binlog_filter->get_do_db());
|
|
|
|
protocol->store(binlog_filter->get_ignore_db());
|
2002-12-11 08:17:51 +01:00
|
|
|
if (protocol->write())
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2001-07-10 14:53:08 +02:00
|
|
|
}
|
2008-02-19 13:58:08 +01:00
|
|
|
my_eof(thd);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(FALSE);
|
2000-10-02 05:28:21 +02:00
|
|
|
}
|
2000-10-27 06:11:55 +02:00
|
|
|
|
2001-07-10 14:53:08 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
/**
|
|
|
|
Execute a SHOW BINARY LOGS statement.
|
2002-08-08 02:12:02 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
@param thd Pointer to THD object for the client thread executing the
|
|
|
|
statement.
|
2002-08-08 02:12:02 +02:00
|
|
|
|
2009-01-09 13:49:24 +01:00
|
|
|
@retval FALSE success
|
|
|
|
@retval TRUE failure
|
2002-08-08 02:12:02 +02:00
|
|
|
*/
|
2004-10-20 03:04:37 +02:00
|
|
|
bool show_binlogs(THD* thd)
|
2000-10-27 06:11:55 +02:00
|
|
|
{
|
2002-08-08 02:12:02 +02:00
|
|
|
IO_CACHE *index_file;
|
2005-05-19 12:34:15 +02:00
|
|
|
LOG_INFO cur;
|
|
|
|
File file;
|
2000-10-27 06:11:55 +02:00
|
|
|
char fname[FN_REFLEN];
|
|
|
|
List<Item> field_list;
|
2000-11-16 02:58:58 +01:00
|
|
|
uint length;
|
2005-05-25 11:56:47 +02:00
|
|
|
int cur_dir_len;
|
2002-12-11 08:17:51 +01:00
|
|
|
Protocol *protocol= thd->protocol;
|
|
|
|
DBUG_ENTER("show_binlogs");
|
2001-07-10 14:53:08 +02:00
|
|
|
|
|
|
|
if (!mysql_bin_log.is_open())
|
2000-11-16 02:58:58 +01:00
|
|
|
{
|
2004-11-12 13:34:00 +01:00
|
|
|
my_message(ER_NO_BINARY_LOGGING, ER(ER_NO_BINARY_LOGGING), MYF(0));
|
2003-07-04 02:18:15 +02:00
|
|
|
return 1;
|
2000-11-16 02:58:58 +01:00
|
|
|
}
|
2000-10-27 06:11:55 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
field_list.push_back(new Item_empty_string("Log_name", 255));
|
2006-04-13 09:50:33 +02:00
|
|
|
field_list.push_back(new Item_return_int("File_size", 20,
|
2005-05-19 12:34:15 +02:00
|
|
|
MYSQL_TYPE_LONGLONG));
|
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
include/mysql.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new statement attribute STMT_ATTR_CURSOR_TYPE
- MYSQL_STMT::flags to store statement cursor type
- MYSQL_STMT::server_status to store server status (i. e. if the server
was able to open a cursor for this query).
include/mysql_com.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new COMmand, COM_FETCH, to fetch K rows from read-only cursor.
By design should support scrollable cursors as well.
- a few new server statuses:
SERVER_STATUS_CURSOR_EXISTS is sent by server in reply to COM_EXECUTE,
when cursor was successfully opened for this query
SERVER_STATUS_LAST_ROW_SENT is sent along with the last row to prevent one
more round trip just for finding out that all rows were fetched from
this cursor (this is server mem savier also).
- and finally, all possible values of STMT_ATTR_CURSOR_TYPE,
while now we support only CURSORT_TYPE_NO_CURSOR and
CURSOR_TYPE_READ_ONLY
libmysql/libmysql.c:
Cursor patch to push into the main tree, client library part (considered
stable):
- simple additions to mysql_stmt_fetch implementation to read data
from an opened cursor: we can read up to iteration count rows per
one request; read rows are buffered in the same way as rows of
mysql_stmt_store_result.
- now send stmt->flags to server to let him now if we wish to have
a cursor for this statement.
- support for setting/getting statement cursor type.
libmysqld/examples/Makefile.am:
Testing cursors was originally implemented in C++. Now when these tests
go into client_test, it's time to convert it to C++ as well.
libmysqld/lib_sql.cc:
- cleanup: send_fields flags are now named.
sql/ha_innodb.cc:
- cleanup: send_fields flags are now named.
sql/mysql_priv.h:
- cursors support: declaration for server-side handler of COM_FETCH
sql/protocol.cc:
- cleanup: send_fields flags are now named.
- we can't anymore assert that field_types[field_pos] is sensible:
if we have COM_EXCUTE(stmt1), COM_EXECUTE(stmt2), COM_FETCH(stmt1)
field_types[field_pos] will point to fields of stmt2.
sql/protocol.h:
- cleanup: send_fields flag_s_ are now named.
sql/protocol_cursor.cc:
- cleanup: send_fields flags are now named.
sql/repl_failsafe.cc:
- cleanup: send_fields flags are now named.
sql/slave.cc:
- cleanup: send_fields flags are now named.
sql/sp.cc:
- cleanup: send_fields flags are now named.
sql/sp_head.cc:
- cleanup: send_fields flags are now named.
sql/sql_acl.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.h:
- cleanup: send_fields flags are now named.
sql/sql_error.cc:
- cleanup: send_fields flags are now named.
sql/sql_handler.cc:
- cleanup: send_fields flags are now named.
sql/sql_help.cc:
- cleanup: send_fields flags are now named.
sql/sql_parse.cc:
Server side support for cursors:
- handle COM_FETCH
- enforce assumption that whenever we free thd->free_list,
we reset it to zero. This way it's much easier to handle free_list
in prepared statements implementation.
sql/sql_prepare.cc:
Server side support for cursors:
- implementation of mysql_stmt_fetch (fetch some rows from open cursor).
- management of cursors memory is quite tricky now.
- execute_stmt can't be reused anymore in mysql_stmt_execute and
mysql_sql_stmt_execute
sql/sql_repl.cc:
- cleanup: send_fields flags are now named.
sql/sql_select.cc:
Server side support for cursors:
- implementation of Cursor::open, Cursor::fetch (buggy when it comes to
non-equi joins), cursor cleanups.
- -4 -3 -0 constants indicating return value of sub_select and end_send are
to be renamed to something more readable:
it turned out to be not so simple, so it should come with the other patch.
sql/sql_select.h:
Server side support for cursors:
- declaration of Cursor class.
- JOIN::fetch_limit contains runtime value of rows fetched via cursor.
sql/sql_show.cc:
- cleanup: send_fields flags are now named.
sql/sql_table.cc:
- cleanup: send_fields flags are now named.
sql/sql_union.cc:
- if there was a cursor, don't cleanup unit: we'll need it to fetch
the rest of the rows.
tests/Makefile.am:
Now client_test is in C++.
tests/client_test.cc:
A few elementary tests for cursors.
BitKeeper/etc/ignore:
Added libmysqld/examples/client_test.cc to the ignore list
2004-08-03 12:32:21 +02:00
|
|
|
if (protocol->send_fields(&field_list,
|
|
|
|
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2006-09-04 13:43:34 +02:00
|
|
|
|
|
|
|
pthread_mutex_lock(mysql_bin_log.get_log_lock());
|
2000-10-27 06:11:55 +02:00
|
|
|
mysql_bin_log.lock_index();
|
2002-08-08 02:12:02 +02:00
|
|
|
index_file=mysql_bin_log.get_index_file();
|
2006-09-04 13:43:34 +02:00
|
|
|
|
|
|
|
mysql_bin_log.raw_get_current_log(&cur); // dont take mutex
|
|
|
|
pthread_mutex_unlock(mysql_bin_log.get_log_lock()); // lockdep, OK
|
|
|
|
|
2005-05-25 11:56:47 +02:00
|
|
|
cur_dir_len= dirname_length(cur.log_file_name);
|
2005-05-19 12:34:15 +02:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
|
|
|
|
|
|
|
|
/* The file ends with EOF or empty line */
|
|
|
|
while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1)
|
2000-11-16 02:58:58 +01:00
|
|
|
{
|
2005-05-25 11:56:47 +02:00
|
|
|
int dir_len;
|
|
|
|
ulonglong file_length= 0; // Length if open fails
|
|
|
|
fname[--length] = '\0'; // remove the newline
|
2005-05-19 12:34:15 +02:00
|
|
|
|
2002-12-14 16:43:01 +01:00
|
|
|
protocol->prepare_for_resend();
|
2005-05-25 11:56:47 +02:00
|
|
|
dir_len= dirname_length(fname);
|
|
|
|
length-= dir_len;
|
|
|
|
protocol->store(fname + dir_len, length, &my_charset_bin);
|
|
|
|
|
|
|
|
if (!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length)))
|
|
|
|
file_length= cur.pos; /* The active log, use the active position */
|
|
|
|
else
|
2005-05-19 12:34:15 +02:00
|
|
|
{
|
|
|
|
/* this is an old log, open it and find the size */
|
2005-07-18 14:46:53 +02:00
|
|
|
if ((file= my_open(fname, O_RDONLY | O_SHARE | O_BINARY,
|
2005-05-25 11:56:47 +02:00
|
|
|
MYF(0))) >= 0)
|
2005-05-19 12:34:15 +02:00
|
|
|
{
|
2005-05-25 11:56:47 +02:00
|
|
|
file_length= (ulonglong) my_seek(file, 0L, MY_SEEK_END, MYF(0));
|
2005-05-19 12:34:15 +02:00
|
|
|
my_close(file, MYF(0));
|
|
|
|
}
|
|
|
|
}
|
2005-05-25 11:56:47 +02:00
|
|
|
protocol->store(file_length);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (protocol->write())
|
2002-08-08 02:12:02 +02:00
|
|
|
goto err;
|
2000-11-16 02:58:58 +01:00
|
|
|
}
|
2000-10-27 06:11:55 +02:00
|
|
|
mysql_bin_log.unlock_index();
|
2008-02-19 13:58:08 +01:00
|
|
|
my_eof(thd);
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(FALSE);
|
2000-11-16 02:58:58 +01:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
err:
|
|
|
|
mysql_bin_log.unlock_index();
|
2004-10-20 03:04:37 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
2000-10-27 06:11:55 +02:00
|
|
|
}
|
|
|
|
|
2007-12-21 21:34:43 +01:00
|
|
|
/**
|
|
|
|
Load data's io cache specific hook to be executed
|
|
|
|
before a chunk of data is being read into the cache's buffer
|
|
|
|
The fuction instantianates and writes into the binlog
|
|
|
|
replication events along LOAD DATA processing.
|
|
|
|
|
|
|
|
@param file pointer to io-cache
|
|
|
|
@return 0
|
|
|
|
*/
|
2001-08-03 23:57:53 +02:00
|
|
|
int log_loaded_block(IO_CACHE* file)
|
|
|
|
{
|
2007-12-21 21:34:43 +01:00
|
|
|
DBUG_ENTER("log_loaded_block");
|
2004-12-31 11:04:35 +01:00
|
|
|
LOAD_FILE_INFO *lf_info;
|
2007-12-21 21:34:43 +01:00
|
|
|
uint block_len;
|
|
|
|
/* buffer contains position where we started last read */
|
2008-01-31 12:32:48 +01:00
|
|
|
uchar* buffer= (uchar*) my_b_get_buffer_start(file);
|
2007-12-21 21:34:43 +01:00
|
|
|
uint max_event_size= current_thd->variables.max_allowed_packet;
|
|
|
|
lf_info= (LOAD_FILE_INFO*) file->arg;
|
2006-02-26 00:03:52 +01:00
|
|
|
if (lf_info->thd->current_stmt_binlog_row_based)
|
2008-02-03 11:48:45 +01:00
|
|
|
DBUG_RETURN(0);
|
2001-08-03 23:57:53 +02:00
|
|
|
if (lf_info->last_pos_in_file != HA_POS_ERROR &&
|
2007-12-21 21:34:43 +01:00
|
|
|
lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
|
2008-01-06 13:16:28 +01:00
|
|
|
DBUG_RETURN(0);
|
2007-12-21 21:34:43 +01:00
|
|
|
|
2009-02-10 23:47:54 +01:00
|
|
|
for (block_len= (uint) (my_b_get_bytes_in_buffer(file)); block_len > 0;
|
2007-12-21 21:34:43 +01:00
|
|
|
buffer += min(block_len, max_event_size),
|
|
|
|
block_len -= min(block_len, max_event_size))
|
2001-08-03 23:57:53 +02:00
|
|
|
{
|
2007-12-21 21:34:43 +01:00
|
|
|
lf_info->last_pos_in_file= my_b_get_pos_in_file(file);
|
|
|
|
if (lf_info->wrote_create_file)
|
|
|
|
{
|
|
|
|
Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
|
|
|
|
min(block_len, max_event_size),
|
|
|
|
lf_info->log_delayed);
|
|
|
|
mysql_bin_log.write(&a);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
|
|
|
|
buffer,
|
|
|
|
min(block_len, max_event_size),
|
|
|
|
lf_info->log_delayed);
|
|
|
|
mysql_bin_log.write(&b);
|
|
|
|
lf_info->wrote_create_file= 1;
|
|
|
|
DBUG_SYNC_POINT("debug_lock.created_file_event",10);
|
|
|
|
}
|
2001-08-03 23:57:53 +02:00
|
|
|
}
|
2007-12-21 21:34:43 +01:00
|
|
|
DBUG_RETURN(0);
|
2001-08-03 23:57:53 +02:00
|
|
|
}
|
2002-12-16 14:33:29 +01:00
|
|
|
|
2007-03-02 17:43:45 +01:00
|
|
|
/*
|
|
|
|
Replication System Variables
|
|
|
|
*/
|
|
|
|
|
|
|
|
class sys_var_slave_skip_counter :public sys_var
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
sys_var_slave_skip_counter(sys_var_chain *chain, const char *name_arg)
|
|
|
|
:sys_var(name_arg)
|
|
|
|
{ chain_sys_var(chain); }
|
|
|
|
bool check(THD *thd, set_var *var);
|
|
|
|
bool update(THD *thd, set_var *var);
|
|
|
|
bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
|
|
|
|
/*
|
|
|
|
We can't retrieve the value of this, so we don't have to define
|
|
|
|
type() or value_ptr()
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
|
|
|
class sys_var_sync_binlog_period :public sys_var_long_ptr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
sys_var_sync_binlog_period(sys_var_chain *chain, const char *name_arg,
|
|
|
|
ulong *value_ptr)
|
|
|
|
:sys_var_long_ptr(chain, name_arg,value_ptr) {}
|
|
|
|
bool update(THD *thd, set_var *var);
|
|
|
|
};
|
|
|
|
|
|
|
|
static sys_var_chain vars = { NULL, NULL };
|
|
|
|
|
2008-11-22 00:22:21 +01:00
|
|
|
static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates",
|
|
|
|
OPT_GLOBAL, SHOW_MY_BOOL,
|
|
|
|
(uchar*) &opt_log_slave_updates);
|
|
|
|
static sys_var_const sys_relay_log(&vars, "relay_log",
|
|
|
|
OPT_GLOBAL, SHOW_CHAR_PTR,
|
|
|
|
(uchar*) &opt_relay_logname);
|
|
|
|
static sys_var_const sys_relay_log_index(&vars, "relay_log_index",
|
|
|
|
OPT_GLOBAL, SHOW_CHAR_PTR,
|
|
|
|
(uchar*) &opt_relaylog_index_name);
|
|
|
|
static sys_var_const sys_relay_log_info_file(&vars, "relay_log_info_file",
|
|
|
|
OPT_GLOBAL, SHOW_CHAR_PTR,
|
|
|
|
(uchar*) &relay_log_info_file);
|
2007-03-02 17:43:45 +01:00
|
|
|
static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge",
|
|
|
|
&relay_log_purge);
|
2008-11-22 00:22:21 +01:00
|
|
|
static sys_var_const sys_relay_log_space_limit(&vars,
|
|
|
|
"relay_log_space_limit",
|
|
|
|
OPT_GLOBAL, SHOW_LONGLONG,
|
|
|
|
(uchar*)
|
|
|
|
&relay_log_space_limit);
|
|
|
|
static sys_var_const sys_slave_load_tmpdir(&vars, "slave_load_tmpdir",
|
|
|
|
OPT_GLOBAL, SHOW_CHAR_PTR,
|
|
|
|
(uchar*) &slave_load_tmpdir);
|
2007-03-02 17:43:45 +01:00
|
|
|
static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout",
|
|
|
|
&slave_net_timeout);
|
2008-11-22 00:22:21 +01:00
|
|
|
static sys_var_const sys_slave_skip_errors(&vars, "slave_skip_errors",
|
|
|
|
OPT_GLOBAL, SHOW_CHAR,
|
|
|
|
(uchar*) slave_skip_error_names);
|
2007-03-02 17:43:45 +01:00
|
|
|
static sys_var_long_ptr sys_slave_trans_retries(&vars, "slave_transaction_retries",
|
|
|
|
&slave_trans_retries);
|
|
|
|
static sys_var_sync_binlog_period sys_sync_binlog_period(&vars, "sync_binlog", &sync_binlog_period);
|
|
|
|
static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
int result= 0;
|
|
|
|
pthread_mutex_lock(&LOCK_active_mi);
|
|
|
|
pthread_mutex_lock(&active_mi->rli.run_lock);
|
|
|
|
if (active_mi->rli.slave_running)
|
|
|
|
{
|
|
|
|
my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
|
|
|
|
result=1;
|
|
|
|
}
|
|
|
|
pthread_mutex_unlock(&active_mi->rli.run_lock);
|
|
|
|
pthread_mutex_unlock(&LOCK_active_mi);
|
|
|
|
var->save_result.ulong_value= (ulong) var->value->val_int();
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&LOCK_active_mi);
|
|
|
|
pthread_mutex_lock(&active_mi->rli.run_lock);
|
|
|
|
/*
|
|
|
|
The following test should normally never be true as we test this
|
|
|
|
in the check function; To be safe against multiple
|
|
|
|
SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
|
|
|
|
*/
|
|
|
|
if (!active_mi->rli.slave_running)
|
|
|
|
{
|
|
|
|
pthread_mutex_lock(&active_mi->rli.data_lock);
|
|
|
|
active_mi->rli.slave_skip_counter= var->save_result.ulong_value;
|
|
|
|
pthread_mutex_unlock(&active_mi->rli.data_lock);
|
|
|
|
}
|
|
|
|
pthread_mutex_unlock(&active_mi->rli.run_lock);
|
|
|
|
pthread_mutex_unlock(&LOCK_active_mi);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
|
|
|
|
{
|
|
|
|
sync_binlog_period= (ulong) var->save_result.ulonglong_value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int init_replication_sys_vars()
|
|
|
|
{
|
|
|
|
if (mysql_add_sys_var_chain(vars.first, my_long_options))
|
|
|
|
{
|
|
|
|
/* should not happen */
|
|
|
|
fprintf(stderr, "failed to initialize replication system variables");
|
|
|
|
unireg_abort(1);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-01-15 09:11:44 +01:00
|
|
|
#endif /* HAVE_REPLICATION */
|
2002-12-16 14:33:29 +01:00
|
|
|
|
|
|
|
|