1. 08 Aug, 2005 1 commit
    • unknown's avatar
      Fix for bug #10055 "Using stored function with information_schema causes empty · 39fda600
      unknown authored
      result set".
      
      To enable full access to contents of I_S tables from stored functions
      or statements that use them, we manipulate with thread's open tables
      state and ensure that we won't cause deadlock when we open tables by
      ignoring flushes and name-locks.
      Building of contents of I_S.TABLES no longer requires locking of tables
      since we use use handler::info() method with HA_STATUS_AUTO flag instead
      of handler::update_auto_increment() for obtaining information about
      auto-increment values. But this also means that handlers have to implement
      support for HA_STATUS_AUTO flag (particularly InnoDB needs it).
      
      
      mysql-test/r/alter_table.result:
        Updated test results. This change was caused by the fact that now when
        we build contents of I_S tables (and thus output of SHOW INDEX) we
        don't use instances of tables which may be already opened and locked
        by thread (we always use new instance).
      mysql-test/r/information_schema.result:
        Added test which checks how information about current auto-increment value for
        table is reported in INFORMATION_SCHEMA.TABLES view.
      mysql-test/r/sp.result:
        Added test for bug #10055 "Using stored function with information_schema causes
        empty result set".
      mysql-test/t/information_schema.test:
        Added test which checks how information about current auto-increment value for
        table is reported in INFORMATION_SCHEMA.TABLES view.
      mysql-test/t/sp.test:
        Added test for bug #10055 "Using stored function with information_schema causes
        empty result set".
      sql/mysql_priv.h:
        close_thread_tables():
          Get rid of 'stopper' argument which is no longer used. Now when we need
          to open and then close some table without touching tables which are already
          opened we use THD::reset_n/restore_backup_open_tables_state() methods.
        open_tables()/open_normal_and_derived_tables():
          Added 'flags' argument to be able open tables even if some has done
          a flush or hold namelock on them.
      sql/sp.cc:
        close_proc_table/open_proc_table_for_read/db_find_routine():
          Replaced push_open_tables_state/pop_open_tables_state() methods which
          were saving/restoring current open tables state in/from THD::open_state_list
          with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
          methods which assume that backup storage for this state is allocated on
          stack (or elsewhere) by their caller.
        open_proc_table_for_read():
          Since now we can have several open tables states stacked up we can't rely
          rely on checking whether we have some tables open in previous state.
          Instead we always assume that some tables are open and we need to ignore
          flush while locking mysql.proc. We don't really need 
          MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK in this case since we open mysql.proc table
          only for reading.
      sql/sp.h:
        Added declarations of open_proc_table_for_read()/close_proc_table() to be
        able to use them in sql_show.cc.
      sql/sql_base.cc:
        close_thread_tables():
          Get rid of 'stopper' argument which is no longer used. Now when we need
          to open and then close some table without touching tables which are already
          opened we use THD::reset_n/restore_backup_open_tables_state() methods.
        open_tables()/open_normal_and_derived_tables():
          Added 'flags' argument to be able open tables even if some has done
          a flush or hold namelock on them.
      sql/sql_class.cc:
        Open_tables_state, THD:
          Replaced push_open_tables_state/pop_open_tables_state() methods which
          were saving/restoring current open tables state in/from THD::open_state_list
          with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
          methods which assume that backup storage for this state is allocated on
          stack (or elsewhere) by their caller.
      sql/sql_class.h:
        Open_tables_state, THD:
          Replaced push_open_tables_state/pop_open_tables_state() methods which
          were saving/restoring current open tables state in/from THD::open_state_list
          with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
          methods which assume that backup storage for this state is allocated on
          stack (or elsewhere) by their caller.
      sql/sql_handler.cc:
        open_tables()/open_normal_and_derived_tables():
          Added 'flags' argument to be able open tables even if some has done
          a flush or hold namelock on them.
      sql/sql_prepare.cc:
        open_tables()/open_normal_and_derived_tables():
          Added 'flags' argument to be able open tables even if some has done
          a flush or hold namelock on them.
      sql/sql_show.cc:
        get_all_tables():
          Now we use THD::reset_n_/restore_backup_open_tables_state() for 
          saving/restoring open tables state instead of working with it directly
          (This also allows us to have proper content of I_S system tables in
          statements with stored functions and in stored functions). We also
          ignore possible flushes when opening tables (we may create deadlock
          otherwise). Also we do all needed manipulations with LEX in this function
          and not in get_schema_tables_result() now.
        get_schema_tables_record():
          Let us use handler::info() method with HA_STATUS_AUTO flag for obtaining
          information about table's auto-increment value. This allows to avoid locking
          of tables which is needed when we use handler::update_auto_increment() method.
        fill_schema_proc():
          Now we use open_proc_table_for_read/close_proc_table() for access to
          mysql.proc table (so we won't cause deadlock if we already have some
          tables open and locked, this also allows us to have proper content in
          ROUTINES system table in statements using stored functions/in stored
          functions).
        get_schema_tables_result():
          Moved all manipulations with Open_tables_state and LEX needed for
          safe opening of tables to ST_SCHEMA_TABLE::fill_table functions
          (i.e. get_all_tables() and fill_schema_proc()).
      sql/sql_update.cc:
        open_tables()/open_normal_and_derived_tables():
          Added 'flags' argument to be able open tables even if some has done
          a flush or hold namelock on them.
      39fda600
  2. 14 Jul, 2005 7 commits
    • unknown's avatar
      Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0 · 20d8170a
      unknown authored
      into  mysql.com:/usr/home/bar/mysql-5.0
      
      
      20d8170a
    • unknown's avatar
      item.cc: · 9f707ab2
      unknown authored
        After merge fix.
      
      
      sql/item.cc:
        After merge fix.
      9f707ab2
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 7e2defb6
      unknown authored
      into  mysql.com:/media/sda1/mysql/mysql-5.0-10760-new
      
      
      7e2defb6
    • unknown's avatar
      Implement MarkM optimization request to avoid redundnat packet exchange · fd9f67f8
      unknown authored
      in cursors.
      
      
      libmysql/libmysql.c:
        - reset_stmt_handle(): don't reset the server side just because we have 
          an open cursor: the server will close the cursor automatically if 
          needed
      sql/sql_prepare.cc:
        - implement Prepared_statement::close_cursor,
        - implicitly close an open cursor in mysql_stmt_execute instead of 
          issuing an error (to reduce the need to explicitly close cursors
          and save network bandwidth).
        - cleanup
      sql/sql_select.cc:
        Remove a destructor: cursor destruction can not be done by simply
        calling a destructor, because of cross-references between cursor
        and statement memory.
      sql/sql_select.h:
        - add an empty Cursor destructor
      tests/mysql_client_test.c:
        - remove a test for dropped functionality
      fd9f67f8
    • unknown's avatar
      Merge mysql.com:/usr/home/bar/mysql-4.1.num-conv · 212345b4
      unknown authored
      into  mysql.com:/usr/home/bar/mysql-5.0
      
      
      mysql-test/r/ctype_utf8.result:
        Auto merged
      mysql-test/t/ctype_utf8.test:
        Auto merged
      sql/item.h:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/item.cc:
        After merge fix.
      212345b4
    • unknown's avatar
      valgrind error fix(uninitialiased variable) · c0e325a3
      unknown authored
      removed unnecessary operation
      
      
      sql/sql_lex.cc:
        valgrind error fix(uninitialiased variable)
      sql/sql_parse.cc:
        removed unnecessary operation
      c0e325a3
    • unknown's avatar
      Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1 · 86cb32b7
      unknown authored
      into  mysql.com:/usr/home/bar/mysql-4.1.num-conv
      
      
      mysql-test/r/ctype_utf8.result:
        Auto merged
      mysql-test/t/ctype_utf8.test:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      86cb32b7
  3. 13 Jul, 2005 32 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 8ba10fa9
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      8ba10fa9
    • unknown's avatar
      Post-merge fixes. · 060730f4
      unknown authored
      060730f4
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 10ec1349
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc
      
      
      10ec1349
    • unknown's avatar
      Merge mysql.com:/opt/local/work/mysql-4.1-9379 · 27180ce9
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      mysql-test/r/ps.result:
        Manual merge.
      mysql-test/t/ps.test:
        Manual merge.
      27180ce9
    • unknown's avatar
      Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0 · 15413296
      unknown authored
      into mysql.com:/M50/mysql-5.0
      
      
      VC++Files/tests/mysql_client_test.dsp:
        Auto merged
      mysql-test/r/view.result:
        Auto merged
      mysql-test/t/view.test:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      15413296
    • unknown's avatar
      A test case for Bug#9442 "Set parameter make query fail if column · c663aa89
      unknown authored
      character set is UCS2".
      The bug is no longer repeatable.
      
      
      mysql-test/r/ps.result:
        Test results fixed (a test case for Bug#9442)
      mysql-test/t/ps.test:
        A test case for Bug#9442 "Set parameter make query fail if column 
        character set is UCS2
      c663aa89
    • unknown's avatar
      Merging separate commits into 5.0.9-beta build clone and general BK tree. · 19f4236b
      unknown authored
      Tagging the 5.0.9-beta release.
      
      
      mysql-test/r/view.result:
        Auto merged
      mysql-test/t/view.test:
        Auto merged
      VC++Files/tests/mysql_client_test.dsp:
        Merging separate commits into 5.0.9-beta build clone and general BK tree.
      sql/sql_insert.cc:
        Merging separate commits into 5.0.9-beta build clone and general BK tree.
      19f4236b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 03cf7dde
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc
      
      
      03cf7dde
    • unknown's avatar
      Now when we create or drop trigger we will open only subject table and not · 4c197d99
      unknown authored
      all tables suggested by prelocking algorithm.
      Added test for bug #11889 "Server crashes when dropping trigger using stored
      routine" (which was fixed by previous patch).
      
      
      mysql-test/r/trigger.result:
        Since we are using open_ltable() now to open table for trigger creation, code
        for error when we try to create trigger on view has changed to equivalent one.
        Added test for bug #11889 "Server crashes when dropping trigger using stored
        routine".
      mysql-test/t/trigger.test:
        Since we are using open_ltable() now to open table for trigger creation, code
        for error when we try to create trigger on view has changed to equivalent one.
        Added test for bug #11889 "Server crashes when dropping trigger using stored
        routine".
      sql/sql_trigger.cc:
        mysql_create_or_drop_trigger():
          It is better to open only table for which we are going to create or drop
          trigger with open_ltable() since we don't really need working prelocking
          in this case.
      4c197d99
    • unknown's avatar
      Merge mysql.com:/opt/local/work/mysql-4.1-9379 · 061406ba
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      sql/item.cc:
        Auto merged
      mysql-test/r/ps.result:
        Manual merge.
      mysql-test/t/ps.test:
        Manual merge.
      sql/item_func.cc:
        Manual merge.
      061406ba
    • unknown's avatar
      A fix and a test case for Bug#9379 (collation of a parameter marker is · 98248f04
      unknown authored
      binary).
      
      
      mysql-test/r/ps.result:
        Test results fixed (Bug#9379)
      mysql-test/t/ps.test:
        A test case for Bug#9379 (collation of a parameter marker is binary)
      sql/item.cc:
        - set Item_param::collation to str_value collation, if Item_param
        is assigned a string. Reset it to default in Item_param::reset() (on 
        the next execution it can be assigned a number).
      sql/item_func.cc:
        - now that item collation can change between executions
        (if this item is Item_param), we need to register the change
        of the execution tree in the rollback list.
      98248f04
    • unknown's avatar
      Merge mysql.com:/opt/local/work/mysql-4.1-11458 · b7033fb3
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      configure.in:
        Manual merge
      mysql-test/r/ps.result:
        Manual merge
      mysql-test/t/ps.test:
        Manual merge
      b7033fb3
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 51ce56e6
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      51ce56e6
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · e064ca31
      unknown authored
      into  mysql.com:/opt/local/work/mysql-4.1-11458
      
      
      e064ca31
    • unknown's avatar
      Merge mysql.com:/opt/local/work/mysql-4.1-11458 · 91c97a76
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-root
      
      
      sql/mysql_priv.h:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      mysql-test/r/ps.result:
        Manual merge.
      mysql-test/t/ps.test:
        Manual merge.
      sql/item.cc:
        Manual merge.
      sql/item.h:
        Manual merge.
      sql/item_subselect.h:
        Manual merge.
      sql/sql_parse.cc:
        Manual merge.
      sql/sql_prepare.cc:
        Manual merge.
      91c97a76
    • unknown's avatar
      Cleanup after test for Bug#11458 · f5c8f42f
      unknown authored
      f5c8f42f
    • unknown's avatar
      4.1.13 has been cloned off · 5ef54bb9
      unknown authored
      
      configure.in:
        Increase version number to 4.1.14, as the clone for 4.1.13 has been created.
      5ef54bb9
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · 7a0f6d52
      unknown authored
      into  mysql.com:/opt/local/work/mysql-4.1-11458
      
      
      sql/mysql_priv.h:
        Auto merged
      7a0f6d52
    • unknown's avatar
      - a fix for Bug#11458 "Prepared statement with subselects return random · ece17ba3
      unknown authored
      data": remove the fix for another bug (8807) that
      added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder
      to prevent their evaluation at prepare. As this bit hanged in 
      Item_subselect::used_tables_cache for ever, a constant subquery with
      a placeholder was never evaluated as such, which caused wrong 
      choice of the execution plan for the statement.
      - to fix Bug#8807 backport a better fix from 5.0
      - post-review fixes.
      
      
      mysql-test/r/ps.result:
        Bug#11458: test results fixed
      mysql-test/t/ps.test:
        - add a test case for Bug#11458 "Prepared statement with subselects return 
        random data"
      sql/item.cc:
        - remove unnecessary Item_param::fix_fields
        - fix Item_param::set_null to set item_type accordingly (safety:
          Item_param should behave like a basic constant).
      sql/item.h:
        Remove Item_param::fix_fields
      sql/item_subselect.h:
        Remove no more existing friend.
      sql/mysql_priv.h:
        Add UNCACHEABLE_PREPARE to mark all subqueries as uncacheable if
        in statement prepare (backport from 5.0).
      sql/sql_lex.h:
        Comment fixed.
      sql/sql_parse.cc:
        If in statement prepare, mark all subqueries as uncacheable (backport
        from 5.0)
      sql/sql_prepare.cc:
        Switch off the uncacheable flag from all subqueries after statement
        prepare is done (backport from 5.0)
      ece17ba3
    • unknown's avatar
      sql_update.cc: · 859ccd3b
      unknown authored
        mysql_update(): Call handler::unlock_row()
        also in the first while loop.
        This patch is from Heikki,
        and it was approved by Sergei Golubchik.
      
      
      sql/sql_update.cc:
        mysql_update(): Call handler::unlock_row()
        also in the first while loop.
        This patch is from Heikki,
        and it was approved by Sergei Golubchik.
      859ccd3b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 7001961e
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc
      
      
      7001961e
    • unknown's avatar
      Fixed trigger.test after fixing bug #11554 "Server crashes on statement · 02bfa710
      unknown authored
      indirectly using non-cached function".
      
      
      mysql-test/r/trigger.result:
        Fixed test case after fixing bug #11554 "Server crashes on statement
        indirectly using non-cached function".
      mysql-test/t/trigger.test:
        Fixed test case after fixing bug #11554 "Server crashes on statement
        indirectly using non-cached function".
      02bfa710
    • unknown's avatar
      Merge mysql.com:/home/bkroot/mysql-4.1 · 7310c345
      unknown authored
      into mysql.com:/home/bk/bXXX-mysql-5.0
      
      
      mysql-test/r/rpl_deadlock.result:
        Auto merged
      mysql-test/t/rpl_deadlock.test:
        Auto merged
      7310c345
    • unknown's avatar
      Bug#11905: Tables used in rpl_deadlock are not dropped at the · ecd1ea93
      unknown authored
      end of the test, causing subsequent tests to fail.
      
      
      mysql-test/r/rpl_deadlock.result:
        Result change.
      mysql-test/t/rpl_deadlock.test:
        Tables used in the test but not dropped.
      ecd1ea93
    • unknown's avatar
      Post-merge fix · 52adc14e
      unknown authored
      52adc14e
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 9aa15040
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc
      
      
      mysql-test/r/sp-error.result:
        Auto merged
      mysql-test/t/sp-error.test:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sp.h:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_lex.cc:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      sql/share/errmsg.txt:
        Manual merge.
      sql/sp.cc:
        Manual merge.
      9aa15040
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/4.1 · 3b7a17d8
      unknown authored
      into mysql.com:/home/gluh/MySQL/Merge/5.0
      
      
      mysql-test/r/func_str.result:
        Auto merged
      mysql-test/t/func_str.test:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      3b7a17d8
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0 · 9ea8a511
      unknown authored
      into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
      
      
      9ea8a511
    • unknown's avatar
    • unknown's avatar
      Implementation of Monty's idea: Now we can open mysql.proc table for lookup · 11f9e513
      unknown authored
      of stored routines definitions even if we already have some tables open and
      locked. To avoid deadlocks in this case we have to put certain restrictions
      on locking of mysql.proc table.
      
      This allows to use stored routines safely under LOCK TABLES without explicitly
      mentioning mysql.proc in the list of locked tables. It also fixes bug #11554
      "Server crashes on statement indirectly using non-cached function".
      
      
      mysql-test/r/sp-error.result:
        Added test which checks that now we can read stored routines definitions
        under LOCK TABLES even if we have not locked mysql.proc explicitly. Also
        added check for restrictions which this ability puts on mysql.proc locking.
        Updated test for bug #9566 to correspond this new situation.
      mysql-test/r/sp-threads.result:
        Added test for bug #11554 "Server crashes on statement indirectly using
        non-cached function".
      mysql-test/t/sp-error.test:
        Added test which checks that now we can read stored routines definitions
        under LOCK TABLES even if we have not locked mysql.proc explicitly. Also
        added check for restrictions which this ability puts on mysql.proc locking.
        Updated test for bug #9566 to correspond this new situation.
      mysql-test/t/sp-threads.test:
        Added test for bug #11554 "Server crashes on statement indirectly using
        non-cached function".
      sql/lock.cc:
        get_lock_data():
         To be able to open and lock for reading system tables like 'mysql.proc',
         when we already have some tables opened and locked, and avoid deadlocks
         we have to disallow write-locking of these tables with any other tables.
      sql/mysql_priv.h:
        open_table() has new parameter which allows to open table even if some-one
        has done a flush or holding namelock on it.
      sql/share/errmsg.txt:
        Added error message saying that one cannot write-lock some of system tables
        with any other tables.
      sql/sp.cc:
        open_proc_table_for_read()/close_proc_table():
          Added functions to be able open and close mysql.proc table when we already
          have some tables open and locked.
        open_proc_table_for_update():
          Added function to simplify opening of mysql.proc for updates.
        db_find_routine_aux()/db_find_routine()/db_update_routine()/...
          Moved responsibility for opening mysql.proc table from db_find_routine_aux()
          one level up, since this level knows better which type of table access for
          reading of for update it needs.
        sp_function_exists():
          Removed unused function.
      sql/sp.h:
        sp_function_exists():
          Removed unused function.
      sql/sql_base.cc:
        open_table():
          Added new parameter which allows to open table even if some-one has done a
          flush or holding namelock on it.
        open_unireg_entry():
          Mark 'mysql.proc' as a system table which has special restrictions on its
          locking, but thanks to them can be open and locked even if we already have
          some open and locked.
      sql/sql_class.cc:
        Moved THD members holding information about open and locked tables to separate
        Open_tables_state class to be able to save/restore this state easier.
        Added THD::push_open_tables_state()/pop_open_tables_state() methods for
        saving/restoring this state.
      sql/sql_class.h:
        Moved THD members holding information about open and locked tables to separate
        Open_tables_state class to be able to save/restore this state easier.
        Added THD::push_open_tables_state()/pop_open_tables_state() methods for
        saving/restoring this state.
      sql/sql_lex.cc:
        Removed LEX::proc_table member which was not really used.
      sql/sql_lex.h:
        Removed LEX::proc_table member which was not really used.
      sql/sql_table.cc:
        open_table() has new parameter which allows to open table even if some-one
        has done a flush or holding namelock on it.
      sql/table.h:
        Added TABLE_SHARE::system_table indicating that this table is system table
        like 'mysql.proc' and we want to be able to open and read-lock it even when
        we already have some tables open and locked (and because of this we have
        to put some restrictions on write locking it).
      11f9e513
    • unknown's avatar
      Bug #9854 hex() and out of range handling · 3ae23d5b
      unknown authored
        added out of range handling
      
      
      3ae23d5b
    • unknown's avatar
      897a8d0f