mariadb/sql
unknown 378894b000 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
..
share Merge 4.1 to 5.0. 2003-12-16 16:12:28 +01:00
.cvsignore
add_errmsg
client_settings.h SCRUM 2003-09-19 14:05:28 +05:00
custom_conf.h
derror.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
des_key_file.cc Merge with 4.0.16 2003-10-07 15:42:26 +03:00
field.cc proper fix for the bug #2077: accented characters in enum/defaul values are reported incorrectly. 2003-12-16 17:39:33 +04:00
field.h Added missing timeout function for named pipes and shared memory (fixes core dump on windows) 2003-12-15 17:58:15 +02:00
field_conv.cc insert table select * from table2 now converts charsets correctly 2003-12-13 18:49:10 +01:00
filesort.cc Merging 4.1 -> 5.0 2003-09-24 11:29:38 +02:00
frm_crypt.cc
gen_lex_hash.cc - Polished mysql-copyright a bit and added call to remove 2003-09-23 00:38:01 +02:00
gstream.cc
gstream.h
ha_berkeley.cc Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
ha_berkeley.h Bitmap post-review fixes 2003-10-30 19:17:57 +01:00
ha_heap.cc Added missing SSL library (Should be in source distribution) 2003-11-28 12:18:13 +02:00
ha_heap.h
ha_innodb.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
ha_innodb.h fixes to Bitmap class 2003-10-24 22:44:48 +02:00
ha_isam.cc key_map with more that 64 bits width 2003-10-11 13:06:55 +02:00
ha_isam.h
ha_isammrg.cc added 'explicit' keyword to Bitmap constructor 2003-11-21 19:16:19 +03:00
ha_isammrg.h
ha_myisam.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
ha_myisam.h Merge bk-internal:/home/bk/mysql-4.1/ 2003-10-31 10:34:34 +01:00
ha_myisammrg.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
ha_myisammrg.h After merge fixes 2003-08-19 00:08:08 +03:00
handler.cc WorkLog#1280 - Remove fixed table handler from lex/yacc 2003-12-02 20:23:13 +00:00
handler.h WorkLog#1280 - Remove fixed table handler from lex/yacc 2003-12-02 20:23:13 +00:00
hash_filo.cc
hash_filo.h SCRUM 2003-09-19 14:44:31 +05:00
hostname.cc Don't flush cur_log (relay log) on flush_relay_log_info becasue this crashes the server if cur_log is 'hot' and the io_thread has changed log file. 2003-11-22 03:21:40 +02:00
init.cc Simplified 'wrong xxx name' error messages by introducing 'general' ER_WRONG_NAME error 2003-11-03 14:01:59 +02:00
item.cc Merge 4.1 to 5.0. 2003-12-16 16:12:28 +01:00
item.h Fixed BUG#336: Subselects with tables does not work as values for local SP variables 2003-12-04 15:17:55 +01:00
item_buff.cc
item_cmpfunc.cc Merge 4.1 to 5.0. 2003-12-16 16:12:28 +01:00
item_cmpfunc.h Merge rurik.mysql.com:/home/igor/mysql-5.0 2003-12-01 16:20:46 -08:00
item_create.cc post-merge fixes 2003-12-08 15:18:29 +04:00
item_create.h post-merge fixes 2003-12-08 15:18:29 +04:00
item_func.cc Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. 2003-12-16 14:15:27 +01:00
item_func.h Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
item_geofunc.cc
item_geofunc.h fixed printability of gis functions 2003-11-06 21:03:11 +02:00
item_row.cc fixed printability of Items (all items except subselects) 2003-10-12 17:56:05 +03:00
item_row.h fixed printability of Items (all items except subselects) 2003-10-12 17:56:05 +03:00
item_strfunc.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
item_strfunc.h Merge 2003-11-03 22:48:03 +02:00
item_subselect.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
item_subselect.h Added missing SSL library (Should be in source distribution) 2003-11-28 12:18:13 +02:00
item_sum.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
item_sum.h Merge 2003-10-22 20:52:47 +03:00
item_timefunc.cc post-merge fixes 2003-12-08 17:44:56 +04:00
item_timefunc.h post-merge fixes 2003-12-08 15:18:29 +04:00
item_uniq.cc
item_uniq.h added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor() 2003-10-30 12:57:26 +02:00
key.cc added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor() 2003-10-30 12:57:26 +02:00
lex.h Post-merge fixes. 2003-12-16 18:09:22 +01:00
lex_symbol.h
lock.cc Merging 4.1->5.0 2003-10-22 16:10:22 +02:00
log.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
log_event.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
log_event.h This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
Makefile.am - Added missing backslash to sql/Makefile.am that prevented the sp_* header 2003-12-04 12:02:18 +01:00
matherr.c
mf_iocache.cc
my_lock.c
mysql_priv.h This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
mysqld.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
net_serv.cc Fixed BUG#1965: Opening a cursor hangs client when malformed select fails 2003-11-27 16:48:21 +01:00
nt_servc.cc
nt_servc.h
opt_ft.cc merging in index_merge (in progress, not yet working) 2003-11-13 22:14:37 +03:00
opt_ft.h logging_ok: 2003-11-20 23:27:11 +03:00
opt_range.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
opt_range.h Post-merge fixes 2003-11-22 00:20:48 +03:00
opt_sum.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
password.c C cleanups 2003-09-03 16:31:01 +02:00
procedure.cc
procedure.h
protocol.cc Task ID 499:Add a new settable string variable(init_connect, init_slave) 2003-12-08 09:13:14 +04:00
protocol.h Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
protocol_cursor.cc Post-merge fixes. 2003-12-01 18:24:09 +01:00
records.cc Merging 4.1 -> 5.0 2003-09-24 11:29:38 +02:00
repl_failsafe.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
repl_failsafe.h
set_var.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
set_var.h post-merge fixes 2003-12-08 09:44:04 +04:00
slave.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
slave.h This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
sp.cc Renamed the "schema" column to "db" in mysql.proc to keep it in style with 2003-12-16 19:14:10 +01:00
sp.h In order to make ALTER PROCEDURE|FUNCTION work correctly, and in general to 2003-12-12 14:05:29 +01:00
sp_cache.cc Fixed various memory leaks. 2003-12-15 13:24:16 +01:00
sp_cache.h Fixed various memory leaks. 2003-12-15 13:24:16 +01:00
sp_head.cc Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. 2003-12-16 14:15:27 +01:00
sp_head.h Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. 2003-12-16 14:15:27 +01:00
sp_pcontext.cc Various bug fixes: 2003-11-13 19:34:56 +01:00
sp_pcontext.h Various bug fixes: 2003-11-13 19:34:56 +01:00
sp_rcontext.cc Fixed BUG#1965: Opening a cursor hangs client when malformed select fails 2003-11-27 16:48:21 +01:00
sp_rcontext.h Fixed BUG#1965: Opening a cursor hangs client when malformed select fails 2003-11-27 16:48:21 +01:00
spatial.cc Removed some warnings reported by valgrind 2003-11-04 14:09:03 +02:00
spatial.h
sql_acl.cc WL#1365: Implement definer's rights execution of stored procedures. 2003-12-13 16:40:52 +01:00
sql_acl.h WL#1365: Implement definer's rights execution of stored procedures. 2003-12-13 16:40:52 +01:00
sql_analyse.cc
sql_analyse.h
sql_base.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_bitmap.h added 'explicit' keyword to Bitmap constructor 2003-11-21 19:16:19 +03:00
sql_cache.cc Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
sql_cache.h Merge laptop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1 2003-08-26 16:42:49 +03:00
sql_class.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
sql_class.h This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
sql_client.cc
sql_crypt.cc
sql_crypt.h
sql_db.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_delete.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
sql_derived.cc Merge 2003-11-28 13:31:38 +02:00
sql_do.cc fixed error handling in SET and DO operators (BUG#1484) 2003-10-08 11:19:09 +03:00
sql_error.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_handler.cc Merge with 4.0 to get: 2003-11-20 22:30:48 +02:00
sql_help.cc Added missing SSL library (Should be in source distribution) 2003-11-28 12:18:13 +02:00
sql_insert.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_lex.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_lex.h WL#1363: Update the mysql.proc table and add new fields. 2003-12-10 19:05:37 +01:00
sql_list.cc
sql_list.h Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_load.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
sql_manager.cc
sql_manager.h
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. 2003-12-16 14:15:27 +01:00
sql_prepare.cc manual merge 2003-12-04 18:15:45 +03:00
sql_rename.cc
sql_repl.cc This will be pushed only after I fix the testsuite. 2003-12-18 01:09:05 +01:00
sql_repl.h Merge 4.1 into 5.0 2003-08-26 11:51:09 +02:00
sql_select.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
sql_select.h Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_show.cc Merge 4.1 to 5.0. 2003-12-16 16:12:28 +01:00
sql_sort.h
sql_state.c
sql_string.cc after review fix 2003-11-03 12:28:36 +02:00
sql_string.h after review fix 2003-11-03 12:28:36 +02:00
sql_table.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
sql_test.cc Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
sql_udf.cc merge with 4.0 for more memory allocation variables. 2003-10-13 15:50:30 +03:00
sql_udf.h hanged UDF interface to use clear() instead of reset() 2003-08-27 22:30:50 +03:00
sql_union.cc Post-merge fixes. 2003-12-01 18:24:09 +01:00
sql_update.cc Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
sql_yacc.yy Merge 4.1 to 5.0. 2003-12-16 16:12:28 +01:00
stacktrace.c
stacktrace.h
strfunc.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
structs.h CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS 2003-11-18 13:47:27 +02:00
table.cc proper fix for the bug #2077: accented characters in enum/defaul values are reported incorrectly. 2003-12-16 17:39:33 +04:00
table.h Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
thr_malloc.cc
time.cc Merge key cache structures to one 2003-11-20 22:06:25 +02:00
udf_example.cc after review patch (SCRUM) 2003-10-06 11:13:25 +03:00
uniques.cc Fix for bug #1980 2003-12-02 21:20:51 +03:00
unireg.cc Removed some warnings reported by valgrind 2003-11-04 14:09:03 +02:00
unireg.h unused variable max_prep_stmt_count removed 2003-12-05 01:55:57 +03:00
watchdog_mysqld