1. 05 Jun, 2012 3 commits
  2. 01 Jun, 2012 4 commits
    • Annamalai Gurusami's avatar
      f2d7e1ff
    • Annamalai Gurusami's avatar
      Bug #13933132: [ERROR] GOT ERROR -1 WHEN READING TABLE APPEARED · a28a2ca7
      Annamalai Gurusami authored
      WHEN KILLING
      
      Suppose there is a query waiting for a lock.  If the user kills
      this query, then "Got error -1 when reading table" error message
      must not be logged in the server log file.  Since this is a user
      requested interruption, no spurious error message must be logged
      in the server log.  This patch will remove the error message from
      the log.
      
      approved by joh and tatjana
      a28a2ca7
    • Jon Olav Hauglid's avatar
      Bug#13982017: ALTER TABLE RENAME ENDS UP WITH ERROR 1050 (42S01) · 1c0388a5
      Jon Olav Hauglid authored
      Fixed by backport of:
          ------------------------------------------------------------
          revno: 3402.50.156
          committer: Jon Olav Hauglid <jon.hauglid@oracle.com>
          branch nick: mysql-trunk-test
          timestamp: Wed 2012-02-08 14:10:23 +0100
          message:
            Bug#13417754 ASSERT IN ROW_DROP_DATABASE_FOR_MYSQL DURING DROP SCHEMA
            
            This assert could be triggered if an InnoDB table was being moved
            to a different database using ALTER TABLE ... RENAME, while this
            database concurrently was being dropped by DROP DATABASE.
            
            The reason for the problem was that no metadata lock was taken
            on the target database by ALTER TABLE ... RENAME.
            DROP DATABASE was therefore not blocked and could remove
            the database while ALTER TABLE ... RENAME was executing. This
            could cause the assert in InnoDB to be triggered.
            
            This patch fixes the problem by taking a IX metadata lock on
            the target database before ALTER TABLE ... RENAME starts
            moving a table to a different database.
            
            Note that this problem did not occur with RENAME TABLE which
            already takes the correct metadata locks.
            
            Also note that this patch slightly changes the behavior of
            ALTER TABLE ... RENAME. Before, the statement would abort and
            return an error if a lock on the target table name could not
            be taken immediately. With this patch, ALTER TABLE ... RENAME
            will instead block and wait until the lock can be taken 
            (or until we get a lock timeout). This also means that it is
            possible to get ER_LOCK_DEADLOCK errors in this situation
            since we allow ALTER TABLE ... RENAME to wait and not just
            abort immediately.
      1c0388a5
    • Annamalai Gurusami's avatar
      Merge from mysql-5.1 to mysql-5.5. · 4acca343
      Annamalai Gurusami authored
      4acca343
  3. 31 May, 2012 6 commits
  4. 30 May, 2012 6 commits
  5. 29 May, 2012 3 commits
  6. 28 May, 2012 1 commit
    • Praveenkumar Hulakund's avatar
      Bug#14003080:65104: MAX_USER_CONNECTIONS WITH PROCESSLIST EMPTY · b2c3acc9
      Praveenkumar Hulakund authored
      Analysis:
      -------------
      If server is started with limit of MAX_CONNECTIONS and 
      MAX_USER_CONNECTIONS then only MAX_USER_CONNECTIONS of any particular
      users can be connected to server and total MAX_CONNECTIONS of client can
      be connected to server.
      
      Server maintains a counter for total CONNECTIONS and total CONNECTIONS 
      from particular user.
      
      Here, MAX_CONNECTIONS of connections are created to server. Out of this
      MAX_CONNECTIONS, connections from particular user (say USER1) are
      also created. The connections from USER1 is lesser than 
      MAX_USER_CONNECTIONS. After that there was one more connection request from
      USER1. Since USER1 can still create connections as he havent reached
      MAX_USER_CONNECTIONS, server increments counter of CONNECTIONS per user.
      As server already has MAX_CONNECTIONS of connections, next check to total
      CONNECTION count fails. In this case control is returned WITHOUT 
      decrementing the CONNECTIONS per user. So the counter per user CONNECTIONS goes
      on incrementing for each attempt until current connections are closed. 
      And because of this counter per CONNECTIONS reached MAX_USER_CONNECTIONS. 
      So, next connections form USER1 user always returns with MAX_USER_CONNECTION 
      limit error, even when total connection to sever are less than MAX_CONNECTIONS.
      
      Fix:
      -------------
      This issue is occurred because of not handling counters properly in the
      server. Changed the code to handle per user connection counters properly.
      b2c3acc9
  7. 25 May, 2012 2 commits
  8. 24 May, 2012 4 commits
    • Mayank Prasad's avatar
      Bug#13417440 : 63340: ARCHIVE FILE IO NOT INSTRUMENTED · efe42792
      Mayank Prasad authored
            
      Details:
       - Archive storage engine file access were not instrumented and thus
         were not shown in PS tables.
            
      Fix:
       - Added instrumentation code by using PS Apis for I/O.
      efe42792
    • Inaam Rana's avatar
      merge from 5.1 · b91be277
      Inaam Rana authored
      b91be277
    • Inaam Rana's avatar
      Bug #14100254 65389: MVCC IS BROKEN WITH IMPLICIT LOCK · 01748ce1
      Inaam Rana authored
      rb://1088
      approved by: Marko Makela
      
      This bug was introduced in early stages of plugin. We were not
      checking for an implicit lock on sec index rec for trx_id that is
      stamped on current version of the clust_index in case where the
      clust_index has a previous delete marked version.
      01748ce1
    • Sujatha Sivakumar's avatar
      Bug#13833962:DISABLE [NOTE] START BINLOG_DUMP TO SLAVE_SERVER(0) MESSAGES · dcd4fa3f
      Sujatha Sivakumar authored
      IN THE ERROR LOG
            
      Problem:
      Using mysqlbinlog with the --read-from-remote-server option as shown below
      prints a message in error log for each call. This happens for 5.5 and above
      versions
            
      mysqlbinlog -uroot -p --read-from-remote-server --host=localhost test
            
      Message in error log file is given below:
      120312 10:27:57 [Note] Start binlog_dump to slave_server(0), pos(test, 4)
            
      The problem is that it can fill up the error log if the command is called
      very often.
            
      Analysis:
      The below mentioned print function is called from "mysql_binlog_send" function
      which causes the "Start binlog_dump..." string to be printed in error log file.
      
      sql_print_information("Start binlog_dump to master_thread_id(%lu) 
      slave_server(%d)..."
            
      Fix:
      A condition has been added in such a way that the 'sql_print_information' 
      will be invoked only when the "log_warnings" variable is set to >1 
      otherwise don't call the 'sql_print_information' function.
      
      dcd4fa3f
  9. 23 May, 2012 3 commits
  10. 21 May, 2012 3 commits
    • Annamalai Gurusami's avatar
      Merge from mysql-5.1 to mysql-5.5 · 41c37c77
      Annamalai Gurusami authored
      41c37c77
    • Annamalai Gurusami's avatar
      Bug #12752572 61579: REPLICATION FAILURE WHILE · e979417c
      Annamalai Gurusami authored
      INNODB_AUTOINC_LOCK_MODE=1 AND USING TRIGGER
      
      When an insert stmt like "insert into t values (1),(2),(3)" is
      executed, the autoincrement values assigned to these three rows are
      expected to be contiguous.  In the given lock mode
      (innodb_autoinc_lock_mode=1), the auto inc lock will be released
      before the end of the statement.  So to make the autoincrement
      contiguous for a given statement, we need to reserve the auto inc
      values at the beginning of the statement.  
      
      Modified the fix based on review comment by Svoj.  
      e979417c
    • Tor Didriksen's avatar
      Bug#13986705 CRASH IN GET_INTERVAL_VALUE() WITH DATE CALCULATION WITH UTF32 INTERVALS · a73d2ae0
      Tor Didriksen authored
      This is a followup to the fix for Bug#12340997
      get_interval_value() was trying to parse the input string,
      looking for leading '-' while skipping whitespace.
      The macro my_isspace() does not work for utf32 character set,
      since my_charset_utf32_general_ci.ctype == NULL.
      
      Solution: convert input to ASCII before parsing,
      and use the character set of the returned ASCII string.
      a73d2ae0
  11. 18 May, 2012 1 commit
    • Rohit Kalhans's avatar
      BUG#14005409 - 64624 · 781137c0
      Rohit Kalhans authored
            
      Problem: After the fix for Bug#12589870, a new field that
      stores the length of db name was added in the buffer that
      stores the query to be executed. Unlike for the plain user
      session, the replication execution did not allocate the
      necessary chunk in Query-event constructor. This caused an
      invalid read while accessing this field.
            
      Solution: We fix this problem by allocating a necessary chunk
      in the buffer created in the Query_log_event::Query_log_event()
      and store the length of database name.
      
      sql/log_event.cc:
        Added a new field in the buffer created in the
        Query_log_event's constructor and store the length
        of database name.
      781137c0
  12. 17 May, 2012 3 commits
    • Gopal Shankar's avatar
      Bug#12636001 : deadlock from thd_security_context · 21faded5
      Gopal Shankar authored
      PROBLEM:
      Threads end-up in deadlock due to locks acquired as described
      below,
      
      con1: Run Query on a table. 
        It is important that this SELECT must back-off while
        trying to open the t1 and enter into wait_for_condition().
        The SELECT then is blocked trying to lock mysys_var->mutex
        which is held by con3. The very significant fact here is
        that mysys_var->current_mutex will still point to LOCK_open,
        even if LOCK_open is no longer held by con1 at this point.
      
      con2: Try dropping table used in con1 or query some table.
        It will hold LOCK_open and be blocked trying to lock
        kernel_mutex held by con4.
      
      con3: Try killing the query run by con1.
        It will hold THD::LOCK_thd_data belonging to con1 while
        trying to lock mysys_var->current_mutex belonging to con1.
        But current_mutex will point to LOCK_open which is held
        by con2.
      
      con4: Get innodb engine status
        It will hold kernel_mutex, trying to lock THD::LOCK_thd_data
        belonging to con1 which is held by con3.
      
      So while technically only con2, con3 and con4 participate in the
      deadlock, con1's mysys_var->current_mutex pointing to LOCK_open
      is a vital component of the deadlock.
      
      CYCLE = (THD::LOCK_thd_data -> LOCK_open ->
               kernel_mutex -> THD::LOCK_thd_data)
      
      FIX:
      LOCK_thd_data has responsibility of protecting,
      1) thd->query, thd->query_length
      2) VIO
      3) thd->mysys_var (used by KILL statement and shutdown)
      4) THD during thread delete.
      
      Among above responsibilities, 1), 2)and (3,4) seems to be three
      independent group of responsibility. If there is different LOCK
      owning responsibility of (3,4), the above mentioned deadlock cycle
      can be avoid. This fix introduces LOCK_thd_kill to handle
      responsibility (3,4), which eliminates the deadlock issue.
      
      Note: The problem is not found in 5.5. Introduction MDL subsystem 
      caused metadata locking responsibility to be moved from TDC/TC to
      MDL subsystem. Due to this, responsibility of LOCK_open is reduced. 
      As the use of LOCK_open is removed in open_table() and 
      mysql_rm_table() the above mentioned CYCLE does not form.
      Revision ID for changes,
      open_table() = dlenev@mysql.com-20100727133458-m3ua9oslnx8fbbvz
      mysql_rm_table() = jon.hauglid@oracle.com-20101116100012-kxep9txz2fxy3nmw
      
      21faded5
    • unknown's avatar
      No commit message · 3e1758d3
      unknown authored
      No commit message
      3e1758d3
    • unknown's avatar
      No commit message · 932376f9
      unknown authored
      No commit message
      932376f9
  13. 16 May, 2012 1 commit
    • Annamalai Gurusami's avatar
      Bug #13943231: ALTER TABLE AFTER DISCARD MAY CRASH THE SERVER · ce9e6b5a
      Annamalai Gurusami authored
      The following scenario crashes our mysql server:
      
      1.  set global innodb_file_per_table=1;
      2.  create table t1(c1 int) engine=innodb;
      3.  alter table t1 discard tablespace;
      4.  alter table t1 add unique index(c1);
      
      Step 4 crashes the server.  This patch introduces a check on discarded
      tablespace to avoid the crash.
      
      rb://1041 approved by Marko Makela
      ce9e6b5a