mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03: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.
This commit is contained in:
@ -14,6 +14,15 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
Mostly this file is used in the server. But a little part of it is used in
|
||||
mysqlbinlog too (definition of SELECT_DISTINCT and others).
|
||||
The consequence is that 90% of the file is wrapped in #ifndef MYSQL_CLIENT,
|
||||
except the part which must be in the server and in the client.
|
||||
*/
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
|
||||
#include <my_global.h>
|
||||
#include <assert.h>
|
||||
#include <mysql_version.h>
|
||||
@ -176,7 +185,15 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
|
||||
#define TEST_NO_STACKTRACE 512
|
||||
#define TEST_SIGINT 1024 /* Allow sigint on threads */
|
||||
|
||||
/* options for select set by the yacc parser (stored in lex->options) */
|
||||
#endif
|
||||
|
||||
/*
|
||||
This is included in the server and in the client.
|
||||
Options for select set by the yacc parser (stored in lex->options).
|
||||
None of the 32 defines below should have its value changed, or this will
|
||||
break replication.
|
||||
*/
|
||||
|
||||
#define SELECT_DISTINCT (1L << 0)
|
||||
#define SELECT_STRAIGHT_JOIN (1L << 1)
|
||||
#define SELECT_DESCRIBE (1L << 2)
|
||||
@ -214,6 +231,9 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
|
||||
#define OPTION_RELAXED_UNIQUE_CHECKS (1L << 27)
|
||||
#define SELECT_NO_UNLOCK (1L << 28)
|
||||
|
||||
/* The rest of the file is included in the server only */
|
||||
#ifndef MYSQL_CLIENT
|
||||
|
||||
/* options for UNION set by the yacc parser (stored in unit->union_option) */
|
||||
#define UNION_ALL 1
|
||||
|
||||
@ -1102,3 +1122,5 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
|
||||
table->map= (table_map) 1 << tablenr;
|
||||
table->force_index= table_list->force_index;
|
||||
}
|
||||
|
||||
#endif /* MYSQL_CLIENT */
|
||||
|
Reference in New Issue
Block a user