1. 16 Mar, 2007 1 commit
    • cbell/Chuck@mysql_cab_desk.'s avatar
      WL#3629 - Replication of Invocation and Invoked Features · 3e44599c
      cbell/Chuck@mysql_cab_desk. authored
      This changeset adds replication of events and user-defined functions. 
      There are several bug reports involved in this change:
      
      BUG#16421, BUG#17857, BUG#20384:
      This patch modifies the mysql.events table to permit the addition of
      another enum value for the status column. The column now has values
      of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of
      SLAVESIDE_DISABLED is set on the slave during replication of events.
      This enables users to determine which events werereplicated from the 
      master and to later enable them if they promote the slave to a master.
      The CREATE, ALTER, and DROP statements are binlogged.
      A new test was added for replication of events (rpl_events).
      
      BUG#17671:
      This patch modifies the code to permit logging of user-defined functions.
      Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error 
      message to be displayed should a replicated user-defined function not be
      found in the loadable library or if the library is missing from the
      slave.The CREATE andDROP statements are binlogged. A new test was added 
      for replication of user-defined functions (rpl_udf). 
      
      The patch also adds a new column to the mysql.event table named
      'originator' that is used to store the server_id of the server that
      the event originated on. This enables users to promote a slave to a 
      master and later return the promoted slave to a slave and disable the
      replicated events.
      3e44599c
  2. 27 Feb, 2007 1 commit
    • cbell/Chuck@mysql_cab_desk.'s avatar
      BUG#20141 "User-defined variables are not replicated properly for · 2763e9af
      cbell/Chuck@mysql_cab_desk. authored
                SF/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"
      
      This patch corrects a minor error in the previous patch for BUG#20141. This patch
      corrects an errant code change to sp_head.cc. The comments for the first patch follow:
      
      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.
      2763e9af
  3. 26 Feb, 2007 7 commits
    • cbell/Chuck@mysql_cab_desk.'s avatar
      Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl · 995f2ae1
      cbell/Chuck@mysql_cab_desk. authored
      into  mysql_cab_desk.:C:/source/C++/mysql-5.1-new-rpl
      995f2ae1
    • cbell/Chuck@mysql_cab_desk.'s avatar
      BUG#20141 "User-defined variables are not replicated properly for · d7e4de99
      cbell/Chuck@mysql_cab_desk. authored
                SF/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.
      d7e4de99
    • mats@romeo.(none)'s avatar
      75be2a8b
    • mats@romeo.(none)'s avatar
      BUG#26634 (Valgrind failure in tree: memory loss for memory allocated in rpl_utility.h): · 62f82309
      mats@romeo.(none) authored
      Adding code to release allocated memory when tables_to_lock list is
      cleared.
      62f82309
    • mats@romeo.(none)'s avatar
      Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl · 959b8810
      mats@romeo.(none) authored
      into  romeo.(none):/home/bk/b25091-mysql-5.1-new-rpl
      959b8810
    • mats@romeo.(none)'s avatar
      Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl · 988ae560
      mats@romeo.(none) authored
      into  romeo.(none):/home/bk/b25091-mysql-5.1-new-rpl
      988ae560
    • mats@romeo.(none)'s avatar
      BUG#25091 (A DELETE statement to mysql database is not logged in ROW format): · f9101992
      mats@romeo.(none) authored
      With this patch, statements that change metadata (in the mysql database)
      is logged as statements, while normal changes (e.g., using INSERT, DELETE,
      and/or UPDATE) is logged according to the format in effect.
      
      The log tables (i.e., general_log and slow_log) are not replicated at all.
      
      With this patch, the following statements are replicated as statements:
      GRANT, REVOKE (ALL), CREATE USER, DROP USER, and RENAME USER.
      f9101992
  4. 24 Feb, 2007 20 commits
  5. 23 Feb, 2007 8 commits
    • gbichot@dl145h.mysql.com's avatar
      Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs". · ba2452f0
      gbichot@dl145h.mysql.com authored
      mysqlbinlog prints all row-based events of a single statement as a
      single "BINLOG" statement containing the concatenation of those events.
      Big (i.e. >64k) concatenations of row-based events
      (e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow
      to a temporary file but the IO_CACHE had not been inited with
      open_cached_file(), so it tried to create a temporary file in
      an uninitialized directory (thus failing to create, then to write;
      some OS errors were printed, and it finally segfaulted).
      After fixing this, it appeared that mysqlbinlog was printing only
      a piece of big concatenations of row-based events (it printed
      at most the size of the IO_CACHE's buffer i.e. 64k); that caused data
      loss at restore. We fix and test that.
      Last, mysqlbinlog's printouts looked a bit strange with the informative
      header (#-prefixed) of groupped Rows_log_event all on one line,
      so we insert \n. After that, a small bug in the --hexdump code appeared
      (only if the string to hex-print had its length a multiple of 16),
      we fix it.
      ba2452f0
    • gbichot@dl145h.mysql.com's avatar
      Merge dl145h.mysql.com:/users/gbichot/mysql-5.0-rpl · 84f875cf
      gbichot@dl145h.mysql.com authored
      into  dl145h.mysql.com:/users/gbichot/mysql-5.1-rpl
      84f875cf
    • monty@mysql.com/narttu.mysql.fi's avatar
    • mats@romeo.(none)'s avatar
      BUG#19033 (RBR: slave does not handle schema changes correctly): · 54b04ff5
      mats@romeo.(none) authored
      Post-merge fixes.
      54b04ff5
    • gbichot@dl145h.mysql.com's avatar
      the fix for BUG#24432 · 44c6c4cc
      gbichot@dl145h.mysql.com authored
        "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
      didn't make it into 5.0.36 and 5.1.16,
      so we need to adjust the bug-detection-based-on-version-number code.
      Because the rpl tree has a too old version, rpl_insert_id cannot pass,
      so I disable it (like is already the case in 5.1-rpl for the same reason),
      and the repl team will re-enable it when they merge 5.0 and 5.1 into
      their trees (thus getting the right version number).
      44c6c4cc
    • mats@romeo.(none)'s avatar
      Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl · 2114ea31
      mats@romeo.(none) authored
      into  romeo.(none):/home/bk/b19033-mysql-5.1-new-rpl
      2114ea31
    • monty@narttu.mysql.fi's avatar
      Merge mysql.com:/home/my/mysql-5.0 · 6d78655a
      monty@narttu.mysql.fi authored
      into  mysql.com:/home/my/mysql-5.1
      6d78655a
    • monty@mysql.com/narttu.mysql.fi's avatar
      Fixed compiler warnings · f0ae3ce9
      monty@mysql.com/narttu.mysql.fi authored
      Fixed compile-pentium64 scripts
      Fixed wrong estimate of update_with_key_prefix in sql-bench
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
      Fixed unsafe define of uint4korr()
      Fixed that --extern works with mysql-test-run.pl
      Small trivial cleanups
      This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
      Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
      Split handle_one_connection() into reusable sub functions.
      Split create_new_thread() into reusable sub functions.
      Added thread_scheduler; Preliminary interface code for future thread_handling code.
      
      Use 'my_thread_id' for internal thread id's
      Make thr_alarm_kill() to depend on thread_id instead of thread
      Make thr_abort_locks_for_thread() depend on thread_id instead of thread
      In store_globals(), set my_thread_var->id to be thd->thread_id.
      Use my_thread_var->id as basis for my_thread_name()
      The above changes makes the connection we have between THD and threads more soft.
      
      Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
      Fixed compiler warnings
      Fixed core dumps when running with --debug
      Removed setting of signal masks (was never used)
      Made event code call pthread_exit() (portability fix)
      Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
      Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
      Removed one common 'not freed memory' warning from mysqltest
      Fixed a couple of usage of not initialized warnings (unlikely cases)
      Suppress compiler warnings from bdb and (for the moment) warnings from ndb
      f0ae3ce9
  6. 22 Feb, 2007 3 commits