An error occurred fetching the project authors.
  1. 20 Aug, 2005 1 commit
    • unknown's avatar
      Fixes during review of new pushed code · 3eda70b2
      unknown authored
      Fixed new bug when running a SP without a default database
      
      
      mysql-test/r/information_schema.result:
        Added test to cover changes made in default handling
      mysql-test/r/sp-security.result:
        Added test when executing SP without a default database
      mysql-test/t/information_schema.test:
        Added test to cover changes made in default handling
      mysql-test/t/sp-security.test:
        Added test when executing SP without a default database
      sql/item_strfunc.cc:
        Removed wrong push
      sql/mysqld.cc:
        Indentation fix
      sql/sql_base.cc:
        Use share->db instead of share->table_cache_key
        Remove assert that can never fail (because of test in previous row)
      sql/sql_db.cc:
        Allow empty database name when called from SP
        (To allow on run without a default database)
      sql/sql_parse.cc:
        Added comment
      sql/sql_show.cc:
        Indentation fixes
        Simplified code by checking for 'wrong' condition first and doing continue instead of going down one level
        Simplified precision and decimal handling
      3eda70b2
  2. 18 Aug, 2005 1 commit
    • unknown's avatar
      Cleanups and optimization during review of new code · 44086a62
      unknown authored
      mysql-test/t/kill.test:
        Moved --disable_reconnect earlier to avoid race condition
      sql/sql_help.cc:
        Cleanup during review of new code
        (Moved variable definitions first in function
      sql/sql_insert.cc:
        Cleanup during review of new code
      sql/sql_lex.cc:
        Cleanup during review of new code
      sql/sql_parse.cc:
        Cleanup during review of new code
        Changed potential problem with previous_table_ref where it dependent that TABLE_LIST first element would be next_local
        Rearanged code in add_table_to_list() to remove extra if
        Combined 2 calls to calloc() to one
      sql/sql_view.cc:
        Remove extra indentation level
        Combined common 'on error' exit
      sql/sql_yacc.yy:
        Fixed comment style
      sql/table.cc:
        Cleanup during review of new code
        - Changed while() loops to for() loop (to make code more readable)
        - Removed not needed initialization of variables
        - Removed not needed 'else' cases
        - Removed trivial ASSERT's that was checked by previous code
        - Moved comment setting last in Natural_join_column::check_grants()
      44086a62
  3. 15 Aug, 2005 3 commits
    • unknown's avatar
      Don't clear warnings for functions or triggers · 51919db0
      unknown authored
      Fixed failing test
      
      
      mysql-test/t/rpl_trigger.test:
        Added missing option that caused the test to fail sometimes
      sql/sql_parse.cc:
        Don't clear warnings for functions or triggers
      51919db0
    • unknown's avatar
    • unknown's avatar
      Save and clear run context before executing a stored function or trigger and restore it afterwards. · a914b527
      unknown authored
      This allows us to use statement replication with functions and triggers
      The following things are fixed with this patch:
      - NOW() and automatic timestamps takes the value from the main event for functions and triggers (which allows these to replicate with statement level logging)
      - No side effects for triggers or functions with auto-increment values(), last_insert_id(), rand() or found_rows()
      - Triggers can't return result sets
      
      Fixes bugs:
      #12480: NOW() is not constant in a trigger
      #12481: Using NOW() in a stored function breaks statement based replication
      #12482: Triggers has side effects with auto_increment values
      #11587: trigger causes lost connection error
      
      
      mysql-test/r/trigger.result:
        Added test fpr big
      mysql-test/t/sp-error.test:
        Changed error message numbers
      mysql-test/t/trigger.test:
        Added test for trigger returning result (#11587)
      sql/item_func.cc:
        Store the first used seed value for RAND() value.
        (This makes rand() replicatable in functions and triggers)
        Save and clear run context before executing a stored function and restore it afterwards.
        This removes side effects of stored functions for RAND(), auto-increment values and NOW() and makes most stored function replicatable
      sql/share/errmsg.txt:
        Reuse error message also for triggers
      sql/sp_head.cc:
        If in function or trigger, don't change value of NOW()
        (This allows us to use statement replication with functions that directly or indirectly uses timestamps)
      sql/sql_class.cc:
        Added framework for storing and retrieving run context while exceuting triggers or stored functions.
      sql/sql_class.h:
        Added framework for storing and retrieving run context while exceuting triggers or stored functions.
      sql/sql_parse.cc:
        If in function or trigger, don't change value of NOW()
        (This allows us to use statement replication with functions that directly or indirectly uses timestamps)
      sql/sql_trigger.cc:
        Moved process_triggers function from sql_trigger.h
        Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
      sql/sql_trigger.h:
        Moved process_triggers function from sql_trigger.h
        Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
      sql/sql_yacc.yy:
        Give error message if trigger can return a result set (Bug #11587)
      tests/fork_big2.pl:
        Removed return from end of lines
      mysql-test/r/rpl_trigger.result:
        New BitKeeper file ``mysql-test/r/rpl_trigger.result''
      mysql-test/t/rpl_trigger.test:
        New BitKeeper file ``mysql-test/t/rpl_trigger.test''
      a914b527
  4. 13 Aug, 2005 1 commit
    • unknown's avatar
      sql_parse.cc: · 66b97195
      unknown authored
        Don't skip SET command even if --replicate-wild* says to.
        E.g., SET ONE_SHOT TIME_ZONE = 'XYZ' should be executed (BUG #12542)
      
      
      sql/sql_parse.cc:
        Don't skip SET command even if --replicate-wild* says to.
        E.g., SET ONE_SHOT TIME_ZONE = 'XYZ' should be executed (BUG #12542)
      66b97195
  5. 12 Aug, 2005 4 commits
    • unknown's avatar
      BUG#12162 - one can start two transactions with the same XID. · 87ae5a15
      unknown authored
      Now we keep all active XID's in a hash
      
      
      87ae5a15
    • unknown's avatar
      Implementation of WL#2486 - · 7517d7e1
      unknown authored
      "Process NATURAL and USING joins according to SQL:2003".
      
      * Some of the main problems fixed by the patch:
        - in "select *" queries the * expanded correctly according to
          ANSI for arbitrary natural/using joins
        - natural/using joins are correctly transformed into JOIN ... ON
          for any number/nesting of the joins.
        - column references are correctly resolved against natural joins
          of any nesting and combined with arbitrary other joins.
      
      * This patch also contains a fix for name resolution of items
        inside the ON condition of JOIN ... ON - in this case items must
        be resolved only against the JOIN operands. To support such
        'local' name resolution, the patch introduces a stack of
        name resolution contexts used at parse time.
      
      NOTICE:
      - This patch is not complete in the sense that
        - there are 2 test cases that still do not pass -
          one in join.test, one in select.test. Both are marked
          with a comment "TODO: WL#2486".
        - it does not include a new test specific for the task
      
      
      mysql-test/include/ps_query.inc:
        Adjusted according to standard NATURAL/USING join semantics.,
      mysql-test/r/bdb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/derived.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/errors.result:
        The column as a whole cannot be resolved, so different error message.
      mysql-test/r/fulltext.result:
        Adjusted according to standard JOIN ... ON semantics =>
        the ON condition can refer only to the join operands.
      mysql-test/r/fulltext_order_by.result:
        More detailed error message.
      mysql-test/r/innodb.result:
        Adjusted according to standard NATURAL/USING join semantics.
        This test doesn't pass completetly yet!
      mysql-test/r/insert_select.result:
        More detailed error message.
      mysql-test/r/join.result:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/r/join_crash.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/join_nested.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/join_outer.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/multi_update.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/null_key.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/order_by.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_2myisam.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_3innodb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_4heap.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_5merge.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_6bdb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_7ndb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/select.result:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one failing test case which is commented with
        WL#2486 in the test file.
      mysql-test/r/subselect.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/type_ranges.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/union.result:
        More detailed error message.
      mysql-test/t/bdb.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/errors.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/fulltext.test:
        Adjusted according to standard JOIN ... ON semantics =>
        the ON condition can refer only to the join operands.
      mysql-test/t/fulltext_order_by.test:
        More detailed error message.
      mysql-test/t/innodb.test:
        Adjusted according to standard NATURAL/USING join semantics.
        This test doesn't pass completetly yet!
      mysql-test/t/insert_select.test:
        More detailed error message.
      mysql-test/t/join.test:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/t/join_crash.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/join_nested.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/join_outer.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/null_key.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/order_by.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/select.test:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/t/subselect.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/type_ranges.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/union.test:
        More detailed error message.
      sql/item.cc:
        - extra parameter to find_field_in_tables
        - find_field_in_real_table renamed to find_field_in_table
        - fixed comments/typos
      sql/item.h:
        - added [first | last]_name_resolution_table to class
          Name_resolution_context
        - commented old code
        - standardized formatting
      sql/mysql_priv.h:
        - refactored the find_field_in_XXX procedures,
        - added a new procedure for natural join table references,
        - renamed the find_field_in_XXX procedures to clearer names
      sql/sp.cc:
        - pass the top-most list of the FROM clause to setup_tables
        - extra parameter to find_field_in_tables
      sql/sql_acl.cc:
        - renamed find_field_in_table => find_field_in_table_ref
        - extra parameter to find_field_in_table_ref
        - commented old code
      sql/sql_base.cc:
        This file contains the core of the implementation of the processing
        of NATURAL/USING joins (WL#2486).
        - added many comments to old code
        - refactored the group of find_field_in_XXX procedures, and added a
          new procedure for natural joins. There is one find_field_in_XXX procedure
          per each type of table reference (stored table, merge view, or natural
          join); one meta-procedure that selects the correct one depeneding on the
          table reference; and one procedure that goes over a list of table
          referenes.
        - NATURAL/USING joins are processed through the procedures:
            mark_common_columns, store_natural_using_join_columns,
            store_top_level_join_columns, setup_natural_join_row_types.
          The entry point to processing NATURAL/USING joins is the
          procedure 'setup_natural_join_row_types'.
        - Replaced the specialized Field_iterator_XXX iterators with one
          generic iterator over the fields of a table reference.
        - Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
          the processing of natural joins in a separate set of procedures.
      sql/sql_class.h:
        - Commented old code.
      sql/sql_delete.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_help.cc:
        - pass the end name resolution table to find_field_in_tables
        - adjust the list of tables for name resolution
      sql/sql_insert.cc:
        - Changed the code that saves and restores the current context to
          support the list of tables for name resolution -
          context->first_name_resolution_table, and
          table_list->next_name_resolution_table.
          Needed to support an ugly trick to resolve inserted columns only in
          the first table.
        - Added Name_resolution_context::[first | last]_name_resolution_table.
        - Commented old code
      sql/sql_lex.cc:
        - set select_lex.parent_lex correctly
        - set correct state of the current name resolution context
      sql/sql_lex.h:
        - Added a stack of name resolution contexts to support local
          contexts for JOIN ... ON conditions.
        - Commented old code.
      sql/sql_load.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_olap.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_parse.cc:
        - correctly set SELECT_LEX::parent_lex
        - set the first table of the current name resoltion context
        - added support for NATURAL/USING joins
        - commented old code
      sql/sql_select.cc:
        - Pass the FROM clause to setup_tables.
        - Pass the end table to find_field_in_tables
        - Improved comments
      sql/sql_show.cc:
        - Set SELECT_LEX::parent_lex.
      sql/sql_update.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_yacc.yy:
        - Added support for a stack of name resolution contexts needed to
          implement name resolution for JOIN ... ON. A context is pushed
          for each new JOIN ... ON, and popped afterwards.
        - Added support for NATURAL/USING joins.
      sql/table.cc:
        - Added new class Natural_join_column to hide the heterogeneous
          representation of column references for stored tables and for
          views.
        - Added a new list TABLE_LIST::next_name_resolution_table to
          support name resolution with NATURAL/USING joins. Also added
          other members to TABLE_LIST to support NATURAL/USING joins.
        - Added a generic iterator over the fields of table references
          of various types - class Field_iterator_table_ref
      sql/table.h:
        - Added new class Natural_join_column to hide the heterogeneous
          representation of column references for stored tables and for
          views.
        - Added a new list TABLE_LIST::next_name_resolution_table to
          support name resolution with NATURAL/USING joins. Also added
          other members to TABLE_LIST to support NATURAL/USING joins.
        - Added a generic iterator over the fields of table references
          of various types - class Field_iterator_table_ref
      tests/mysql_client_test.c:
        Adjusted according to standard NATURAL JOIN syntax.
      7517d7e1
    • unknown's avatar
      Fixes during review of new pushed code · d6c3d655
      unknown authored
      Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      
      
      sql/ha_berkeley.cc:
        Removed not used variable (and options)
      sql/ha_berkeley.h:
        Removed not used argument
      sql/ha_ndbcluster.cc:
        Remove compiler warning
      sql/init.cc:
        Simplify code
      sql/item_sum.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/mysql_priv.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/mysqld.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_class.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_delete.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_derived.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_lex.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_parse.cc:
        Indentation fixes
      sql/sql_select.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_select.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_show.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_union.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_update.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_yacc.yy:
        Changed variable name i to more descriptive name
        Removed compiler warning
      d6c3d655
    • unknown's avatar
      Avoid spurious error when restoring INFORMATION_SCHEMA as the current · e0607f0a
      unknown authored
      database after failing to execute a stored procedure in an inaccessible
      database. (Bug #12318)
      
      
      mysql-test/r/sp-security.result:
        Update results
      mysql-test/t/sp-security.test:
        Add regression test
      sql/mysql_priv.h:
        Add additional argument to mysql_change_db()
      sql/sp.cc:
        Use mysql_change_db(), get rid of sp_change_db().
      sql/sp.h:
        Get rid of sp_change_db().
      sql/sql_db.cc:
        Handle no_access_check flag to mysql_change_db, and remove the send_ok()
        call.
      sql/sql_parse.cc:
        Add extra argument to mysql_change_db(), and call send_ok() after
        successful calls to same (since it no longer does it for us).
      e0607f0a
  6. 11 Aug, 2005 1 commit
    • unknown's avatar
      Cleanups during review of new code · d83f6908
      unknown authored
      mysql-test/t/sp.test:
        Use --disable_parsing instead of comments
      sql/lock.cc:
        Remove compiler warning
      sql/mysqld.cc:
        Always send valid flag argument to reload_acl_and_cache()
      sql/sp_cache.cc:
        Simple optimization
        Don't use mutex to read 'long' variable
        Indentation fixes
      sql/sp_head.cc:
        Fix comments to use /* */
        Set proc_info to 0 after close_thread_tables()
      sql/sql_base.cc:
        remove not needed test
      sql/sql_parse.cc:
        Always send valid flag argument to reload_acl_and_cache()
        Fixed indentation
        Ensure we get an error if reset_master() fails.
      d83f6908
  7. 10 Aug, 2005 3 commits
    • unknown's avatar
      BUG#12228: Post review fixes: Added test case, code cleanup. · 6b9ec78b
      unknown authored
      mysql-test/r/sp-threads.result:
        Testcase for BUG#12228
      mysql-test/t/sp-threads.test:
        Testcase for BUG#12228
      sql/sp_cache.cc:
        BUG#12228: Post-review fixes: small code cleanup
      sql/sp_cache.h:
        BUG#12228: Post-review fixes: fixed the comment
      sql/sql_parse.cc:
        BUG#12228: Post-review fixes: in mysql_parse, flush obsolete SPs from the caches only if 
         the query hasn't been handled by the query cache.
      sql/sql_prepare.cc:
        BUG#12228: Post-review fixes: in mysql_stmt_prepare/execute, flush SP caches 
         "closer to the execution"
      6b9ec78b
    • unknown's avatar
      error message fixed · 2bd3255e
      unknown authored
      2bd3255e
    • unknown's avatar
      Fix for bug #12280 "Triggers: crash if flush tables". · f6fff55e
      unknown authored
      We should not allow FLUSH statement to be executed inside both triggers
      and stored functions.
      
      
      mysql-test/r/sp-error.result:
        Updated test after replacing error, which is thrown when one uses FLUSH
        statement inside of stored function, with more specific.
        Also now we issue more general error when we barking about USE command
        in stored routines.
      mysql-test/r/trigger.result:
        Added test for bug #12280 "Triggers: crash if flush tables"
      mysql-test/t/sp-error.test:
        Updated test after replacing error, which is thrown when one uses FLUSH
        statement inside of stored function, with more specific.
        Also now we issue more general error when we barking about USE command
        in stored routines.
      mysql-test/t/trigger.test:
        Added test for bug #12280 "Triggers: crash if flush tables"
      sql/share/errmsg.txt:
        Removed ER_SP_NO_USE error. Now we use more general ER_SP_BADSTATEMENT in this
        case. Instead added error message for barking about statements which should not
        be allowed inside of stored functions or triggers.
        It is safe to do this since it is highly unprobable that someone will upgrade
        first to the new 5.0 release and then downgrade back to the old one.
      sql/sql_parse.cc:
        reload_acl_and_cache():
          FLUSH TABLES and FLUSH PRIVILEGES should not be allowed if we are inside
          of stored function or trigger.
      sql/sql_yacc.yy:
        We should not allow FLUSH statement inside both triggers and stored
        functions. Replaced error which is thrown in this case with more
        specific.
        Also now we issue more general ER_SP_BADSTATEMENT error when one tries
        to use USE command inside of stored routine.
      f6fff55e
  8. 09 Aug, 2005 2 commits
    • unknown's avatar
      Clumsy but working fix for bug #11973 "SELECT .. INTO var_name; in trigger · 61a68ed6
      unknown authored
      cause crash on update".
      
      Let us update "thd" pointer in LEX, all its units and in LEX::result before
      executing statement in trigger body, since triggers are associated with TABLE
      object and because of this can be used in different threads.
      
      
      mysql-test/r/trigger.result:
        Added test case for bug #11973 "SELECT .. INTO var_name; in trigger cause
        crash on update".
      mysql-test/t/trigger.test:
        Added test case for bug #11973 "SELECT .. INTO var_name; in trigger cause
        crash on update".
      sql/item_subselect.cc:
        subselect_engine:
          Moved implementation of set_thd() method to item_subselect.cc,
          since now it also sets "thd" for subselect_engine::result.
      sql/item_subselect.h:
        subselect_engine:
          Moved implementation of set_thd() method to item_subselect.cc,
          since now it also sets "thd" for subselect_engine::result.
      sql/sql_class.h:
        select_result:
          Added set_thd() method for updating select_result::thd value (we need this
          in cases when statement to which this select_result belongs will be used
          in different threads, as it happens for statements in trigger body).
        multi_delete/multi_update:
          Got rid of redundant "thd" member (we already have it in select_result).
      sql/sql_delete.cc:
        multi_delete:
          Got rid of redundant "thd" member (we already have it in select_result).
      sql/sql_lex.h:
        st_select_lex_unit:
          Added set_thd() method for updating st_select_lex_unit::thd value
          (we need this in cases when statement to which this unit belongs will
           be used in different threads, as it happens for statements in trigger body).
          We don't update thd of select_result pointed by st_select_lex_unit::result
          in this method, since it is either have too short lifetime (i.e. created for
          each execution) or is accessible via Item_subquery or LEX::result and thus
          already taken care of.
      sql/sql_parse.cc:
        multi_delete:
          Got rid of redundant "thd" member (we already have it in select_result).
      sql/sql_prepare.cc:
        reinit_stmt_before_use():
          We have to update "thd" pointer in LEX, all its units and in LEX::result,
          since statements which belong to trigger body are associated with TABLE
          object and because of this can be used in different threads.
      sql/sql_update.cc:
        multi_update:
          Got rid of redundant "thd" member (we already have it in select_result).
      61a68ed6
    • unknown's avatar
      Merged code. · 776713f4
      unknown authored
      776713f4
  9. 08 Aug, 2005 2 commits
    • unknown's avatar
      Fix for BUG#12228: SP cache code: · 502e97f8
      unknown authored
      * Cleanup SP Cache code, now SP Cache only deletes sp_head objects in 
        sp_cache_flush_obsolete() invalidates all pointers to routines in the cache.
      * Use new SP Cache use contract in the code.
      
      There is no test case because it doesn't seem to be possible to cause thread races to end
      the same way they end in heavy-load test. This patch removes the crash in heavy test.
      
      
      mysql-test/r/type_bit.result:
        Drop the tables this test tries to create
      mysql-test/r/view.result:
        Drop function this test creates
      mysql-test/t/type_bit.test:
        Drop the tables this test tries to create
      mysql-test/t/view.test:
        Drop function this test creates
      sql/sp.cc:
        Fix for BUG#12228: When a routine is deleted/modified, invalidate all cached SPs in all
        threads. We need to do so because sp_lex_keeper::{prelocking_tables, query_tables_own_last}
        in one SP may depend on another SP sp_lex_keeper::m_lex is using.
      sql/sp_cache.cc:
        Fix for BUG#12228:
        * Move class sp_cache to here from sp_cache.h, document the functions.
        * sp_cache_insert, sp_cache_remove, sp_cache_invalidate and sp_cache_lookup must not delete
          sp_head* objects as they may be called during SP execution when sp_head objects are used.
        * Added sp_cache_flush_obsolete() function that may delete sp_head objects.
        * Removed sp_cache_remove as there is no need for it now - when we change one SP we should
          invalidate all other SPs, because sp_lex_keeper::{prelocking_tables, 
          query_tables_own_last} from one SP depend on content of another SP (used in 
          sp_lex_keeper::m_lex).
      sql/sp_cache.h:
        Fix for BUG#12228:
        * Move class sp_cache to sp_cache.cc it is not needed in .h file
        * Added comments
      sql/sql_parse.cc:
        Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before running the query
      sql/sql_prepare.cc:
        Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before preparing/executing a PS
      502e97f8
    • unknown's avatar
      Review of new pushed code · 97988099
      unknown authored
      - Fixed some error condtion when handling dates with 'T'
      - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed
      - Safety fixes and cleanups
      
      
      mysql-test/r/subselect.result:
        Added extra test case to test case for bug #11867
        (Result shows that current code is not yet right and needs to be fixed)
      mysql-test/r/type_datetime.result:
        More tests for dates of type CCYYMMDDTHHMMSS
      mysql-test/t/subselect.test:
        Added extra test case to test case for bug #11867
      mysql-test/t/type_datetime.test:
        More tests for dates of type CCYYMMDDTHHMMSS
      sql-common/my_time.c:
        Fixed handling of dates of type CCYYMMDDTHHMMSS
        (Old code couldn't handle 2003-0304 or 2003-0003-02)
      sql/slave.cc:
        Indentation cleanup
      sql/sql_parse.cc:
        Added test of return value of get_system_var()
      sql/sql_select.cc:
        Removed unnecessary call to field->table->maybe_null
      sql/sql_union.cc:
        Indentation fixes
      97988099
  10. 07 Aug, 2005 1 commit
    • unknown's avatar
      Bug#10109 · fdb4d307
      unknown authored
        "INSERT .. SELECT ... ON DUPLICATE KEY UPDATE fails"
        Ensure that check_insert_fields() is only called once when
        doing an INSERT..SELECT
      
      
      mysql-test/r/insert_update.result:
        Test for bug 10109
      mysql-test/t/insert_update.test:
        Test for bug 10109
      sql/sql_class.h:
        select_insert needs more state
      sql/sql_insert.cc:
        ensure that check_insert_fields() is only called once when
        doing an INSERT...SELECT
      sql/sql_parse.cc:
        more args for select_insert constructor
      fdb4d307
  11. 06 Aug, 2005 1 commit
    • unknown's avatar
      Fix error message when creating a non-string field with a display · c62a5942
      unknown authored
      width beyond the maximum. (Bug #6080)
      
      
      mysql-test/r/errors.result:
        Update results
      mysql-test/r/type_bit.result:
        Update results
      mysql-test/r/type_bit_innodb.result:
        Update results
      mysql-test/t/errors.test:
        Add new regression test
      mysql-test/t/type_bit_innodb.test:
        Update error code in test
      sql/share/errmsg.txt:
        Add new error message
      sql/sql_parse.cc:
        Display more appropriate error message for column creation that
        fails due to a non-string field with a display width that is too
        big.
      c62a5942
  12. 05 Aug, 2005 1 commit
    • unknown's avatar
      Bug#9459 - deadlock with flush with lock, and lock table write · 2977a3a4
      unknown authored
      Added a check before taking a global read lock if
      the own thread has a write locked table.
      
      
      mysql-test/r/flush.result:
        Bug#9459 - deadlock with flush with lock, and lock table write
        The test result.
      mysql-test/t/flush.test:
        Bug#9459 - deadlock with flush with lock, and lock table write
        The test case.
      2977a3a4
  13. 30 Jul, 2005 1 commit
    • unknown's avatar
      Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for · 11abe15e
      unknown authored
      its body, but lets each statement to get/release its own locks. This allows a broader set
      of statements to be executed inside PROCEDUREs (but breaks replication)
      This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
      
      
      mysql-test/r/sp-security.result:
        Drop tables this test attempts to create
      mysql-test/r/sp-threads.result:
        Update test results
      mysql-test/r/sp.result:
        Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
      mysql-test/r/view.result:
        Enabled a test case that now works with prelocking-free SPs
      mysql-test/t/sp-security.test:
        Drop tables this test attempts to create
      mysql-test/t/sp.test:
        Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
      mysql-test/t/view.test:
        Enabled a test case that now works with prelocking-free SPs
      sql/handler.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/item_func.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sp.cc:
        Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
        "CALL proc(...)" statements.
      sql/sp.h:
        Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
        "CALL proc(...)" statements.
      sql/sp_cache.h:
        Added comments
      sql/sp_head.cc:
        Non-prelocked SP execution:
        * Try to unlock tables after PROCEDURE arguments have been evaluated.
        * Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
          B) when its statement enters/leaves prelocked mode itself.
      sql/sp_head.h:
        Non-prelocked SP execution:  Make sp_lex_keeper to additionally keep list of tables it 
        needs to prelock when its statement enters/leaves prelocked mode on its own.
      sql/sql_base.cc:
        Non-prelocked SP execution: Make open_tables() to
         * detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
         * Make lex->query_tables_last to point precisely to a boundary in lex->query_tables 
           list where 'own' tables and views' tables end and added-for-prelocking tables begin.
           (it was not true before - view's tables could end up after query_tables_own_last)
      sql/sql_class.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sql_class.h:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sql_lex.cc:
        Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
      sql/sql_parse.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
      sql/sql_trigger.h:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      11abe15e
  14. 27 Jul, 2005 2 commits
    • unknown's avatar
      Merging · 62aad333
      unknown authored
      sql/sql_parse.cc:
        error function changed
      62aad333
    • unknown's avatar
      Increase allowed size of stored procedure bodies to 4GB, and · eb25e83e
      unknown authored
      produce a sensible error when that limit is exceeded. (Bug #11602)
      
      
      client/mysqltest.c:
        Increase query buffer size, and explain why
      mysql-test/r/system_mysql_db.result:
        Update results
      scripts/mysql_create_system_tables.sh:
        Increase size of proc.body
      scripts/mysql_fix_privilege_tables.sql:
        Increase size of proc.body
      sql/share/errmsg.txt:
        Add error for SP routines that are too long
      sql/sp.cc:
        Raise an error when the SP body is too long.
      sql/sp.h:
        Add error for SP body being too long.
      sql/sql_parse.cc:
        Handle SP_BODY_TOO_LONG error.
      mysql-test/r/sp-big.result:
        New BitKeeper file ``mysql-test/r/sp-big.result''
      mysql-test/t/sp-big.test:
        New BitKeeper file ``mysql-test/t/sp-big.test''
      eb25e83e
  15. 25 Jul, 2005 1 commit
    • unknown's avatar
      Don't force column header to @@session.var_name if @@local.var_name · f8a6e9d3
      unknown authored
      was used. (Bug #10724)
      
      
      mysql-test/r/key_cache.result:
        Updated results
      mysql-test/r/ps_1general.result:
        Updated results
      mysql-test/r/user_var.result:
        Add new results
      mysql-test/r/variables.result:
        Update results
      mysql-test/t/user_var.test:
        Add new regression test
      sql/item_func.cc:
        Don't set name explicitly in get_system_var(), let it get set by the
        select_item: rule in sql_parse.yy or other callers of get_system_var().
      sql/sql_parse.cc:
        Set the name on the Item returned by get_system_var().
      f8a6e9d3
  16. 23 Jul, 2005 1 commit
  17. 19 Jul, 2005 3 commits
    • unknown's avatar
      Fix for bugs #5892/6182/8751/8758/10994 (based on Antony's patch) · a32bf7fb
      unknown authored
        "Triggers have the wrong namespace"
        "Triggers: duplicate names allowed"
        "Triggers: CREATE TRIGGER does not accept fully qualified names"
        "SHOW TRIGGERS"
      
      
      mysql-test/r/information_schema.result:
        Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
      mysql-test/r/information_schema_db.result:
        INFORMATION_SCHEMA.TRIGGERS view was added.
      mysql-test/r/rpl_sp.result:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
      mysql-test/r/trigger.result:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
        Added test checking that triggers have database wide namespace.
        Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
        table in a different DB".
      mysql-test/r/view.result:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
      mysql-test/t/information_schema.test:
        Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
      mysql-test/t/rpl_sp.test:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
      mysql-test/t/trigger.test:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
        Added test checking that triggers have database wide namespace.
        Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
        table in a different DB".
      mysql-test/t/view.test:
        Now DROP TRIGGER interprets first part of trigger identifier as database
        name and not as table name. Adjusted tests properly.
      sql/handler.cc:
        Added .TRN tho the list of known file extensions assoicated with tables.
      sql/item.h:
        trg_action_time_type/trg_event_type enums:
          Added TRG_ACTION_MAX/TRG_EVENT_MAX elements which should be used instead of
          magical values in various loops where we iterate through all types of trigger
          action times or/and trigger event types.
      sql/lex.h:
        Added new symbol "TRIGGERS".
      sql/mysql_priv.h:
        Added declaration of constant holding extension for trigger name (.TRN) files.
      sql/mysqld.cc:
        Added statistical variable for SHOW TRIGGERS command.
      sql/share/errmsg.txt:
        Added error message saying that one attempts to create trigger in wrong schema.
      sql/sp.cc:
        Replaced magical values with TRG_EVENT_MAX/TRG_ACTION_MAX constants.
      sql/sql_base.cc:
        open_unireg_entry():
          Now Table_triggers_list::check_n_load() has one more argument which
          controls whether we should prepare Table_triggers_list with fully functional
          triggers or load only their names.
      sql/sql_lex.h:
        Added element for new SHOW TRIGGERS command to enum_sql_command enum.
      sql/sql_parse.cc:
        prepare_schema_table():
          Added support for SHOW TRIGGERS statement.
      sql/sql_show.cc:
        Added new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
      sql/sql_table.cc:
        mysql_rm_table_part2():
          Replaced simple deletion of .TRG file with call to
          Table_triggers_list::drop_all_triggers which will also delete .TRN files
          for all triggers associated with table.
      sql/sql_trigger.cc:
        Now triggers have database wide namespace. To support it we create special .TRN
        file with same name as trigger for each trigger. This file contains name of
        trigger's table so one does not need to specify it explicitly in DROP TRIGGER.
        Moreover DROP TRIGGER treats first part of trigger identifier as database name
        now. Updated mysql_create_or_drop_trigger() routine and
        Table_triggers_list::create_trigger()/drop_trigger()/check_n_load() methods
        accordingly. Added add_table_for_trigger() routine and
        Table_triggers_list::drop_all_triggers() method.
        
        Added Table_triggers_list::get_trigger_info() for obtaining trigger metadata.
      sql/sql_trigger.h:
        Table_triggers_list:
          Use TRG_EVENT_MAX, TRG_ACTION_MAX instead of magic values.
          Added get_trigger_info() method for obtaining trigger's meta-data.
          Added drop_all_triggers() method which drops all triggers for table.
          Added declarations of trg_action_time_type_names/trg_event_type_names
          arrays which hold names of triggers action time types  and event types.
      sql/sql_yacc.yy:
        Changed grammar for CREATE/DROP TRIGGER to support database wide trigger
        namespace. Added new SHOW TRIGGERS statement.
      sql/table.h:
        enum enum_schema_tables:
          Added constant for new INFORMATION_SCHEMA.TRIGGERS view.
      a32bf7fb
    • unknown's avatar
      Bug#11577 'show procedure/function status' doesn't work for user with limited access · 11ff7b16
      unknown authored
         changed 'SHOW PROCEDURE' behavoiur to be like INFORMATION_SCHEMA.routines
      
      
      11ff7b16
    • unknown's avatar
      Handle systems where 127.0.0.1 doesn't always map to 'localhost' · f19af294
      unknown authored
      first. (Bug #11822)
      
      
      sql/hostname.cc:
        Short-circuit ip_to_hostname() lookup for INADDR_LOOPBACK to
        always return 'localhost'.
      sql/sql_parse.cc:
        Push special handling of 127.0.0.1 into ip_to_hostname().
      f19af294
  18. 18 Jul, 2005 1 commit
    • unknown's avatar
      Cleanups during review · 68b4d7b7
      unknown authored
      Changed defaults option --instance to --defaults-group-suffix
      Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
      Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX
      mysql_print_defaults now understands --defaults-group-suffix
      Remove usage of my_tempnam() (not safe function)
      if( -> if ( and while( to while (
      
      
      BitKeeper/deleted/.del-my_tempnam.c~a8562f15dad3012f:
        Delete: mysys/my_tempnam.c
      VC++Files/client/mysqlclient.dsp:
        Remove not used file my_tempnam.c
      VC++Files/client/mysqlclient_ia64.dsp:
        Remove not used file my_tempnam.c
      VC++Files/libmysql/libmysql.dsp:
        Remove not used file my_tempnam.c
      VC++Files/libmysql/libmysql_ia64.dsp:
        Remove not used file my_tempnam.c
      VC++Files/mysys/mysys.dsp:
        Remove not used file my_tempnam.c
      VC++Files/mysys/mysys_ia64.dsp:
        Remove not used file my_tempnam.c
      client/mysql.cc:
        Change to use get_defaults_options()
        Remove compiler warnings
      client/mysqldump.c:
        Indentation fixes
        Use quoted table name for 'primary_key_fields'
      extra/my_print_defaults.c:
        Add support for --defaults-group-suffix
        change to use get_default_options()
      extra/replace.c:
        Replace my_tempnam() with create_tmp_file() to allow us to remove my_tempnam.c
      include/config-win.h:
        Added DEFAULT_GROUP_SUFFIX_ENV
      include/my_sys.h:
        Change defaults_instance -> defaults_group_suffix
        Change get_defaults_files -> get_defaults_options
      libmysql/Makefile.shared:
        Added DEFAULT_GROUP_SUFFIX_ENV
      mysys/Makefile.am:
        Added DEFAULT_GROUP_SUFFIX_ENV
        Remove my_tempnam.c
      mysys/default.c:
        Changed --instance to --defaults-group-suffix
        Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX and moved the name to Makefile.am
        (mysys shouldn't by MySQL independent)
        Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
      mysys/default_modify.c:
        Optimized code to use allocated space more efficently
        Reduce code size
        Ensure that realloc() works independent of argument size
      mysys/my_bitmap.c:
        Added missing return
      sql/ha_innodb.cc:
        Change if( -> if (
      sql/ha_ndbcluster.cc:
        Change while( -> while (
      sql/item_cmpfunc.cc:
        Break loop early (simple optimization)
      sql/item_strfunc.cc:
        Change if( -> if (
      sql/log.cc:
        Fixed comment
      sql/mysqld.cc:
        Change if( -> if (
      sql/opt_range.cc:
        while( -> while (
        if( -> if (
      sql/parse_file.cc:
        Change if( -> if (
      sql/sql_cache.cc:
        while( -> while (
      sql/sql_parse.cc:
        Change if( -> if (
      sql/sql_prepare.cc:
        Added comment
      sql/sql_select.cc:
        while( -> while (
        Removed index variable by incrementing pointer
      sql/sql_show.cc:
        Change if( -> if (
      sql/sql_yacc.yy:
        Change if( -> if (
      tests/mysql_client_test.c:
        Added cast to first argument to bzero()
      68b4d7b7
  19. 14 Jul, 2005 1 commit
  20. 13 Jul, 2005 2 commits
    • 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
      897a8d0f
  21. 09 Jul, 2005 1 commit
    • unknown's avatar
      Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers · 14b1f91b
      unknown authored
      crash if referencing a table" and several other related bugs.
      Fix for bug #11834 "Re-execution of prepared statement with dropped function
      crashes server." which was spotted during work on previous bugs.
      
      Also couple of nice cleanups:
      - Replaced two separate hashes for stored routines used by statement with one.
      - Now instead of doing one pass through all routines used in statement for
        caching them and then doing another pass for adding their tables to table
        list, we do only one pass during which do both things.
      
      
      mysql-test/r/sp-error.result:
        Added test for bug #11834 "Re-execution of prepared statement with dropped
        function crashes server" also covering handling of prepared statements
        which use stored functions but does not require prelocking.
      mysql-test/r/sp.result:
        Updated test for LOCK TABLES with views in table list.
        (Old version of statement used in this test will work ok now, since prelocking
         algorithm was tuned and will lock only one multi-set of tables for each routine
         even if this routine is used in several different views).
      mysql-test/r/trigger.result:
        Added several tests for triggers using tables.
      mysql-test/t/sp-error.test:
        Added test for bug #11834 "Re-execution of prepared statement with dropped
        function crashes server" also covering handling of prepared statements
        which use stored functions but does not require prelocking.
      mysql-test/t/sp.test:
        Updated comment about recursive views to reflect current situation.
        Updated test for LOCK TABLES with views in table list.
        (Old version of statement used in this test will work ok now, since prelocking
         algorithm was tuned and will lock only one multi-set of tables for each routine
         even if this routine is used in several different views).
      mysql-test/t/trigger.test:
        Added several tests for triggers using tables.
      sql/item_func.cc:
        Item_func_sp::cleanup():
          By next statement execution stored function can be dropped or altered so
          we can't assume that sp_head object for it will be still valid.
      sql/sp.cc:
        - Added Sroutine_hash_entry structure that represents element in the set of
          stored routines used by statement or routine. We can't as before use
          LEX_STRING for this purprose because we want link all elements of this set
          in list.
        - Replaced sp_add_to_hash() with sp_add_used_routine() which takes into account
          that now we use one hash for stored routines used by statement instead of two
          and which mantains list linking all elelemnts in this hash.
        - Renamed sp_merge_hash() to sp_update_sp_used_routines().
        - Introduced sp_update_stmt_used_routines() for adding elements to the set of
          routines used by statement from another similar set for statement or routine.
          This function will also mantain list linking elements of destination set.
        - Now instead of one sp_cache_routines() function we have family of 
          sp_cache_routines_and_add_tables() functions which are also responsible for
          adding tables used by routines being cached to statement table list. Nice
          optimization - thanks to list linking all elements in the hash of routines
          used by statement we don't need to perform several iterations over this hash
          (as it was before in cases when we have added new elements to it).
      sql/sp.h:
        Added declarations of functions used for manipulations with set (hash) of stored
        routines used by statement.
      sql/sp_head.cc:
        sp_name::init_qname():
          Now sp_name also holds key identifying routine in the set (hash) of
          stored routines used by statement. 
        sp_head:
          Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
          routines used by this routine we use one hash - m_sroutines. 
        sp_instr_set_trigger_field:
          Added support for subqueries in assignments to row accessors in triggers.
        Removed definition of sp_add_sp_tables_to_table_list() and auxilary functions 
        since now we don't have separate stage on which we add tables used by routines
        used by statement to table list for prelocking. We do it on the same stage as
        we load those routines in SP cache. So all this functionality moved to
        sp_cache_routines_and_add_tables() family of functions.
      sql/sp_head.h:
        sp_name:
          Now this class also holds key identifying routine in the set (hash) of stored
          routines used by statement. 
        sp_head:
          Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
          routines used by this routine we use one hash - m_sroutines. 
        sp_instr_set_trigger_field:
          Added support for subqueries in assignments to row accessors in triggers.
        Removed declaration of sp_add_sp_tables_to_table_list() since now we don't have
        separate stage on which we add tables used by routines used by statement to
        table list for prelocking. We do it on the same stage as we load those routines
        in SP cache.
      sql/sql_base.cc:
        open_tables():
        - LEX::spfuns/spprocs hashes were replaced with one LEX::sroutines hash.
        - Now instead of doing one pass through all routines used in statement for
          caching them and then doing another pass for adding their tables to table
          list, we do only one pass during which do both things. It is easy to do
          since all routines in the set of routines used by statement are linked in
          the list. This also allows us to calculate table list for prelocking more
          precisely.
        - Now triggers properly inform prelocking algorithm about tables they use.
      sql/sql_lex.cc:
        lex_start():
          Replaced LEX::spfuns/spprocs with with one LEX::sroutines hash.
          Added LEX::sroutines_list list linking all elements in this hash.
        st_lex::st_lex():
          Moved definition of LEX constructor to sql_lex.cc file to be able
          use sp_sroutine_key declaration from sp.h in it.
      sql/sql_lex.h:
        LEX:
          Replaced two separate hashes for stored routines used by statement with one.
          Added list linking all elements in this hash to be able to iterate through all
          elements and add new elements to this hash at the same time.
          Moved constructor definition to sql_lex.cc.
      sql/sql_parse.cc:
        mysql_execute_command():
          Replaced LEX::spfuns/spprocs with one LEX::sroutines hash.
      sql/sql_trigger.cc:
        Added missing GNU GPL notice.
        Table_triggers_list::check_n_load()
          Added initialization of sroutines_key which stores key representing
          triggers of this table in the set (hash) of routines used by this statement.
      sql/sql_trigger.h:
        Added missing GNU GPL notice.
        Table_triggers_list:
          Added sroutines_key member to store key representing triggers of this
          table in the set (hash) of routines used by this statement.
          Declared sp_cache_routines_and_add_tables_for_triggers() as friend since
          it needs access to sroutines_key and trigger bodies.
      sql/sql_yacc.yy:
        - Now we use sp_add_used_routine() instead of sp_add_to_hash() for adding
          elements to the set of stored routines used in statement.
        - Enabled support of subqueries as right sides in assignments to triggers' row
          accessors.
      14b1f91b
  22. 07 Jul, 2005 1 commit
    • unknown's avatar
      Fix for bug #8449(Silent column changes) · 077e335e
      unknown authored
      mysql-test/r/show_check.result:
        test result fixed
      mysql-test/r/sql_mode.result:
        test result fixed
      mysql-test/r/type_decimal.result:
        test result fixed
      mysql-test/r/type_float.result:
        test result fixed
      mysql-test/r/type_newdecimal.result:
        test result fixed
      mysql-test/t/type_decimal.test:
        test fixed
      mysql-test/t/type_float.test:
        test fixed
      mysql-test/t/type_newdecimal.test:
        test case added
      sql/share/errmsg.txt:
        error messages added
      sql/sql_parse.cc:
        now precision/scale parameters are handled in required way
      077e335e
  23. 04 Jul, 2005 1 commit
    • unknown's avatar
      Fixes during review of new code · 306ebf7b
      unknown authored
      - Mostly indentation fixes
      - Added missing test
      - Ensure that Item_func_case() checks for stack overruns
      - Use real_item() instead of (Item_ref*) item
      - Fixed wrong error handling
      
      
      myisam/mi_unique.c:
        Improved comments
      myisam/myisampack.c:
        Updated version number
      mysql-test/r/group_by.result:
        Added test that was lost during earlier merge
      mysql-test/r/information_schema.result:
        Safety fix: Drop procedures before used
      mysql-test/t/group_by.test:
        Added test that was lost during earlier merge
      mysql-test/t/information_schema.test:
        Safety fix: Drop procedures before used
      mysys/hash.c:
        Updated comment
      sql/field.cc:
        false -> FALSE
      sql/ha_ndbcluster.cc:
        Fix some style issues
        - No () around argument to 'case'
        - Space before ( in switch and if
        - Removed 'goto'
        - Added {}
        - Added () to make expressions easier to read
        - my_snprintf -> strmov
      sql/handler.cc:
        if( -> if (
      sql/item.cc:
        Indentation changes
      sql/item.h:
        false -> FALSE
      sql/item_cmpfunc.cc:
        Ensure that Item_func_case() check for stack overrun properly
      sql/item_cmpfunc.h:
        Ensure that Item_func_case() check for stack overrun properly
      sql/item_func.cc:
        Indentation fixes
        Fixed wrong goto label
      sql/mysqld.cc:
        Remove test for opt_disable_networking as this flag can never be set here
      sql/opt_range.cc:
        Simplify code
      sql/sql_class.h:
        Move define out from middle of class definition
      sql/sql_parse.cc:
        Remove extra empty lines
      sql/sql_select.cc:
        use real_item() instead of (Item_ref*) item
        Modifed function comment to be align with others
        Simple optimization
      sql/sql_union.cc:
        Portability fix:
        Don't use 'bool_variable|=...'
      sql/sql_view.cc:
        Move List_iterator_fast out from loops (rewind is faster than creating a new itearator)
      strings/ctype-utf8.c:
        if( -> if (
      strings/ctype.c:
        Remove disabled code
      strings/decimal.c:
        Indentation fixes
      strings/xml.c:
        Indentation fixes
      306ebf7b
  24. 01 Jul, 2005 1 commit
    • unknown's avatar
      Name resolution context added (BUG#6443) · b4f595b9
      unknown authored
      include/my_bitmap.h:
        new bitmap operation
      mysql-test/r/view.result:
        added warnings
        Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
      mysql-test/t/view.test:
        Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
      mysys/my_bitmap.c:
        new bitmap operation
      sql/field.h:
        index of field in table added
      sql/item.cc:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/item.h:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/item_cmpfunc.cc:
        table list removed from fix_fields() arguments
      sql/item_cmpfunc.h:
        table list removed from fix_fields() arguments
      sql/item_func.cc:
        table list removed from fix_fields() arguments
      sql/item_func.h:
        table list removed from fix_fields() arguments
      sql/item_row.cc:
        table list removed from fix_fields() arguments
      sql/item_row.h:
        table list removed from fix_fields() arguments
      sql/item_strfunc.cc:
        fixed server crash on NULL argument
      sql/item_strfunc.h:
        table list removed from fix_fields() arguments
      sql/item_subselect.cc:
        table list removed from fix_fields() arguments
      sql/item_subselect.h:
        table list removed from fix_fields() arguments
      sql/item_sum.cc:
        table list removed from fix_fields() arguments
      sql/item_sum.h:
        table list removed from fix_fields() arguments
      sql/item_timefunc.cc:
        table list removed from fix_fields() arguments
      sql/item_timefunc.h:
        table list removed from fix_fields() arguments
      sql/item_uniq.h:
        table list removed from fix_fields() arguments
      sql/log_event.cc:
        Name resolution context added
      sql/log_event.h:
        Name resolution context added
      sql/mysql_priv.h:
        Name resolution context added
      sql/set_var.cc:
        table list removed from fix_fields() arguments
      sql/share/errmsg.txt:
        new error message
      sql/sp.cc:
        Name resolution context added
      sql/sp_head.cc:
        table list removed from fix_fields() arguments
      sql/sp_head.h:
        Name resolution context added
      sql/sql_base.cc:
        table list removed from fix_fields() arguments
        Name resolution context added
      sql/sql_class.cc:
        renamed variable
      sql/sql_delete.cc:
        Name resolution context added
      sql/sql_derived.cc:
        Name resolution context added
      sql/sql_do.cc:
        table list removed from fix_fields() arguments
      sql/sql_handler.cc:
        Name resolution context added
      sql/sql_help.cc:
        Name resolution context added
      sql/sql_insert.cc:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/sql_lex.cc:
        Name resolution context added
      sql/sql_lex.h:
        removed resolve mode (information stored into name resolution context)
      sql/sql_load.cc:
        table list removed from fix_fields() arguments
      sql/sql_olap.cc:
        Name resolution context added
      sql/sql_parse.cc:
        Name resolution context added
      sql/sql_prepare.cc:
        table list removed from fix_fields() arguments
      sql/sql_select.cc:
        table list removed from fix_fields() arguments
      sql/sql_show.cc:
        Name resolution context added
      sql/sql_trigger.cc:
        table list removed from fix_fields() arguments
      sql/sql_udf.h:
        table list removed from fix_fields() arguments
      sql/sql_union.cc:
        Name resolution context added
      sql/sql_update.cc:
        Name resolution context added
      sql/sql_view.cc:
        Name resolution context added
      sql/sql_view.h:
        table list removed from fix_fields() arguments
      sql/sql_yacc.yy:
        Name resolution context added
      sql/table.cc:
        Name resolution context added
        merged view processing moved
      sql/table.h:
        merged view processing moved
      b4f595b9
  25. 28 Jun, 2005 2 commits
    • unknown's avatar
      Move reset of insert_values to ensure it's done also during error conditions · 05c7edf6
      unknown authored
      This fixed a failure of insert_update.test on some platforms
      
      
      mysys/thr_alarm.c:
        Fixed problem noticed by valgrind
      sql/opt_range.cc:
        Simple optimization for common case
      sql/sql_base.cc:
        Safety assert
      sql/sql_insert.cc:
        Added comment
      05c7edf6
    • unknown's avatar
      Fix max_connections_per_hour handling when the global · 8efb9a01
      unknown authored
      max_user_connections is also set. (Bug #9947)
      
      
      sql/sql_parse.cc:
        Don't cap max_connections_per_hour to the global max_user_connections,
        since the latter is a limit of concurrent connections. Also, count
        number of concurrent connections for a user correctly, instead of
        starting at 2.
      8efb9a01
  26. 27 Jun, 2005 1 commit
    • unknown's avatar
      Portability fixes · 76d444fc
      unknown authored
      Fixes while reviewing new pushed code
      NULL as argument to encrypt/decrypt should return NULL without a warning
      
      
      client/mysqldump.c:
        Cleanup
        Ensure we free allocated memory
        Portability fixes
      client/mysqltest.c:
        Cleanup of code during review
        Portability fixes (Don't use 'bool')
      mysql-test/r/func_encrypt.result:
        NULL as argument to encrypt/decrypt should return NULL without a warning
      mysql-test/r/func_encrypt_nossl.result:
        Added test of NULL argument
      mysql-test/t/func_encrypt_nossl.test:
        Added test of NULL argument
      sql/handler.cc:
        Cleanup during code review
      sql/item_strfunc.cc:
        NULL as argument to encrypt/decrypt should return NULL without a warning
      sql/sql_parse.cc:
        Fix wrong merge (fix was not needed as the previous code was reverted)
      sql/sql_table.cc:
        Removed extra new line
      76d444fc