summaryrefslogtreecommitdiff
path: root/sql/log.cc
Commit message (Collapse)AuthorAgeFilesLines
* BUG#48738: merge local branch into mysql-5.0-bugteam latest.Luis Soares2009-12-241-4/+6
|\
| * BUG#48738: Backport patch for Bug 34582 to 5.0 codebase.Luis Soares2009-11-131-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | From BUG 34582 commit message: Issuing 'FLUSH LOGS' does not close and reopen indexfile. Instead a SEEK_SET is performed. This patch makes index file to be closed and reopened whenever a rotation happens (FLUSH LOGS is issued or binary log exceeds maximum configured size).
* | Bug#48983: Bad strmake calls (length one too long)Davi Arnaut2009-12-171-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is a somewhat common misusage of the strmake function. The strmake(dst, src, len) function writes at most /len/ bytes to the string pointed to by src, not including the trailing null byte. Hence, if /len/ is the exact length of the destination buffer, a one byte buffer overflow can occur if the length of the source string is equal to or greater than /len/. client/mysqldump.c: Make room for the trailing null byte. libmysql/libmysql.c: Add comment, there is enough room in the buffer. Increase buffer length, two strings are concatenated. libmysqld/lib_sql.cc: Make room for the trailing null byte. mysys/default.c: Make room for the trailing null bytes. mysys/mf_pack.c: Make room for the trailing null byte. server-tools/instance-manager/commands.cc: Copy only if overflow isn't possible in both cases. server-tools/instance-manager/listener.cc: Make room for the trailing null byte. sql/log.cc: Make room for the trailing null byte. sql/sp_pcontext.h: Cosmetic fix. sql/sql_acl.cc: MAX_HOSTNAME already specifies space for the trailing null byte. sql/sql_parse.cc: Make room for the trailing null byte. sql/sql_table.cc: Make room for the trailing null byte.
* Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-08-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 This patch fixes a number of GCC warnings about variables used before initialized. A new macro UNINIT_VAR() is introduced for use in the variable declaration, and LINT_INIT() usage will be gradually deprecated. (A workaround is used for g++, pending a patch for a g++ bug.) GCC warnings for unused results (attribute warn_unused_result) for a number of system calls (present at least in later Ubuntus, where the usual void cast trick doesn't work) are also fixed. client/mysqlmanager-pwgen.c: A fix for warn_unused_result, adding fallback to use of srand()/rand() if /dev/random cannot be used. Also actually adds calls to rand() in the second branch so that it actually creates a random password.
* BUG#43263 BEGIN skipped in some replicate-do-db casesHe Zhenxing2009-05-311-3/+3
| | | | | | | | | | | | | BEGIN/COMMIT/ROLLBACK was subject to replication db rules, and caused the boundary of a transaction not recognized correctly when these queries were ignored by the rules. Fixed the problem by skipping replication db rules for these statements. sql/log_event.cc: Skip checking replication db rules for BEGIN/COMMIT/ROLLBACK statements
* BUG#37145 Killing a statement doing DDL may log binlog event with error code ↵He Zhenxing2009-03-271-5/+10
| | | | | | | | | | | | | | | | | | | | | 1053 When the thread executing a DDL was killed after finished its execution but before writing the binlog event, the error code in the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED. This patch fixed the problem by ignoring the kill status when constructing the event for DDL statements. This patch also included the following changes in order to provide the test case. 1) modified mysqltest to support variable for connection command 2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to run mysql client against the slave mysqld.
* Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-2/+2
| | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* Fix PB warnings for parenthesis and valgrind leak report.Luis Soares2008-12-111-6/+7
| | | | BUG#38826
* BUG#38826 Race in MYSQL_LOG::purge_logs is impossible to debug in productionLuis Soares2008-12-041-79/+133
| | | | | | | | | BUG#39325 Server crash inside MYSQL_LOG::purge_first_log halts replicaiton The patch reverses the order of the purging and updating events for log and relay-log.info/index files respectively. This solves the problem of having holes caused by crashes happening between updating info/index files and purging logs. NOTE: This is a combined patch for BUG#38826 and BUG#39325. This patch is based on bugteam tree and takes into account reviewers suggestions.
* Bug#37027 expire_logs_days and missing binlogs cause a crash !Kristofer Pettersson2008-07-241-45/+97
| | | | | | | If the server failed to expired log files during start up it could crash. sql/log.cc: Added predicate to protect againt cases when current_thd might be NULL.
* Merge mysql1000.(none):/home/andrei/MySQL/FIXES/5.0/bug18199-purge_no_warnunknown2008-03-211-26/+127
|\ | | | | | | | | | | | | | | into mysql1000.(none):/home/andrei/MySQL/MERGE/5.0-bug18199_35178 sql/log.cc: Auto merged
| * Bug #18199 PURGE BINARY LOGS fails silently with missing logs;unknown2008-03-171-26/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #18453 Warning/error message if there is a mismatch between ... There were three problems: 1. the reported lack of warnings for the BEFORE syntax of PURGE; 2. the similar lack of warnings for the TO syntax; 3. incompatible behaviour between the two in that the latter blanked out regardlessly of presence or lack the actual file corresponding to an index record; the former version gave up at the first mismatch. fixed with deploying the warning's generation and synronizing logics of purge_logs() and purge_logs_before_date(). my_stat() is called in either of two branches of purge_logs() (responsible for the TO syntax of PURGE) similarly to how it has behaved in the BEFORE syntax. If there is no actual binlog file, my_stat returns NULL and my_delete is not invoked. A critical error is reported to the user if a file from the index could not be retrieved info about or deleted with a system error code different than ENOENT. sql/log.cc: generating warning in two functions. refining logics to call my_stat() by purge_logs() as it happens in purge_logs_before_date(). my_delete() is called only if my_stat() ensured existance of the file. A critical error is reported to the user if a file from the index could not be my_stat():ed or my_delete():d with an error different than ENOENT. sql/share/errmsg.txt: new error message mysql-test/include/show_binary_logs.inc: a new macro - shortcut of show binary logs mysql-test/r/binlog_index.result: new results mysql-test/t/binlog_index.test: a regression test for the bugs
* | Merge bk@192.168.21.1:mysql-5.0-optunknown2008-02-271-6/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | into mysql.com:/home/hf/work/25097/my50-25097 libmysql/libmysql.c: Auto merged libmysqld/lib_sql.cc: Auto merged sql/log.cc: Auto merged
| * Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.unknown2008-02-271-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no way to return an error from the client library if no MYSQL connections was established. So here i added variables to store that king of errors and made functions like mysql_error(NULL) to return these. client/mysql.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. Show the error message on std_error include/sql_common.h: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. cant_connect_sqlstate constant declared libmysql/libmysql.c: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. mysql_sqlstate(NULL) returns 'unknown_sqlstate' libmysqld/lib_sql.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. EMBEDDED_SERVER version of the vprint_msg_to_log() implemented sql-common/client.c: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. mysql_server_last_errno and mysql_server_last_error introduced to store errors not related to particular connections. mysql_error(NULL) and mysql_errno(NULL) now returns these mysql_server_last_error and errno respectively sql/log.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. EMBEDDED_LIBRARY implementation of the vprint_msg_to_log() moved to lib_sql.cc
* | Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0unknown2008-01-311-29/+71
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | into dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-merge include/my_sys.h: Auto merged sql/log.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged
| * BUG#26395: if crash during autocommit update to transactional table on ↵unknown2007-12-211-29/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master, slave fails Now, every transaction (including autocommit transactions) start with a BEGIN and end with a COMMIT/ROLLBACK in the binlog. Added a test case, and updated lots of test case result files. mysql-test/t/rpl_transaction-master.opt: BitKeeper file /home/sven/bk/b26395-autocommit-xa/5.0-rpl/mysql-test/t/rpl_transaction-master.opt mysql-test/t/rpl_transaction-slave.opt: BitKeeper file /home/sven/bk/b26395-autocommit-xa/5.0-rpl/mysql-test/t/rpl_transaction-slave.opt mysql-test/r/mix_innodb_myisam_binlog.result: Updated result file mysql-test/r/multi_update.result: Updated result file mysql-test/r/rpl_transaction.result: New result file for new test case. mysql-test/r/sp_trans_log.result: Updated result file mysql-test/r/variables-big.result: Updated result file mysql-test/t/rpl_transaction.test: New test case. sql/log.cc: - Always write BEGIN and COMMIT around statements, even in autocommit mode. - Added comments for binlog_commit and binlog_rollback. sql/log_event.cc: Added debug trigger to avoid writing xid events to the binlog.
* | Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-optunknown2007-12-171-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/31752_/50-31752_ client/mysql.cc: Auto merged sql/log.cc: Auto merged sql/set_var.cc: Auto merged sql/sp.cc: Auto merged sql/unireg.cc: Auto merged
| * Merge mysql.com:/misc/mysql/31752_/41-31752_unknown2007-12-171-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/31752_/50-31752_ mysys/mf_pack.c: Auto merged sql/log.cc: Auto merged sql/sql_show.cc: manual merge sql/unireg.cc: manual merge
| | * Bug#31752: check strmake() boundsunknown2007-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | post-fixes: prevent semi-related overflow, additional comments mysys/mf_pack.c: extra comments sql/log.cc: prevent overflow (length parameter of strmake() should never become < 0) sql/sql_show.cc: additional comments sql/unireg.cc: additional comments
| * | Merge mysql.com:/misc/mysql/31752_/41-31752_unknown2007-11-261-1/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/31752_/50-31752_ sql/log.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged strings/strmake.c: Auto merged sql/sql_show.cc: manually merged sql/unireg.cc: manual merge
| | * Bug#31752: check strmake() boundsunknown2007-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strmake() calls are easy to get wrong. Add checks in extra debug mode to identify possible exploits. Remove some dead code. Remove some off-by-one errors identified with new checks. sql/log.cc: fix off-by-one buffer-length argument to prevent stack smashing sql/repl_failsafe.cc: fix off-by-one buffer-length argument to prevent stack smashing sql/set_var.cc: fix off-by-one buffer-length argument to prevent stack smashing (already approved, backports #31588) sql/sql_show.cc: misdimensioned buffers: functions further down the callstack expect bufsize of FN_REFLEN sql/unireg.cc: When EXTRA_DEBUG is enabled, strmake() will write funny patterns to buffers it operates on to identify possibly overflows. This leads to badness in mysql_create_frm(), so we explicitly put any unused bytes (back) into a defined state. Not a bug-fix, but part of the strmake() bug detector. strings/strmake.c: strmake() takes maximum string length rather than buffer-length (string length + 1 to accomodate \0 terminator) as argument. Since this is easy to get wrong, add extra debug code to identify off-by-ones so we can prevent stack smashing. Alternative "BAD_STRING_COMPILER" removed after checking with Monty.
| | * Bug#22645 LC_TIME_NAMES: Statement not replicatedunknown2006-12-051-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: replication of LC_TIME_NAMES didn't work. Thus, INSERTS or UPDATES using date_format() always worked with en_US on the slave side. Fix: adding ONE_SHOT implementation for LC_TIME_NAMES. mysql-test/r/variables.result: Adding various tests with LC_TIME_NAMES and string and numeric constants and expressions. mysql-test/t/variables.test: Adding various tests with LC_TIME_NAMES and string and numeric constants and expressions. sql/log.cc: Adding ONE_SHOT trick for lc_time_names. sql/mysql_priv.h: Adding new member "number" - for unique locale IDs. Adding prototype for my_locale_by_number(). sql/set_var.cc: Modifying lc_time_names variable to understand both: - string valyes (using locale name) - number values (using locale IDs) sql/set_var.h: - Marking lc_time_names as ONE_SHOT capable. - Marking lc_time_names as INT_RESULT compatible. sql/sql_locale.cc: - adding local IDs - better layout for locale data declarations (splitting long lines into short ones) - adding DBUG_ASSERT into my_locale_by_name() and moving this function towards the end of file - after "my_locales" declaration - adding my_locale_by_number() implementation sql/sql_parse.cc: Adding initialization of lc_time_names to its default value (en_US) mysql-test/r/rpl_locale.result: Adding test case mysql-test/t/rpl_locale.test: Adding test case
| | * Merge perch.ndb.mysql.com:/home/jonas/src/41-workunknown2006-09-041-2/+7
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | into perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-ndb sql/log.cc: Auto merged
* | | | Bug #28597 Replication doesn't start after upgrading to 5.1.18unknown2007-11-051-7/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since bug@20166, which replaced the binlog file name generating to base on pidfile_name instead of the previous glob_hostname, the binlog file name suddenly started to be stored solely in the absolute path format, including a case when --log-bin option meant a relative path. What's more serious, the path for binlog file can lead unrequestedly to pid-file directory so that after any proper fix for this bug there might be similar to the bug report consequences for one who upgrades from post-fix-bug@20166-pre-fix-bug@28597 to post-fix-bug@28597. Fixed with preserving`pidfile_name' (intr.by bug@20166) but stripping off its directory part. This restores the original logics of storing the names in compatible with --log-bin option format and with the requirement for --log-bin ralative path to corresond to the data directory. Side effects for this fix: effective fixing bug@27070, refining its test; ensuring no overrun for buff can happen anymore (Bug#31836 insufficient space reserved for the suffix of relay log file name); bug#31837 --remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql missed in rpl_temporary.test; fixes Bug@28603 Invalid log-bin default location; mysql-test/t/rpl_dual_pos_advance.test: After correcting the logics of log file name composing workaround for Bug #27070 server logs are created unrequested and in wrong directory is removed. mysql-test/t/rpl_temporary.test: remaining temp file of the test removed sql/log.cc: stripping off the directory part of `pidfile_name' for binlog name generating (which fixes two more bugs on wrong binlog file location); ensuring no overrun for buff can happen anymore (Bug #31836 insufficient space reserved for the suffix of relay log file name);
* | | (pushing for Andrei)unknown2007-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack Once had been set the flag might later got reset inside of a stored routine execution stack. The reason was in that there was no check if a new statement started at time of resetting. The artifact affects most of binlogable DML queries. Notice, that multi-update is wrapped up within bug@27716 fix, multi-delete bug@29136. Fixed with saving parent's statement flag of whether the statement modified non-transactional table, and unioning (merging) the value with that was gained in mysql_execute_command. Resettling thd->no_trans_update members into thd->transaction.`member`; Asserting code; Effectively the following properties are held. 1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table reflects the fact if such a table got modified by the substatement. That also respects THD::really_abort_on_warnin() requirements. 2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as the union of the values of all invoked sub-statements. That fixes this bug#27417; Computing of thd->transaction.all.modified_non_trans_table is refined to base to the stmt's value for all the case including insert .. select statement which before the patch had an extra issue bug@28960. Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in to temp_table select. The supplied test verifies limitely, mostly asserts. The ultimate testing is defered for bug@13270, bug@23333. mysql-test/r/mix_innodb_myisam_binlog.result: results changed mysql-test/t/mix_innodb_myisam_binlog.test: regression test incl the related bug#28960. sql/ha_ndbcluster.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/handler.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/handler.h: new member added sql/log.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/set_var.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/sp_head.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} and saving and merging stmt's flag at the end of a substatement. sql/sql_class.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/sql_class.h: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/sql_delete.cc: correcting basic delete incl truncate branch and multi-delete queries to set stmt.modified_non_trans_table; optimization to set the flag at the end of per-row loop; multi-delete still has an extra issue similar to bug#27716 of multi-update - to be address with bug_29136 fix. sql/sql_insert.cc: thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/sql_load.cc: eliminating a separate issue where the stmt flag was saved and re-stored after write_record that actually could change it and the change would be lost but should remain permanent; thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt} sql/sql_parse.cc: initialization to transaction.stmt.modified_non_trans_table at the common part of all types of statements processing - mysql_execute_command(). sql/sql_table.cc: moving the reset up to the mysql_execute_command() caller sql/sql_update.cc: correcting update query case (multi-update part of the issues covered by other bug#27716 fix) thd->transaction.{all,stmt}.modified_non_trans_table instead of thd->no_trans_update.{all,stmt}
* | | Moved the DBUG_ASSERT from bug 28983 tounknown2007-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | a place where it would not obstruct correct multithreading.
* | | Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maintunknown2007-07-101-7/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/tnurnberg/22540/50-22540 sql/log.cc: Auto merged
| * | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-07-091-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB dollin' it up for Guilhem ;) -- test streamlined, better comments, faster code, add'l assert. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB comment clarified
* | | | Merge sita.local:/Users/tsmith/m/bk/50unknown2007-07-091-5/+5
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | into sita.local:/Users/tsmith/m/bk/maint/50 sql/log.cc: Auto merged
| * | | Bug #28983: 'reset master' in multiple threads and innodb tables unknown2007-07-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asserts debug binary We can't reliably check if the binary log is opened without acquiring its mutex. Fixed by removing this check. sql/log.cc: Bug #28983: can't reliably check if bin_log is open outside of its mutex
* | | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB minor fixes to appease pushbuild. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB change type to uchar * so it's the same as in 5.1.
* | | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-06-301-35/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB previous correction didn't. make sure "tail" is fixed up when filling cache several times; rework formulae. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary
* | | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB Windows fixies
* | | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB windows fixies
* | | | Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using ↵unknown2007-06-251-22/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem.
* | | | Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS ↵unknown2007-06-251-4/+59
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using InnoDB fix binlog-writing so that end_log_pos is given correctly even within transactions for both SHOW BINLOG and SHOW MASTER STATUS, that is as absolute values (from log start) rather than relative values (from transaction's start). --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint into sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 mysql-test/r/binlog.result: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. --- manual merge mysql-test/t/binlog.test: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. sql/log.cc: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly even within transactions. do this by rewriting the commit-buffer in place.
* | | Remove dangerous "remove warning" hack, cast to longunknown2007-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | will truncate the time value on systems where "long" are 32bit, instead use time_t as datatype
* | | Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0unknown2007-04-121-54/+42
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel client/mysqldump.c: Auto merged mysql-test/t/sp.test: Auto merged mysys/my_malloc.c: Auto merged mysys/my_static.c: Auto merged mysys/safemalloc.c: Auto merged ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged sql/ha_archive.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql-common/client.c: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql-common/my_time.c: Auto merged mysql-test/r/sp.result: Merged from main 5.0 sql/sql_load.cc: Merged from main 5.0
| * | | Fix warning on Windowsunknown2007-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | sql/log.cc: Change print_buffer_to_nt_eventlog() to take size_t instead of int/uint for buffer sizes
| * | | Remove warning when compiling libmysqld/log.ccunknown2007-03-281-31/+31
| | | | | | | | | | | | | | | | | | | | sql/log.cc: define print_buffer_to_file only ifdef EMBEDDED_LIBRARY, to avoid "defined but not used" warning
| * | | Merge pilot.blaudden:/home/msvensson/mysql/bug27490/my50-bug27490unknown2007-03-281-23/+11
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint sql/log.cc: Auto merged
| | * | | Bug#27490 Function to log to NT event log could allocate memoryunknown2007-03-281-23/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Change 'print_buffer_to_nt_event_log' to overwrite the string if the buffer is not long enough to hold the ending CR/LF's - Make functions static - Remove the "hack" intended to force 'print_buffer_to_nt_event_log' never to use "new" sql/log.cc: -Change 'print_buffer_to_nt_event_log' to overwrite the string if the buffer is not long enough to hold the ending CR/LF's - Make functions static - Remove the "hack" intended to force 'print_buffer_to_nt_event_log' never to use "new"
* | | | | Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()unknown2007-03-231-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit was not restored at the end of SF() invocation, where SF() modified non-ta table. As the result of this artifact it was not possible to detect whether there were any side-effects when top-level query ends. If the top level query table was not modified and the bit is lost there would be no binlogging. Fixed with preserving the bit inside of thd->no_trans_update struct. The struct agregates two bool flags telling whether the current query and the current transaction modified any non-ta table. The flags stmt, all are dropped at the end of the query and the transaction. mysql-test/r/sp_trans.result: results will be changed once again after bug#23333 will be fixed. mysql-test/t/sp_trans.test: regression test added sql/ha_ndbcluster.cc: replacing thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit and bool thd->no_trans_update with thd->no_trans_update as struct sql/handler.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/log.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/set_var.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sp_head.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_class.h: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_delete.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_insert.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_load.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_parse.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_table.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_update.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools.
* | | | Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0unknown2007-03-011-25/+40
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint BitKeeper/etc/ignore: auto-union client/mysqltest.c: Auto merged extra/comp_err.c: Auto merged include/my_time.h: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/mysqltest.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/mysqltest.test: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_strfunc.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/tztime.cc: Auto merged client/mysql_upgrade.c: Manual merge mysql-test/mysql-test-run.pl: Manual merge mysql-test/r/ctype_cp932.result: Manual merge mysql-test/r/mysqlbinlog.result: Manual merge mysql-test/t/ctype_cp932.test: Manual merge mysql-test/t/mysql.test: Manual merge mysql-test/t/mysqlbinlog.test: Manual merge
| * \ \ \ Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0unknown2007-03-011-2/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge sql/field.cc: Auto merged sql/log.cc: Auto merged sql/slave.cc: Auto merged sql/sql_repl.cc: Auto merged
| | * | | | Fixed compiler warnings.unknown2007-02-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client/mysql_upgrade.c: Fixed problem with mysql_upgrade being dependent on local my.cnf files and problem with memory not being freed. client/mysqltest.c: Changed type to avoid warning. cmd-line-utils/readline/xmalloc.c: Fix to avoid warning. include/my_dbug.h: To disable parts from code in non-debug more. sql/field.cc: Fixed warning. sql/ha_archive.cc: Fixed warning. sql/ha_berkeley.cc: Added casts to avoid warnings. sql/ha_ndbcluster.cc: Fixed warnings. sql/log.cc: Added casts to avoid warnings. sql/slave.cc: Avoid warning. sql/sql_repl.cc: Avoid warning. support-files/compiler_warnings.supp: Added disabled warnings to compiler_warnings.supp file. These are backported mainly from 5.1 suppress file, but there are some additional new ones.
| * | | | | Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.0-rplunknown2007-02-261-2/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged
| | * \ \ \ \ Merge mysql_cab_desk.:C:/source/c++/mysql-5.0-rplunknown2007-02-231-2/+2
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql_cab_desk.:C:/source/c++/mysql-5.0_BUG_20141 sql/log.cc: Auto merged
| | | * | | | | BUG#20141 "User-defined variables are not replicated properly for SF/unknown2007-02-231-2/+2
| | | | |/ / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Triggers in SBR mode." BUG#14914 "SP: Uses of session variables in routines are not always replicated" BUG#25167 "Dupl. usage of user-variables in trigger/function is not replicated correctly" User-defined variables used inside of stored functions/triggers in statements which did not update tables directly were not replicated. We also had problems with replication of user-defined variables which were used in triggers (or stored functions called from table-updating statements) more than once. This patch addresses the first issue by enabling logging of all references to user-defined variables in triggers/stored functions and not only references from table-updating statements. The second issue stemmed from the fact that for user-defined variables used from triggers or stored functions called from table-updating statements we were writing binlog events for each reference instead of only one event for the first reference. This problem is already solved for stored functions called from non-updating statements with help of "event unioning" mechanism. So the patch simply extends this mechanism to the case affected. It also fixes small problem in this mechanism which caused wrong logging of references to user-variables in cases when non-updating statement called several stored functions which used the same variable and some of these function calls were omitted from binlog as they were not updating any tables. mysql-test/r/rpl_user_variables.result: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch adds the correct results for execution of the added test procedures to the rpl_user_variables test. mysql-test/t/rpl_user_variables.test: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch adds additional tests to the rpl_user_variables test that test many of the different ways user-defined variables can be required to be replicated. sql/item_func.cc: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. To properly log accesses to user-defined variables from stored functions/triggers, the get_var_with_binlog() method needs to log references to such variables even from non-table-updating statements within them. sql/log.cc: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch modifies the start_union_events method to accept the query id from a parameter. This allows callers to set the query_id to the id of the sub statement such as a trigger or stored function. Which permits the code to identify when a user defined variable has been used by the statement and this already present in THD::user_var_event. Note: The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper replication of access to user-defined variables under a special test case (the last case shown in rpl_user_variables.test). sql/sp_head.cc: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch modifies the code to allow for cases where events for function calls have a separate union for each event and thus cannot use the query_id of the caller as the start of the union. Thus, we use an artifically created query_id to set the start of the events. Note: The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper replication of access to user-defined variables under a special test case (the last case shown in rpl_user_variables.test). sql/sql_class.cc: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch adds the query_id parameter to the calls to mysql_bin_log.start_union_events(). Note: The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper replication of access to user-defined variables under a special test case (the last case shown in rpl_user_variables.test). sql/sql_class.h: BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode. This patch adds the query_id parameter to the calls to mysql_bin_log.start_union_events().
| * | | | | | Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rplunknown2007-02-251-1/+1
| |\ \ \ \ \ \ | | |/ / / / / | | | | / / / | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge sql/field.cc: Auto merged sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/sql_insert.cc: Auto merged