1. 28 May, 2007 3 commits
  2. 24 May, 2007 4 commits
  3. 23 May, 2007 7 commits
    • dlenev@mockturtle.local's avatar
      Merge mockturtle.local:/home/dlenev/src/mysql-5.0-like · 661aaec6
      dlenev@mockturtle.local authored
      into  mockturtle.local:/home/dlenev/src/mysql-5.1-like-2
      661aaec6
    • dlenev@mockturtle.local's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 2b3ae933
      dlenev@mockturtle.local authored
      into  mockturtle.local:/home/dlenev/src/mysql-5.1-like-2
      2b3ae933
    • dlenev@mockturtle.local's avatar
      5.1 version of fix for: · 8e8f4c05
      dlenev@mockturtle.local authored
        Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
                    by other connections"
        Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
      As well as:
        Bug #25578 "CREATE TABLE LIKE does not require any privileges
                    on source table".
      
      The first and the second bugs resulted in various errors and wrong
      binary log order when one tried to execute concurrently CREATE TABLE LIKE
      statement and DDL statements on source table or DML/DDL statements on its
      target table.
      
      The problem was caused by incomplete protection/table-locking against
      concurrent statements implemented in mysql_create_like_table() routine.
      We solve it by simply implementing such protection in proper way.
      Most of actual work for 5.1 was already done by fix for bug 20662 and
      preliminary patch changing locking in ALTER TABLE.
      
      The third bug allowed user who didn't have any privileges on table create
      its copy and therefore circumvent privilege check for SHOW CREATE TABLE.
      
      This patch solves this problem by adding privilege check, which was missing.
      
      Finally it also removes some duplicated code from mysql_create_like_table()
      and thus fixes bug #26869 "TABLE_LIST::table_name_length inconsistent with
      TABLE_LIST::table_name".
      8e8f4c05
    • dlenev@mockturtle.local's avatar
      5.0 version of fix for: · c07b3670
      dlenev@mockturtle.local authored
       Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
                   by other connections"
       Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
      As well as:
       Bug #25578 "CREATE TABLE LIKE does not require any privileges
                   on source table".
      
      The first and the second bugs resulted in various errors and wrong
      binary log order when one tried to execute concurrently CREATE TABLE LIKE
      statement and DDL statements on source table or DML/DDL statements on its
      target table.
      
      The problem was caused by incomplete protection/table-locking against
      concurrent statements implemented in mysql_create_like_table() routine.
      We solve it by simply implementing such protection in proper way (see
      comment for sql_table.cc for details).
      
      The third bug allowed user who didn't have any privileges on table create
      its copy and therefore circumvent privilege check for SHOW CREATE TABLE.
      
      This patch solves this problem by adding privilege check, which was missing.
      
      Finally it also removes some duplicated code from mysql_create_like_table().
      
      Note that, altough tests covering concurrency-related aspects of CREATE TABLE
      LIKE behaviour will only be introduced in 5.1, they were run manually for
      this patch as well.
      c07b3670
    • thek@adventure.(none)'s avatar
      f52c5a20
    • thek@adventure.(none)'s avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug21074/my51-bug21074 · 0eaa6152
      thek@adventure.(none) authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
      0eaa6152
    • thek@adventure.(none)'s avatar
      - This patch addesses the performance issues with invalidating the entire · c454071e
      thek@adventure.(none) authored
        cache by changing the behavior of the query cache resize-method.
      - set query_cache_size=<new_size>; is significantly faster than RESET QUERY
        CACHE as it simply destroys and recreates the query cache, whereas
        RESET QUERY CACHE keeps its internal structure aligned with server 
        load profile.
      c454071e
  4. 22 May, 2007 4 commits
  5. 21 May, 2007 1 commit
  6. 19 May, 2007 2 commits
  7. 18 May, 2007 4 commits
  8. 16 May, 2007 14 commits
    • kostja@vajra.(none)'s avatar
      Comment fix. · e4a3189c
      kostja@vajra.(none) authored
      e4a3189c
    • thek@adventure.(none)'s avatar
      Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · 6d6674e7
      thek@adventure.(none) authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
      6d6674e7
    • thek@adventure.(none)'s avatar
      Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 06ce4772
      thek@adventure.(none) authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
      06ce4772
    • thek@adventure.(none)'s avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug27415/my50-bug27415 · 0e82ce84
      thek@adventure.(none) authored
      into  adventure.(none):/home/thek/Development/cpp/bug27415/my51-bug27415
      0e82ce84
    • thek@adventure.(none)'s avatar
      Bug#27415 Text Variables in stored procedures · ed43ceb1
      thek@adventure.(none) authored
       - Problem was reported as a SP variable using itself as 
         right value inside SUBSTR caused corruption of data. 
       - This bug could not be verified in either 5.0bk or 5.1bk
       - Added test case to prevent future regressions.
      ed43ceb1
    • kostja@vajra.(none)'s avatar
      Fix a typo. · 672f2bd5
      kostja@vajra.(none) authored
      672f2bd5
    • kostja@vajra.(none)'s avatar
      An attempt to fix event_bugs.test failure on Debian · 35ad6816
      kostja@vajra.(none) authored
      (Bug#26338 "events_bugs.test fail on Debian")
      35ad6816
    • kostja@vajra.(none)'s avatar
      Make a stab at events_bugs.test failure under valgrind (no · 37843864
      kostja@vajra.(none) authored
      open bug report, reproduced in the runtime team tree).
      37843864
    • kostja@vajra.(none)'s avatar
      Merge vajra.(none):/opt/local/work/mysql-5.0-21483 · 1683d65a
      kostja@vajra.(none) authored
      into  vajra.(none):/opt/local/work/mysql-5.1-21483
      1683d65a
    • kostja@vajra.(none)'s avatar
      Fix a failing assert. · bb2a43dd
      kostja@vajra.(none) authored
      bb2a43dd
    • kostja@vajra.(none)'s avatar
      Correct a merge error. · 752972b5
      kostja@vajra.(none) authored
      752972b5
    • kostja@vajra.(none)'s avatar
      Merge vajra.(none):/opt/local/work/mysql-5.0-21483 · e1218d0e
      kostja@vajra.(none) authored
      into  vajra.(none):/opt/local/work/mysql-5.1-21483
      e1218d0e
    • kostja@vajra.(none)'s avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · f10effe4
      kostja@vajra.(none) authored
      into  vajra.(none):/opt/local/work/mysql-5.0-21483
      f10effe4
    • kostja@vajra.(none)'s avatar
      A fix and a test case for · 747842e1
      kostja@vajra.(none) authored
      Bug#21483 "Server abort or deadlock on INSERT DELAYED with another
      implicit insert"
      Also fixes and adds test cases for bugs:
      20497 "Trigger with INSERT DELAYED causes Error 1165"
      21714 "Wrong NEW.value and server abort on INSERT DELAYED to a
      table with a trigger".
      Post-review fixes.
      
      Problem:
      In MySQL INSERT DELAYED is a way to pipe all inserts into a
      given table through a dedicated thread. This is necessary for
      simplistic storage engines like MyISAM, which do not have internal
      concurrency control or threading and thus can not
      achieve efficient INSERT throughput without support from SQL layer.
      DELAYED INSERT works as follows:
      For every distinct table, which can accept DELAYED inserts and has
      pending data to insert, a dedicated thread is created to write data
      to disk. All user connection threads that attempt to
      delayed-insert into this table interact with the dedicated thread in
      producer/consumer fashion: all records to-be inserted are pushed
      into a queue of the dedicated thread, which fetches the records and 
      writes them.
      In this design, client connection threads never open or lock
      the delayed insert table.
      This functionality was introduced in version 3.23 and does not take 
      into account existence of triggers, views, or pre-locking.
      E.g. if INSERT DELAYED is called from a stored function, which,
      in turn, is called from another stored function that uses the delayed
      table, a deadlock can occur, because delayed locking by-passes
      pre-locking. Besides:
       * the delayed thread works directly with the subject table through
         the storage engine API and does not invoke triggers
       * even if it was patched to invoke triggers, if triggers,
         in turn, used other tables, the delayed thread would
         have to open and lock involved tables (use pre-locking).
       * even if it was patched to use pre-locking, without deadlock
         detection the delayed thread could easily lock out user 
         connection threads in case when the same table is used both
         in a trigger and on the right side of the insert query: 
         the delayed thread would not release locks until all inserts 
         are complete, and user connection can not complete inserts 
         without having locks on the tables used on the right side of the
         query.
      
      Solution:
      
      These considerations suggest two general alternatives for the
      future of INSERT DELAYED:
       * it is considered a full-fledged alternative to normal INSERT
       * it is regarded as an optimisation that is only relevant 
         for simplistic engines.
      Since we missed our chance to provide complete support of new
      features when 5.0 was in development, the first alternative
      currently renders infeasible.
      However, even the second alternative, which is to detect
      new features and convert DELAYED insert into a normal insert, 
      is not easy to implement.
      The catch-22 is that we don't know if the subject table has triggers
      or is a view before we open it, and we only open it in the
      delayed thread. We don't know if the query involves pre-locking
      until we have opened all tables, and we always first create
      the delayed thread, and only then open the remaining tables.
      This patch detects the problematic scenarios and converts
      DELAYED INSERT to a normal INSERT using the following approach:
       * if the statement is executed under pre-locking (e.g. from
         within a stored function or trigger) or the right
         side may require pre-locking, we detect the situation
         before creating a delayed insert thread and convert the statement
         to a conventional INSERT.
        * if the subject table is a view or has triggers, we shutdown
         the delayed thread and convert the statement to a conventional
         INSERT.
      747842e1
  9. 15 May, 2007 1 commit