1. 22 Sep, 2005 2 commits
    • unknown's avatar
      Fixes needed to build 5.0.13 on Windows: · ac9c1fa3
      unknown authored
      - reflect two "Makefile.am" changes in the respective "VC project" files,
      - correct a typo in a (normally) unused macro parameter.
      
      
      VC++Files/libmysqld/libmysqld.vcproj:
        Reflect a change done by Kostja in the Unix "libmysqld/Makefile.am":
        New file "sql/sql_cursor.cpp" replaces "sql/protocol_cursor.cpp".
      VC++Files/sql/mysqld.vcproj:
        Reflect a change done by Kostja in the Unix "sql/Makefile.am":
        New file "sql/sql_cursor.cpp" replaces "sql/protocol_cursor.cpp".
      sql/ha_federated.cc:
        Correct a typo (matters only if "SAFEMALLOC" is set).
      ac9c1fa3
    • unknown's avatar
      Fixed problems found by valgrind · 7d6d4c83
      unknown authored
      Fixed problems in test suite where some test failed
      Fixed access to not initialized memory in federated
      Fixed access to not initialized memory when using BIT fields in internal temporary tables
      
      
      BitKeeper/etc/ignore:
        added libmysqld/sql_cursor.h
      mysql-test/r/information_schema.result:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd
      mysql-test/r/information_schema_inno.result:
        Remove used tables at start
      mysql-test/r/multi_statement.result:
        Remove used tables at start
      mysql-test/r/temp_table.result:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/r/type_bit.result:
        More tests
      mysql-test/t/information_schema.test:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/t/information_schema_inno.test:
        Remove used tables at start
      mysql-test/t/multi_statement.test:
        Remove used tables at start
      mysql-test/t/temp_table.test:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/t/type_bit.test:
        More tests
      mysql-test/valgrind.supp:
        Removed some valgrind warnings that isn't errors
      sql/ha_federated.cc:
        Fixed errors discovered by valgrind:
        - Socket was not initialized
        - share->scheme was deleted while there was still pointer into it from the hash
      sql/item_func.h:
        Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup())
        This fixed a bug with access to already freed memory
      sql/sql_base.cc:
        Reset variables used by fulltext
      sql/sql_select.cc:
        Fixed various problems with bit fields when used in internal temporary tables.
        Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
      7d6d4c83
  2. 21 Sep, 2005 1 commit
    • unknown's avatar
      A fix and a test case for Bug#6513 "Test Suite: Values inserted by using · 813fc410
      unknown authored
      cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
      Crash while fetching from table with 5 million records."
      A fix for a possible memory leak when fetching into an SP cursor
      in a long loop.
      The patch uses a common implementation of cursors in the binary protocol and 
      in stored procedures and implements materialized cursors.
      For implementation details, see comments in sql_cursor.cc
      
      
      include/my_sys.h:
        - declaration for multi_alloc_root
      libmysqld/Makefile.am:
        - drop protocol_cursor.cc, add sql_cursor.cc (replaces the old
        implementation of cursors with a new one)
      mysql-test/r/ctype_ujis.result:
        - test results fixed (a test case for Bug#6513)
      mysql-test/r/sp-big.result:
        - test results fixed (a test case for Bug#9819)
      mysql-test/t/ctype_ujis.test:
        Add a test case for Bug#6513 "Test Suite: Values inserted by using cursor is
         interpreted latin1 character"
      mysql-test/t/sp-big.test:
        Add a restricted test case for Bug#9819 "Cursors: Mysql Server Crash
        while fetching from table with 5 million records."
      mysys/my_alloc.c:
        - an implementation of multi_alloc_root; this is largely a copy-paste
          from mulalloc.c, but the function is small and there is no easy way
          to reuse the existing C function.
      sql/Makefile.am:
        - add sql_cursor.h, sql_cursor.cc (a new implementation of stored procedure
        cursors) and drop protocol_cursor.cc (the old one)
      sql/handler.cc:
        - now TABLE object has its mem_root always initialized.
          Adjust the implementation handler::ha_open
      sql/item_subselect.cc:
        - adjust to the changed declaration of st_select_lex_unit::prepare
      sql/protocol.h:
        - drop Protocol_cursor
      sql/sp_head.cc:
        - move juggling with Query_arena::free_list and Item::next to
          sp_eval_func_item, as this is needed in 3 places already.
      sql/sp_head.h:
        - declare a no-op implementation for cleanup_stmt in sp_instr_cpush.
          This method is needed for non-materializing cursors, which are yet not 
          used in stored procedures.
        - declaration for sp_eval_func_item
      sql/sp_rcontext.cc:
        - reimplement sp_cursor using the new implementation of server side cursors.
        - use sp_eval_func_item to assign values of SP variables from the
          row fetched from a cursor. This should fix a possible memory leak in 
          the old implementation of sp_cursor::fetch
      sql/sp_rcontext.h:
        - reimplement sp_cursor using the new implementation of server side cursors.
      sql/sql_class.cc:
        - disable the functionality that closes transient cursors at commit/rollback;
          transient cursors are not used in 5.0, instead we use materialized ones.
          To be enabled in a later version.
      sql/sql_class.h:
        - adjust to the rename Cursor -> Server_side_cursor
        - additional declarations of select_union used in materialized cursors
      sql/sql_derived.cc:
        - reuse bits of tmp table code in UNION, derived tables, and materialized
          cursors
        - cleanup comments
      sql/sql_lex.h:
        - declarations of auxiliary methods used by materialized cursors
        - a cleanup in st_select_lex_unit interface
      sql/sql_list.h:
        - add an array operator new[] to class Sql_alloc
      sql/sql_prepare.cc:
        - split the tight coupling of cursors and prepared statements to reuse 
          the same implementation in stored procedures
        - cleanups of error processing in Prepared_statement::{prepare,execute}
      sql/sql_select.cc:
        - move the implementation of sensitive (non-materializing) cursors to 
          sql_cursor.cc
        - make temporary tables self-contained: the table, its record and fields
          are allocated in TABLE::mem_root. This implementation is not clean
          and resets thd->mem_root several times because of the way create_tmp_table 
          works (many additional things are done inside it).
        - adjust to the changed declaration of st_select_lex_unit::prepare
      sql/sql_select.h:
        - move the declaration of sensitive (non-materializing) cursors to 
          sql_cursor.cc
      sql/sql_union.cc:
        - move pieces of st_select_unit::prepare to select_union and st_table
          methods to be able to reuse code in the implementation of materialized
          cursors
      sql/sql_view.cc:
        - adjust to the changed signature of st_select_lex_unit::prepare
      sql/table.cc:
        - implement auxiliary st_table methods for use with temporary tables
      sql/table.h:
        - add declarations for auxiliary methods of st_table used to work with 
         temporary tables
      tests/mysql_client_test.c:
        - if cursors are materialized, a parallel update of the table used
          in the cursor may go through: update the test.
      sql/sql_cursor.cc:
        New BitKeeper file ``sql/sql_cursor.cc'' -- implementation of server side
        cursors
      sql/sql_cursor.h:
        New BitKeeper file ``sql/sql_cursor.h'' - declarations for
        server side cursors.
      813fc410
  3. 20 Sep, 2005 3 commits
  4. 17 Sep, 2005 2 commits
  5. 16 Sep, 2005 1 commit
    • unknown's avatar
      log.cc: · a12f1d0e
      unknown authored
        Cast my_munmap() argument to be able to compile on Solaris
      
      
      sql/log.cc:
        Cast my_munmap() argument to be able to compile on Solaris
      a12f1d0e
  6. 15 Sep, 2005 11 commits
  7. 14 Sep, 2005 20 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · dceb8fb2
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2
      
      
      sql/mysql_priv.h:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sp_head.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      dceb8fb2
    • unknown's avatar
      Fix for bug #12704 "Server crashes during trigger execution". · d5303b8a
      unknown authored
      This bug occurs when some trigger for table used by DML statement is created
      or changed while statement was waiting in lock_tables(). In this situation
      prelocking set which we have calculated becames invalid which can easily lead
      to errors and even in some cases to crashes.
      
      With proposed patch we no longer silently reopen tables in lock_tables(),
      instead caller of lock_tables() becomes responsible for reopening tables and
      recalculation of prelocking set.
      
      
      mysql-test/t/trigger.test:
        Added tests for bug #12704 "Server crashes during trigger execution".
        Unfortunately these tests rely on the order in which tables are locked
        by statement so they are non-determenistic and therefore should be disabled.
      sql/lock.cc:
        mysql_lock_tables():
          Now instead of always reopening altered or dropped tables by itself
          mysql_lock_tables() can notify upper level and rely on caller doing this.
      sql/mysql_priv.h:
        Now mysql_lock_tables() can either reopen deleted or altered tables by itself
        or notify caller about such situation through 'need_reopen' argument and rely
        on it in this.
        Also lock_tables() has new 'need_reopen' out parameter through which it
        notifies caller that some tables were altered or dropped so he needs to reopen
        them (and rebuild prelocking set some triggers may change or simply appear).
      sql/sp.cc:
        sp_add_used_routine():
          To be able to restore LEX::sroutines_list to its state right after parsing
          we now adjust  LEX::sroutines_list_own_last/sroutines_list_own_elements when
          we add directly used routine.
        sp_remove_not_own_routines():
          Added procedure for restoring LEX::sroutines/sroutines_list to their state
          right after parsing (by throwing out non-directly used routines).
        sp_cache_routines_and_add_tables_for_view()/sp_update_stmt_used_routines():
          We should use LEX::sroutines_list instead of LEX::sroutines as source of
          routines used by view, since LEX::sroutines is not availiable for view
          on second attempt to open it (see comment in open_tables() about it).
      sql/sp.h:
        sp_remove_not_own_routines():
          Added procedure for restoring LEX::sroutines/sroutines_list to their state
          right after parsing (by throwing out non-directly used routines).
      sql/sp_head.cc:
        Removed assert which is no longer always true.
      sql/sql_base.cc:
        reopen_table():
          When we re-open table and do shallow copy of TABLE object we should adjust
          pointers to it in associated Table_triggers_list object. Removed nil
          operation.
        open_tables():
          Now this function is able to rebuild prelocking set for statement if it is
          needed. It also correctly handles FLUSH TABLES which may occur during its
          execution.
        lock_tables():
          Instead of allowing mysql_lock_tables() to silently reopen altered or dropped
          tables let us notify caller and rely on that it will do reopen itself.
          This solves the problem when trigger suddenly appears or changed during
          mysq_lock_tables().
        close_tables_for_reopen():
          Added routine for properly preparing for reopening of tables and recalculation
          of set of prelocked tables.
      sql/sql_handler.cc:
        Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
      sql/sql_insert.cc:
        Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
      sql/sql_lex.cc:
        LEX:
          Added 'sroutines_list_own_last' and 'sroutines_list_own_elements' members
          which are used for keeping state in which 'sroutines_list' was right after
          statement parsing (and for restoring of this list to this state).
      sql/sql_lex.h:
        LEX:
          Added 'sroutines_list_own_last' and 'sroutines_list_own_elements' members
          which are used for keeping state in which 'sroutines_list' was right after
          statement parsing (and for restoring of this list to this state).
          Added chop_off_not_own_tables() method to simplify throwing away list
          of implicitly used (prelocked) tables.
      sql/sql_prepare.cc:
        Now instead of silently reopening altered or dropped tables in
        lock_tables() we notify caller and rely on that the caller will
        reopen tables.
      sql/sql_table.cc:
        Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
      sql/sql_trigger.cc:
        Added Table_triggers_list::set_table() method to adjust Table_triggers_list
        to new pointer to TABLE instance.
      sql/sql_trigger.h:
        Added Table_triggers_list::set_table() method to adjust Table_triggers_list
        to new pointer to TABLE instance.
      sql/sql_update.cc:
        Now instead of silently reopening altered or dropped tables in
        lock_tables() we notify caller and rely on that the caller will
        reopen tables.
      d5303b8a
    • unknown's avatar
      Merge eherman@bk-internal.mysql.com:/home/bk/mysql-5.0 · 4e17e059
      unknown authored
      into  mysql.com:/home/eric/mysql-5.0-fed-err
      
      
      4e17e059
    • unknown's avatar
      Merge eherman@bk-internal.mysql.com:/home/bk/mysql-5.0 · 8ac6ab4a
      unknown authored
      into  mysql.com:/home/eric/mysql-5.0-fed-err
      
      
      8ac6ab4a
    • unknown's avatar
      Updated test results for view test. · 11e0bdd7
      unknown authored
      
      mysql-test/r/view.result:
        Updated test results
      11e0bdd7
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 92e4aa67
      unknown authored
      into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.0
      
      
      92e4aa67
    • unknown's avatar
      fixed portability · 78cf7b19
      unknown authored
      78cf7b19
    • unknown's avatar
      Merge mysql.com:/home/mydev/mysql-5.0 · 232d1ff4
      unknown authored
      into  mysql.com:/home/mydev/mysql-5.0-5000
      
      
      232d1ff4
    • unknown's avatar
      Merge mysql.com:/home/emurphy/src/work/mysql-5.0-bug-12870 · 949cc285
      unknown authored
      into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.0
      
      
      sql/sql_parse.cc:
        Auto merged
      949cc285
    • unknown's avatar
      BUG#12870 (CREATE PROCEDURE followed by ROLLBACK is not replicated) · bdae7b9b
      unknown authored
      Fixed by making CREATE/ALTER/DROP PROCEDURE cause implicit commit.
      
      
      mysql-test/r/rpl_ddl.result:
        Updated results to include testing of implicit commit for
        create/alter/drop procedure
      mysql-test/t/rpl_ddl.test:
        BUG#12870 test implicit commit for create/alter/drop procedure.
      sql/sql_parse.cc:
        CREATE/ALTER/DROP PROCEDURE/SPFUNCTION now causes implicit commit.
      bdae7b9b
    • unknown's avatar
      Per LenZ, changed calculated buffer size to constant and removed some unused variables. · 7dc083d5
      unknown authored
      
      sql/ha_federated.cc:
        converted calculated buffer size to static interger.
        removed unused variables.
      7dc083d5
    • unknown's avatar
      Merge mysql.com:/home/alexi/mysql-5.0 · 97bea909
      unknown authored
      into  mysql.com:/home/alexi/dev/mysql-5.0-13000
      
      
      mysql-test/r/view.result:
        Auto merged
      mysql-test/t/view.test:
        Auto merged
      97bea909
    • unknown's avatar
      Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(), · b214671e
      unknown authored
       DAYOFWEEK(), and WEEKDAY().
      
      
      mysql-test/r/func_time.result:
        Fixed new results for testcases containing EXPLAIN EXTENDED SELECT ...
         WEEKDAY ... DAYNAME. The new results are correct and correspond to
         the changes in create_func_weekday() and create_func_dayname().
      mysql-test/r/view.result:
        Fixed some testcases results (bugs #12963, #13000).
      mysql-test/t/view.test:
        Added testcases for for bugs #12963, #13000.
      sql/item_create.cc:
        Fixed bugs #12963, #13000: wrong VIEW creation with DAYNAME(),
         DAYOFWEEK(), and WEEKDAY().
         Modified create_func_dayname(), create_func_dayofweek(), and
         create_func_weekday(). They don´t insert Item_func_to_days
         object now.
      sql/item_timefunc.cc:
        Fixed bugs #12963, #13000: wrong VIEW creation with DAYNAME(),
         DAYOFWEEK(), and WEEKDAY().
         Modified Item_func_weekday::val_int(). The argument of weekday should
         not be considered now to be Item_func_to_days object.
      sql/item_timefunc.h:
        Fixed bugs #12963, 13000: wrong VIEW creation with DAYNAME(),
         DAYOFWEEK(), and WEEKDAY.
         Modified Item_func_weekday::func_name(). It returns now different
         names depending on the odbc_type attribute value.
      b214671e
    • unknown's avatar
      Merge mysql.com:/home/mydev/mysql-5.0 · dd8d6395
      unknown authored
      into  mysql.com:/home/mydev/mysql-5.0-5000
      
      
      sql/sql_show.cc:
        Auto merged
      dd8d6395
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0 · 528c3a71
      unknown authored
      into dl145c.mysql.com:/home/ndbdev/tomas/mysql-5.0
      
      
      528c3a71
    • unknown's avatar
      Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-5.0 · 21b8177e
      unknown authored
      into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner2-5.0
      
      
      21b8177e
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0 · ead2b334
      unknown authored
      into dl145c.mysql.com:/home/ndbdev/tomas/mysql-5.0
      
      
      ead2b334
    • unknown's avatar
      Merge mysql.com:/home/stewart/Documents/MySQL/5.0/main · 06fc0e8b
      unknown authored
      into  mysql.com:/home/stewart/Documents/MySQL/5.0/bug13136
      
      
      06fc0e8b
    • unknown's avatar
      Merge mysql.com:/home/mydev/mysql-5.0 · 18196ce1
      unknown authored
      into  mysql.com:/home/mydev/mysql-5.0-5000
      
      
      18196ce1
    • unknown's avatar
      Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-5.0 · e33c22a1
      unknown authored
      into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner2-5.0
      
      
      e33c22a1