An error occurred fetching the project authors.
  1. 06 Sep, 2004 2 commits
  2. 29 Aug, 2004 2 commits
    • unknown's avatar
      log.cc: · 6e3e3eae
      unknown authored
        Fixed missing * in comment in setup_windows_event_source
      
      
      sql/log.cc:
        Fixed missing * in comment in setup_windows_event_source
      6e3e3eae
    • unknown's avatar
      Fix for BUG#4500 "set character set replicates incorrectly" · 804238d3
      unknown authored
      We must not reset the charset in slave after each statement, otherwise the SET CHARACTER SET is cancelled immediately.
      Instead, we write a SET CHARACTER SET DEFAULT to the master's binlog when needed (like we already do for SET FOREIGN_KEY_CHECKS);
      such writing is not necessary in 4.1 (in 4.1 the bug does not exist, as the SET ONE_SHOT syntax is used).
      I have written a test and it works, but I'm not pushing the test as it requires building with all charsets.
      I have noticed differences between what is inserted in the master's table in 4.0 and 4.1, and alerted Bar.
      
      
      sql/log.cc:
        When SET CHARACTER SET has been used, we must reset the charset after the writing the statement, in the binlog.
        In 4.1, this resetting is already achieved by the SET ONE_SHOT syntax.
      sql/log_event.cc:
        In slave, we must not simply reset the charset after each statement: if we do this, the charset gets
        immediately after executing the SET CHARACTER SET! (BUG#4500).
      804238d3
  3. 27 Aug, 2004 1 commit
    • unknown's avatar
      Code style fixes. · d15fefa9
      unknown authored
      Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()
      
      
      mysql-test/r/lowercase_table.result:
        Changed foo database -> mysqltest
        More test cases
      mysql-test/t/lowercase_table.test:
        Changed foo database -> mysqltest
        More test cases
      mysys/my_getopt.c:
        Fix new code to use MySQL indentation style
      sql/log.cc:
        Change to use MySQL indentation style and naming conventions
        Remove usage of strlen() and strcat()
      sql/mysqld.cc:
        Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()
      sql/sql_base.cc:
        Added comment
      sql/table.cc:
        Added #if MYSQL_VERSION_ID < 40100 to ensure code is merged correctly
      d15fefa9
  4. 19 Aug, 2004 1 commit
    • unknown's avatar
      Bug #4466 Nothing in .err when mysql service ends because of malformed my.ini options · ab169859
      unknown authored
      mysqld.cc:
        Changed LOGLEVEL enum to loglevel
      mysql_priv.h, log.cc:
        Changed LOGLEVEL to loglevel.  Removed startup_ from some of the DBUG_ENTER macros. Removed the print_msg_to_log function as it was unused.
      my_getopt.c, my_getopt.h:
        Renamed LOGLEVEL to loglevel to match coding standards
      
      
      include/my_getopt.h:
        Renamed LOGLEVEL to loglevel to match coding standards
      mysys/my_getopt.c:
        Renamed LOGLEVEL to loglevel to match coding standards
      sql/log.cc:
        Changed LOGLEVEL to loglevel.  Removed startup_ from some of the DBUG_ENTER macros. Removed the print_msg_to_log function as it was unused.
      sql/mysql_priv.h:
        Changed LOGLEVEL to loglevel.  Removed startup_ from some of the DBUG_ENTER macros. Removed the print_msg_to_log function as it was unused.
      sql/mysqld.cc:
        Changed LOGLEVEL enum to loglevel
      ab169859
  5. 18 Aug, 2004 2 commits
    • unknown's avatar
      Fix for BUG#4971 "CREATE TABLE ... TYPE=HEAP SELECT ... stops slave (wrong DELETE in binlog)": · 090b38b0
      unknown authored
      replacing the no_log argument of mysql_create_table() by some safer method
      (temporarily setting OPTION_BIN_LOG to 0) which guarantees that even the automatic
      DELETE FROM heap_table does not get into the binlog when a not-yet-existing HEAP table
      is opened by mysql_create_table().
      
      
      mysql-test/r/rpl_heap.result:
        result update
      mysql-test/t/rpl_heap.test:
        testing a bug
      sql/log.cc:
        new class Disable_binlog used to temporarily disable binlogging for one thread.
      sql/mysql_priv.h:
        removing argument no_log from mysql_create_table(); no_log was perfect as some
        binlogging could still be done by open_unireg_entry() for a HEAP table.
      sql/sql_class.h:
        new class Disable_binlog used to temporarily disable binlogging for one thread.
      sql/sql_parse.cc:
        removing no_log
      sql/sql_table.cc:
        removing no_log from mysql_create_table(); instead using new class Disable_binlog.
        Disabling binlogging in some cases, where the binlogging is done later by some other code
        (case of CREATE SELECT and ALTER).
      090b38b0
    • unknown's avatar
      BUG# 4466 - Nothing in .err when mysql service ends because of malformed my.ini options · 992baee9
      unknown authored
      mysqld.cc:
        Changed option_error_reporter to match new function header that includes LOGLEVEL enum
      mysql_priv.h:
        Removed the MY_ERROR style bitmask.  Changed function headers to use new LOGLEVEL enum
      log.cc:
        Changed print_buffer_to_log to print_buffer_to_file.  Remove the timestamp bool and now all log entries written to stderr are timestamped.  Removed some unused commented code.  changed to use the new LOGLEVEL enum.  
      my_getopt.c:
        Changed functions to use the new LOGLEVEL enum and changed the included error reporter to be default_reporter.  This reporter is used in handle_options if a reporter is not given
      my_getopt.h:
        changed typedefs to use better naming convention.  Moved error bitmask into the LOGLEVEL enum and included it here.
      
      
      include/my_getopt.h:
        changed typedefs to use better naming convention.  Moved error bitmask into the LOGLEVEL enum and included it here.
      mysys/my_getopt.c:
        Changed functions to use the new LOGLEVEL enum and changed the included error reporter to be default_reporter.  This reporter is used in handle_options if a reporter is not given
      sql/log.cc:
        Changed print_buffer_to_log to print_buffer_to_file.  Remove the timestamp bool and now all log entries written to stderr are timestamped.  Removed some unused commented code.  changed to use the new LOGLEVEL enum.
      sql/mysql_priv.h:
        Removed the MY_ERROR style bitmask.  Changed function headers to use new LOGLEVEL enum
      sql/mysqld.cc:
        Changed option_error_reporter to match new function header that includes LOGLEVEL enum
      992baee9
  6. 14 Aug, 2004 1 commit
    • unknown's avatar
      mysql_priv.h: · 7c3ecdff
      unknown authored
        Added declarations for print_msg_to_log and vprint_msg_to_log.  sql_print_error are simple functions that wrap calls to print_msg_to_log.  Define the different error types with MY_ERROR_TYPE, MY_WARNING_TYPE, and MY_INFORMATION_TYPE
      gen_lex_hash.cc:
        Added NULL error reporting parameter to handle_options
      log.cc:
        Add print_msg_to_log, print_buffer_to_log, and vprint_msg_to_log.  Print_msg_to_log will write the message to the windows event log if on NT.  We now have error, warning, and information versions of sql_print_xxxx.  T his is a variation of a similar changeset WAX did.
      mysqld.cc:
        Added option_error_reporter callback function and pass that into handle_options
      mysql.cc:
        Added NULL as error reporter arg to the end of handle_options
      Many files:
        Added NULL error reporter parameter as the last paramter to handle_options
      my_getopt.c:
        Added second function pointer to server as an error reporting callback.  Added local function report_option_error that will either write the error to stderr or to the error reporting callback.  changed all calls in handle_options from fprintf(stderr, ... ) to report_option_error
      my_getopt.h:
        Changed declaration of handle_options to use typedefs for the two function pointers.  added second function pointer to server as an error reporting callback
      mysqld.dsp:
        Added custom build step for compiling message file and added message resource file (output of mc)
      
      
      VC++Files/sql/mysqld.dsp:
        Added custom build step for compiling message file and added message resource file (output of mc)
      client/mysqladmin.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlcheck.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqldump.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlimport.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlmanager-pwgen.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlmanagerc.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlbinlog.cc:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqlshow.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysqltest.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/my_print_defaults.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/mysql_install.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/mysql_waitpid.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/perror.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/resolve_stack_dump.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      extra/resolveip.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      isam/isamchk.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      isam/pack_isam.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      myisam/mi_test1.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      myisam/myisam_ftdump.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      myisam/myisamchk.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      myisam/myisampack.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      include/my_getopt.h:
        Changed declaration of handle_options to use typedefs for the two function pointers.  added second function pointer to server as an error reporting callback
      mysys/my_getopt.c:
        Added second function pointer to server as an error reporting callback.  Added local function report_option_error that will either write the error to stderr or to the error reporting callback.  changed all calls in handle_options from fprintf(stderr, ... ) to report_option_error
      tools/mysqlmanager.c:
        Added NULL error reporter parameter as the last paramter to handle_options
      client/mysql.cc:
        Added NULL as error reporter arg to the end of handle_options
      sql/mysqld.cc:
        Added option_error_reporter callback function and pass that into handle_options
      sql/log.cc:
        Add print_msg_to_log, print_buffer_to_log, and vprint_msg_to_log.  Print_msg_to_log will write the message to the windows event log if on NT.  We now have error, warning, and information versions of sql_print_xxxx.  T his is a variation of a similar changeset WAX did.
      sql/gen_lex_hash.cc:
        Added NULL error reporting parameter to handle_options
      sql/mysql_priv.h:
        Added declarations for print_msg_to_log and vprint_msg_to_log.  sql_print_error are simple functions that wrap calls to print_msg_to_log.  Define the different error types with MY_ERROR_TYPE, MY_WARNING_TYPE, and MY_INFORMATION_TYPE
      BitKeeper/etc/logging_ok:
        Logging to logging@openlogging.org accepted
      7c3ecdff
  7. 31 Jul, 2004 1 commit
    • unknown's avatar
      Fix for: · d028624d
      unknown authored
      Bug #4810 "deadlock with KILL when the victim was in a wait state"
      (I included mutex unlock into exit_cond() for future safety)
      and BUG#4827 "KILL while START SLAVE may lead to replication slave crash"
      
      
      sql/lock.cc:
        we did exit_cond() before unlock(LOCK_open), which led to deadlocks with THD::awake(). Fixing this.
      sql/log.cc:
        mutex unlock is now included in exit_cond()
      sql/repl_failsafe.cc:
        we did exit_cond() before unlock(LOCK_rpl_status), which led to deadlocks with THD::awake(). Fixing this.
      sql/slave.cc:
        we did exit_cond() before unlock(cond_lock), which led to deadlocks with THD::awake(). Fixing this.
        Fixing also that if killed while waiting for slave thread to start, we don't release the mutex
        (that caused a double release of the mutex => crash).
      sql/sql_class.h:
        comments about exit_cond()/enter_cond().
        Mutex unlock is now included in exit_cond() so that it's always done in the good order.
      sql/sql_table.cc:
        unlock is now included in exit_cond().
      d028624d
  8. 29 Jul, 2004 1 commit
    • unknown's avatar
      Avoiding a theoretically possible crash (pthread_mutex_lock(0)) which could... · e62048fa
      unknown authored
      Avoiding a theoretically possible crash (pthread_mutex_lock(0)) which could (at least in POSIX Threads books)
      happen on SMP machines, when a thread is going to wait on a condition and it is KILLed at the
      same time.
      Cleaning code a bit by adding a test in enter_cond() that we have the mutex (was already the case in all places
      where it's called except one which is fixed here).
      
      
      sql/log.cc:
        safe_mutex_assert_owner() is now in THD::enter_cond()
      sql/slave.cc:
        lock mutex before waiting on condition.
      sql/sql_class.cc:
        THD::awake(): before locking the mutex, let's test it's not zero;
        in theory indeed, the killer thread may see current_cond non-zero and current_mutex zero
        (order of assignments is not guaranteed by POSIX).
        A comment noting that there is still a small chance a KILL does not work and needs
        being re-issued.
      sql/sql_class.h:
        Assert in enter_cond() that we have the mutex.
        It is already the case in all places where we call enter_cond(), so better ensure it there.
      e62048fa
  9. 10 Mar, 2004 2 commits
    • unknown's avatar
      Undoing 2 parts of changeset 1.1730.1.1 : · 3768f9ef
      unknown authored
      - the one about BUG#2921
      - the one about relay log flushing
      Both will be rewritten in a next changeset
      (this one will not be pushed before the next changeset).
      
      
      sql/log.cc:
        undo
      sql/log_event.cc:
        undo
      sql/repl_failsafe.cc:
        undo
      sql/slave.cc:
        undo
      sql/slave.h:
        undo
      sql/sql_repl.cc:
        undo
      3768f9ef
    • unknown's avatar
      Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882) · 98cd9f93
      unknown authored
      BUILD/compile-pentium-debug-max:
        Added --with-raid
      configure.in:
        Removed -DFN_NO_CASE_SENCE for Mac OS X as this is not always true
      mysql-test/install_test_db.sh:
        Added --skip-warnings
      mysql-test/mysql-test-run.sh:
        Fixes to get --gdb and --ddd to work
      mysql-test/r/lowercase_table2.result:
        Test for lower_case_table_names=2 and temporary tables
      mysql-test/r/lowercase_table3.result:
        Fixed error message
      mysql-test/r/multi_update.result:
        Test of behaviour of multi-table-delete and alias
      mysql-test/t/lowercase_table2.test:
        Test for lower_case_table_names=2 and temporary tables
      mysql-test/t/lowercase_table3.test:
        Fixed error
      mysql-test/t/multi_update.test:
        Test of behaviour of multi-table-delete and alias (Bug #2940)
      mysys/mf_iocache.c:
        Renamed _flush_io_cache to my_b_flush_io_cache
      sql/ha_myisam.cc:
        Added comment
      sql/lock.cc:
        Extra debugging
      sql/log.cc:
        New parameter to flush_relay_log_info
      sql/log_event.cc:
        New parameter to flush_relay_log_info
      sql/mf_iocache.cc:
        Removed not used header files
      sql/mysqld.cc:
        More debugging info
        Less warnings when run with --skip-warnings
      sql/opt_range.cc:
        More debug information
      sql/repl_failsafe.cc:
        New parameter to flush_relay_log_info
      sql/slave.cc:
        First start SQL thread, then start IO thread. This fixed a raze condition in SLAVE START (Bug #2921)
        Ensure that we have a lock on the IO thread before flushing a relay log file that. The original code could core dump when a relay log rotated.
      sql/slave.h:
        New parameter to flush_relay_log_info
      sql/sql_base.cc:
        Added warning
      sql/sql_handler.cc:
        Indentation fix
      sql/sql_repl.cc:
        New parameter to flush_relay_log_info
      sql/sql_select.cc:
        Fixed problem with deleting temporary tables when using lower_case_table_names=2. (Bug #2858)
      sql/sql_table.cc:
        Fixed comment
      sql/sql_yacc.yy:
        Removed compiler warning
      include/my_sys.h:
        Fixed usage of unpack_filename
      mysys/mf_pack.c:
        Changed unpack_filename() to return length of result string.
      mysys/test_fn.c:
        Fixed usage of unpack_filename
      sql/sql_db.cc:
        Fixed memory leak with raid tables
      sql/table.cc:
        Fixed usage of unpack_filename
      98cd9f93
  10. 19 Feb, 2004 2 commits
    • unknown's avatar
      Fixed usage of strxnmov() in recent changesets · 4454f791
      unknown authored
      libmysql/libmysql.c:
        szPipeName -> pipe_name
        fixed usage of strxnmov()
      mysys/mf_tempfile.c:
        Fixed usage of strnxmov()
        Simple optimization
      mysys/my_tempnam.c:
        Fixed usage of strnxmov()
        Simple optimization
      sql/log.cc:
        simple optimization
      sql/mini_client.cc:
        szPipeName -> pipe_name
        fixed usage of strxnmov()
      sql/mysqld.cc:
        szPipeName -> pipe_name
        fixed usage of strxnmov()
        Fixed indentation
      4454f791
    • unknown's avatar
      potential problem fixed afer some reasoning · 7e44a786
      unknown authored
      7e44a786
  11. 08 Dec, 2003 1 commit
    • unknown's avatar
      Fix for BUG#2045 "Sending SIGHUP to mysqld crashes it if running with --log-bin". · f1446eac
      unknown authored
      The constructor of Rotate_log_event used when we are rotating our binlog or
      relay log, should not assume that there is a nonzero THD available.
      For example, when we are reacting to SIGHUP, the THD is 0.
      In fact we don't need to use the THD in this constructor;
      we can do like for Stop_log_event, and use the minimal Log_event
      constructor.
      If we were allowed to put Unix-specific commands in the testsuite,
      I'd add a test for this (<sigh>).
      
      
      sql/log.cc:
        A comment to warn that thd can be 0.
        The part about LOG_EVENT_FORCED_ROTATE_F is just to avoid segfault;
        this flag is already removed in 4.1 anyway.
      sql/log_event.cc:
        A comment.
      sql/log_event.h:
        The constructor of Rotate_log_event used when we are rotating our binlog or
        relay log, should not assume that there is a nonzero THD available.
        For example, when we are reacting to SIGHUP, the THD is 0.
        In fact we don't need to use the THD in this constructor;
        we can do like for Stop_log_event, and use the minimal Log_event
        constructor.
        This fixes BUG#2045 
        "Sending SIGHUP to mysqld crashes it if running with --log-bin"
      f1446eac
  12. 01 Dec, 2003 1 commit
  13. 02 Oct, 2003 1 commit
    • unknown's avatar
      Optimized code for setting user variables with := and fixed some bugs in old code (Bug #1194) · d7f5e818
      unknown authored
      Use forced close of socket to make mysqld shutdown faster when used under valgrind
      
      
      mysql-test/mysql-test-run.sh:
        Added --skip-bdb for valgrind
      mysql-test/r/user_var.result:
        Extended test for user variables
      mysql-test/t/user_var.test:
        Extended test for user variables
      sql/item_func.cc:
        Optimized code for setting user variables with := and fixed some bugs in old code
      sql/item_func.h:
        Optimized code for setting user variables
      sql/log.cc:
        Fixed comments
      sql/mysqld.cc:
        Use forced close of socket to make mysqld shutdown faster when used under valgrind
      sql/sql_class.h:
        Optimized code for setting user variables
      d7f5e818
  14. 24 Sep, 2003 1 commit
    • unknown's avatar
      Fix for · dbfb3791
      unknown authored
      Bug #1392 "On Win, slave leaves one temp file after successf. replicating LOAD DATA INFILE"
      Windows-specific bug (we forgot to close a file before deleting it).
      Patch written by me, tested by Miguel (thanks!) and it works.
      
      
      sql/log.cc:
        changed the comment to mean the truth
      sql/log_event.cc:
        When you finish replicating LOAD DATA INFILE, close the SQL_LOADxxx.data file
        before deleting it, or Windows will refuse to delete.
        No need to do the same thing for the SQL_LOADxxx.data file, it's not opened
        at this moment.
      dbfb3791
  15. 28 Aug, 2003 1 commit
    • unknown's avatar
      Add detection of in_addr_t · 35c2595d
      unknown authored
      Add pack_bits to pack_reclength for dynamic rows.  This solves buffer a possible buffer overflow on update.
      (This will probably solve bug #563)
      Fix test for available file descriptors in mysqltest
      Fixed core dump bug in replication tests when running without transactional table support
      
      
      acconfig.h:
        Add detection of in_addr_t
      acinclude.m4:
        Add detection of in_addr_t
      configure.in:
        Add detection of in_addr_t
      extra/my_print_defaults.c:
        Cleanup
      extra/resolveip.c:
        Add detection of in_addr_t
      libmysql/dll.c:
        Fixed C++ commments
      myisam/mi_dynrec.c:
        Add ASSERT if allocated record length is to small
      myisam/mi_open.c:
        Add pack_bits to pack_reclength for dynamic rows.  This solves buffer a possible buffer overflow on update.
      myisam/mi_test_all.sh:
        Added valgrind option to make it easier to verify tests
      mysql-test/include/check_var_limit.inc:
        Fix test for available file descriptors
      mysql-test/r/myisam.result:
        More tests
      mysql-test/t/myisam.test:
        More tests
      mysql-test/t/query_cache_merge.test:
        Fix test for available file descriptors
      mysys/default.c:
        Cleanup
      mysys/my_pthread.c:
        Remove C++ comments
      sql/log.cc:
        Code cleanup
        Fixed core dump bug in replication tests when running without transactional table support.
      35c2595d
  16. 25 Aug, 2003 1 commit
    • unknown's avatar
      Clearer states in SHOW PROCESSLIST for replication threads. · 972a33ae
      unknown authored
      For example the Binlog_dump thread (on the master) sometimes showed "Slave:".
      And there were confusing messages where "binlog" was employed instead
      of "relay log".
      
      
      sql/log.cc:
        MYSQL_LOG::wait_for_update() is used by the binlog_dump and I/Oslave threads,
        and it updates thd->proc_info, so we need a bool to not show the same
        proc_info for 2 different things (previously we showed "Slave: etc" and that's
        bad for a binlog_dump thread).
      sql/slave.cc:
        Clearer thd-proc_info for slave threads.
      sql/sql_class.h:
        prototype change
      sql/sql_repl.cc:
        clearer thd->proc_info for binlog_dump thread
      972a33ae
  17. 22 Aug, 2003 1 commit
    • unknown's avatar
      2 minor edits, plus · 6a8158a9
      unknown authored
      fix for BUG#1113 "INSERT into non-trans table SELECT ; ROLLBACK" does not send warning"
      and
      fix for BUG#873 "In transaction, INSERT to non-trans table is written too early to binlog".
      Now we don't always write the non-trans update immediately to the binlog;
      if there is something in the binlog cache we write it to the binlog cache
      (because the non-trans update could depend on a trans table which was modified
      earlier in the transaction); then in case of ROLLBACK, we write the binlog
      cache to the binlog, wrapped with BEGIN/ROLLBACK.
      This guarantees that the slave does the same updates.
      For ROLLBACK TO SAVEPOINT: when we execute a SAVEPOINT command we write it
      to the binlog cache. At ROLLBACK TO SAVEPOINT, if some non-trans table was updated,
      we write ROLLBACK TO SAVEPOINT to the binlog cache; when the transaction
      terminates (COMMIT/ROLLBACK), the binlog cache will be flushed to the binlog
      (because of the non-trans update) so we'll have SAVEPOINT and ROLLBACK TO
      SAVEPOINT in the binlog.
      
      Apart from this rare case of updates of mixed table types in transaction, the
      usual way is still clear the binlog cache at ROLLBACK, or chop it at
      ROLLBACK TO SAVEPOINT (meaning the SAVEPOINT command is also chopped, which
      is fine).
      Note that BUG#873 encompasses subbugs 1) and 2) of BUG#333 "3 binlogging bugs when doing INSERT with mixed InnoDB/MyISAM".
      
      
      client/mysqldump.c:
        Minor edit: one CHANGE MASTER with 2 arguments instead of 2 CHANGE MASTER with one argument each.
      mysql-test/r/rpl_loaddata.result:
        result update
      mysql-test/t/rpl_loaddata.test:
        minor edit: simplifying the test.
      sql/handler.cc:
        Fix for BUG#873. See comments in code, and the description of the changeset.
      sql/log.cc:
        * Previously, if a query updated a non-transactional table we wrote it immediately
        to the real binlog. This causes a bug when the update is done inside a transaction
        and uses the content of an updated transactional table (because this makes
        a wrong order of queries in the binlog). So if the binlog cache is not empty,
        we write the query to the binlog cache; otherwise we can write it to the binlog.
        * Previously, when we flushed the binlog cache to the binlog, we wrapped it
        with BEGIN/COMMIT. Now it's also possible to wrap it with BEGIN/ROLLBACK, to handle
        transactions which update both transactional and non-transactional tables.
      sql/log_event.cc:
        The slave thread can leave a transaction if COMMIT or if ROLLBACK.
      sql/sql_class.h:
        prototype
      sql/sql_insert.cc:
        Fix for BUG#1113:
        this was because the INSERT SELECT code did not set OPTION_STATUS_NO_TRANS_UPDATE.
      sql/sql_parse.cc:
        Don't send ER_WARNING_NOT_COMPLETE_ROLLBACK if this is the SQL slave thread (see comments).
      6a8158a9
  18. 20 Aug, 2003 2 commits
    • unknown's avatar
      First commit for fixing BUG#1100 · 03de2bec
      unknown authored
      "LOAD DATA INFILE is badly filtered by binlog-*-db rules".
      There will probably be a second final one to merge Dmitri's changes
      to rpl_log.result and mine.
      2 new tests:
      rpl_loaddata_rule_m : test of logging of LOAD DATA INFILE when the master has binlog-*-db rules,
      rpl_loaddata_rule_s : test of logging of LOAD DATA INFILE when the slave has binlog-*-db rules and --log-slave-updates.
      
      
      mysql-test/r/rpl_loaddata.result:
        Test that logging of LOAD DATA INFILE is done on the slave
      mysql-test/t/rpl_loaddata.test:
        Test that logging of LOAD DATA is done on the slave
      sql/log.cc:
        debug info
      sql/log_event.cc:
        * Append_block, Exec_load and Delete_file now have a member 'db' like Create_file.
        This member is filled by mysql_load(). It is used for filtering by binlog-*-db rules,
        that's all. It's not written to the binlog, and so can't be read from the binlog.
        In other words, that's temporary info which is stored in the event and lost when
        it is written and deleted.
        * Better error messages in Append_block et al. events.
        * The slave now logs (log-slave-updates) the Create_file et al. events in mysql_load()
        (they are not directly copied from the events in the relay log, because this
        prevented filtering by binlog-*-db rules). Before, mysql_load() in the slave
        did no logging, now it does the logging, as in any regular thread.
      sql/log_event.h:
        New member 'db' for Append_block et al. events.
      sql/slave.cc:
        Removed useless code. Why was it useless:
        - CREATE_FILE_EVENT is not defined in 3.23. It appeared in 4.0.
        - in queue_old_event(), which is called only if the master is 3.23, we had a
        case CREATE_FILE_EVENT:
        so this case can be removed.
        - this case was the only caller of process_io_create_file() so this function
        can be removed.
      sql/sql_load.cc:
        Pass the db to events, so that they can be well filtered.
      sql/sql_repl.cc:
        Pass the db to events so that they can be well filtered.
      03de2bec
    • unknown's avatar
      Fixed some varnings from valgrind · a6261f53
      unknown authored
      Set min value of max_allowed_packet to 1024
      Fixed problem with UNION's without braces and SQL_CALC_FOUND_ROWS, LIMIT #,#
      and ORDER BY...LIMIT
      
      
      include/m_string.h:
        Added memcpy_overlap() to avoid warnings when using valgrind on memcpy(A,A,...)
      myisam/mi_create.c:
        Fixed comment
      myisam/mi_search.c:
        Fix warning from valgrind
      myisam/mi_write.c:
        Indentation fix
      mysql-test/mysql-test-run.sh:
        Add options handled by general skip- option
      mysql-test/r/packet.result:
        Update results after change to mysqld (min max_allowed_packet length is now 1024)
      mysql-test/r/union.result:
        Added testing of UNION with SQL_CALC_FOUND_ROWS
      mysql-test/t/packet.test:
        Update results after change to mysqld (min max_allowed_packet length is now 1024)
      mysql-test/t/union.test:
        Added testing of UNION with SQL_CALC_FOUND_ROWS
      sql/field.cc:
        Fix to remove waarning from valgrind
      sql/ha_innodb.cc:
        Remove wrong include file
      sql/item_cmpfunc.cc:
        Safety fix to handle EOM conditions in IN
      sql/item_sum.cc:
        Fixed prototype for update_field() (argument was alwys 0)
      sql/item_sum.h:
        Fixed prototype for update_field() (argument was alwys 0)
      sql/item_uniq.h:
        Fixed prototype for update_field() (argument was alwys 0)
      sql/log.cc:
        Indentation fix
      sql/mysqld.cc:
        Set min value of max_allowed_packet to 1024 (to avoid it getting set to 0)
      sql/net_serv.cc:
        Indentation changes + trivial optimization
      sql/sql_select.cc:
        Fixed prototype for update_field() (argument was alwys 0)
      sql/sql_union.cc:
        Fixed problem with UNION's without braces and
        - SQL_CALC_FOUND_ROWS
        - LIMIT #,#
        - ORDER BY ... LIMIT
      a6261f53
  19. 19 Aug, 2003 1 commit
    • unknown's avatar
      Use my_b_append instead of my_b_write on a SEQ_READ_APPEND cache, when we write · 9c68cded
      unknown authored
      the first 4 bytes of the relay log. Indeed comments in mysys/mf_iocache.c 
      say we must always use my_b_append for such a cache.
      This *could* avoid a very rare assertion failure which is: 
      030524 19:32:38  Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log '/
      users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000001' position: 4
      030524 19:32:38  next log '/users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000002' is currently active
      mysqld: mf_iocache.c:701: _my_b_seq_read: Assertion `pos_in_file == info->end_of_file' failed.
      and which seemed to happen always when the SQL thread and/or the I/O thread
      were at position 4 in a relay log.
      
      
      include/my_sys.h:
        moving a function from log_event.cc so that it can be widely used
      mysys/mf_iocache.c:
        moving a function from log_event.cc so that it can be widely used
      sql/log.cc:
        my_b_write should not be used on a SEQ_READ_APPEND cache, one should use my_b_append
        (otherwise there could be some locking problems).
      sql/log_event.cc:
        moved to mysys/mf_iocache.c for wider use.
        A typo.
      9c68cded
  20. 14 Jul, 2003 3 commits
    • unknown's avatar
      Fixed wrong test in LOG::close · 462b47e2
      unknown authored
      Fixed test for binary build
      
      
      mysql-test/r/rpl_max_relay_size.result:
        Fixed test for binary build
      mysql-test/t/rpl_max_relay_size.test:
        Fixed test for binary build
      sql/log.cc:
        Fixed wrong test in close
      462b47e2
    • unknown's avatar
      Better fix for bug #791: At binlog rotation, INSERTs may not find their way into the binlog · 467e193a
      unknown authored
      mysql-test/t/rpl_flush_log_loop.test:
        Add timer to avoid problem when 'flush logs' is executed before we have read all data from master
      sql/log.cc:
        Better fix for bug #791:
        Mark log as LOG_TO_BE_OPENED instead of LOG_CLOSED when it's closed and opened.
      sql/mysqld.cc:
        Better startup message
      sql/slave.cc:
        Fix argument to close()
      sql/sql_class.h:
        Better handling of log.close()
      467e193a
    • unknown's avatar
      Safety and speedup fixes: · 852e2b0f
      unknown authored
      Changed is_open() to work as before.
      Added back inited argument to LOG
      
      
      mysql-test/r/rpl_flush_log_loop.result:
        Fixed results (probably bug in previous rpatch)
      sql/handler.cc:
        Changed is_open() to work as before
      sql/item_func.cc:
        Changed is_open() to work as before
      sql/log.cc:
        Part revert of previous patch.
        The reason for adding back 'inited' is that is that we can't be 100 % sure that init_pthread_objects() is called before mysqld dies (for example on windows)
        I removed mutex lock handling in is_open() as the new code didn't have ANY affect except beeing slower.
        Added back checking of is_open() to some functions as we don't want to do a mutex lock when we are not using logging.
        Indentation/comment fixes
      sql/log_event.cc:
        Changed is_open() to work as before
      sql/repl_failsafe.cc:
        Changed is_open() to work as before
      sql/sql_base.cc:
        Changed is_open() to work as before
      sql/sql_class.h:
        Changed is_open() to work as before. Added back 'inited' variable
      sql/sql_db.cc:
        Changed is_open() to work as before
      sql/sql_delete.cc:
        Changed is_open() to work as before
      sql/sql_insert.cc:
        Changed is_open() to work as before
      sql/sql_load.cc:
        Changed is_open() to work as before
      sql/sql_parse.cc:
        Changed is_open() to work as before
      sql/sql_rename.cc:
        Changed is_open() to work as before
      sql/sql_repl.cc:
        Changed is_open() to work as before
      sql/sql_table.cc:
        Changed is_open() to work as before
      sql/sql_update.cc:
        Changed is_open() to work as before
      852e2b0f
  21. 12 Jul, 2003 2 commits
    • unknown's avatar
      Member no_rotate in MYSQL_LOG was always 0, I delete it. · a0a2be1d
      unknown authored
      sql/log.cc:
        Member no_rotate of MYSQL_LOG is useless; this shows it for sure:
        [guilhem@gbichot2 mysql-4.0]$ bk -r grep no_rotate
        sql/log.cc      1.83       no_rotate(0), need_start_event(1)
        sql/log.cc      1.75      if (no_rotate)
        sql/log.cc      1.89      if (!no_rotate)
        sql/sql_class.h 1.119     bool no_rotate;
        i.e. no_rotate is 0 all the time. So we don't need it.
        Biggest part of the patch is indentation change.
      sql/sql_class.h:
        suppress no_rotate
      a0a2be1d
    • unknown's avatar
      removed 2 small useless if(). · 9b8f7a09
      unknown authored
      sql/log.cc:
        a comment for the future.
      sql/mysqld.cc:
        if (p) is not needed: fn_ext() always returns a valid pointed; the way
        to test if an extension was found is if (*p), not if (p).
        But here even if there's no extension, we still want to truncate opt_name
        to FN_REFLEN, so we always execute the code.
        By design, the test was always 'false' (because we strip the extension before
        testing if there's an extension) so log->set_no_rotate never executed.
      sql/sql_class.h:
        remove set_no_rotate as we don't need it.
      9b8f7a09
  22. 11 Jul, 2003 1 commit
    • unknown's avatar
      Fix for BUG#791: · 917b4fb0
      unknown authored
      a safer way of initing the mutexes in MYSQL_LOG.
      is_open() is now always thread-safe.
      See each file for details.
      
      
      sql/handler.cc:
        is_open() with locks
      sql/item_func.cc:
        is_open() with locks
      sql/log.cc:
        No more 'inited'.
        We now always use is_open() in a thread-safe manner.
        This simplifies some functions (no more need to test is_open() twice).
      sql/log_event.cc:
        is_open() with locks
      sql/mysqld.cc:
        Init mutexes for the global MYSQL_LOG objects.
        We care about no_rotate, because we can't do it in open() anymore (because
        we don't have 'inited' anymore).
      sql/repl_failsafe.cc:
        is_open() with locks
      sql/slave.cc:
        init pthread objects (mutexes, conds) in the constructor of st_relay_log_info.
        Some better locking in rotate_relay_log().
      sql/sql_base.cc:
        is_open() with locks
      sql/sql_class.h:
        Before, we inited LOCK_log in MYSQL_LOG::open(), so in other places of the code
        when we were never 100% sure that it had been inited. For example, if the server
        was running without --log-bin, ::open() was not called so the mutex was not
        inited. We could detect it with !inited, but not safely as 'inited' was not
        protected by any mutex.
        So now:
        we *always* init the LOCK_log mutex, even if the log is not used. We can't init
        the mutex in MYSQL_LOG's constructor, because for global objects like
        mysql_bin_log, mysql_log etc, the constructor is called before MY_INIT(), but
        safe_mutex depends on MY_INIT(). So we have a new function MYSQL_LOG::init_pthread_objects
        which we call in main(), after MY_INIT().
        For the relay log, we call this function in the constructor of
        st_relay_log_info, which is called before any function tries to
        use the relay log (the relay log is always invoked as rli.relay_log).
        So now we should be safe in all cases and we don't need 'inited'.
      sql/sql_db.cc:
        is_open() with locks
      sql/sql_delete.cc:
        is_open() with locks
      sql/sql_insert.cc:
        is_open() with locks
      sql/sql_load.cc:
        is_open() with locks
      sql/sql_parse.cc:
        is_open() with locks
      sql/sql_rename.cc:
        is_open() with locks
      sql/sql_repl.cc:
        is_open() with locks
      sql/sql_table.cc:
        is_open() with locks
      sql/sql_update.cc:
        is_open() with locks
      917b4fb0
  23. 08 Jul, 2003 2 commits
    • unknown's avatar
      Cleanups · cf092c8c
      unknown authored
      mysql-test/t/distinct.test:
        Cleanup
      sql/log.cc:
        Cleanup
      sql/slave.cc:
        Cleanup
      sql/sql_delete.cc:
        Cleanup
      sql/sql_parse.cc:
        Simple optimization
      cf092c8c
    • unknown's avatar
      Fix for · 0a93e156
      unknown authored
      BUG#797 "If query ignored on slave (replicate-ignore-table) the slave still checks if
      the returned error (0) is the same as the one on the master, whereas it shouldn't
      test this.
      Plus a new test for BUG#797.
      
      
      include/mysqld_error.h:
        New error code (can be sent only to the slave thread, not to normal clients).
      sql/log.cc:
        removed comment from a previous debugging.
      sql/log_event.cc:
        ER_SLAVE_IGNORED_TABLE is an ignorable error.
      sql/share/czech/errmsg.txt:
        for BUG#797
      sql/share/danish/errmsg.txt:
        for BUG#797
      sql/share/dutch/errmsg.txt:
        for BUG#797
      sql/share/english/errmsg.txt:
        for BUG#797
      sql/share/estonian/errmsg.txt:
        for BUG#797
      sql/share/french/errmsg.txt:
        for BUG#797
      sql/share/german/errmsg.txt:
        for BUG#797
      sql/share/greek/errmsg.txt:
        for BUG#797
      sql/share/hungarian/errmsg.txt:
        for BUG#797
      sql/share/italian/errmsg.txt:
        for BUG#797
      sql/share/japanese/errmsg.txt:
        for BUG#797
      sql/share/korean/errmsg.txt:
        for BUG#797
      sql/share/norwegian-ny/errmsg.txt:
        for BUG#797
      sql/share/norwegian/errmsg.txt:
        for BUG#797
      sql/share/polish/errmsg.txt:
        for BUG#797
      sql/share/portuguese/errmsg.txt:
        for BUG#797
      sql/share/romanian/errmsg.txt:
        for BUG#797
      sql/share/russian/errmsg.txt:
        for BUG#797
      sql/share/slovak/errmsg.txt:
        for BUG#797
      sql/share/spanish/errmsg.txt:
        for BUG#797
      sql/share/swedish/errmsg.txt:
        for BUG#797
      sql/share/ukrainian/errmsg.txt:
        for BUG#797
      sql/sql_parse.cc:
        when in sql_parse in the slave thread we ignore the query because of replicate-do
        and replicate-ignore options, we return a specific error to the slave thread,
        so that it knows that the query has been ignored (which is different from a
        successful query).
        A small cleanup (test was done twice).
      0a93e156
  24. 06 Jul, 2003 1 commit
    • unknown's avatar
      WL#912 (more user control on relay logs): · c22f493a
      unknown authored
      FLUSH LOGS now rotates relay logs,
      and a new variable max_relay_log_size.
      Plus a very small bit of code cleaning.
      
      
      libmysqld/lib_sql.cc:
        open_log has no default arguments anymore.
      mysql-test/r/rpl_flush_log_loop.result:
        result update now that FLUSH LOGS rotates relay logs.
      mysql-test/r/rpl_log.result:
        result update now that FLUSH LOGS rotates relay logs.
      mysql-test/r/rpl_rotate_logs.result:
        result update now that max_binlog_size is 4096.
      mysql-test/t/rpl_rotate_logs-master.opt:
        now max_binlog_size must be a multiple of 4096 (see change in mysqld.cc)
      sql/log.cc:
        Got rid of default arguments of various MYSQL_LOG methods (the default arguments
        made code reading uneasy).
        Set max_size in ::init().
        New function set_max_size() to set max_size of a MYSQL_LOG on-the-fly.
        More DBUG info.
      sql/mysql_priv.h:
        no defaults in open_log().
        New variables max_relay_log_size.
      sql/mysqld.cc:
        New variable and option max_relay_log_size.
        max_binlog_size and max_relay_log_size are multiples of IO_SIZE.
        No more default arguments for log functions.
      sql/set_var.cc:
        New variable max_relay_log_size.
        If it is 0, then max_binlog_size will apply to relay logs.
        When one of these variables is changed, fix_max_%log_size is called
        to update max_size of the binary and/or relay logs.
      sql/slave.cc:
        New function rotate_relay_log().
      sql/slave.h:
        New function rotate_relay_log().
      sql/sql_class.h:
        New member max_size of MYSQL_LOG (for automatic rotation).
        New method set_max_size() for setting on-the-fly.
      sql/sql_parse.cc:
        Flush the relay log in FLUSH LOGS.
      c22f493a
  25. 06 Jun, 2003 1 commit
    • unknown's avatar
      -- already approved; it would be nice if it goes into 3.23.57 -- · 92d1e362
      unknown authored
      Fix for bug 254 : the first Start_log_event after server startup will
      have created=now(), whereas the next ones (FLUSH LOGS, auto rotation)
      will have created=0. Before this, it was always now().
      This way, slaves >=4.0.14 will know when they must
      drop stale temp tables or not. The next task is now modify 4.0.14 to
      implement this.
      
      
      sql/log.cc:
        Fix for bug 254 : the first Start_log_event after server startup will
        have created=now(), whereas the next ones (FLUSH LOGS, auto rotation)
        will have created=0. Before this, it was always now().
        This way, slaves >=4.0.14 will know when they must
        drop stale temp tables or not.
      sql/log_event.h:
        An explanation.
      sql/sql_class.h:
        Prototype change (see log.cc).
      92d1e362
  26. 26 May, 2003 1 commit
    • unknown's avatar
      code cleanup · 1c4988fc
      unknown authored
      mysql-test/r/rpl_insert_id.result:
        Test logging of FOREIGN_KEY_CHECKS
      mysql-test/t/rpl_insert_id.test:
        Test logging of FOREIGN_KEY_CHECKS
      sql/log.cc:
        Code cleanup
      1c4988fc
  27. 25 May, 2003 1 commit
    • unknown's avatar
      log.cc: · 141956b2
      unknown authored
        If FOREIGN_KEY_CHECKS=0, wrap in binlog SQL statements inside SET FOREIGN_...=0; ... ; SET FOREIGN_...=1
      
      
      sql/log.cc:
        If FOREIGN_KEY_CHECKS=0, wrap in binlog SQL statements inside SET FOREIGN_...=0; ... ; SET FOREIGN_...=1
      141956b2
  28. 10 May, 2003 1 commit
    • unknown's avatar
      MySQL-classic did not pass the test suite rpl_rotate_logs.test anymore... · 47743d89
      unknown authored
         MySQL-classic did not pass the test suite rpl_rotate_logs.test anymore because a recent 1.1424.2.17 cset introduced an opt_using_transactions
          which prevented binlogs to be rotated if transactions were not enabled. Fix for this. This bug did not affect releases.
      
      
      sql/log.cc:
        MySQL-classic did not pass the test suite rpl_rotate_logs.test anymore because a recent 1.1424.2.17 cset introduced an opt_using_transactions
        which prevented binlogs to be rotated if transactions were not enabled. Fix for this. This bug did not affect releases.
      47743d89
  29. 02 May, 2003 1 commit
    • unknown's avatar
      Many files: · fa90ccb6
      unknown authored
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      
      
      sql/log.cc:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      sql/handler.cc:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      sql/handler.h:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      sql/ha_innodb.cc:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      sql/ha_innodb.h:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/include/log0log.h:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/include/trx0trx.h:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/os/os0file.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/buf/buf0flu.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/trx/trx0trx.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/log/log0log.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/srv/srv0srv.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      innobase/row/row0mysql.c:
        Eliminate the LOCK_log bottleneck in group commit in binlogging: flush InnoDB log files only after it has been released
      fa90ccb6
  30. 04 Apr, 2003 1 commit
    • unknown's avatar
      log.cc: · 65d8257e
      unknown authored
        Fix crash in previous bug fix log.cc reported by Rob Lyon if --skip-innodb is specified
      
      
      sql/log.cc:
        Fix crash in previous bug fix log.cc reported by Rob Lyon if --skip-innodb is specified
      65d8257e