An error occurred fetching the project authors.
  1. 25 Feb, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Bug #51355 handler stmt cause assertion in · a7eb883f
      Jon Olav Hauglid authored
                 bool MDL_context::try_acquire_lock(MDL_request*)
      
      This assert was triggered in the following way:
      1) HANDLER OPEN t1 from connection 1
      2) DROP TABLE t1 from connection 2. This will block due to the metadata lock
      held by the open handler in connection 1.
      3) DML statement (e.g. INSERT) from connection 1. This will close the table
      opened by the HANDLER in 1) and release its metadata lock. This is done due
      to the pending exclusive metadata lock from 2). 
      4) DROP TABLE t1 from connection 2 now completes and removes table t1.
      5) HANDLER READ from connection 1. Since the handler table was closed in 3),
      the handler code will try to reopen the table. First a new metadata lock on
      t1 will be granted before the command fails since the table was removed in 4).
      6) HANDLER READ from connection 1. This caused the assert.
      
      The reason for the assert was that the MDL_request's pointer to the lock
      ticket was not reset when the statement failed. HANDLER READ then tried to
      acquire a lock using the same MDL_request object, triggering the assert.
      This bug was only noticeable on debug builds and did not cause any problems
      on release builds.
      
      This patch fixes the problem by assuring that the pointer to the metadata 
      lock ticket is reset when reopening of handler tables fails.
      
      Test case added to handler.inc
      a7eb883f
  2. 16 Feb, 2010 1 commit
  3. 15 Feb, 2010 1 commit
    • Dmitry Lenev's avatar
      Fix for bug #51136 "Crash in pthread_rwlock_rdlock on · 5180e803
      Dmitry Lenev authored
      TEMPORARY + HANDLER + LOCK + SP".
      
      Server crashed when one: 
      1) Opened HANDLER or acquired global read lock
      2) Then locked one or several temporary tables with
         LOCK TABLES statement (but no base tables).
      3) Then issued any statement causing commit (explicit 
         or implicit).
      4) Issued statement which should have closed HANDLER
         or released global read lock.
         
      The problem was that when entering LOCK TABLES mode in the
      scenario described above we incorrectly set transactional
      MDL sentinel to zero. As result during commit all metadata 
      locks were released (including lock for open HANDLER or
      global metadata shared lock). Indeed, attempt to release
      metadata lock for the second time which happened during
      HANLDER CLOSE or during release of GLR caused crash.
      
      This patch fixes problem by changing MDL_context's
      set_trans_sentinel() method to set sentinel to correct 
      value (it should point to the most recent ticket).
      
      mysql-test/include/handler.inc:
        Added test for bug #51136 "Crash in pthread_rwlock_rdlock on 
        TEMPORARY + HANDLER + LOCK + SP".
      mysql-test/r/flush.result:
        Updated test results (see flush.test).
      mysql-test/r/handler_innodb.result:
        Updated test results (see include/handler.inc).
      mysql-test/r/handler_myisam.result:
        Updated test results (see include/handler.inc).
      mysql-test/t/flush.test:
        Added additional coverage for bug #51136 "Crash in
        pthread_rwlock_rdlock on TEMPORARY + HANDLER + LOCK +
        SP".
      sql/mdl.h:
        When setting new value of transactional sentinel use 
        pointer to the most recent ticket instead of value 
        returned by MDL_context::mdl_savepoint(). 
        This allows to handle correctly situation when the new 
        value of sentinel should be the same as its current value 
        (MDL_context::mdl_savepoint() returns NULL in this case).
      5180e803
  4. 12 Feb, 2010 1 commit
    • Dmitry Lenev's avatar
      Fix for bug #50908 "Assertion `handler_tables_hash.records == 0' · 249be178
      Dmitry Lenev authored
      failed in enter_locked_tables_mode".
      
      Server was aborted due to assertion failure when one tried to 
      execute statement requiring prelocking (i.e. firing triggers
      or using stored functions) while having open HANDLERs.
      
      The problem was that THD::enter_locked_tables_mode() method
      which was called at the beginning of execution of prelocked 
      statement assumed there are no open HANDLERs. It had to do 
      so because corresponding THD::leave_locked_tables_mode()
      method was unable to properly restore MDL sentinel when
      leaving LOCK TABLES/prelocked mode in the presence of open 
      HANDLERs.
      
      This patch solves this problem by changing the latter method
      to properly restore MDL sentinel and thus removing need for 
      this assumption. As a side-effect, it lifts unjustified
      limitation by allowing to keep HANDLERs open when entering 
      LOCK TABLES mode.
      
      mysql-test/include/handler.inc:
        Adjusted tests after making LOCK TABLES not to close
        open HANDLERs. Added coverage for bug #50908
        "Assertion `handler_tables_hash.records == 0' failed
        in enter_locked_tables_mode".
      mysql-test/r/handler_innodb.result:
        Updated test results (see include/handler.inc).
      mysql-test/r/handler_myisam.result:
        Updated test results (see include/handler.inc).
      sql/mysql_priv.h:
        Introduced mysql_ha_move_tickets_after_trans_sentinel()
        routine which allows to move tickets for metadata locks
        corresponding to open HANDLERs after transaction sentinel.
      sql/sql_class.cc:
        Changed THD::leave_locked_tables_mode() to correctly restore 
        MDL sentinel value in the presence of open HANDLERs.
      sql/sql_class.h:
        Removed assert from THD::enter_locked_tables_mode() as we
        no longer have to close HANDLERs when entering LOCK TABLES 
        or prelocked modes. Instead we keep them open and correctly
        restore MDL sentinel value after leaving them.
        Removal of assert also fixes problem from the bug report.
      sql/sql_handler.cc:
        Introduced mysql_ha_move_tickets_after_trans_sentinel()
        routine which allows to move tickets for metadata locks
        corresponding to open HANDLERs after transaction sentinel.
      sql/sql_parse.cc:
        We no longer have to close HANDLERs when entering LOCK TABLES 
        mode. Instead we keep them open and simply correctly restore 
        MDL sentinel value after leaving this mode.
      249be178
  5. 06 Feb, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Bug #50912 Assertion `ticket->m_type >= mdl_request->type' · c01f008c
      Jon Olav Hauglid authored
                 failed on HANDLER + I_S
      
      This assert was triggered when an I_S query tried to acquire a
      metadata lock on a table which was already locked by a HANDLER
      statement in the same connection.
      
      First the HANDLER took a MDL_SHARED lock. Afterwards, the I_S query
      requested a MDL_SHARED_HIGH_PRIO lock. The existing MDL_SHARED ticket
      is found in find_ticket() since it satisfies 
      ticket->has_stronger_or_equal_type(mdl_request->type) as MDL_SHARED
      and MDL_SHARED_HIGH_PRIO have equal strengths, just different priority.
      
      However, two asserts later check lock type strengths using relational
      operators (>= and <=) rather than MDL_ticket::has_stronger_or_equal_type().
      These asserts are triggered since MDL_SHARED >= MDL_SHARED_HIGH_PRIORITY
      is false (mapped to 1 and 2 respectively).
      
      This patch updates the asserts to use MDL_ticket::has_stronger_or_equal_type()
      rather than relational operators to check lock type strength.
      
      Test case added to include/handler.inc.
      c01f008c
  6. 05 Feb, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Bug #50907 Assertion `hash_tables->table->next == __null' on · cb400f38
      Jon Olav Hauglid authored
                 HANDLER OPEN
      
      The problem was a too restrictive assert in the code for 
      HANDLER ... OPEN and HANDLER ... READ that checked table->next
      to verify that we didn't open views or merge tables.
      
      This pointer is also used to link temporary tables together
      (see thd->temporary_tables). In this case TABLE::next can be
      set even if we're trying to open a single table.
      
      This patch adjust the two asserts to also check for the presence
      of temporary tables.
      
      Test case added to handler_myisam.test.
      cb400f38
  7. 01 Feb, 2010 1 commit
    • Dmitry Lenev's avatar
      Implement new type-of-operation-aware metadata locks. · ff6fd58d
      Dmitry Lenev authored
      Add a wait-for graph based deadlock detector to the
      MDL subsystem.
      
      Fixes bug #46272 "MySQL 5.4.4, new MDL: unnecessary deadlock" and
      bug #37346 "innodb does not detect deadlock between update and
      alter table".
      
      The first bug manifested itself as an unwarranted abort of a
      transaction with ER_LOCK_DEADLOCK error by a concurrent ALTER
      statement, when this transaction tried to repeat use of a
      table, which it has already used in a similar fashion before
      ALTER started.
      
      The second bug showed up as a deadlock between table-level
      locks and InnoDB row locks, which was "detected" only after
      innodb_lock_wait_timeout timeout.
      
      A transaction would start using the table and modify a few
      rows.
      Then ALTER TABLE would come in, and start copying rows
      into a temporary table. Eventually it would stumble on
      the modified records and get blocked on a row lock.
      The first transaction would try to do more updates, and get
      blocked on thr_lock.c lock.
      This situation of circular wait would only get resolved
      by a timeout.
      
      Both these bugs stemmed from inadequate solutions to the
      problem of deadlocks occurring between different
      locking subsystems.
      
      In the first case we tried to avoid deadlocks between metadata
      locking and table-level locking subsystems, when upgrading shared
      metadata lock to exclusive one.
      Transactions holding the shared lock on the table and waiting for
      some table-level lock used to be aborted too aggressively.
      
      We also allowed ALTER TABLE to start in presence of transactions
      that modify the subject table. ALTER TABLE acquires
      TL_WRITE_ALLOW_READ lock at start, and that block all writes
      against the table (naturally, we don't want any writes to be lost
      when switching the old and the new table). TL_WRITE_ALLOW_READ
      lock, in turn, would block the started transaction on thr_lock.c
      lock, should they do more updates. This, again, lead to the need
      to abort such transactions.
      
      The second bug occurred simply because we didn't have any
      mechanism to detect deadlocks between the table-level locks
      in thr_lock.c and row-level locks in InnoDB, other than
      innodb_lock_wait_timeout.
      
      This patch solves both these problems by moving lock conflicts
      which are causing these deadlocks into the metadata locking
      subsystem, thus making it possible to avoid or detect such
      deadlocks inside MDL.
      
      To do this we introduce new type-of-operation-aware metadata
      locks, which allow MDL subsystem to know not only the fact that
      transaction has used or is going to use some object but also what
      kind of operation it has carried out or going to carry out on the
      object.
      
      This, along with the addition of a special kind of upgradable
      metadata lock, allows ALTER TABLE to wait until all
      transactions which has updated the table to go away.
      This solves the second issue.
      Another special type of upgradable metadata lock is acquired
      by LOCK TABLE WRITE. This second lock type allows to solve the
      first issue, since abortion of table-level locks in event of
      DDL under LOCK TABLES becomes also unnecessary.
      
      Below follows the list of incompatible changes introduced by
      this patch:
      
      - From now on, ALTER TABLE and CREATE/DROP TRIGGER SQL (i.e. those
        statements that acquire TL_WRITE_ALLOW_READ lock)
        wait for all transactions which has *updated* the table to
        complete.
      
      - From now on, LOCK TABLES ... WRITE, REPAIR/OPTIMIZE TABLE
        (i.e. all statements which acquire TL_WRITE table-level lock) wait
        for all transaction which *updated or read* from the table
        to complete.
        As a consequence, innodb_table_locks=0 option no longer applies
        to LOCK TABLES ... WRITE.
      
      - DROP DATABASE, DROP TABLE, RENAME TABLE no longer abort
        statements or transactions which use tables being dropped or
        renamed, and instead wait for these transactions to complete.
      
      - Since LOCK TABLES WRITE now takes a special metadata lock,
        not compatible with with reads or writes against the subject table
        and transaction-wide, thr_lock.c deadlock avoidance algorithm
        that used to ensure absence of deadlocks between LOCK TABLES
        WRITE and other statements is no longer sufficient, even for
        MyISAM. The wait-for graph based deadlock detector of MDL
        subsystem may sometimes be necessary and is involved. This may
        lead to ER_LOCK_DEADLOCK error produced for multi-statement
        transactions even if these only use MyISAM:
      
        session 1:         session 2:
        begin;
      
        update t1 ...      lock table t2 write, t1 write;
                           -- gets a lock on t2, blocks on t1
      
        update t2 ...
        (ER_LOCK_DEADLOCK)
      
      - Finally,  support of LOW_PRIORITY option for LOCK TABLES ... WRITE
        was abandoned.
        LOCK TABLE ... LOW_PRIORITY WRITE from now on has the same
        priority as the usual LOCK TABLE ... WRITE.
        SELECT HIGH PRIORITY no longer trumps LOCK TABLE ... WRITE  in
        the wait queue.
      
      - We do not take upgradable metadata locks on implicitly
        locked tables. So if one has, say, a view v1 that uses
        table t1, and issues:
        LOCK TABLE v1 WRITE;
        FLUSH TABLE t1; -- (or just 'FLUSH TABLES'),
        an error is produced.
        In order to be able to perform DDL on a table under LOCK TABLES,
        the table must be locked explicitly in the LOCK TABLES list.
      
      mysql-test/include/handler.inc:
        Adjusted test case to trigger an execution path on which bug 41110
        "crash with handler command when used concurrently with alter
        table" and bug 41112 "crash in mysql_ha_close_table/get_lock_data
        with alter table" were originally discovered. Left old test case
        which no longer triggers this execution path for the sake of
        coverage.
        Added test coverage for HANDLER SQL statements and type-aware
        metadata locks.
        Added a test for the global shared lock and HANDLER SQL.
        Updated tests to take into account that the old simple deadlock
        detection heuristics was replaced with a graph-based deadlock
        detector.
      mysql-test/r/debug_sync.result:
        Updated results (see debug_sync.test).
      mysql-test/r/handler_innodb.result:
        Updated results (see handler.inc test).
      mysql-test/r/handler_myisam.result:
        Updated results (see handler.inc test).
      mysql-test/r/innodb-lock.result:
        Updated results (see innodb-lock.test).
      mysql-test/r/innodb_mysql_lock.result:
        Updated results (see innodb_mysql_lock.test).
      mysql-test/r/lock.result:
        Updated results (see lock.test).
      mysql-test/r/lock_multi.result:
        Updated results (see lock_multi.test).
      mysql-test/r/lock_sync.result:
        Updated results (see lock_sync.test).
      mysql-test/r/mdl_sync.result:
        Updated results (see mdl_sync.test).
      mysql-test/r/sp-threads.result:
        SHOW PROCESSLIST output has changed due to the fact that waiting
        for LOCK TABLES WRITE now happens within metadata locking
        subsystem.
      mysql-test/r/truncate_coverage.result:
        Updated results (see truncate_coverage.test).
      mysql-test/suite/funcs_1/datadict/processlist_val.inc:
        SELECT FROM I_S.PROCESSLIST output has changed due to fact that
        waiting for LOCK TABLES WRITE now happens within metadata locking
        subsystem.
      mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
        SELECT FROM I_S.PROCESSLIST output has changed due to fact that
        waiting for LOCK TABLES WRITE now happens within metadata locking
        subsystem.
      mysql-test/suite/rpl/t/rpl_sp.test:
        Updated to a new SHOW PROCESSLIST state name.
      mysql-test/t/debug_sync.test:
        Use LOCK TABLES READ instead of LOCK TABLES WRITE as the latter
        no longer allows to trigger execution path involving waiting on
        thr_lock.c lock and therefore reaching debug sync-point covered
        by this test.
      mysql-test/t/innodb-lock.test:
        Adjusted test case to the fact that innodb_table_locks=0 option is
        no longer supported, since LOCK TABLES WRITE handles all its
        conflicts within MDL subsystem.
      mysql-test/t/innodb_mysql_lock.test:
        Added test for bug #37346 "innodb does not detect deadlock between
        update and alter table".
      mysql-test/t/lock.test:
        Added test coverage which checks the fact that we no longer support
        DDL under LOCK TABLES on tables which were locked implicitly.
        Adjusted existing test cases accordingly.
      mysql-test/t/lock_multi.test:
        Added test for bug #46272 "MySQL 5.4.4, new MDL: unnecessary
        deadlock".  Adjusted other test cases to take into account the
        fact that waiting for LOCK TABLES ... WRITE now happens within MDL
        subsystem.
      mysql-test/t/lock_sync.test:
        Since LOCK TABLES ... WRITE now takes SNRW metadata lock for
        tables locked explicitly we have to implicitly lock InnoDB tables
        (through view) to trigger the table-level lock conflict between
        TL_WRITE and TL_WRITE_ALLOW_WRITE.
      mysql-test/t/mdl_sync.test:
        Added basic test coverage for type-of-operation-aware metadata
        locks. Also covered with tests some use cases involving HANDLER
        statements in which a deadlock could arise.
        Adjusted existing tests to take type-of-operation-aware MDL into
        account.
      mysql-test/t/multi_update.test:
        Update to a new SHOW PROCESSLIST state name.
      mysql-test/t/truncate_coverage.test:
        Adjusted test case after making LOCK TABLES WRITE to wait until
        transactions that use the table to be locked are completed.
        Updated to the changed name of DEBUG_SYNC point.
      sql/handler.cc:
        Global read lock functionality has been
        moved into a class.
      sql/lock.cc:
        Global read lock functionality has been
        moved into a class.
        Updated code to use the new MDL API.
      sql/mdl.cc:
        Introduced new type-of-operation aware metadata locks.
        To do this:
        - Changed MDL_lock to use one list for waiting requests and one
          list for granted requests. For each list, added a bitmap
          that holds information what lock types a list contains.
          Added a helper class MDL_lock::List to manipulate with granted
          and waited lists while keeping the bitmaps in sync
          with list contents.
        - Changed lock-compatibility functions to use bitmaps that
          define compatibility.
        - Introduced a graph based deadlock detector inspired by
          waiting_threads.c from Maria implementation.
        - Now that we have a deadlock detector, and no longer have
          a global lock to protect individual lock objects, but rather
          use an rw lock per object, removed redundant code for upgrade,
          and the global read lock. Changed the MDL API to
          no longer require the caller to acquire the global
          intention exclusive lock by means of a separate method.
          Removed a few more methods that became redundant.
        - Removed deadlock detection heuristic, it has been made
          obsolete by the deadlock detector.
        - With operation-type-aware metadata locks, MDL subsystem has
          become aware of potential conflicts between DDL and open
          transactions. This made it possible to remove calls to
          mysql_abort_transactions_with_shared_lock() from acquisition
          paths for exclusive lock and lock upgrade. Now we can simply
          wait for these transactions to complete without fear of
          deadlock. Function mysql_lock_abort() has also become
          unnecessary for all conflicting cases except when a DDL
          conflicts with a connection that has an open HANDLER.
      sql/mdl.h:
        Introduced new type-of-operation aware metadata locks.
        Introduced a graph based deadlock detector and supporting
        methods.
        Added comments.
        God rid of redundant API calls.
        Renamed m_lt_or_ha_sentinel to m_trans_sentinel,
        since now it guards the global read lock as well as
        LOCK TABLES and HANDLER locks.
      sql/mysql_priv.h:
        Moved the global read lock functionality into a
        class.
        Added MYSQL_OPEN_FORCE_SHARED_MDL flag which forces
        open_tables() to take MDL_SHARED on tables instead of
        metadata locks specified in the parser. We use this to
        allow PREPARE run concurrently in presence of
        LOCK TABLES ... WRITE.
        Added signature for find_table_for_mdl_ugprade().
      sql/set_var.cc:
        Global read lock functionality has been
        moved into a class.
      sql/sp_head.cc:
        When creating TABLE_LIST elements for prelocking or
        system tables set the type of request for metadata
        lock according to the operation that will be performed
        on the table.
      sql/sql_base.cc:
        - Updated code to use the new MDL API.
        - In order to avoid locks starvation we take upgradable
          locks all at once. As result implicitly locked tables no
          longer get an upgradable lock. Consequently DDL and FLUSH
          TABLES for such tables is prohibited.
          find_write_locked_table() was replaced by
          find_table_for_mdl_upgrade() function.
          open_table() was adjusted to return TABLE instance with
          upgradable ticket when necessary.
        - We no longer wait for all locks on OT_WAIT back off
          action -- only on the lock that caused the wait
          conflict. Moreover, now we distinguish cases when we
          have to wait due to conflict in MDL and old version
          of table in TDC.
        - Upate mysql_notify_threads_having_share_locks()
          to only abort thr_lock.c waits of threads that
          have open HANDLERs, since lock conflicts with only
          these threads now can lead to deadlocks not detectable
          by the MDL deadlock detector.
        - Remove mysql_abort_transactions_with_shared_locks()
          which is no longer needed.
      sql/sql_class.cc:
        Global read lock functionality has been moved into a class.
        Re-arranged code in THD::cleanup() to simplify assert.
      sql/sql_class.h:
        Introduced class to incapsulate global read lock
        functionality.
        Now sentinel in MDL subsystem guards the global read lock
        as well as LOCK TABLES and HANDLER locks. Adjusted code
        accordingly.
      sql/sql_db.cc:
        Global read lock functionality has been moved into a class.
      sql/sql_delete.cc:
        We no longer acquire upgradable metadata locks on tables
        which are locked by LOCK TABLES implicitly. As result
        TRUNCATE TABLE is no longer allowed for such tables.
        Updated code to use the new MDL API.
      sql/sql_handler.cc:
        Inform MDL_context about presence of open HANDLERs.
        Since HANLDERs break MDL protocol by acquiring table-level
        lock while holding only S metadata lock on a table MDL
        subsystem should take special care about such contexts (Now
        this is the only case when mysql_lock_abort() is used).
      sql/sql_parse.cc:
        Global read lock functionality has been moved into a class.
        Do not take upgradable metadata locks when opening tables
        for CREATE TABLE SELECT as it is not necessary and limits
        concurrency.
        When initializing TABLE_LIST objects before adding them
        to the table list set the type of request for metadata lock
        according to the operation that will be performed on the
        table.
        We no longer acquire upgradable metadata locks on tables
        which are locked by LOCK TABLES implicitly. As result FLUSH
        TABLES is no longer allowed for such tables.
      sql/sql_prepare.cc:
        Use MYSQL_OPEN_FORCE_SHARED_MDL flag when opening
        tables during PREPARE. This allows PREPARE to run
        concurrently in presence of LOCK TABLES ... WRITE.
      sql/sql_rename.cc:
        Global read lock functionality has been moved into a class.
      sql/sql_show.cc:
        Updated code to use the new MDL API.
      sql/sql_table.cc:
        Global read lock functionality has been moved into a class.
        We no longer acquire upgradable metadata locks on tables
        which are locked by LOCK TABLES implicitly. As result DROP
        TABLE is no longer allowed for such tables.
        Updated code to use the new MDL API.
      sql/sql_trigger.cc:
        Global read lock functionality has been moved into a class.
        We no longer acquire upgradable metadata locks on tables
        which are locked by LOCK TABLES implicitly. As result
        CREATE/DROP TRIGGER is no longer allowed for such tables.
        Updated code to use the new MDL API.
      sql/sql_view.cc:
        Global read lock functionality has been moved into a class.
        Fixed results of wrong merge that led to misuse of GLR API.
        CREATE VIEW statement is not a commit statement.
      sql/table.cc:
        When resetting TABLE_LIST objects for PS or SP re-execution
        set the type of request for metadata lock according to the
        operation that will be performed on the table. Do the same
        in auxiliary function initializing metadata lock requests
        in a table list.
      sql/table.h:
        When initializing TABLE_LIST objects set the type of request
        for metadata lock according to the operation that will be
        performed on the table.
      sql/transaction.cc:
        Global read lock functionality has been moved into a class.
      ff6fd58d
  8. 21 Jan, 2010 1 commit
    • Dmitry Lenev's avatar
      Patch that changes metadata locking subsystem to use mutex per lock and · b3f63454
      Dmitry Lenev authored
      condition variable per context instead of one mutex and one conditional
      variable for the whole subsystem.
      
      This should increase concurrency in this subsystem.
      
      It also opens the way for further changes which are necessary to solve
      such bugs as bug #46272 "MySQL 5.4.4, new MDL: unnecessary deadlock"
      and bug #37346 "innodb does not detect deadlock between update and alter
      table".
      
      Two other notable changes done by this patch:
      
      - MDL subsystem no longer implicitly acquires global intention exclusive
        metadata lock when per-object metadata lock is acquired. Now this has
        to be done by explicit calls outside of MDL subsystem.
      - Instead of using separate MDL_context for opening system tables/tables
        for purposes of I_S we now create MDL savepoint in the main context
        before opening tables and rollback to this savepoint after closing
        them. This means that it is now possible to get ER_LOCK_DEADLOCK error
        even not inside a transaction. This might happen in unlikely case when
        one runs DDL on one of system tables while also running DDL on some
        other tables. Cases when this ER_LOCK_DEADLOCK error is not justified
        will be addressed by advanced deadlock detector for MDL subsystem which
        we plan to implement.
      
      mysql-test/include/handler.inc:
        Adjusted handler_myisam.test and handler_innodb.test to the fact that
        exclusive metadata locks on tables are now acquired according to
        alphabetical order of fully qualified table names instead of order
        in which tables are mentioned in statement.
      mysql-test/r/handler_innodb.result:
        Adjusted handler_myisam.test and handler_innodb.test to the fact that
        exclusive metadata locks on tables are now acquired according to
        alphabetical order of fully qualified table names instead of order
        in which tables are mentioned in statement.
      mysql-test/r/handler_myisam.result:
        Adjusted handler_myisam.test and handler_innodb.test to the fact that
        exclusive metadata locks on tables are now acquired according to
        alphabetical order of fully qualified table names instead of order
        in which tables are mentioned in statement.
      mysql-test/r/mdl_sync.result:
        Adjusted mdl_sync.test to the fact that exclusive metadata locks on
        tables are now acquired according to alphabetical order of fully
        qualified table names instead of order in which tables are mentioned
        in statement.
      mysql-test/t/mdl_sync.test:
        Adjusted mdl_sync.test to the fact that exclusive metadata locks on
        tables are now acquired according to alphabetical order of fully
        qualified table names instead of order in which tables are mentioned
        in statement.
      sql/events.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/ha_ndbcluster.cc:
        Since manipulations with open table state no longer install proxy
        MDL_context it does not make sense to perform them in order to
        satisfy assert in mysql_rm_tables_part2(). Removed them per agreement
        with Cluster team. This has not broken test suite since scenario in
        which deadlock can occur and assertion fails is not covered by tests.
      sql/lock.cc:
        MDL subsystem no longer implicitly acquires global intention exclusive
        metadata lock when per-object exclusive metadata lock is acquired.
        Now this has to be done by explicit calls outside of MDL subsystem.
      sql/log.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/mdl.cc:
        Changed metadata locking subsystem to use mutex per lock and condition
        variable per context instead of one mutex and one conditional variable
        for the whole subsystem.
        Changed approach to handling of global metadata locks. Instead of
        implicitly acquiring intention exclusive locks when user requests
        per-object upgradeable or exclusive locks now we require them to be
        acquired explicitly in the same way as ordinary metadata locks.
        In fact global lock are now ordinary metadata locks in new GLOBAL
        namespace.
        
        To implement these changes:
        - Removed LOCK_mdl mutex and COND_mdl condition variable.
        - Introduced MDL_lock::m_mutex mutexes which protect individual lock
          objects.
        - Replaced mdl_locks hash with MDL_map class, which has hash for
          MDL_lock objects as a member and separate mutex which protects this
          hash. Methods of this class allow to find(), find_or_create() or
          remove() MDL_lock objects in concurrency-friendly fashion (i.e.
          for most common operation, find_or_create(), we don't acquire
          MDL_lock::m_mutex while holding MDL_map::m_mutex. Thanks to MikaelR
          for this idea and benchmarks!). Added three auxiliary members to
          MDL_lock class (m_is_destroyed, m_ref_usage, m_ref_release) to
          support this concurrency-friendly behavior.
        - Introduced MDL_context::m_ctx_wakeup_cond condition variable to be
          used for waiting until this context's pending request can be
          satisfied or its thread has to perform actions to resolve potential
          deadlock. Context which want to wait add ticket corresponding to the
          request to an appropriate queue of waiters in MDL_lock object so
          they can be noticed when other contexts change state of lock and be
          awaken by them by signalling on MDL_context::m_ctx_wakeup_cond.
          As consequence MDL_ticket objects has to be used for any waiting
          in metadata locking subsystem including one which happens in
          MDL_context::wait_for_locks() method.
          Another consequence is that MDL_context is no longer copyable and
          can't be saved/restored when working with system tables.
        - Made MDL_lock an abstract class, which delegates specifying exact
          compatibility matrix to its descendants. Added MDL_global_lock child
          class for global lock (The old is_lock_type_compatible() method
          became can_grant_lock() method of this class). Added MDL_object_lock
          class to represent per-object lock (The old MDL_lock::can_grant_lock()
          became its method). Choice between two classes happens based on MDL
          namespace in MDL_lock::create() method.
        - Got rid of MDL_lock::type member as its meaning became ambigous for
          global locks.
        - To simplify waking up of contexts waiting for lock split waiting queue
          in MDL_lock class in two queues. One for pending requests for exclusive
          (including intention exclusive) locks and another for requests for
          shared locks.
        - Added virtual wake_up_waiters() method to MDL_lock, MDL_global_lock and
          MDL_object_lock classes which allows to wake up waiting contexts after
          state of lock changes. Replaced old duplicated code with calls to this
          method.
        - Adjusted MDL_context::try_acquire_shared_lock()/exclusive_lock()/
          global_shared_lock(), MDL_ticket::upgrade_shared_lock_to_exclusive_lock()
          and MDL_context::release_ticket() methods to use MDL_map and
          MDL_lock::m_mutex instead of single LOCK_mdl mutex and wake up
          waiters according to the approach described above. The latter method
          also was renamed to MDL_context::release_lock().
        - Changed MDL_context::try_acquire_shared_lock()/exclusive_lock() and
          release_lock() not to handle global locks. They are now supposed to
          be taken explicitly like ordinary metadata locks.
        - Added helper MDL_context::try_acquire_global_intention_exclusive_lock()
          and acquire_global_intention_exclusive_lock() methods.
        - Moved common code from MDL_context::acquire_global_shared_lock() and
          acquire_global_intention_exclusive_lock() to new method -
          MDL_context::acquire_lock_impl().
        - Moved common code from MDL_context::try_acquire_shared_lock(),
          try_acquire_global_intention_exclusive_lock()/exclusive_lock()
          to MDL_context::try_acquire_lock_impl().
        - Since acquiring of several exclusive locks can no longer happen under
          single LOCK_mdl mutex the approach to it had to be changed. Now we do
          it in one by one fashion. This is done in alphabetical order to avoid
          deadlocks. Changed MDL_context::acquire_exclusive_locks() accordingly
          (as part of this change moved code responsible for acquiring single
          exclusive lock to new MDL_context::acquire_exclusive_lock_impl()
          method).
        - Since we no longer have single LOCK_mdl mutex which protects all
          MDL_context::m_is_waiting_in_mdl members using these members to
          determine if we have really awaken context holding conflicting
          shared lock became inconvinient. Got rid of this member and changed
          notify_shared_lock() helper function and process of acquiring
          of/upgrading to exclusive lock not to rely on such information.
          Now in MDL_context::acquire_exclusive_lock_impl() and
          MDL_ticket::upgrade_shared_lock_to_exclusive_lock() we simply
          re-try to wake up threads holding conflicting shared locks after
          small time out.
        - Adjusted MDL_context::can_wait_lead_to_deadlock() and
          MDL_ticket::has_pending_conflicting_lock() to use per-lock
          mutexes instead of LOCK_mdl. To do this introduced
          MDL_lock::has_pending_exclusive_lock() method.
      sql/mdl.h:
        Changed metadata locking subsystem to use mutex per lock and condition
        variable per context instead of one mutex and one conditional variable
        for the whole subsystem. In order to implement this change:
        
        - Added MDL_key::cmp() method to be able to sort MDL_key objects
          alphabetically. Changed length fields in MDL_key class to uint16
          as 16-bit is enough for length of any key.
        - Changed MDL_ticket::get_ctx() to return pointer to non-const
          object in order to be able to use MDL_context::awake() method
          for such contexts.
        - Got rid of unlocked versions of can_wait_lead_to_deadlock()/
          has_pending_conflicting_lock() methods in MDL_context and
          MDL_ticket. We no longer has single mutex which protects all
          locks. Thus one always has to use versions of these methods
          which acquire per-lock mutexes.
        - MDL_request_list type of list now counts its elements.
        - Added MDL_context::m_ctx_wakeup_cond condition variable to be used
          for waiting until this context's pending request can be satisfied
          or its thread has to perform actions to resolve potential deadlock.
          Added awake() method to wake up context from such wait.
          Addition of condition variable made MDL_context uncopyable.
          As result we no longer can save/restore MDL_context when working
          with system tables. Instead we create MDL savepoint before opening
          those tables and rollback to it once they are closed.
        - MDL_context::release_ticket() became release_lock() method.
        - Added auxiliary MDL_context::acquire_exclusive_lock_impl() method
          which does all necessary work to acquire exclusive lock on one object
          but should not be used directly as it does not enforce any asserts
          ensuring that no deadlocks are possible.
        - Since we no longer need to know if thread trying to acquire exclusive
          lock managed to wake up any threads having conflicting shared locks
          (as, anyway, we will try to wake up such threads again shortly)
        - MDL_context::m_is_waiting_in_mdl member became unnecessary and
          notify_shared_lock() no longer needs to be friend of MDL_context.
        
        Changed approach to handling of global metadata locks. Instead of
        implicitly acquiring intention exclusive locks when user requests
        per-object upgradeable or exclusive locks now we require them to be
        acquired explicitly in the same way as ordinary metadata locks.
        
        - Added new GLOBAL namespace for such locks.
        - Added new type of lock to be requested MDL_INTENTION_EXCLISIVE.
        - Added MDL_context::try_acquire_global_intention_exclusive_lock()
          and acquire_global_intention_exclusive_lock() methods.
        - Moved common code from MDL_context::acquire_global_shared_lock()
          and acquire_global_intention_exclusive_lock() to new method -
          MDL_context::acquire_lock_impl().
        - Moved common code from MDL_context::try_acquire_shared_lock(),
          try_acquire_global_intention_exclusive_lock()/exclusive_lock()
          to MDL_context::try_acquire_lock_impl().
        - Added helper MDL_context::is_global_lock_owner() method to be
          able easily to find what kind of global lock this context holds.
        - MDL_context::m_has_global_shared_lock became unnecessary as
          global read lock is now represented by ordinary ticket.
        - Removed assert in MDL_context::set_lt_or_ha_sentinel() which became
          false for cases when we execute LOCK TABLES under global read lock
          mode.
      sql/mysql_priv.h:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result calls
        opening/closing system tables were changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/sp.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/sp.h:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/sql_base.cc:
        close_thread_tables():
          Since we no longer use separate MDL_context for opening system
          tables we need to avoid releasing all transaction locks when
          closing system table. Releasing metadata lock on system table
          is now responsibility of THD::restore_backup_open_tables_state().
        open_table_get_mdl_lock(),
        Open_table_context::recover_from_failed_open():
          MDL subsystem no longer implicitly acquires global intention exclusive
          metadata lock when per-object upgradable or exclusive metadata lock is
          acquired. So this have to be done explicitly from these calls.
          Changed Open_table_context class to store MDL_request object for
          global intention exclusive lock acquired when opening tables.
        open_table():
          Do not release metadata lock if we have failed to open table as
          this lock might have been acquired by one of previous statements
          in transaction, and therefore should not be released.
        open_system_tables_for_read()/close_system_tables()/
        open_performance_schema_table():
          Instead of using separate MDL_context for opening system tables we now
          create MDL savepoint in the main context before opening such tables
          and rollback to this savepoint after closing them. To support this
          change methods of THD responsible for saving/restoring open table
          state were changed to use Open_tables_backup class which in addition
          to Open_table_state has a member for this savepoint. As result code
          opening/closing system tables was changed to use Open_tables_backup
          instead of Open_table_state class as well.
        close_performance_schema_table():
          Got rid of duplicated code.
      sql/sql_class.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. Also releasing
        metadata lock on system table is now responsibility of
        THD::restore_backup_open_tables_state().
        Adjusted assert in THD::cleanup() to take into account fact that now
        we also use MDL sentinel for global read lock.
      sql/sql_class.h:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. As result:
        - 'mdl_context' member was moved out of Open_tables_state to THD class.
          enter_locked_tables_mode()/leave_locked_tables_mode() had to follow.
        - Methods of THD responsible for saving/restoring open table state were
          changed to use Open_tables_backup class which in addition to
          Open_table_state has a member for this savepoint.
        Changed Open_table_context class to store MDL_request object for
        global intention exclusive lock acquired when opening tables.
      sql/sql_delete.cc:
        MDL subsystem no longer implicitly acquires global intention exclusive
        metadata lock when per-object exclusive metadata lock is acquired.
        Now this has to be done by explicit calls outside of MDL subsystem.
      sql/sql_help.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
      sql/sql_parse.cc:
        Adjusted assert reload_acl_and_cache() to the fact that global read
        lock now takes full-blown metadata lock.
      sql/sql_plist.h:
        Added support for element counting to I_P_List list template.
        One can use policy classes to specify if such counting is needed
        or not needed for particular list.
      sql/sql_show.cc:
        Instead of using separate MDL_context for opening tables for I_S
        purposes we now create MDL savepoint in the main context before
        opening tables and rollback to this savepoint after closing them.
        To support this and similar change for system tables methods of
        THD responsible for saving/restoring open table state were changed
        to use Open_tables_backup class which in addition to Open_table_state
        has a member for this savepoint. As result code opening/closing tables
        for I_S purposes was changed to use Open_tables_backup instead of
        Open_table_state class as well.
      sql/sql_table.cc:
        mysql_rm_tables_part2():
          Since now global intention exclusive metadata lock is ordinary
          metadata lock we no longer can rely that by releasing MDL locks
          on all tables we will release all locks acquired by this routine.
          So in non-LOCK-TABLES mode we have to release all locks acquired
          explicitly.
        prepare_for_repair(), mysql_alter_table():
          MDL subsystem no longer implicitly acquires global intention
          exclusive metadata lock when per-object exclusive metadata lock
          is acquired. Now this has to be done by explicit calls outside of
          MDL subsystem.
      sql/tztime.cc:
        Instead of using separate MDL_context for opening system tables we now
        create MDL savepoint in the main context before opening such tables
        and rollback to this savepoint after closing them. To support this
        change methods of THD responsible for saving/restoring open table
        state were changed to use Open_tables_backup class which in addition
        to Open_table_state has a member for this savepoint. As result code
        opening/closing system tables was changed to use Open_tables_backup
        instead of Open_table_state class as well.
        Also changed code not to use special mechanism for open system tables
        when it is not really necessary.
      b3f63454
  9. 30 Dec, 2009 1 commit
    • Dmitry Lenev's avatar
      Implementation of simple deadlock detection for metadata locks. · 2579817d
      Dmitry Lenev authored
      This change is supposed to reduce number of ER_LOCK_DEADLOCK
      errors which occur when multi-statement transaction encounters
      conflicting metadata lock in cases when waiting is possible.
      
      The idea is not to fail ER_LOCK_DEADLOCK error immediately when
      we encounter conflicting metadata lock. Instead we release all
      metadata locks acquired by current statement and start to wait
      until conflicting lock go away. To avoid deadlocks we use simple
      empiric which aborts waiting with ER_LOCK_DEADLOCK error if it
      turns out that somebody is waiting for metadata locks owned by
      this transaction.
      
      This patch also fixes bug #46273 "MySQL 5.4.4 new MDL: Bug#989
      is not fully fixed in case of ALTER".
      
      The bug was that concurrent execution of UPDATE or MULTI-UPDATE
      statement as a part of multi-statement transaction that already
      has used table being updated and ALTER TABLE statement might have
      resulted of loss of isolation between this transaction and ALTER
      TABLE statement, which manifested itself as changes performed by
      ALTER TABLE becoming visible in transaction and wrong binary log
      order as a consequence.
      
      This problem occurred when UPDATE or MULTI-UPDATE's wait in
      mysql_lock_tables() call was aborted due to metadata lock
      upgrade performed by concurrent ALTER TABLE. After such abort all
      metadata locks held by transaction were released but transaction
      silently continued to be executed as if nothing has happened.
      
      We solve this problem by changing our code not to release all
      locks in such case. Instead we release only locks which were
      acquired by current statement and then try to reacquire them
      by restarting open/lock tables process. We piggyback on simple
      deadlock detector implementation since this change has to be
      done anyway for it.
      
      mysql-test/include/handler.inc:
        After introduction of basic deadlock detector for metadata locks
        it became necessary to change parts of test for HANDLER statements
        which covered some of scenarios in which ER_LOCK_DEADLOCK error
        was detected in absence of real deadlock (with new deadlock detector
        this no longer happens).
        Also adjusted test to the fact that HANDLER READ for the table no
        longer will be blocked by ALTER TABLE for the same table which awaits
        for metadata lock upgrade (this is due to removal of mysql_lock_abort()
        from wait_while_table_is_used()).
      mysql-test/r/handler_innodb.result:
        After introduction of basic deadlock detector for metadata locks
        it became necessary to change parts of test for HANDLER statements
        which covered some of scenarios in which ER_LOCK_DEADLOCK error
        was detected in absence of real deadlock (with new deadlock detector
        this no longer happens).
        Also adjusted test to the fact that HANDLER READ for the table no
        longer will be blocked by ALTER TABLE for the same table which awaits
        for metadata lock upgrade (this is due to removal of mysql_lock_abort()
        from wait_while_table_is_used()).
      mysql-test/r/handler_myisam.result:
        After introduction of basic deadlock detector for metadata locks
        it became necessary to change parts of test for HANDLER statements
        which covered some of scenarios in which ER_LOCK_DEADLOCK error
        was detected in absence of real deadlock (with new deadlock detector
        this no longer happens).
        Also adjusted test to the fact that HANDLER READ for the table no
        longer will be blocked by ALTER TABLE for the same table which awaits
        for metadata lock upgrade (this is due to removal of mysql_lock_abort()
        from wait_while_table_is_used()).
      mysql-test/r/mdl_sync.result:
        Added test coverage for basic deadlock detection in metadata
        locking subsystem and for bug #46273 "MySQL 5.4.4 new MDL:
        Bug#989 is not fully fixed in case of ALTER".
      mysql-test/r/sp-lock.result:
        Adjusted test coverage for metadata locking for stored routines
        since after introduction of basic deadlock detector for metadata
        locks number of scenarios in which ER_LOCK_DEADLOCK error in
        absence of deadlock has decreased.
      mysql-test/t/mdl_sync.test:
        Added test coverage for basic deadlock detection in metadata
        locking subsystem and for bug #46273 "MySQL 5.4.4 new MDL:
        Bug#989 is not fully fixed in case of ALTER".
      mysql-test/t/sp-lock.test:
        Adjusted test coverage for metadata locking for stored routines
        since after introduction of basic deadlock detector for metadata
        locks number of scenarios in which ER_LOCK_DEADLOCK error in
        absence of deadlock has decreased.
      sql/log_event_old.cc:
        close_tables_for_reopen() now takes one more argument which
        specifies at which point it should stop releasing metadata
        locks acquired by this connection.
      sql/mdl.cc:
        Changed metadata locking subsystem to support basic deadlock detection
        with a help of the following simple empiric -- we assume that there is
        a deadlock if there is a connection which has to wait for a metadata
        lock which is currently acquired by some connection which is itself
        waiting to be able to acquire some shared metadata lock.
        
        To implement this change:
        - Added MDL_context::can_wait_lead_to_deadlock()/_impl() methods
          which allow to find out if there is someone waiting for metadata
          lock which is held by the connection and therefore deadlocks are
          possible if this connection is going to wait for some metadata lock.
          To do this added version of MDL_ticket::has_pending_conflicting_lock()
          method which assumes that its caller already owns LOCK_mdl mutex.
        - Changed MDL_context::wait_for_locks() to use one of the above methods
          to check if somebody is waiting for metadata lock owned by this
          context (and therefore deadlock is possible) and emit ER_LOCK_DEADLOCK
          error in this case. Also now we mark context of connections waiting
          inside of this method by setting MDL_context::m_is_waiting_in_mdl
          member. Thanks to this such connection could be waken up if some
          other connection starts waiting for one of its metadata locks and
          so a deadlock can occur.
        - Adjusted notify_shared_lock() to wake up connections which wait inside
          MDL_context::wait_for_locks() while holding shared metadata lock.
        - Changed MDL_ticket::upgrade_shared_lock_to_exclusive() to add
          temporary ticket for exclusive lock to MDL_lock::waiting queue, so
          request for metadata lock upgrade can be properly detected by our
          empiric.
          Also now this method invokes a callback which forces transactions
          holding shared metadata lock on the table to call MDL_context::
          can_wait_lead_to_deadlock() method even if they don't need any new
          metadata locks. Thanks to this such transactions can detect deadlocks/
          livelocks between MDL and table-level locks.
        
        Also reduced timeouts between calls to notify_shared_lock()
        in MDL_ticket::upgrade_shared_lock_to_exclusive() and
        MDL_context::acquire_exclusive_locks(). This was necessary
        to get rid of call to mysql_lock_abort() in wait_while_table_is_used().
        (Now we instead rely on notify_shared_lock() timely calling
        mysql_lock_abort_for_thread() for the table on which lock
        is being upgraded/acquired).
      sql/mdl.h:
        - Added a version of MDL_ticket::has_pending_conflicting_lock() method
          to be used in situations when caller already has acquired LOCK_mdl
          mutex.
        - Added MDL_context::can_wait_lead_to_deadlock()/_impl() methods
          which allow to find out if there is someone waiting for metadata lock
          which is held by this connection and thus deadlocks are possible if
          this connections will start waiting for some metadata lock.
        - Added MDL_context::m_is_waiting_in_mdl member to mark connections
          waiting in MDL_context::wait_for_locks() method of metadata locking
          subsystem. Added getter method for this private member to make it
          accessible in notify_shared_lock() auxiliary so we can wake-up such
          connections if they hold shared metadata locks.
        - Finally, added mysql_abort_transactions_with_shared_lock() callback
          to be able force transactions which don't need any new metadata
          locks still call MDL_context::can_wait_lead_to_deadlock() and detect
          some of deadlocks between metadata locks and table-level locks.
      sql/mysql_priv.h:
        close_tables_for_reopen() now takes one more argument which
        specifies at which point it should stop releasing metadata
        locks acquired by this connection.
      sql/sql_base.cc:
        Changed approach to metadata locking for multi-statement transactions.
        We no longer fail ER_LOCK_DEADLOCK error immediately when we encounter
        conflicting metadata lock. Instead we release all metadata locks
        acquired by current statement and start to wait until conflicting
        locks to go away by calling MDL_context::wait_for_locks() method.
        To avoid deadlocks the latter implements simple empiric which aborts
        waiting with ER_LOCK_DEADLOCK error if it turns out that somebody
        is waiting for metadata locks owned by this transaction.
        
        To implement the change described above:
        - Introduced Open_table_context::m_start_of_statement_svp member to
          store state of metadata locks at the start of the statement.
        - Changed Open_table_context::request_backoff_action() not to
          fail with ER_LOCK_DEADLOCK immediately if back-off is requested
          due to conflicting metadata lock.
        - Added new argument for close_tables_for_reopen() procedure which
          allows to specify subset of metadata locks to be released.
        - Changed open_tables() not to release all metadata locks acquired
          by current transaction when metadata lock conflict is discovered.
          Instead we release only locks acquired by current statement.
        - Changed open_ltable() and open_and_lock_tables_derived() not to emit
          ER_LOCK_DEADLOCK error when mysql_lock_tables() is aborted in
          multi-statement transaction when somebody tries to acquire exclusive
          metadata lock on the table. Instead we release metadata locks acquired
          by current statement and try to wait until they can be re-acquired.
        - Adjusted tdc_wait_for_old_versions() to check if there is someone
          waiting for one of metadata locks held by this connection and run
          deadlock detection in order to avoid deadlocks in some
          situations.
        - Added mysql_abort_transactions_with_shared_lock() callback which
          allows to force transactions holding shared metadata lock on the
          table to call MDL_context::can_wait_lead_to_deadlock() even if they
          don't need any new metadata locks so they can detect potential
          deadlocks between metadata locking subsystem and table-level locks.
        - Adjusted wait_while_table_is_used() not to set TABLE::version to
          0 as it is now done only when necessary by the above-mentioned
          callback. Also removed unnecessary call to mysql_lock_abort().
          Instead we rely on code performing metadata lock upgrade aborting
          waits on the table-level lock for this table by calling
          mysql_lock_abort_for_thread() (invoked by
          mysql_notify_thread_having_shared_lock()). In future this should
          allow to reduce number of scenarios in which we produce
          ER_LOCK_DEADLOCK error even though no real deadlock exists.
      sql/sql_class.h:
        Introduced Open_table_context::m_start_of_statement_svp member to
        store state of metadata locks at the start of the statement.
        Replaced Open_table_context::m_can_deadlock member with m_has_locks
        member to reflect the fact that we no longer unconditionally emit
        ER_LOCK_DEADLOCK error for transaction having some metadata locks
        when conflicting metadata lock is discovered.
      sql/sql_insert.cc:
        close_tables_for_reopen() now takes one more argument which
        specifies at which point it should stop releasing metadata
        locks acquired by this connection.
      sql/sql_plist.h:
        Made I_P_List_iterator<T, B> usable with const lists.
      sql/sql_show.cc:
        close_tables_for_reopen() now takes one more argument which
        specifies at which point it should stop releasing metadata
        locks acquired by this connection.
      sql/sql_update.cc:
        Changed UPDATE and MULTI-UPDATE code not to release all metadata
        locks when calls to mysql_lock_tables() are aborted. Instead we
        release only locks which are acquired by this statement and then
        try to reacquire them by calling open_tables(). This solves
        bug #46273 "MySQL 5.4.4 new MDL: Bug#989 is not fully fixed in
        case of ALTER".
      2579817d
  10. 22 Dec, 2009 1 commit
    • Konstantin Osipov's avatar
      A prerequisite patch for the fix for Bug#46224 · a2878a39
      Konstantin Osipov authored
      "HANDLER statements within a transaction might lead to deadlocks".
      Introduce a notion of a sentinel to MDL_context. A sentinel
      is a ticket that separates all tickets in the context into two
      groups: before and after it. Currently we can have (and need) only
      one designated sentinel -- it separates all locks taken by LOCK
      TABLE or HANDLER statement, which must survive COMMIT and ROLLBACK
      and all other locks, which must be released at COMMIT or ROLLBACK.
      The tricky part is maintaining the sentinel up to date when
      someone release its corresponding ticket. This can happen, e.g.
      if someone issues DROP TABLE under LOCK TABLES (generally,
      see all calls to release_all_locks_for_name()).
      MDL_context::release_ticket() is modified to take care of it.
      
      ******
      A fix and a test case for Bug#46224 "HANDLER statements within a
      transaction might lead to deadlocks".
      
      An attempt to mix HANDLER SQL statements, which are transaction-
      agnostic, an open multi-statement transaction,
      and DDL against the involved tables (in a concurrent connection) 
      could lead to a deadlock. The deadlock would occur when
      HANDLER OPEN or HANDLER READ would have to wait on a conflicting
      metadata lock. If the connection that issued HANDLER statement
      also had other metadata locks (say, acquired in scope of a 
      transaction), a classical deadlock situation of mutual wait
      could occur.
      
      Incompatible change: entering LOCK TABLES mode automatically
      closes all open HANDLERs in the current connection.
      
      Incompatible change: previously an attempt to wait on a lock
      in a connection that has an open HANDLER statement could wait
      indefinitely/deadlock. After this patch, an error ER_LOCK_DEADLOCK
      is produced.
      
      The idea of the fix is to merge thd->handler_mdl_context
      with the main mdl_context of the connection, used for transactional
      locks. This makes deadlock detection possible, since all waits
      with locks are "visible" and available to analysis in a single
      MDL context of the connection.
      
      Since HANDLER locks and transactional locks have a different life
      cycle -- HANDLERs are explicitly open and closed, and so
      are HANDLER locks, explicitly acquired and released, whereas
      transactional locks "accumulate" till the end of a transaction
      and are released only with COMMIT, ROLLBACK and ROLLBACK TO SAVEPOINT,
      a concept of "sentinel" was introduced to MDL_context.
      All locks, HANDLER and others, reside in the same linked list.
      However, a selected element of the list separates locks with
      different life cycle. HANDLER locks always reside at the
      end of the list, after the sentinel. Transactional locks are
      prepended to the beginning of the list, before the sentinel.
      Thus, ROLLBACK, COMMIT or ROLLBACK TO SAVEPOINT, only
      release those locks that reside before the sentinel. HANDLER locks
      must be released explicitly as part of HANDLER CLOSE statement,
      or an implicit close. 
      The same approach with sentinel
      is also employed for LOCK TABLES locks. Since HANDLER and LOCK TABLES
      statement has never worked together, the implementation is
      made simple and only maintains one sentinel, which is used either
      for HANDLER locks, or for LOCK TABLES locks.
      
      
      mysql-test/include/handler.inc:
        Add test coverage for Bug#46224 "HANDLER statements within a
        transaction might lead to deadlocks".
        Extended HANDLER coverage to cover a mix of HANDLER, transactions
        and DDL statements.
      mysql-test/r/handler_innodb.result:
        Update results (Bug#46224).
      mysql-test/r/handler_myisam.result:
        Update results (Bug#46224).
      sql/lock.cc:
        Remove thd->some_tables_deleted, it's never used.
      sql/log_event.cc:
        No need to check for thd->locked_tables_mode, 
        it's done inside release_transactional_locks().
      sql/mdl.cc:
        Implement the concept of HANDLER and LOCK TABLES "sentinel".
        Implement a method to clone an acquired ticket.
        Do not return tickets beyond the sentinel when acquiring
        locks, create a copy.
        Remove methods to merge and backup MDL_context, they are now
        not used (Hurra!). This opens a path to a proper constructor
        and destructor of class MDL_context (to be done in a separate
        patch).
        Modify find_ticket() to provide information about where
        the ticket position is with regard to the sentinel.
      sql/mdl.h:
        Add declarations necessary for the implementation of the concept
        of "sentinel", a dedicated ticket separating transactional and
        non-transactional locks.
      sql/mysql_priv.h:
        Add mark_tmp_table_for_reuse() declaration, 
        a function to "close" a single session (temporary) table.
      sql/sql_base.cc:
        Remove thd->some_tables_deleted.
        Modify deadlock-prevention asserts and deadlock detection
        heuristics to take into account that from now on HANDLER locks
        reside in the same locking context.
        Add broadcast_refresh() to mysql_notify_thread_having_shared_lock():
        this is necessary for the case when a thread having a shared lock
        is asleep in tdc_wait_for_old_versions(). This situation is only
        possible with HANDLER t1 OPEN; FLUSH TABLE (since all over code paths
        that lead to tdc_wait_for_old_versions() always have an
        empty MDL_context). Previously the server would simply deadlock
        in this situation.
      sql/sql_class.cc:
        Remove now unused member "THD::some_tables_deleted". 
        Move mysql_ha_cleanup() a few lines above in THD::cleanup() 
        to make sure that all handlers are closed when it's time to 
        destroy the MDL_context of this connection.
        Remove handler_mdl_context and handler_tables.
      sql/sql_class.h:
        Remove THD::handler_tables, THD::handler_mdl_context,
        THD::some_tables_deleted.
      sql/sql_handler.cc:
        Remove thd->handler_tables.
        Remove thd->handler_mdl_context.
        Rewrite mysql_ha_open() to have no special provision for MERGE
        tables, now that we don't have to manipulate with thd->handler_tables
        it's easy to do.
        Remove dead code.
        Fix a bug in mysql_ha_flush() when we would always flush
        a temporary HANDLER when mysql_ha_flush() is called (actually
        mysql_ha_flush() never needs to flush temporary tables).
      sql/sql_insert.cc:
        Update a comment, no more thd->some_tables_deleted.
      sql/sql_parse.cc:
        Implement an incompatible change: entering LOCK TABLES closes
        active HANDLERs, if any.
        Now that we have a sentinel, we don't need to check
        for thd->locked_tables_mode when releasing metadata locks in
        COMMIT/ROLLBACK.
      sql/sql_plist.h:
        Add new (now necessary) methods to the list class.
      sql/sql_prepare.cc:
        Make sure we don't release HANDLER locks when rollback to a
        savepoint, set to not keep locks taken at PREPARE.
      sql/sql_servers.cc:
        Update to a new signature of MDL_context::release_all_locks().
      sql/sql_table.cc:
        Remove thd->some_tables_deleted.
      sql/transaction.cc:
        Add comments. 
        Make sure rollback to (MDL) savepoint works under LOCK TABLES and
        with HANDLER tables.
      a2878a39
  11. 30 Nov, 2009 1 commit
    • Konstantin Osipov's avatar
      Initial import of WL#3726 "DDL locking for all metadata objects". · e3b03d5d
      Konstantin Osipov authored
      Backport of:
      ------------------------------------------------------------
      revno: 2630.4.1
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-3726-w
      timestamp: Fri 2008-05-23 17:54:03 +0400
      message:
        WL#3726 "DDL locking for all metadata objects".
      
        After review fixes in progress.
      ------------------------------------------------------------
      
      This is the first patch in series. It transforms the metadata 
      locking subsystem to use a dedicated module (mdl.h,cc). No 
      significant changes in the locking protocol. 
      The import passes the test suite with the exception of 
      deprecated/removed 6.0 features, and MERGE tables. The latter
      are subject to a fix by WL#4144.
      Unfortunately, the original changeset comments got lost in a merge,
      thus this import has its own (largely insufficient) comments.
      
      This patch fixes Bug#25144 "replication / binlog with view breaks".
      Warning: this patch introduces an incompatible change:
      Under LOCK TABLES, it's no longer possible to FLUSH a table that 
      was not locked for WRITE.
      Under LOCK TABLES, it's no longer possible to DROP a table or
      VIEW that was not locked for WRITE.
      
      ******
      Backport of:
      ------------------------------------------------------------
      revno: 2630.4.2
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-3726-w
      timestamp: Sat 2008-05-24 14:03:45 +0400
      message:
        WL#3726 "DDL locking for all metadata objects".
      
        After review fixes in progress.
      
      ******
      Backport of:
      ------------------------------------------------------------
      revno: 2630.4.3
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-3726-w
      timestamp: Sat 2008-05-24 14:08:51 +0400
      message:
        WL#3726 "DDL locking for all metadata objects"
      
        Fixed failing Windows builds by adding mdl.cc to the lists
        of files needed to build server/libmysqld on Windows.
      
      ******
      Backport of:
      ------------------------------------------------------------
      revno: 2630.4.4
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-3726-w
      timestamp: Sat 2008-05-24 21:57:58 +0400
      message:
        WL#3726 "DDL locking for all metadata objects".
      
        Fix for assert failures in kill.test which occured when one
        tried to kill ALTER TABLE statement on merge table while it
        was waiting in wait_while_table_is_used() for other connections
        to close this table.
      
        These assert failures stemmed from the fact that cleanup code
        in this case assumed that temporary table representing new
        version of table was open with adding to THD::temporary_tables
        list while code which were opening this temporary table wasn't
        always fulfilling this.
      
        This patch changes code that opens new version of table to
        always do this linking in. It also streamlines cleanup process
        for cases when error occurs while we have new version of table
        open.
      
      ******
      WL#3726 "DDL locking for all metadata objects"
      Add libmysqld/mdl.cc to .bzrignore.
      ******
      Backport of:
      ------------------------------------------------------------
      revno: 2630.4.6
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-3726-w
      timestamp: Sun 2008-05-25 00:33:22 +0400
      message:
        WL#3726 "DDL locking for all metadata objects".
      
        Addition to the fix of assert failures in kill.test caused by
        changes for this worklog.
      
      
      Make sure we close the new table only once.
      
      .bzrignore:
        Add libmysqld/mdl.cc
      libmysqld/CMakeLists.txt:
        Added mdl.cc to the list of files needed for building of libmysqld.
      libmysqld/Makefile.am:
        Added files implementing new meta-data locking subsystem to the server.
      mysql-test/include/handler.inc:
        Use separate connection for waiting while threads performing DDL
        operations conflicting with open HANDLER tables reach blocked
        state. This is required because now we check and close tables open
        by HANDLER statements in this connection conflicting with DDL in
        another each time open_tables() is called and thus select from I_S
        which is used for waiting will unblock DDL operations if issued
        from connection with open HANDLERs.
      mysql-test/r/create.result:
        Adjusted test case after change in implementation of CREATE TABLE
        ... SELECT.  We no longer have special check in open_table() which
        catches the case when we select from the table created. Instead we
        rely on unique_table() call which happens after opening and
        locking all tables.
      mysql-test/r/flush.result:
        FLUSH TABLES WITH READ LOCK can no longer happen under LOCK
        TABLES.  Updated test accordingly.
      mysql-test/r/flush_table.result:
        Under LOCK TABLES we no longer allow to do FLUSH TABLES for tables
        locked for read. Updated test accordingly.
      mysql-test/r/handler_innodb.result:
        Use separate connection for waiting while threads performing DDL
        operations conflicting with open HANDLER tables reach blocked
        state. This is required because now we check and close tables open
        by HANDLER statements in this connection conflicting with DDL in
        another each time open_tables() is called and thus select from I_S
        which is used for waiting will unblock DDL operations if issued
        from connection with open HANDLERs.
      mysql-test/r/handler_myisam.result:
        Use separate connection for waiting while threads performing DDL
        operations conflicting with open HANDLER tables reach blocked
        state. This is required because now we check and close tables open
        by HANDLER statements in this connection conflicting with DDL in
        another each time open_tables() is called and thus select from I_S
        which is used for waiting will unblock DDL operations if issued
        from connection with open HANDLERs.
      mysql-test/r/information_schema.result:
        Additional test for WL#3726 "DDL locking for all metadata
        objects".  Check that we use high-priority metadata lock requests
        when filling I_S tables.
        
        Rearrange tests to match 6.0 better (fewer merge conflicts).
      mysql-test/r/kill.result:
        Added tests checking that DDL and DML statements waiting for
        metadata locks can be interrupted by KILL command.
      mysql-test/r/lock.result:
        One no longer is allowed to do DROP VIEW under LOCK TABLES even if
        this view is locked by LOCK TABLES. The problem is that in such
        situation write locks on view are not mutually exclusive so
        upgrading metadata lock which is required for dropping of view
        will lead to deadlock.
      mysql-test/r/partition_column_prune.result:
        Update results (same results in 6.0), WL#3726
      mysql-test/r/partition_pruning.result:
        Update results (same results in 6.0), WL#3726
      mysql-test/r/ps_ddl.result:
        We no longer invalidate prepared CREATE TABLE ... SELECT statement
        if target table changes. This is OK since it is not strictly
        necessary.
        
        
        The first change is wrong, is caused by FLUSH TABLE
        now flushing all unused tables. This is a regression that
        Dmitri fixed in 6.0 in a follow up patch.
      mysql-test/r/sp.result:
        Under LOCK TABLES we no longer allow accessing views which were
        not explicitly locked. To access view we need to obtain metadata
        lock on it and doing this under LOCK TABLES may lead to deadlocks.
      mysql-test/r/view.result:
        One no longer is allowed to do DROP VIEW under LOCK TABLES even if
        this view is locked by LOCK TABLES. The problem is that in such
        situation even "write locks" on view are not mutually exclusive so
        upgrading metadata lock which is required for dropping of view
        will lead to deadlock
      mysql-test/r/view_grant.result:
        ALTER VIEW implementation was changed to open a view only after
        checking that user which does alter has appropriate privileges on
        it. This means that in case when user's privileges are
        insufficient for this we won't check that new view definer is the
        same as original one or user performing alter has SUPER privilege.
        Adjusted test case accordingly.
      mysql-test/r/view_multi.result:
        Added test case for bug#25144 "replication / binlog with view
        breaks".
      mysql-test/suite/rpl/t/disabled.def:
        Disable test for deprecated features (they don't work with new MDL).
      mysql-test/t/create.test:
        Adjusted test case after change in implementation of CREATE TABLE
        ... SELECT.  We no longer have special check in open_table() which
        catches the case when we select from the table created. Instead we
        rely on unique_table() call which happens after opening and
        locking all tables.
      mysql-test/t/disabled.def:
        Disable merge.test, subject of WL#4144
      mysql-test/t/flush.test:
        
        FLUSH TABLES WITH READ LOCK can no longer happen under LOCK
        TABLES.  Updated test accordingly.
      mysql-test/t/flush_table.test:
        Under LOCK TABLES we no longer allow to do FLUSH TABLES for tables
        locked for read. Updated test accordingly.
      mysql-test/t/information_schema.test:
        Additional test for WL#3726 "DDL locking for all metadata
        objects".  Check that we use high-priority metadata lock requests
        when filling I_S tables.
        
        Rearrange the results for easier merges with 6.0.
      mysql-test/t/kill.test:
        Added tests checking that DDL and DML statements waiting for
        metadata locks can be interrupted by KILL command.
      mysql-test/t/lock.test:
        One no longer is allowed to do DROP VIEW under LOCK TABLES even if
        this view is locked by LOCK TABLES. The problem is that in such
        situation write locks on view are not mutually exclusive so
        upgrading metadata lock which is required for dropping of view
        will lead to deadlock.
      mysql-test/t/lock_multi.test:
        Adjusted test case to the changes of status in various places
        caused by change in implementation FLUSH TABLES WITH READ LOCK,
        which is now takes global metadata lock before flushing tables and
        therefore waits on at these places.
      mysql-test/t/ps_ddl.test:
        We no longer invalidate prepared CREATE TABLE ... SELECT statement
        if target table changes. This is OK since it is not strictly
        necessary.
        
        
        The first change is wrong, is caused by FLUSH TABLE
        now flushing all unused tables. This is a regression that
        Dmitri fixed in 6.0 in a follow up patch.
      mysql-test/t/sp.test:
        Under LOCK TABLES we no longer allow accessing views which were
        not explicitly locked. To access view we need to obtain metadata
        lock on it and doing this under LOCK TABLES may lead to deadlocks.
      mysql-test/t/trigger_notembedded.test:
        Adjusted test case to the changes of status in various places
        caused by change in implementation FLUSH TABLES WITH READ LOCK,
        which is now takes global metadata lock before flushing tables and
        therefore waits on at these places.
      mysql-test/t/view.test:
        One no longer is allowed to do DROP VIEW under LOCK TABLES even if
        this view is locked by LOCK TABLES. The problem is that in such
        situation even "write locks" on view are not mutually exclusive so
        upgrading metadata lock which is required for dropping of view
        will lead to deadlock.
      mysql-test/t/view_grant.test:
        ALTER VIEW implementation was changed to open a view only after
        checking that user which does alter has appropriate privileges on
        it. This means that in case when user's privileges are
        insufficient for this we won't check that new view definer is the
        same as original one or user performing alter has SUPER privilege.
        Adjusted test case accordingly.
      mysql-test/t/view_multi.test:
        Added test case for bug#25144 "replication / binlog with view
        breaks".
      sql/CMakeLists.txt:
        Added mdl.cc to the list of files needed for building of server.
      sql/Makefile.am:
        Added files implementing new meta-data locking subsystem to the
        server.
      sql/event_db_repository.cc:
        
        Allocate metadata lock requests objects (MDL_LOCK) on execution
        memory root in cases when TABLE_LIST objects is also allocated
        there or on stack.
      sql/ha_ndbcluster.cc:
        Adjusted code to work nicely with new metadata locking subsystem.
        close_cached_tables() no longer has wait_for_placeholder argument.
        Instead of relying on this parameter and related behavior FLUSH
        TABLES WITH READ LOCK now takes global shared metadata lock.
      sql/ha_ndbcluster_binlog.cc:
        Adjusted code to work with new metadata locking subsystem.
        close_cached_tables() no longer has wait_for_placeholder argument.
        Instead of relying on this parameter and related behavior FLUSH
        TABLES WITH READ LOCK now takes global shared metadata lock.
      sql/handler.cc:
        update_frm_version():
          Directly update TABLE_SHARE::mysql_version member instead of
          going through all TABLE instances for this table (old code was a
          legacy from pre-table-definition-cache days).
      sql/lock.cc:
        Use new metadata locking subsystem. Threw away most of functions
        related to name locking as now one is supposed to use metadata
        locking API instead.  In lock_global_read_lock() and
        unlock_global_read_lock() in order to avoid problems with global
        read lock sneaking in at the moment when we perform FLUSH TABLES
        or ALTER TABLE under LOCK TABLES and when tables being reopened
        are protected only by metadata locks we also have to take global
        shared meta data lock.
      sql/log_event.cc:
        Adjusted code to work with new metadata locking subsystem.  For
        tables open by slave thread for applying RBR events allocate
        memory for lock request object in the same chunk of memory as
        TABLE_LIST objects for them. In order to ensure that we keep these
        objects around until tables are open always close tables before
        calling Relay_log_info::clear_tables_to_lock(). Use new auxiliary
        Relay_log_info::slave_close_thread_tables() method to enforce
        this.
      sql/log_event_old.cc:
        Adjusted code to work with new metadata locking subsystem.  Since
        for tables open by slave thread for applying RBR events memory for
        lock request object is allocated in the same chunk of memory as
        TABLE_LIST objects for them we have to ensure that we keep these
        objects around until tables are open. To ensure this we always
        close tables before calling
        Relay_log_info::clear_tables_to_lock(). To enfore this we use
        new auxiliary Relay_log_info::slave_close_thread_tables()
        method.
      sql/mdl.cc:
        Implemented new metadata locking subsystem and API described in
        WL3726 "DDL locking for all metadata objects".
      sql/mdl.h:
        Implemented new metadata locking subsystem and API described in
        WL3726 "DDL locking for all metadata objects".
      sql/mysql_priv.h:
        - close_thread_tables()/close_tables_for_reopen() now has one more
          argument which indicates that metadata locks should be released
          but not removed from the context in order to be used later in
          mdl_wait_for_locks() and tdc_wait_for_old_version().
        - close_cached_table() routine is no longer public.
        - Thread waiting in wait_while_table_is_used() can be now killed
          so this function returns boolean to make caller aware of such
          situation.
        - We no longer have  table cache as separate entity instead used
          and unused TABLE instances are linked to TABLE_SHARE objects in
          table definition cache.
        - Now third argument of open_table() is also used for requesting
          table repair or auto-discovery of table's new definition. So its
          type was changed from bool to enum.
        - Added tdc_open_view() function for opening view by getting its
          definition from disk (and table cache in future).
        - reopen_name_locked_table() no longer needs "link_in" argument as
          now we have exclusive metadata locks instead of dummy TABLE
          instances when this function is called.
        - find_locked_table() now takes head of list of TABLE instances
          instead of always scanning through THD::open_tables list. Also
          added find_write_locked_table() auxiliary.
        - reopen_tables(), close_cached_tables() no longer have
          mark_share_as_old and wait_for_placeholder arguments. Instead of
          relying on this parameters and related behavior FLUSH TABLES
          WITH READ LOCK now takes global shared metadata lock.
        - We no longer need drop_locked_tables() and
          abort_locked_tables().
        - mysql_ha_rm_tables() now always assume that LOCK_open is not
          acquired by caller.
        - Added notify_thread_having_shared_lock() callback invoked by
          metadata locking subsystem when acquiring an exclusive lock, for
          each thread that has a conflicting shared metadata lock.
        - Introduced expel_table_from_cache() as replacement for
          remove_table_from_cache() (the main difference is that this new
          function assumes that caller follows metadata locking protocol
          and never waits).
        - Threw away most of functions related to name locking. One should
          use new metadata locking subsystem and API instead.
      sql/mysqld.cc:
        Got rid of call initializing/deinitializing table cache since now
        it is embedded into table definition cache. Added calls for
        initializing/ deinitializing metadata locking subsystem.
      sql/rpl_rli.cc:
        Introduced auxiliary Relay_log_info::slave_close_thread_tables()
        method which is used for enforcing that we always close tables
        open for RBR before deallocating TABLE_LIST elements and MDL_LOCK
        objects for them.
      sql/rpl_rli.h:
        Introduced auxiliary Relay_log_info::slave_close_thread_tables()
        method which is used for enforcing that we always close tables
        open for RBR before deallocating TABLE_LIST elements and MDL_LOCK
        objects for them.
      sql/set_var.cc:
        close_cached_tables() no longer has wait_for_placeholder argument.
        Instead of relying on this parameter and related behavior FLUSH
        TABLES WITH READ LOCK now takes global shared metadata lock.
      sql/sp_head.cc:
        For tables added to the statement's table list by prelocking
        algorithm we allocate these objects either on the same memory as
        corresponding table list elements or on THD::locked_tables_root
        (if we are building table list for LOCK TABLES).
      sql/sql_acl.cc:
        Allocate metadata lock requests objects (MDL_LOCK) on execution
        memory root in cases when we use stack TABLE_LIST objects to open
        tables.  Got rid of redundant code by using unlock_locked_tables()
        function.
      sql/sql_base.cc:
        Changed code to use new MDL subsystem. Got rid of separate table
        cache.  Now used and unused TABLE instances are linked to the
        TABLE_SHAREs in table definition cache.
        
        check_unused():
          Adjusted code to the fact that we no longer have separate table
          cache.  Removed dead code.
        table_def_free():
          Free TABLE instances referenced from TABLE_SHARE objects before
          destroying table definition cache.
        get_table_share():
          Added assert which ensures that noone will be able to access
          table (and its share) without acquiring some kind of metadata
          lock first.
        close_handle_and_leave_table_as_lock():
          Adjusted code to the fact that TABLE instances now are linked to
          list in TABLE_SHARE.
        list_open_tables():
          Changed this function to use table definition cache instead of
          table cache.
        free_cache_entry():
          Unlink freed TABLE elements from the list of all TABLE instances
          for the table in TABLE_SHARE.
        kill_delayed_thread_for_table():
          Added auxiliary for killing delayed insert threads for
          particular table.
        close_cached_tables():
          Got rid of wait_for_refresh argument as we now rely on global
          shared metadata lock to prevent FLUSH WITH READ LOCK sneaking in
          when we are reopening tables. Heavily reworked this function to
          use new MDL code and not to rely on separate table cache entity.
        close_open_tables():
          We no longer have separate table cache.
        close_thread_tables():
          Release metadata locks after closing all tables. Added skip_mdl
          argument which allows us not to remove metadata lock requests
          from the context in case when we are going to use this requests
          later in mdl_wait_for_locks() and tdc_wait_for_old_versions().
        close_thread_table()/close_table_for_reopen():
          Since we no longer have separate table cache and all TABLE
          instances are linked to TABLE_SHARE objects in table definition
          cache we have to link/unlink TABLE object to/from appropriate
          lists in the share.
        name_lock_locked_table():
         Moved redundant code to find_write_locked_table() function and
          adjusted code to the fact that wait_while_table_is_used() can
          now return with an error if our thread is killed.
        reopen_table_entry():
          We no longer need "link_in" argument as with MDL we no longer
          call this function with dummy TABLE object pre-allocated and
          added to the THD::open_tables. Also now we add newly-open TABLE
          instance to the list of share's used TABLE instances.
        table_cache_insert_placeholder():
          Got rid of name-locking legacy.
        lock_table_name_if_not_cached():
          Moved to sql_table.cc the only place where it is used. It was
          also reimplemented using new MDL API.
        open_table():
          - Reworked this function to use new MDL subsystem.
          - Changed code to deal with table definition cache directly
            instead of going through separate table cache.
          - Now third argument is also used for requesting table repair
            or auto-discovery of table's new definition. So its type was
            changed from bool to enum.
        find_locked_table()/find_write_locked_table():
          Accept head of list of TABLE objects as first argument and use
          this list instead of always searching in THD::open_tables list.
          Also added auxiliary for finding write-locked locked tables.
        reopen_table():
          Adjusted function to work with new MDL subsystem and to properly
          manuipulate with lists of used/unused TABLE instaces in
          TABLE_SHARE.
        reopen_tables():
          Removed mark_share_as_old parameter. Instead of relying on it
          and related behavior FLUSH TABLES WITH READ LOCK now takes
          global shared metadata lock. Changed code after removing
          separate table cache.
        drop_locked_tables()/abort_locked_tables():
          Got rid of functions which are no longer needed.
          unlock_locked_tables():
          Moved this function from sql_parse.cc and changed it to release
          memory which was used for allocating metadata lock requests for
          tables open and locked by LOCK TABLES.
        tdc_open_view():
          Intoduced function for opening a view by getting its definition
          from disk (and table cache in future).
        reopen_table_entry():
          Introduced function for opening table definitions while holding
          exclusive metatadata lock on it.
        open_unireg_entry():
         Got rid of this function. Most of its functionality is relocated
          to open_table() and open_table_fini() functions, and some of it
          to reopen_table_entry() and tdc_open_view(). Also code
          resposible for auto-repair and auto-discovery of tables was
          moved to separate function.
        open_table_entry_fini():
          Introduced function which contains common actions which finalize
          process of TABLE object creation.
        auto_repair_table():
          Moved code responsible for auto-repair of table being opened
          here.
        handle_failed_open_table_attempt()
          Moved code responsible for handling failing attempt to open
          table to one place (retry due to lock conflict/old version,
          auto-discovery and repair).
        open_tables():
          - Flush open HANDLER tables if they have old version of if there
            is conflicting metadata lock against them (before this moment
            we had this code in open_table()).
          - When we open view which should be processed via derived table
            on the second execution of prepared statement or stored
            routine we still should call open_table() for it in order to
            obtain metadata lock on it and prepare its security context.
          - In cases when we discover that some special handling of
            failure to open table is needed call
            handle_failed_open_table_attempt() which handles all such
            scenarios.
        open_ltable():
          Handling of various special scenarios of failure to open a table
          was moved to separate handle_failed_open_table_attempt()
          function.
        remove_db_from_cache():
          Removed this function as it is no longer used.
        notify_thread_having_shared_lock():
          Added callback which is invoked by MDL subsystem when acquiring
          an exclusive lock, for each thread that has a conflicting shared
          metadata lock.
        expel_table_from_cache():
          Introduced function for removing unused TABLE instances. Unlike
          remove_table_from_cache() it relies on caller following MDL
          protocol and having appropriate locks when calling it and thus
          does not do any waiting if table is still in use.
        tdc_wait_for_old_version():
          Added function which allows open_tables() to wait in cases when
          we discover that we should back-off due to presence of old
          version of table.
        abort_and_upgrade_lock():
          Use new MDL calls.
        mysql_wait_completed_table():
          Got rid of unused function.
        open_system_tables_for_read/for_update()/performance_schema_table():
          Allocate MDL_LOCK objects on execution memory root in cases when
          TABLE_LIST objects for corresponding tables is allocated on
          stack.
        close_performance_schema_table():
          Release metadata locks after closing tables.
        ******
        Use I_P_List for free/used tables list in the table share.
      sql/sql_binlog.cc:
        Use Relay_log_info::slave_close_thread_tables() method to enforce
        that we always close tables open for RBR before deallocating
        TABLE_LIST elements and MDL_LOCK objects for them.
      sql/sql_class.cc:
        Added meta-data locking contexts as part of Open_tables_state
        context.  Also introduced THD::locked_tables_root memory root
        which is to be used for allocating MDL_LOCK objects for tables in
        LOCK TABLES statement (end of lifetime for such objects is UNLOCK
        TABLES so we can't use statement or execution root for them).
      sql/sql_class.h:
        Added meta-data locking contexts as part of Open_tables_state
        context.  Also introduced THD::locked_tables_root memory root
        which is to be used for allocating MDL_LOCK objects for tables in
        LOCK TABLES statement (end of lifetime for such objects is UNLOCK
        TABLES so we can't use statement or execution root for them).
        
        Note: handler_mdl_context and locked_tables_root and
        mdl_el_root will be removed by subsequent patches.
      sql/sql_db.cc:
        mysql_rm_db() does not really need to call remove_db_from_cache()
        as it drops each table in the database using
        mysql_rm_table_part2(), which performs all necessary operations on
        table (definition) cache.
      sql/sql_delete.cc:
        Use the new metadata locking API for TRUNCATE.
      sql/sql_handler.cc:
        Changed HANDLER implementation to use new metadata locking
        subsystem.  Note that MDL_LOCK objects for HANDLER tables are
        allocated in the same chunk of heap memory as TABLE_LIST object
        for those tables.
      sql/sql_insert.cc:
        mysql_insert():
          find_locked_table() now takes head of list of TABLE object as
          its argument instead of always scanning through THD::open_tables
          list.
        handle_delayed_insert():
          Allocate metadata lock request object for table open by delayed
          insert thread on execution memroot.  create_table_from_items():
          We no longer allocate dummy TABLE objects for tables being
          created if they don't exist. As consequence
          reopen_name_locked_table() no longer has link_in argument.
          open_table() now has one more argument which is not relevant for
          temporary tables.
      sql/sql_parse.cc:
        - Moved unlock_locked_tables() routine to sql_base.cc and made
          available it in other files. Got rid of some redundant code by
          using this function.
        - Replaced boolean TABLE_LIST::create member with enum
          open_table_type member.
        - Use special memory root for allocating MDL_LOCK objects for
          tables open and locked by LOCK TABLES (these object should live
          till UNLOCK TABLES so we can't allocate them on statement nor
          execution memory root). Also properly set metadata lock
          upgradability attribure for those tables.
        - Under LOCK TABLES it is no longer allowed to flush tables which
          are not write-locked as this breaks metadata locking protocol
          and thus potentially might lead to deadlock.
        - Added auxiliary adjust_mdl_locks_upgradability() function.
      sql/sql_partition.cc:
        Adjusted code to the fact that reopen_tables() no longer has
        "mark_share_as_old" argument. Got rid of comments which are no
        longer true.
      sql/sql_plist.h:
        Added I_P_List template class for parametrized intrusive doubly
        linked lists and I_P_List_iterator for corresponding iterator.
        Unlike for I_List<> list elements of such list can participate in
        several lists. Unlike List<> such lists are doubly-linked and
        intrusive.
      sql/sql_plugin.cc:
        Allocate metadata lock requests objects (MDL_LOCK) on execution
        memory root in cases when we use stack TABLE_LIST objects to open
        tables.
      sql/sql_prepare.cc:
        Replaced boolean TABLE_LIST::create member with enum
        open_table_type member.  This allows easily handle situation in
        which instead of opening the table we want only to take exclusive
        metadata lock on it.
      sql/sql_rename.cc:
        Use new metadata locking subsystem in implementation of RENAME
        TABLE.
      sql/sql_servers.cc:
        Allocate metadata lock requests objects (MDL_LOCK) on execution
        memory root in cases when we use stack TABLE_LIST objects to open
        tables. Got rid of redundant code by using unlock_locked_tables()
        function.
      sql/sql_show.cc:
        Acquire shared metadata lock when we are getting information for
        I_S table directly from TABLE_SHARE without doing full-blown table
        open.  We use high priority lock request in this situation in
        order to avoid deadlocks.
        Also allocate metadata lock requests objects (MDL_LOCK) on
        execution memory root in cases when TABLE_LIST objects are also
        allocated there
      sql/sql_table.cc:
        mysql_rm_table():
          Removed comment which is no longer relevant.
        mysql_rm_table_part2():
          Now caller of mysql_ha_rm_tables() should not own LOCK_open.
          Adjusted code to use new metadata locking subsystem instead of
          name-locks.
        lock_table_name_if_not_cached():
          Moved this function from sql_base.cc to this file and
          reimplemented it using metadata locking API.
        mysql_create_table():
          Adjusted code to use new MDL API.
        wait_while_table_is_used():
          Changed function to use new MDL subsystem. Made thread waiting
          in it killable (this also led to introduction of return value so
          caller can distinguish successful executions from situations
          when waiting was aborted).
        close_cached_tables():
          Thread waiting in this function is killable now. As result it
          has return value for distinguishing between succes and failure.
          Got rid of redundant boradcast_refresh() call.
        prepare_for_repair():
          Use MDL subsystem instead of name-locks.
        mysql_admin_table():
          mysql_ha_rm_tables() now always assumes that caller doesn't own
          LOCK_open.
        mysql_repair_table():
          We should mark all elements of table list as requiring
          upgradable metadata locks.
        mysql_create_table_like():
          Use new MDL subsystem instead of name-locks.
        create_temporary_tables():
          We don't need to obtain metadata locks when creating temporary
          table.
        mysql_fast_or_online_alter_table():
          Thread waiting in wait_while_table_is_used() is now killable.
        mysql_alter_table():
          Adjusted code to work with new MDL subsystem and to the fact
          that threads waiting in what_while_table_is_used() and
          close_cached_table() are now killable.
      sql/sql_test.cc:
        We no longer have separate table cache. TABLE instances are now
        associated with/linked to TABLE_SHARE objects in table definition
        cache.
      sql/sql_trigger.cc:
        Adjusted code to work with new metadata locking subsystem.  Also
        reopen_tables() no longer has mark_share_as_old argument (Instead
        of relying on this parameter and related behavior FLUSH TABLES
        WITH READ LOCK now takes global shared metadata lock).
      sql/sql_udf.cc:
        Allocate metadata lock requests objects (MDL_LOCK) on execution
        memory root in cases when we use stack TABLE_LIST objects to open
        tables.
      sql/sql_update.cc:
        Adjusted code to work with new meta-data locking subsystem.
      sql/sql_view.cc:
        Added proper meta-data locking to implementations of
        CREATE/ALTER/DROP VIEW statements. Now we obtain exclusive
        meta-data lock on a view before creating/ changing/dropping it.
        This ensures that all concurrent statements that use this view
        will finish before our statement will proceed and therefore we
        will get correct order of statements in the binary log.
        Also ensure that TABLE_LIST::mdl_upgradable attribute is properly
        propagated for underlying tables of view.
      sql/table.cc:
        Added auxiliary alloc_mdl_locks() function for allocating metadata
        lock request objects for all elements of table list.
      sql/table.h:
        TABLE_SHARE:
          Got rid of unused members. Introduced members for storing lists
          of used and unused TABLE objects for this share.
        TABLE:
          Added members for linking TABLE objects into per-share lists of
          used and unused TABLE instances. Added member for holding
          pointer to metadata lock for this table.
        TABLE_LIST:
          Replaced boolean TABLE_LIST::create member with enum
          open_table_type member.  This allows easily handle situation in
          which instead of opening the table we want only to take
          exclusive meta-data lock on it (we need this in order to handle
          ALTER VIEW and CREATE VIEW statements).
          Introduced new mdl_upgradable member for marking elements of
          table list for which we need to take upgradable shared metadata
          lock instead of plain shared metadata lock.  Added pointer for
          holding pointer to MDL_LOCK for the table.
        Added auxiliary alloc_mdl_locks() function for allocating metadata
        lock requests objects for all elements of table list.  Added
        auxiliary set_all_mdl_upgradable() function for marking all
        elements in table list as requiring upgradable metadata locks.
      storage/myisammrg/ha_myisammrg.cc:
        Allocate MDL_LOCK objects for underlying tables of MERGE table.
        To be reworked once Ingo pushes his patch for WL4144.
      e3b03d5d
  12. 24 Jun, 2009 1 commit
    • MySQL Build Team's avatar
      Backport into build-200906240007-5.1.34sp1 · 6313e5a4
      MySQL Build Team authored
      > ------------------------------------------------------------
      > revno: 2857.1.8
      > revision-id: sergey.glukhov@sun.com-20090417084627-yvt63k51vvvjbx9j
      > parent: anurag.shekhar@sun.com-20090417055354-7vw80v1rwn0z1tt4
      > parent: sergey.glukhov@sun.com-20090417074115-dv9h5ijalj2hgq3r
      > committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
      > branch nick: mysql-5.1-bugteam
      > timestamp: Fri 2009-04-17 13:46:27 +0500
      > message:
      >   5.0-bugteam->5.1-bugteam merge
      >     ------------------------------------------------------------
      >     revno: 1810.3882.12
      >     revision-id: sergey.glukhov@sun.com-20090417074115-dv9h5ijalj2hgq3r
      >     parent: patrick.crews@sun.com-20090416174744-u9fxu6ophud91a1h
      >     committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
      >     branch nick: mysql-5.0-bugteam
      >     timestamp: Fri 2009-04-17 12:41:15 +0500
      >     message:
      >       Bug#44151 using handler commands on information_schema tables crashes server
      >       information schema tables are based on internal tmp tables which are removed
      >       after each statement execution. So HANDLER comands can not be used with
      >       information schema.
      6313e5a4
  13. 15 May, 2009 1 commit
    • Matthias Leich's avatar
      Fix for Bug#42308 Several server tests do not pass MTR's --check option · ccfd6971
      Matthias Leich authored
      Details:
      Most tests mentioned within the bug report were already fixed.
      The test modified here failed in stability (high parallel load) tests.
      
      Details:
      1. Take care that disconnects are finished before the test terminates.
      2. Correct wrong handling of send/reap in events_stress which caused
         random garbled output
      3. Minor beautifying of script code
      ccfd6971
  14. 25 Feb, 2009 1 commit
  15. 20 Nov, 2007 1 commit
    • unknown's avatar
      Bug#31397 Inconsistent drop table behavior of handler tables. · 4da1da96
      unknown authored
      The problem is that DROP TABLE and other DDL statements failed to
      automatically close handlers associated with tables that were marked
      for reopen (FLUSH TABLES).
      
      The current implementation fails to properly discard handlers of
      dropped tables (that were marked for reopen) because it searches
      on the open handler tables list and using the current alias of the
      table being dropped. The problem is that it must not use the open
      handler tables list to search because the table might have been
      closed (marked for reopen) by a flush tables command and also it
      must not use the current table alias at all since multiple different
      aliases may be associated with a single table. This is specially
      visible when a user has two open handlers (using alias) of a same
      table and a flush tables command is issued before the table is
      dropped (see test case). Scanning the handler table list is also
      useless for dropping handlers associated with temporary tables,
      because temporary tables are not kept in the THD::handler_tables
      list.
      
      The solution is to simple scan the handlers hash table searching
      for, and deleting all handlers with matching table names if the
      reopen flag is not passed to the flush function, indicating that
      the handlers should be deleted. All matching handlers are deleted
      even if the associated the table is not open.
      
      
      mysql-test/include/handler.inc:
        Add test case for Bug#31397
      mysql-test/r/handler_innodb.result:
        Add test case result for Bug#31397
      mysql-test/r/handler_myisam.result:
        Add test case result for Bug#31397
      sql/mysql_priv.h:
        Rename flush functions to better match the intent of the caller and
        update functions prototypes and remove unused flags.
      sql/sql_base.cc:
        Rename flush functions to better match the intent of the caller.
      sql/sql_class.cc:
        Rename the flush functions to better match the intent of the caller.
        The hash_free function is moved to the cleanup.
      sql/sql_handler.cc:
        When dropping tables for a final close, scan the handler's hash table since
        the table might not be in the handlers open table list because the table was
        marked for reopen or because it's a temporary table.
      sql/sql_rename.cc:
        Drop handlers associated with tables that are being renamed.
      sql/sql_table.cc:
        Now that temporary tables are properly removed even when opened
        by a SQL HANDLER, enable the assert since this branch can't be taken
        outside of SF/trigger/prelocked mode.
      4da1da96
  16. 01 Nov, 2007 1 commit
    • unknown's avatar
      Bug#30882 Dropping a temporary table inside a stored function may cause a server crash · c6fd10db
      unknown authored
      If a stored function that contains a drop temporary table statement
      is invoked by a create temporary table of the same name may cause
      a server crash. The problem is that when dropping a table no check
      is done to ensure that table is not being used by some outer query
      (or outer statement), potentially leaving the outer query with a
      reference to a stale (freed) table.
      
      The solution is when dropping a temporary table, always check if
      the table is being used by some outer statement as a temporary
      table can be dropped inside stored procedures.
      
      The check is performed by looking at the TABLE::query_id value for
      temporary tables. To simplify this check and to solve a bug related
      to handling of temporary tables in prelocked mode, this patch changes
      the way in which this member is used to track the fact that table is
      used/unused. Now we ensure that TABLE::query_id is zero for unused
      temporary tables (which means that all temporary tables which were
      used by a statement should be marked as free for reuse after it's
      execution has been completed).
      
      
      mysql-test/include/handler.inc:
        Add test case for side effect of Bug#30882
      mysql-test/r/handler_innodb.result:
        Add test case result for side effect of Bug#30882
      mysql-test/r/handler_myisam.result:
        Add test case result for side effect of Bug#30882
      mysql-test/r/sp-error.result:
        Add test case result for Bug#30882
      mysql-test/t/sp-error.test:
        Add test case for Bug#30882
      sql/event_db_repository.cc:
        Update close_thread_tables call, no more default values.
      sql/mysql_priv.h:
        Remove implicit default parameters values of the close_thread_tables
        function as no callers are using it.
      sql/slave.cc:
        Update close_thread_tables call, no more default values
      sql/sp_head.cc:
        Update close_thread_tables call, no more default values
      sql/sql_base.cc:
        Changed the approach to distinguishing currently unused temporary tables.
        Now we ensure that such tables always have TABLE::query_id set to 0 and
        use this fact to perform checks during opening and dropping of temporary
        tables. This means that we have to call close_thread_tables() even for
        statements which use only temporary tables. To make this call cheaper,
        we re-factored close_thread_tables() to not take LOCK_open unless there
        are open base tables.
      sql/sql_handler.cc:
        Properly close temporary tables associated with a handler.
      sql/sql_insert.cc:
        close_temporary_table is now merged into drop_temporary_table.
      sql/sql_parse.cc:
        Now the condition doesn't cover all cases because close_thread_tables()
        must be called even for statements that use only temporary tables.
      sql/sql_table.cc:
        Use drop_temporary_table which perform checks to verify if
        the table is not being used. Error path problem is due to
        a handler tables issue and is going to be addressed in bug
        31397.
      sql/table.h:
        Rename previously unused clear_query_id and document the usage of
        query_id and open_by_handler.
      c6fd10db
  17. 11 Oct, 2007 1 commit
    • unknown's avatar
      Post-merge test case for Bug 31409 · f8bc525a
      unknown authored
      mysql-test/include/handler.inc:
        Add test case for Bug 31409
      mysql-test/r/handler_innodb.result:
        Add test case result for InnoDB run of the handler test for Bug 31409
      mysql-test/r/handler_myisam.result:
        Add test case result for MyISAM run of the handler test for Bug 31409
      f8bc525a
  18. 10 Oct, 2007 1 commit
    • unknown's avatar
      Post-merge test case for Bug 21587 · 3c130a75
      unknown authored
      mysql-test/include/handler.inc:
        Add test case for Bug 21587
      mysql-test/r/handler_innodb.result:
        Add test case result for InnoDB run of the handler test for Bug 21587
      mysql-test/r/handler_myisam.result:
        Add test case result for MyISAM run of the handler test for Bug 21587
      3c130a75
  19. 20 Aug, 2007 1 commit
  20. 16 Aug, 2006 2 commits
    • unknown's avatar
      This changeset belongs to · 1c0d27ac
      unknown authored
              WL#3397 Refactoring storage engine test cases (for falcon)
            It contains fixes according to second code review.
      - Remove any occurence of hardcoded assignments of storage engines
      - Use variable names exact telling what it is used for
      - Updated comments
      - remove trailing spaces
      
      
      mysql-test/include/handler.inc:
        - Replace hardcoded MyISAM with assignments via variable
      mysql-test/include/mix1.inc:
        - Replace hardcoded MyISAM with assignments via variable
        - Remove hardcoded InnoDB assignments (They were introduced by late push)
        - Remove trailing spaces
      mysql-test/include/mix2.inc:
        - Replace hardcode MyISAM assignments
        - Remove trailing spaces
        - Engine assignments via variable refers to the use of the storage engine
          $other_non_trans_engine_type, $other_live_chcks_engine_type ...
      mysql-test/include/read_many_rows.inc:
        Replace hardcoded MyISAM assignment
      mysql-test/include/rowid_order.inc:
        remove trailing spaces
      mysql-test/r/handler_innodb.result:
        Updated result
      mysql-test/r/handler_myisam.result:
        Updated result
      mysql-test/r/innodb_mysql.result:
        Updated result
      mysql-test/r/mix2_myisam.result:
        Updated result
      mysql-test/r/read_many_rows_innodb.result:
        Updated result
      mysql-test/r/rowid_order_innodb.result:
        Updated result
      mysql-test/t/handler_innodb.test:
        Introduce $variables
      mysql-test/t/handler_myisam.test:
        Introduce $variables
      mysql-test/t/mix2_myisam.test:
        Introduce $variables
      mysql-test/t/read_many_rows_innodb.test:
        Introduce $variables
      1c0d27ac
    • unknown's avatar
      This changeset belongs to · ca9b3a1a
      unknown authored
            WL#3397 Refactoring storage engine test cases (for falcon)
          It contains also fixes according to code review.
          Contents: Testcases which were in history dedicated to InnoDB or MyISAM only.
          Modifications:
          1. Shift the main testing code into include/<testing field>.inc
             Introduce $variables which can be used to omit tests for features which are not supported by
             certain storage engines.
          2. The storage engine to be tested is assigned within the toplevel script (t/<whatever>_<engine>.test)
             via variable $engine_type and the the main testing code is sourced from 
             include/<testing field>.inc
          3. Some toplevel testscripts have to be renamed to
             - avoid immediate or future namespace clashes
             - show via filename which storage engine is tested
          4. Minor code cleanup like remove trailing spaces, some additional comments ....
      
      
      mysql-test/t/unsafe_binlog_innodb-master.opt:
        Rename: mysql-test/t/innodb_unsafe_binlog-master.opt -> mysql-test/t/unsafe_binlog_innodb-master.opt
      mysql-test/r/read_many_rows_innodb.result:
        Rename: mysql-test/r/innodb-big.result -> mysql-test/r/read_many_rows_innodb.result
      mysql-test/t/cache_innodb-master.opt:
        Rename: mysql-test/t/innodb_cache-master.opt -> mysql-test/t/cache_innodb-master.opt
      mysql-test/t/concurrent_innodb-master.opt:
        Rename: mysql-test/t/innodb_concurrent-master.opt -> mysql-test/t/concurrent_innodb-master.opt
      BitKeeper/deleted/.del-index_merge.result:
        Delete: mysql-test/r/index_merge.result
      BitKeeper/deleted/.del-index_merge_innodb.result:
        Delete: mysql-test/r/index_merge_innodb.result
      BitKeeper/deleted/.del-index_merge_innodb2.result:
        Delete: mysql-test/r/index_merge_innodb2.result
      BitKeeper/deleted/.del-index_merge_ror.result:
        Delete: mysql-test/r/index_merge_ror.result
      BitKeeper/deleted/.del-index_merge_ror_cpk.result:
        Delete: mysql-test/r/index_merge_ror_cpk.result
      mysql-test/r/index_merge_innodb.result:
        BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/r/index_merge_innodb.result
      mysql-test/t/index_merge_innodb.test:
        BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_innodb.test
      mysql-test/t/index_merge_myisam.test:
        BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_myisam.test
      mysql-test/include/concurrent.inc:
        1. This file contains now the main testing code of the former t/innodb_concurrent.test.
        2. It is now sourced by t/concurrent_innodb.test.
      mysql-test/include/deadlock.inc:
        1. This file contains now the main testing code of the former t/innodb-deadlock.test
        2. It is now sourced by t/deadlock_innodb.test.
      mysql-test/include/handler.inc:
        1. This file contains now the main testing code of the former t/innodb_handler.test + t/handler.test.
        2. It is now sourced by t/handler_myisam.test and t/handler_innodb.test.
      mysql-test/include/index_merge1.inc:
        1. This file contains now the main testing code of the former t/index_merge.test.
        2. It is now sourced by t/index_merge_myisam.test.
      mysql-test/include/index_merge2.inc:
        1. This file contains now the main code of t/index_merge_innodb.test.
        2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
      mysql-test/include/index_merge_2sweeps.inc:
        1. This file contains now the main code of the former t/index_merge_innodb2.test.
        2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
      mysql-test/include/index_merge_ror.inc:
        1. This file contains now the main code of the former t/index_merge_ror.test.
        2. It is sourced by t/index_merge_myisam.test.
      mysql-test/include/index_merge_ror_cpk.inc:
        1. This file contains now the main testing code of the former t/index_merge_ror_cpk.test.
        2. It is now sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
      mysql-test/include/mix1.inc:
        1. This file contains now the main testing code of the t/innodb_mysql.test
        2. The name mix1.inc was used because the test contains subtests for different fields.
        3. It is sourced by t/innodb_mysql.test.
        4. Fixes:
            - Assign $other_engine_type instead of hardcoded MyISAM.
            - improve comment
            - remove redundant subtest
            - analyze table t4 instead of wrong table t1
            - remove not needed "eval set storage_engine = $engine_type;"
      mysql-test/include/mix2.inc:
        1. This file is a copy of the main testing code of the t/innodb.test
           A copy has to be used, because t/innodb.test is to be maintained by INNOBASE only.
        2. The name mix2.inc was used because the test contains subtests for different fields.
        3. It is sourced by t/mix2_myisam.test.
        4. Fixes:
            - improved comment
            - additional "eval SET SESSION STORAGE_ENGINE = $other_engine_type;" at beginning of tests
            - assign $other_engine_type instead of hardcoded MyISAM or HEAP
            - assign $other_engine_type where it is needed to preserve test logics
            - correct logical bugs
            - improve(extend) "checksum table" test
      mysql-test/include/query_cache.inc:
        1. This file contains now the main testing code of the former t/innodb_cache.test.
        2. It is now sourced by t/cache_innodb.test
      mysql-test/include/read_many_rows.inc:
        1. This file contains now the main testing code of the former t/innodb_big.test.
        2. It is now sourced by t/read_many_rows_innodb.test.
      mysql-test/include/rowid_order.inc:
        1. This file contains now the main testing code of t/rowid_order_innodb.test.
        2. It is now sourced by t/rowid_order_innodb.test.
      mysql-test/include/unsafe_binlog.inc:
        1. This file contains now the main testing code of the former t/innodb_unsafe_binlog.test.
        2. It is now sourced by t/unsafe_binlog_innodb.test.
      mysql-test/r/cache_innodb.result:
        Updated result
      mysql-test/r/concurrent_innodb.result:
        Updated result
      mysql-test/r/deadlock_innodb.result:
        Updated result
      mysql-test/r/handler_innodb.result:
        Updated result
      mysql-test/r/handler_myisam.result:
        Updated result
      mysql-test/r/index_merge_myisam.result:
        Updated result
      mysql-test/r/innodb_mysql.result:
        Updated result
      mysql-test/r/mix2_myisam.result:
        Updated result
      mysql-test/r/rowid_order_innodb.result:
        Updated result
      mysql-test/r/unsafe_binlog_innodb.result:
        Updated result
      mysql-test/t/cache_innodb.test:
        1. Renaming of t/innodb_cache.test to t/cache_innodb.test
        2. Main code is now sourced from include/query_cache.inc.
      mysql-test/t/concurrent_innodb.test:
        1. Renaming of t/innodb_concurrent.test to t/concurrent_innodb.test
        2. Main code is now sourced from include/concurrent.inc.
           Attention: This test fails even in the old version. (BUG#21579).
                      --> added to t/disabled.def
      mysql-test/t/deadlock_innodb.test:
        1. Renaming of t/innodb_deadlock.test to t/deadlock_innodb.test
        2. Main code is now sourced from include/deadlock.inc.
      mysql-test/t/disabled.def:
        Add the test concurrent_innodb because of 
        BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
      mysql-test/t/handler_innodb.test:
        1. Renaming of t/innodb_handler.test to t/handler_innodb.test
        2. Main code is now sourced from include/handler.inc.
           include/handler.inc = united code of former t/handler.test and t/innodb_handler.test
      mysql-test/t/handler_myisam.test:
        1. Renaming of t/handler.test to t/handler_myisam.test
        2. Main code is now sourced from include/handler.inc.
           include/handler.inc = united code of former t/handler.test and t/handler_innodb.test.
      mysql-test/t/innodb_mysql.test:
        1. Main code is now sourced from include/mix1.inc.
        2. Test was not renamed because t/innodb.test refers to it.
      mysql-test/t/mix2_myisam.test:
        New test: MyISAM variant of mix2 ( = t/innodb.test)
      mysql-test/t/read_many_rows_innodb.test:
        1. Renaming of t/innodb_big.test to t/read_many_rows_innodb.test
        2. Main code is now sourced from include/read_many_rows.inc.
      mysql-test/t/rowid_order_innodb.test:
        Main code is now sourced from t/rowid_order.inc.
      mysql-test/t/unsafe_binlog_innodb.test:
        1. Renaming of t/innodb_unsafe_binlog.test to t/unsafe_binlog_innodb.test
        2. Main code is now sourced from include/unsafe_binlog.inc.
      ca9b3a1a
  21. 25 Jul, 2006 1 commit
    • unknown's avatar
      Bug #15440 (handler.test hangs in embedded mode) · 4f79a028
      unknown authored
      the old problem - mysqltest can't handle multiple connections in the
      embedded server properly. So i disabled the test for the embedded mode
      until mysqltest is fixed
      
      
      mysql-test/t/handler.test:
        test temporarily disabled in embedded server
      4f79a028
  22. 24 Feb, 2006 1 commit
    • unknown's avatar
      Fixes to embedded server to be able to run tests with it · 988f0be6
      unknown authored
      (Needed for "list of pushes" web page and autopush)
      
      
      include/mysql.h:
        Fix to embedded server to be able to run tests on it
      libmysql/libmysql.c:
        Fix to embedded server to be able to run tests on it
      libmysqld/emb_qcache.cc:
        Fix to embedded server to be able to run tests on it
      libmysqld/embedded_priv.h:
        Fix to embedded server to be able to run tests on it
      libmysqld/lib_sql.cc:
        Fix to embedded server to be able to run tests on it
      libmysqld/libmysqld.c:
        Fix to embedded server to be able to run tests on it
      mysql-test/mysql-test-run.sh:
        Fix to embedded server to be able to run tests on it
      mysql-test/r/binlog.result:
        Updated test for embedded server
      mysql-test/r/ctype_cp932.result:
        Updated test for embedded server
      mysql-test/r/innodb.result:
        Updated test for embedded server
      mysql-test/r/mysqltest.result:
        Updated test for embedded server
      mysql-test/r/query_cache.result:
        Updated test for embedded server
      mysql-test/r/query_cache_notembedded.result:
        Updated test for embedded server
      mysql-test/r/sp-error.result:
        Updated test for embedded server
      mysql-test/r/sp.result:
        Updated test for embedded server
      mysql-test/r/subselect.result:
        Updated test for embedded server
      mysql-test/r/view.result:
        Updated test for embedded server
      mysql-test/r/view_grant.result:
        Updated test for embedded server
      mysql-test/t/backup.test:
        Updated test for embedded server
      mysql-test/t/binlog.test:
        Updated test for embedded server
      mysql-test/t/blackhole.test:
        Updated test for embedded server
      mysql-test/t/compress.test:
        Updated test for embedded server
      mysql-test/t/ctype_cp932.test:
        Updated test for embedded server
      mysql-test/t/delayed.test:
        Updated test for embedded server
      mysql-test/t/handler.test:
        Updated test for embedded server
      mysql-test/t/innodb.test:
        Updated test for embedded server
      mysql-test/t/mysql.test:
        Updated test for embedded server
      mysql-test/t/mysql_client_test.test:
        Updated test for embedded server
      mysql-test/t/mysqltest.test:
        Updated test for embedded server
      mysql-test/t/query_cache.test:
        Updated test for embedded server
      mysql-test/t/query_cache_notembedded.test:
        Updated test for embedded server
      mysql-test/t/read_only.test:
        Updated test for embedded server
      mysql-test/t/skip_grants.test:
        Updated test for embedded server
      mysql-test/t/sp-destruct.test:
        Updated test for embedded server
      mysql-test/t/sp-error.test:
        Updated test for embedded server
      mysql-test/t/sp-threads.test:
        Updated test for embedded server
      mysql-test/t/sp.test:
        Updated test for embedded server
      mysql-test/t/subselect.test:
        Updated test for embedded server
      mysql-test/t/temp_table.test:
        Updated test for embedded server
      mysql-test/t/view.test:
        Updated test for embedded server
      mysql-test/t/view_grant.test:
        Updated test for embedded server
      mysql-test/t/wait_timeout.test:
        Updated test for embedded server
      mysys/mf_dirname.c:
        Review fix: Don't access data outside of array
      mysys/my_bitmap.c:
        Remove compiler warnings
      scripts/mysql_fix_privilege_tables.sql:
        Add flush privileges to .sql script so that one doesn't have to reboot mysqld when one runs the mysql_fix_privilege_script
      sql-common/client.c:
        Updated test for embedded server
      sql/item.cc:
        Remove DBUG_PRINT statement that can cause crashes when running with --debug
      sql/mysqld.cc:
        Fix to embedded server to be able to run tests on it
      sql/protocol.cc:
        Fix to embedded server to be able to run tests on it
        (Trivial reconstruction of code)
      sql/protocol.h:
        Fix to embedded server to be able to run tests on it
      sql/sql_base.cc:
        Better comment
      sql/sql_class.cc:
        Fix to embedded server to be able to run tests on it
      sql/sql_class.h:
        Fix to embedded server to be able to run tests on it
      sql/sql_cursor.cc:
        Fix to embedded server to be able to run tests on it
      sql/sql_parse.cc:
        Fix to embedded server to be able to run tests on it
        Don't crash for disabled commands when using embedded server
      sql/sql_prepare.cc:
        Fix to embedded server to be able to run tests on it
      mysql-test/r/ctype_cp932_notembedded.result:
        New BitKeeper file ``mysql-test/r/ctype_cp932_notembedded.result''
      mysql-test/r/innodb_notembedded.result:
        New BitKeeper file ``mysql-test/r/innodb_notembedded.result''
      mysql-test/r/sp.result.orig:
        New BitKeeper file ``mysql-test/r/sp.result.orig''
      mysql-test/r/sp_notembedded.result:
        New BitKeeper file ``mysql-test/r/sp_notembedded.result''
      mysql-test/r/subselect_notembedded.result:
        New BitKeeper file ``mysql-test/r/subselect_notembedded.result''
      mysql-test/t/ctype_cp932_notembedded.test:
        New BitKeeper file ``mysql-test/t/ctype_cp932_notembedded.test''
      mysql-test/t/innodb_notembedded.test:
        New BitKeeper file ``mysql-test/t/innodb_notembedded.test''
      mysql-test/t/sp.test.orig:
        New BitKeeper file ``mysql-test/t/sp.test.orig''
      mysql-test/t/sp_notembedded.test:
        New BitKeeper file ``mysql-test/t/sp_notembedded.test''
      mysql-test/t/subselect_notembedded.test:
        New BitKeeper file ``mysql-test/t/subselect_notembedded.test''
      988f0be6
  23. 05 Jan, 2006 1 commit
    • unknown's avatar
      Review fixes of new pushed code · 43886f1d
      unknown authored
      - Fixed tests
      - Optimized new code
      - Fixed some unlikely core dumps
      - Better bug fixes for:
        - #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        - #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null
      
      
      mysql-test/r/create.result:
        Update results after removing wrong warnings for CREATE ... SELECT
        New tests
      mysql-test/r/handler.result:
        Drop used tables
      mysql-test/r/kill.result:
        Make test portable
      mysql-test/r/mysqlshow.result:
        Drop tables used by previous test
      mysql-test/r/trigger.result:
        Reuse old procedure name
      mysql-test/r/view.result:
        Extra tests
      mysql-test/t/create.test:
        New tests to test fix of removing wrong warnings for CREATE ... SELECT
      mysql-test/t/disabled.def:
        Enable 'kill' test (should now be portable)
      mysql-test/t/handler.test:
        Drop used tables
      mysql-test/t/kill.test:
        Make test portable even if kill doesn't work at once
      mysql-test/t/mysqlshow.test:
        Drop tables used by previous test
      mysql-test/t/trigger.test:
        Reuse old procedure name
      mysql-test/t/view.test:
        Extra tests
      sql/field.cc:
        Removed compiler warning
      sql/ha_federated.cc:
        my_snprintf -> strmake()
        (Simple optimization)
      sql/ha_ndbcluster.cc:
        Indentation cleanups and trival optimization
      sql/item.cc:
        Moved save_org_in_field() to item.cc to make it easier to test
        Remove setting of null_value as this is not needed
      sql/item.h:
        Moved save_org_in_field() to item.cc to make it easier to test
      sql/log_event.cc:
        Remove inline of slave_load_file_stem()
        Added 'extension' parameter to slave_load_file_stem() to get smaller code
        Removed not critical (or needed) DBUG_ASSERT()'s
        Cleaned up usage of slave_load_file_stem() to not depend on constant string lengths
        Indentation fixes
      sql/opt_range.cc:
        Moved code from declaration to function body
        (To make it more readable)
      sql/parse_file.cc:
        Fixed DBUG_PRINT
      sql/sp.cc:
        Simple cleanups
        - Removed not needed {} level
        - Ensure saved variables starts with old_
      sql/sp_head.cc:
        Indentation fixes
        Remove core dump when using --debug when m_next_cached_sp == 0
        Fixed compiler warnings
        Trivial optimizations
      sql/sp_head.h:
        Changed argument to set_definer() to const
        Added THD argument to recursion_level_error() to avoid call to current_thd
      sql/sql_acl.cc:
        Removed not needed test (first_not_own_table is the guard)
      sql/sql_base.cc:
        Removed extra empty line
      sql/sql_handler.cc:
        Don't test table version in mysql_ha_read() as this is already tested in lock_tables()
        Moved call to insert_fields to be after lock_table() to guard aganst reopen of tables
        (Better fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash)
      sql/sql_insert.cc:
        Mark fields that are set in CREATE ... SELECT as used
        (Removed wrong warnings about field not having a default value)
      sql/sql_parse.cc:
        Removed not needed test of 'tables' (first_not_own_table is the guard)
        Simplify code
      sql/sql_select.cc:
        Use group->field to check if value is null instead of item called by 'save_org_in_field'
        This is a better bug fix for #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null)
      sql/sql_trigger.cc:
        Move sql_modes_parameters outside of function
        Indentation fixes
        Fixed compiler warning
        Ensure that thd->lex->query_tables_own_last is set properly before calling check_table_access()
        (This allows us to remove the extra test in check_grant() and check_table_access())
      43886f1d
  24. 04 Jan, 2006 1 commit
    • unknown's avatar
      Big patch to make embedded-server working in 5.x · c958795a
      unknown authored
      Now it supports queries returning several results
      (particularly important with the SP)
      
      
      include/mysql.h:
        embedded_query_result structure added
      libmysql/libmysql.c:
        embedded-server related fixes
      libmysqld/emb_qcache.cc:
        multiple-result support added
      libmysqld/embedded_priv.h:
        embedded_query_result struct implemented
      libmysqld/lib_sql.cc:
        multiple-result support added
      libmysqld/libmysqld.c:
        small fixes
      mysql-test/t/backup.test:
        test fixed
      mysql-test/t/binlog_stm_binlog.test:
        test fixed
      mysql-test/t/binlog_stm_blackhole.test:
        test fixed
      mysql-test/t/binlog_stm_ctype_cp932.test:
        test fixed
      mysql-test/t/compress.test:
        test fixed
      mysql-test/t/delayed.test:
        test fixed
      mysql-test/t/federated.test:
        test fixed
      mysql-test/t/federated_archive.test:
        test fixed
      mysql-test/t/federated_bug_13118.test:
        test fixed
      mysql-test/t/federated_transactions.test:
        test fixed
      mysql-test/t/flush_table.test:
        test fixed
      mysql-test/t/handler.test:
        test fixed
      mysql-test/t/init_connect.test:
        test fixed
      mysql-test/t/innodb.test:
        test fixed
      mysql-test/t/mysql.test:
        test fixed
      mysql-test/t/mysql_client_test.test:
        test fixed
      mysql-test/t/mysqltest.test:
        test fixed
      mysql-test/t/query_cache.test:
        test fixed
      mysql-test/t/query_cache_notembedded.test:
        test fixed
      mysql-test/t/read_only.test:
        test fixed
      mysql-test/t/skip_grants.test:
        test fixed
      mysql-test/t/sp-destruct.test:
        test fixed
      mysql-test/t/sp-error.test:
        test fixed
      mysql-test/t/sp-threads.test:
        test fixed
      mysql-test/t/sp.test:
        test fixed
      mysql-test/t/view.test:
        test fixed
      mysql-test/t/wait_timeout.test:
        test fixed
      sql-common/client.c:
        small fixes
      sql/mysqld.cc:
        embedded-server related fix
      sql/protocol.cc:
        embedded-server related fix
      sql/protocol.h:
        embedded-server related fix
      sql/sql_class.cc:
        embedded-server related fix
      sql/sql_class.h:
        embedded-server related fix
      sql/sql_cursor.cc:
        embedded-server related fix
      sql/sql_parse.cc:
        embedded-server related fix
      sql/sql_prepare.cc:
        embedded-server related fix
      c958795a
  25. 15 Nov, 2005 1 commit
    • unknown's avatar
      Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash · 2f4c2b63
      unknown authored
      Version for 5.0.
      It fixes three problems:
      1. The cause of the bug was that we did not check the table version for
       the HANDLER ... READ commands. We did not notice when a table was
       replaced by a new one. This can happen during ALTER TABLE, REPAIR
       TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
       for this problem "the primary bug fix".
      2. mysql_ha_flush() was not always called with a locked LOCK_open.
       Though the function comment clearly said it must.
       I changed the code so that the locking is done when required. I call
       the fix for this problem "the secondary fix".
      3. In 5.0 (not in 4.1 or 4.0) DROP TABLE had a possible deadlock flaw in
       concur with FLUSH TABLES WITH READ LOCK. I call the fix for this
       problem "the 5.0 addendum fix".
      
      
      include/my_pthread.h:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Added a new macro for the 5.0 addendum fix.
      mysql-test/r/handler.result:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test result.
      mysql-test/t/handler.test:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test case.
      sql/lock.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a comment which did confuse me and which is not fully
        correct anymore after the 5.0 addendum fix.
        Added an assertion which would fire without the 5.0 addendum fix.
      sql/mysql_priv.h:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a definition for the secondary fix.
      sql/sql_base.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed function calls for the secondary fix.
      sql/sql_class.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a function call for the secondary fix.
      sql/sql_handler.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The first two diffs make the primary bug fix.
        The rest is for the secondary fix.
      sql/sql_table.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The first diff (four changed places) make the 5.0 addendum fix.
        The other three are changed function calls for the secondary fix.
      2f4c2b63
  26. 03 Nov, 2005 1 commit
    • unknown's avatar
      Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash · cb60a7b9
      unknown authored
      Version for 4.0.
      It fixes two problems:
      1. The cause of the bug was that we did not check the table version for
         the HANDLER ... READ commands. We did not notice when a table was
         replaced by a new one. This can happen during ALTER TABLE, REPAIR
         TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
         for this problem "the primary bug fix".
      2. mysql_ha_flush() was not always called with a locked LOCK_open.
         Though the function comment clearly said it must.
         I changed the code so that the locking is done when required. I call
         the fix for this problem "the secondary fix".
      
      
      mysql-test/r/handler.result:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test result.
      mysql-test/t/handler.test:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test case.
      sql/mysql_priv.h:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a definition for the secondary fix.
      sql/sql_base.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed function calls for the secondary fix.
      sql/sql_class.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a function call for the secondary fix.
      sql/sql_handler.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The first two diffs make the primary bug fix.
        The rest is for the secondary fix.
      sql/sql_table.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed function calls for the secondary fix.
      cb60a7b9
  27. 31 Aug, 2005 1 commit
    • unknown's avatar
      BUG#11316: mysqltest, problems when assigning value with '#' to $variable · 59bfb47b
      unknown authored
       - Add stricter checking of syntax in mysqltest
      
      
      client/mysqltest.c:
        Stricter checking of syntax in mysqltest.
      mysql-test/r/mysqltest.result:
        Update test results
      mysql-test/t/create.test:
        Remove extra ;
      mysql-test/t/create_select_tmp.test:
        Remove extra ;
      mysql-test/t/drop.test:
        Remove extra ;
      mysql-test/t/flush.test:
        Remove extra ;
      mysql-test/t/handler.test:
        Remove extra ;
      mysql-test/t/innodb.test:
        Remove extra ;
      mysql-test/t/mysqltest.test:
        Add more tests for replace, replace_columns, comments with commands and sync_with_master
      mysql-test/t/rpl000001.test:
        Remove extra ;
      mysql-test/t/rpl_EE_error.test:
        Remove extra ;
      mysql-test/t/rpl_drop.test:
        Remove extra ;
      mysql-test/t/rpl_error_ignored_table.test:
        Remove extra ;
      mysql-test/t/rpl_loaddata.test:
        Remove extra ;
      59bfb47b
  28. 28 Jul, 2005 1 commit
    • unknown's avatar
      Added end marker for tests to make future merges easier · 0062e643
      unknown authored
      mysql-test/t/alias.test:
        Added end marker for test to make future merges easier
      mysql-test/t/alter_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/analyse.test:
        Added end marker for test to make future merges easier
      mysql-test/t/analyze.test:
        Added end marker for test to make future merges easier
        Fixed length of comment lines
      mysql-test/t/ansi.test:
        Added end marker for test to make future merges easier
      mysql-test/t/archive.test:
        Added end marker for test to make future merges easier
      mysql-test/t/auto_increment.test:
        Added end marker for test to make future merges easier
      mysql-test/t/backup.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb-alter-table-1.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb-alter-table-2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb-crash.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb-deadlock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb-deadlock.tminus:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bdb_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bench_count_distinct.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bigint.test:
        Added end marker for test to make future merges easier
      mysql-test/t/binary.test:
        Added end marker for test to make future merges easier
      mysql-test/t/blackhole.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bool.test:
        Added end marker for test to make future merges easier
      mysql-test/t/bulk_replace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/case.test:
        Added end marker for test to make future merges easier
      mysql-test/t/cast.test:
        Added end marker for test to make future merges easier
      mysql-test/t/check.test:
        Added end marker for test to make future merges easier
      mysql-test/t/comments.test:
        Added end marker for test to make future merges easier
      mysql-test/t/compare.test:
        Added end marker for test to make future merges easier
      mysql-test/t/connect.test:
        Added end marker for test to make future merges easier
      mysql-test/t/consistent_snapshot.test:
        Added end marker for test to make future merges easier
      mysql-test/t/constraints.test:
        Added end marker for test to make future merges easier
      mysql-test/t/count_distinct.test:
        Added end marker for test to make future merges easier
      mysql-test/t/count_distinct2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/count_distinct3.test:
        Added end marker for test to make future merges easier
      mysql-test/t/create.test:
        Added end marker for test to make future merges easier
      mysql-test/t/create_select_tmp.test:
        Added end marker for test to make future merges easier
      mysql-test/t/csv.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_big5.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_collate.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_cp1250_ch.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_cp1251.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_cp932.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_create.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_gbk.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_latin1.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_latin1_de.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_latin2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_many.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_mb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_recoding.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_sjis.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_tis620.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_uca.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_ucs.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_ucs_binlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_ujis.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ctype_utf8.test:
        Added end marker for test to make future merges easier
      mysql-test/t/date_formats.test:
        Added end marker for test to make future merges easier
      mysql-test/t/delayed.test:
        Added end marker for test to make future merges easier
      mysql-test/t/delete.test:
        Added end marker for test to make future merges easier
      mysql-test/t/derived.test:
        Added end marker for test to make future merges easier
      mysql-test/t/dirty_close.test:
        Added end marker for test to make future merges easier
      mysql-test/t/distinct.test:
        Added end marker for test to make future merges easier
      mysql-test/t/drop.test:
        Added end marker for test to make future merges easier
      mysql-test/t/drop_temp_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/empty_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/endspace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/errors.test:
        Added end marker for test to make future merges easier
      mysql-test/t/exampledb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/explain.test:
        Added end marker for test to make future merges easier
      mysql-test/t/flush.test:
        Added end marker for test to make future merges easier
      mysql-test/t/flush_block_commit.test:
        Added end marker for test to make future merges easier
      mysql-test/t/flush_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/foreign_key.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_distinct.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_left_join.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_multi.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_order_by.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/fulltext_var.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_compress.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_concat.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_crypt.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_date_add.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_default.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_des_encrypt.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_encrypt.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_encrypt_nossl.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_equal.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_gconcat.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_group.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_if.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_in.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_isnull.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_like.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_math.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_misc.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_op.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_regexp.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_sapdb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_set.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_str.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_system.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_test.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_time.test:
        Added end marker for test to make future merges easier
      mysql-test/t/func_timestamp.test:
        Added end marker for test to make future merges easier
      mysql-test/t/gcc296.test:
        Added end marker for test to make future merges easier
      mysql-test/t/gis-rtree.test:
        Added end marker for test to make future merges easier
      mysql-test/t/gis.test:
        Added end marker for test to make future merges easier
      mysql-test/t/grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/grant2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/grant_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/group_by.test:
        Added end marker for test to make future merges easier
      mysql-test/t/handler.test:
        Added end marker for test to make future merges easier
      mysql-test/t/having.test:
        Added end marker for test to make future merges easier
      mysql-test/t/heap.test:
        Added end marker for test to make future merges easier
      mysql-test/t/heap_auto_increment.test:
        Added end marker for test to make future merges easier
      mysql-test/t/heap_btree.test:
        Added end marker for test to make future merges easier
      mysql-test/t/heap_hash.test:
        Added end marker for test to make future merges easier
      mysql-test/t/help.test:
        Added end marker for test to make future merges easier
      mysql-test/t/init_connect.test:
        Added end marker for test to make future merges easier
      mysql-test/t/init_file.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb-deadlock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb-lock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb-replace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/innodb_handler.test:
        Added end marker for test to make future merges easier
      mysql-test/t/insert.test:
        Added end marker for test to make future merges easier
      mysql-test/t/insert_select-binlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/insert_select.test:
        Added end marker for test to make future merges easier
      mysql-test/t/insert_update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/isam.test:
        Added end marker for test to make future merges easier
      mysql-test/t/join.test:
        Added end marker for test to make future merges easier
      mysql-test/t/join_crash.test:
        Added end marker for test to make future merges easier
      mysql-test/t/join_outer.test:
        Added end marker for test to make future merges easier
      mysql-test/t/key.test:
        Added end marker for test to make future merges easier
      mysql-test/t/key_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/key_diff.test:
        Added end marker for test to make future merges easier
      mysql-test/t/key_primary.test:
        Added end marker for test to make future merges easier
      mysql-test/t/keywords.test:
        Added end marker for test to make future merges easier
      mysql-test/t/kill.test:
        Added end marker for test to make future merges easier
      mysql-test/t/limit.test:
        Added end marker for test to make future merges easier
      mysql-test/t/loaddata.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lock_multi.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lock_tables_lost_commit.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lowercase_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lowercase_table2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lowercase_table3.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lowercase_table_grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/lowercase_table_qcache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/merge.test:
        Added end marker for test to make future merges easier
      mysql-test/t/metadata.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mix_innodb_myisam_binlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/multi_statement.test:
        Added end marker for test to make future merges easier
      mysql-test/t/multi_update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/myisam-blob.test:
        Added end marker for test to make future merges easier
      mysql-test/t/myisam.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysql_client_test.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysql_protocols.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysqlbinlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysqlbinlog2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysqldump.test:
        Added end marker for test to make future merges easier
      mysql-test/t/mysqltest.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_alter_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_autodiscover.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_autodiscover2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_basic.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_blob.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_charset.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_config.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_database.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_grant.later:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_index.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_index_ordered.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_index_unique.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_insert.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_limit.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_lock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_minmax.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_multi.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_replace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_restore.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_subquery.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_transaction.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_truncate.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_types.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ndb_update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/negation_elimination.test:
        Added end marker for test to make future merges easier
      mysql-test/t/not_embedded_server.test:
        Added end marker for test to make future merges easier
      mysql-test/t/null.test:
        Added end marker for test to make future merges easier
      mysql-test/t/null_key.test:
        Added end marker for test to make future merges easier
      mysql-test/t/odbc.test:
        Added end marker for test to make future merges easier
      mysql-test/t/olap.test:
        Added end marker for test to make future merges easier
      mysql-test/t/openssl_1.test:
        Added end marker for test to make future merges easier
      mysql-test/t/order_by.test:
        Added end marker for test to make future merges easier
      mysql-test/t/order_fill_sortbuf.test:
        Added end marker for test to make future merges easier
      mysql-test/t/outfile.test:
        Added end marker for test to make future merges easier
      mysql-test/t/overflow.test:
        Added end marker for test to make future merges easier
      mysql-test/t/packet.test:
        Added end marker for test to make future merges easier
      mysql-test/t/preload.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_10nestset.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_11bugs.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_1general.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_2myisam.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_3innodb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_4heap.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_5merge.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_6bdb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_7ndb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/ps_grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/query_cache.test:
        Added end marker for test to make future merges easier
      mysql-test/t/query_cache_merge.test:
        Added end marker for test to make future merges easier
      mysql-test/t/raid.test:
        Added end marker for test to make future merges easier
      mysql-test/t/range.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rename.test:
        Added end marker for test to make future merges easier
      mysql-test/t/repair.test:
        Added end marker for test to make future merges easier
      mysql-test/t/replace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rollback.test:
        Added end marker for test to make future merges easier
      mysql-test/t/row.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000001.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000002.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000004.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000005.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000006.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000008.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000009.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000010.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000011.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000012.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000013.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000015.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000017.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl000018.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_EE_error.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_alter.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_chain_temp_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_change_master.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_charset.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_commit_after_flush.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_create_database.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_ddl.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_deadlock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_delete_all.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_do_grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_drop.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_drop_temp.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_empty_master_crash.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_error_ignored_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_failed_optimize.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_failsafe.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_flush_log_loop.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_flush_tables.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_free_items.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_get_lock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_heap.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_ignore_grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_init_slave.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_innodb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_insert_id.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_insert_ignore.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_loaddata.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_loaddata_rule_m.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_loaddata_rule_s.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_loaddatalocal.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_log.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_log_pos.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_many_optimize.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_master_pos_wait.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_max_relay_size.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_misc_functions.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_delete.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_delete2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_query.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_update2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_multi_update3.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_mystery22.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_openssl.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_optimize.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_ps.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_redirect.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_relayrotate.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_relayspace.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_replicate_do.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_reset_slave.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_rewrite_db.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_rotate_logs.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_server_id1.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_server_id2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_set_charset.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_skip_error.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_sporadic_master.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_start_stop_slave.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_temporary.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_timezone.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_trunc_binlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_until.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_user_variables.test:
        Added end marker for test to make future merges easier
      mysql-test/t/rpl_variables.test:
        Added end marker for test to make future merges easier
      mysql-test/t/select.test:
        Added end marker for test to make future merges easier
      mysql-test/t/select_found.test:
        Added end marker for test to make future merges easier
      mysql-test/t/select_safe.test:
        Added end marker for test to make future merges easier
      mysql-test/t/show_check.test:
        Added end marker for test to make future merges easier
      mysql-test/t/skip_name_resolve.test:
        Added end marker for test to make future merges easier
      mysql-test/t/sql_mode.test:
        Added end marker for test to make future merges easier
      mysql-test/t/status.test:
        Added end marker for test to make future merges easier
      mysql-test/t/subselect.test:
        Added end marker for test to make future merges easier
      mysql-test/t/subselect2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/subselect_gis.test:
        Added end marker for test to make future merges easier
      mysql-test/t/subselect_innodb.test:
        Added end marker for test to make future merges easier
      mysql-test/t/symlink.test:
        Added end marker for test to make future merges easier
      mysql-test/t/synchronization.test:
        Added end marker for test to make future merges easier
      mysql-test/t/system_mysql_db.test:
        Added end marker for test to make future merges easier
      mysql-test/t/system_mysql_db_fix.test:
        Added end marker for test to make future merges easier
      mysql-test/t/system_mysql_db_refs.test:
        Added end marker for test to make future merges easier
      mysql-test/t/tablelock.test:
        Added end marker for test to make future merges easier
      mysql-test/t/temp_table.test:
        Added end marker for test to make future merges easier
      mysql-test/t/timezone.test:
        Added end marker for test to make future merges easier
      mysql-test/t/timezone2.test:
        Added end marker for test to make future merges easier
      mysql-test/t/timezone3.test:
        Added end marker for test to make future merges easier
      mysql-test/t/timezone_grant.test:
        Added end marker for test to make future merges easier
      mysql-test/t/truncate.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_blob.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_date.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_datetime.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_decimal.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_enum.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_float.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_nchar.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_ranges.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_set.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_time.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_timestamp.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_uint.test:
        Added end marker for test to make future merges easier
      mysql-test/t/type_year.test:
        Added end marker for test to make future merges easier
      mysql-test/t/union.test:
        Added end marker for test to make future merges easier
      mysql-test/t/update.test:
        Added end marker for test to make future merges easier
      mysql-test/t/user_var-binlog.test:
        Added end marker for test to make future merges easier
      mysql-test/t/user_var.test:
        Added end marker for test to make future merges easier
      mysql-test/t/varbinary.test:
        Added end marker for test to make future merges easier
      mysql-test/t/variables.test:
        Added end marker for test to make future merges easier
      mysql-test/t/warnings.test:
        Added end marker for test to make future merges easier
      0062e643
  29. 07 Oct, 2004 1 commit
    • unknown's avatar
      After merge fixes · 73950f75
      unknown authored
      Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code
      
      
      include/hash.h:
        Added back function that's was used in 4.0
      mysql-test/r/delete.result:
        Update results after merge
      mysql-test/r/flush_table.result:
        Update results after merge
      mysql-test/r/func_str.result:
        Update results after merge
      mysql-test/r/handler.result:
        Update results after merge
        Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename
      mysql-test/r/multi_update.result:
        More startup cleanups
      mysql-test/r/rename.result:
        More startup-cleanups
      mysql-test/r/select.result:
        More startup cleanups
      mysql-test/r/show_check.result:
        More startup-cleanups
      mysql-test/t/ctype_latin1_de.test:
        Cleanup
      mysql-test/t/derived.test:
        Portability fix
      mysql-test/t/handler.test:
        Update results after merge
        Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename
      mysql-test/t/multi_update.test:
        More startup cleanups
      mysql-test/t/range.test:
        More comments
      mysql-test/t/rename.test:
        More startup cleanups
      mysql-test/t/select.test:
        More startup cleanups
      mysql-test/t/show_check.test:
        More startup cleanups
      mysql-test/t/type_timestamp.test:
        Add back test deleted during merge
      sql/item_cmpfunc.cc:
        After merge fixes
      sql/item_func.cc:
        Remove compiler warning
      sql/mysql_priv.h:
        After merge fixes
      sql/mysqld.cc:
        After merge fixes
      sql/sql_acl.cc:
        More debugging
      sql/sql_base.cc:
        After merge fixes
        (This fix was needed bacause of multi-table-update reopens tables)
      sql/sql_handler.cc:
        After merge fixes
      sql/sql_lex.h:
        After merge fixes
      sql/sql_select.cc:
        After merge fixes
      sql/sql_show.cc:
        After merge fixes
      sql/sql_table.cc:
        After merge fixes
        Simple cleanup of mysql_discard_or_import_tablespace
      sql/sql_update.cc:
        After merge fixes
        Rework mysql_multi_update to take into account derived tables.
      sql/sql_yacc.yy:
        After merge fixes
      73950f75
  30. 24 Sep, 2004 1 commit
    • unknown's avatar
      BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). · 387ac2e4
      unknown authored
      BUG#4335 - one name can be handler open'ed many times.
      Reworked the HANDLER functions and interface.
      Using a HASH to store information on open tables that
      survives FLUSH TABLE.
      HANDLER tables alias names must now be unique, though it
      is allowed in 4.0 to qualify them with the database name
      of the base table.
      
      
      mysql-test/r/flush_table.result:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Moved pure handler test results to handler.result.
        Added the new test results.
      mysql-test/r/handler.result:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Moved pure handler test results from flush_table.result to here.
      mysql-test/t/flush_table.test:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Moved pure handler tests to handler.test.
        Added new tests.
      mysql-test/t/handler.test:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Moved pure handler tests from flush_table.test to here.
      sql/mysql_priv.h:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Reworked the handler interface.
      sql/sql_base.cc:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Replaced mysql_ha_close_list() by the better named
        function mysql_ha_flush() with readable options.
      sql/sql_class.cc:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Added initialization for the handler tables hash.
        Changed the handler tables clean-up code.
        Unreleted to bug: Changed the order of THD initialization
        to avoid warning messages on Linux with gcc.
      sql/sql_class.h:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Added the handler tables HASH to THD.
      sql/sql_handler.cc:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        Completely reworked the handler functions.
        Added an introducing comment, describing the new functionality.
      sql/sql_table.cc:
        BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
        BUG#4335 - one name can be handler open'ed many times.
        replaced mysql_ha_close() by the better named
        function mysql_ha_flush() with readable options.
      387ac2e4
  31. 18 May, 2004 1 commit
    • unknown's avatar
      Fix and test case for BUG#3649. · da04e3fe
      unknown authored
      mysql-test/r/handler.result:
        Test case for BUG#3649
      mysql-test/t/handler.test:
        Test case for BUG#3649
      sql/sql_handler.cc:
        Fix for BUG#3649: when doing an index scan for an equality condition, use index_next_same to retrieve subsequent rows.
      da04e3fe
  32. 13 Jan, 2004 1 commit
  33. 16 Dec, 2003 1 commit
    • unknown's avatar
      Portability fixes (mostly test suite) · 7dacf466
      unknown authored
      Make ENGINE= an alias for TYPE= (Compabiltiy with 4.1)
      Fix when using symlinked data files and realpath() is not working
      
      
      client/mysqltest.c:
        Copied mysqltest from 4.1 and modified this to compile in 4.0
        This was needed to get replace_columns to work.
      include/my_sys.h:
        Stop compiler warnings about alloca on freebsd
      myisam/mi_check.c:
        Fix when using symlinked data files and realpath() is not working
      mysql-test/r/handler.result:
        test engine=
      mysql-test/r/rpl_max_relay_size.result:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/r/rpl_rotate_logs.result:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/r/rpl_trunc_binlog.result:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/t/handler.test:
        test engine=
      mysql-test/t/rpl_log_pos.test:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/t/rpl_max_relay_size.test:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/t/rpl_rotate_logs.test:
        Use replace_columns to replace some 'not constant' columns
      mysql-test/t/rpl_trunc_binlog.test:
        Use replace_columns to replace some 'not constant' columns
      mysys/my_symlink.c:
        More debugging
      sql/lex.h:
        Make ENGINE= an alias for TYPE=
      sql/mysqld.cc:
        Code cleanup
      strings/strto.c:
        Fix for True64
      strings/strtoll.c:
        Fix for True64
      strings/strtoull.c:
        Remove not needed include file
      7dacf466
  34. 10 Dec, 2003 1 commit
    • unknown's avatar
      WorkLog#1323 · 833f85fb
      unknown authored
      Deprecate the use of TYPE=... Preferred syntax is ENGINE=
      
      
      include/mysqld_error.h:
        New warning for deprecated syntax
      sql/lex.h:
        Introduce ENGINE keyword
        Sort order of symbols
      sql/share/czech/errmsg.txt:
        New warning for deprecated syntax
      sql/share/danish/errmsg.txt:
        New warning for deprecated syntax
      sql/share/dutch/errmsg.txt:
        New warning for deprecated syntax
      sql/share/english/errmsg.txt:
        New warning for deprecated syntax
      sql/share/estonian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/french/errmsg.txt:
        New warning for deprecated syntax
      sql/share/german/errmsg.txt:
        New warning for deprecated syntax
      sql/share/greek/errmsg.txt:
        New warning for deprecated syntax
      sql/share/hungarian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/italian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/japanese/errmsg.txt:
        New warning for deprecated syntax
      sql/share/korean/errmsg.txt:
        New warning for deprecated syntax
      sql/share/norwegian-ny/errmsg.txt:
        New warning for deprecated syntax
      sql/share/norwegian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/polish/errmsg.txt:
        New warning for deprecated syntax
      sql/share/portuguese/errmsg.txt:
        New warning for deprecated syntax
      sql/share/romanian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/russian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/serbian/errmsg.txt:
        New warning for deprecated syntax
      sql/share/slovak/errmsg.txt:
        New warning for deprecated syntax
      sql/share/spanish/errmsg.txt:
        New warning for deprecated syntax
      sql/share/swedish/errmsg.txt:
        New warning for deprecated syntax
      sql/share/ukrainian/errmsg.txt:
        New warning for deprecated syntax
      sql/sql_show.cc:
        Change TYPE= with ENGINE=
      sql/sql_yacc.yy:
        Introduce ENGINE keyword,
        Deprecate TYPE= syntax,
        Introduce SHOW ENGINE syntax,
        Deprecate SHOW INNODB/BDB syntax.
      mysql-test/r/alias.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/alter_table.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/auto_increment.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/bdb-alter-table-1.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/bdb-crash.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/bdb-deadlock.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/bdb.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/bdb_cache.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/case.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/cast.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/constraints.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/create.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_collate.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_latin1_de.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_many.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_mb.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_recoding.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/ctype_ucs.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/delete.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/distinct.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/fulltext.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/fulltext2.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/fulltext_distinct.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/fulltext_left_join.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_compress.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_date_add.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_group.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_if.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_str.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_system.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_test.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/func_time.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/gis-rtree.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/group_by.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/handler.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/heap.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/heap_auto_increment.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/heap_btree.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/heap_hash.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/help.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/innodb-deadlock.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/innodb.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/innodb_cache.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/innodb_handler.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/insert_select.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/isam.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/join.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/join_crash.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/join_outer.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/key.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/lock.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/lock_tables_lost_commit.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/merge.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/mix_innodb_myisam_binlog.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/multi_update.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/myisam.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/null.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/null_key.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/order_by.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/query_cache.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/range.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/repair_part1.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/replace.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/rollback.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/rpl000006.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/rpl_flush_tables.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/rpl_insert_id.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/rpl_relayrotate.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/select.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/select_found.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/show_check.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/sql_mode.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/status.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/subselect.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/subselect2.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/subselect_innodb.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/symlink.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/temp_table.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/type_blob.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/type_datetime.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/type_enum.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/type_nchar.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/type_set.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/union.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/update.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/r/warnings.result:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/alias.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/alter_table.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/auto_increment.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/bdb-alter-table-1.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/bdb-crash.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/bdb-deadlock.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/bdb.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/bdb_cache.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/create.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/ctype_ucs.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/delete.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/distinct.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/fulltext.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/fulltext2.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/fulltext_distinct.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/fulltext_left_join.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_compress.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_date_add.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_group.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_if.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_str.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_test.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/func_time.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/gis-rtree.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/group_by.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/handler.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/heap.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/heap_auto_increment.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/heap_btree.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/heap_hash.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/help.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/innodb-deadlock.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/innodb.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/innodb_cache.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/innodb_handler.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/insert_select.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/isam.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/join.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/join_crash.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/join_outer.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/key.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/lock.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/lock_tables_lost_commit.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/merge.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/mix_innodb_myisam_binlog.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/multi_update.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/myisam.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/null.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/null_key.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/order_by.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/outfile.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/query_cache.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/query_cache_merge.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/range.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/repair_part1.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/replace.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/rollback.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/rpl000006.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/rpl_flush_tables.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/rpl_insert_id.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/rpl_relayrotate.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/select.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/select_found.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/show_check.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/sql_mode.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/status.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/subselect.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/subselect2.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/subselect_innodb.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/symlink.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/temp_table.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/type_datetime.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/type_set.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/union.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/update.test:
        Change occurances of TYPE= to ENGINE=
      mysql-test/t/warnings.test:
        Change occurances of TYPE= to ENGINE=
        New test for deprecated syntax
      833f85fb
  35. 18 Aug, 2003 1 commit
    • unknown's avatar
      After merge fixes · 89ad93a8
      unknown authored
      Use server character set if --default-character-set is not used
      Added convert_string() for more efficient alloc+character-set convert of strings
      
      
      BitKeeper/deleted/.del-convert.result~a3b56e1db6f498e9:
        Delete: mysql-test/r/convert.result
      BitKeeper/deleted/.del-convert.test~f4ceb743194dfe72:
        Delete: mysql-test/t/convert.test
      BitKeeper/deleted/.del-make_win_src_distribution.old~5c9ebdc4a852b43b:
        Delete: scripts/make_win_src_distribution.old
      client/mysql.cc:
        Use server character set if --default-character-set is not used
      client/mysqltest.c:
        Code cleanup (merge identical code)
        More debug messages
      heap/hp_create.c:
        After merge fix
      include/m_ctype.h:
        After merge fix
      include/my_global.h:
        Remove size_str (we already have size_s)
      include/mysql_com.h:
        After merge fix
      libmysql/libmysql.c:
        After merge fix
      libmysqld/Makefile.am:
        After merge fix
      mysql-test/r/auto_increment.result:
        After merge fix
      mysql-test/r/create.result:
        After merge fix
      mysql-test/r/ctype_latin1_de.result:
        After merge fix
      mysql-test/r/distinct.result:
        After merge fix
      mysql-test/r/drop.result:
        After merge fix
      mysql-test/r/fulltext.result:
        After merge fix
      mysql-test/r/func_gconcat.result:
        After merge fix
      mysql-test/r/func_str.result:
        After merge fix
      mysql-test/r/func_test.result:
        After merge fix
      mysql-test/r/grant.result:
        After merge fix
      mysql-test/r/group_by.result:
        After merge fix
      mysql-test/r/handler.result:
        After merge fix
      mysql-test/r/heap.result:
        After merge fix
      mysql-test/r/heap_btree.result:
        After merge fix
      mysql-test/r/heap_hash.result:
        After merge fix
      mysql-test/r/innodb.result:
        After merge fix
      mysql-test/r/insert.result:
        After merge fix
      mysql-test/r/insert_select.result:
        After merge fix
      mysql-test/r/join_outer.result:
        After merge fix
      mysql-test/r/key.result:
        After merge fix
      mysql-test/r/key_cache.result:
        After merge fix
      mysql-test/r/loaddata.result:
        After merge fix
      mysql-test/r/myisam.result:
        After merge fix
      mysql-test/r/null.result:
        After merge fix
      mysql-test/r/null_key.result:
        After merge fix
      mysql-test/r/order_by.result:
        After merge fix
      mysql-test/r/rpl_do_grant.result:
        After merge fix
      mysql-test/r/rpl_error_ignored_table.result:
        After merge fix
      mysql-test/r/rpl_ignore_grant.result:
        After merge fix
      mysql-test/r/rpl_loaddata.result:
        After merge fix
      mysql-test/r/rpl_log.result:
        After merge fix
      mysql-test/r/rpl_log_pos.result:
        After merge fix
      mysql-test/r/rpl_max_relay_size.result:
        After merge fix
      mysql-test/r/rpl_replicate_do.result:
        After merge fix
      mysql-test/r/rpl_reset_slave.result:
        After merge fix
      mysql-test/r/rpl_rotate_logs.result:
        After merge fix
      mysql-test/r/rpl_user_variables.result:
        After merge fix
      mysql-test/r/select.result:
        After merge fix
      mysql-test/r/select_safe.result:
        After merge fix
      mysql-test/r/subselect.result:
        After merge fix
      mysql-test/r/type_blob.result:
        After merge fix
      mysql-test/r/type_decimal.result:
        After merge fix
      mysql-test/r/type_float.result:
        After merge fix
      mysql-test/r/type_ranges.result:
        After merge fix
      mysql-test/r/type_time.result:
        After merge fix
      mysql-test/r/type_uint.result:
        After merge fix
      mysql-test/r/union.result:
        After merge fix
      mysql-test/r/warnings.result:
        After merge fix
      mysql-test/t/auto_increment.test:
        After merge fix
      mysql-test/t/case.test:
        After merge fix
      mysql-test/t/ctype_collate.test:
        After merge fix
      mysql-test/t/ctype_latin1_de.test:
        After merge fix
      mysql-test/t/drop.test:
        After merge fix
      mysql-test/t/func_in.test:
        After merge fix
      mysql-test/t/func_set.test:
        After merge fix
      mysql-test/t/func_str.test:
        After merge fix
      mysql-test/t/func_test.test:
        After merge fix
      mysql-test/t/grant.test:
        After merge fix
      mysql-test/t/group_by.test:
        After merge fix
      mysql-test/t/handler.test:
        After merge fix
      mysql-test/t/heap.test:
        After merge fix
      mysql-test/t/heap_btree.test:
        After merge fix
      mysql-test/t/heap_hash.test:
        After merge fix
      mysql-test/t/innodb.test:
        After merge fix
      mysql-test/t/insert_select.test:
        After merge fix
      mysql-test/t/key.test:
        After merge fix
      mysql-test/t/key_cache.test:
        After merge fix
      mysql-test/t/lock_tables_lost_commit-master.opt:
        After merge fix
      mysql-test/t/lock_tables_lost_commit.test:
        After merge fix
      mysql-test/t/myisam.test:
        After merge fix
      mysql-test/t/row.test:
        After merge fix
      mysql-test/t/subselect.test:
        After merge fix
      mysql-test/t/type_decimal.test:
        After merge fix
      mysql-test/t/type_ranges.test:
        After merge fix
      mysql-test/t/type_uint.test:
        After merge fix
      mysql-test/t/variables.test:
        After merge fix
      mysql-test/t/warnings.test:
        After merge fix
      scripts/make_win_src_distribution.sh:
        after merge fixes
      sql-common/client.c:
        After merge fix
        Change my_connect() to use poll()
        If character set is not given, use servers character set.
      sql/field.cc:
        After merge fix
        Don't give warnings when storing data in fields in optimizer.
      sql/ha_myisammrg.h:
        After merge fix
      sql/log.cc:
        After merge fix
      sql/log_event.cc:
        After merge fix
      sql/mysqld.cc:
        After merge fix
      sql/opt_range.cc:
        After merge fix
      sql/set_var.cc:
        Code cleanup
        Fixed wrong usage of base_names (like medium.key_buffer) that caused core dumps
      sql/set_var.h:
        Fixed wrong usage of base_names (like medium.key_buffer) that caused core dumps
      sql/slave.cc:
        After merge fix
      sql/sql_acl.cc:
        After merge fix
        Code cleanup
      sql/sql_class.cc:
        Added convert_string() for more efficient alloc+character-set convert of strings
        Add cached flags to avoid calling mysql_charset_same() during parsing.
      sql/sql_class.h:
        Added convert_string() for more efficient alloc+character-set convert of strings
        Add cached flags to avoid calling mysql_charset_same() during parsing.
      sql/sql_handler.cc:
        After merge fix
      sql/sql_lex.h:
        After merge fix
      sql/sql_parse.cc:
        Optimize and fix memory reference errors reported by valgrind
      sql/sql_repl.cc:
        After merge fix
      sql/sql_yacc.yy:
        After merge fix
        Avoid calling mysql_charset_same() when parsing identifiers
      strings/ctype-latin1.c:
        Port latin_de conversion code from 4.0
      89ad93a8
  36. 04 Jul, 2003 3 commits
  37. 03 Jul, 2003 1 commit
    • unknown's avatar
      Proposed fix for #751 · 460ffd36
      unknown authored
      Fields in key_expr (mysql_ha_read) wasn't linked to tables.
      Hmm. How did it work at all?
      
      
      mysql-test/r/alias.result:
        It's better to delete table after the test
      mysql-test/r/handler.result:
        appropriate result
      mysql-test/t/alias.test:
        it's better to drop table after test
      mysql-test/t/handler.test:
        test case for #751
      sql/sql_handler.cc:
        fix_fields called
      460ffd36