An error occurred fetching the project authors.
  1. 11 Oct, 2005 1 commit
    • unknown's avatar
      Fixed BUG#13510: Setting password local variable changes current password · 71c89622
      unknown authored
        Disallow conflicting use of variables named "password" and "names". If such
        a variable is declared, and "SET ... = ..." is used for them, an error is
        returned; the user must resolve the conflict by either using `var` (indicating
        that the local variable is set) or by renaming the variable.
        This is necessary since setting "password" and "names" are treated as special
        cases by the parser.
      
      
      mysql-test/r/sp-error.result:
        New test cases for BUG#13510
      mysql-test/t/sp-error.test:
        New test cases for BUG#13510
      sql/share/errmsg.txt:
        New error message for when certain variable names are use which would be
        parsed the wrong way. (E.g. "password" and "names")
      sql/sql_yacc.yy:
        Check if "names" or "password" are used as local variable/parameter, in which
        case "set names" or "set password" will be parsed the wrong way. Give an error
        message instead.
      71c89622
  2. 05 Oct, 2005 1 commit
  3. 30 Sep, 2005 1 commit
  4. 23 Sep, 2005 1 commit
    • unknown's avatar
      Fix bug #3443, better foreign key error messsages. · e4b0b0d0
      unknown authored
      innobase/dict/dict0dict.c:
        Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format.
      innobase/include/dict0dict.h:
        Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format.
      innobase/include/os0file.h:
        Add os_file_read_string.
      innobase/include/trx0trx.h:
        Add trx_set_detailed_error and trx_set_detailed_error_from_file functions
        and a detailed_error field to trx_struct.
      innobase/include/ut0mem.h:
        Add ut_strlcpy.
      innobase/os/os0file.c:
        Add os_file_read_string.
      innobase/row/row0ins.c:
        Add row_ins_set_detailed function and call it when needed.
        
        Adapt to changes in dict_print_info_on_foreign_key_in_create_format.
      innobase/trx/trx0trx.c:
        Add trx_set_detailed_error and trx_set_detailed_error_from_file.
        
        Clear trx->detailed_error in trx_create.
      innobase/ut/ut0mem.c:
        Add ut_strlcpy.
      mysql-test/r/innodb.result:
        Add new tests, adapt existing ones whose output was changed.
      mysql-test/t/innodb.test:
        Add new tests, adapt existing ones whose output was changed.
      sql/ha_innodb.cc:
        Add get_error_message.
        
        Clear trx->detailed_error in start_stmt and external_lock.
      sql/ha_innodb.h:
        Add get_error_message.
      sql/handler.cc:
        Add special case code in print_error for HA_ERR_ROW_IS_REFERENCED and
        HA_ERR_NO_REFERENCED_ROW.
        
        Change SETMSG to point to new error messages.
      sql/share/errmsg.txt:
        Add ER_ROW_IS_REFERENCED_2 and ER_NO_REFERENCED_ROW_2.
      e4b0b0d0
  5. 16 Sep, 2005 1 commit
    • unknown's avatar
      Fix for bug#5508 after Sanja's review · bf58b698
      unknown authored
      mysql-test/r/view.result:
        test results for rename table view1 to view2
      mysql-test/t/view.test:
        tests for rename table view1 to view2
      sql/share/errmsg.txt:
        added new errormessage (schema change not allowed in rename table view)
      sql/sql_rename.cc:
        added support for renaming views
      sql/sql_view.cc:
        added new function mysql_rename_view
      sql/sql_view.h:
        added prototype mysql_rename_view
      bf58b698
  6. 14 Sep, 2005 1 commit
    • unknown's avatar
      part 1 (ver 2, postreview fix) of WL#2787 · f7aeb6f9
      unknown authored
      view definer information syntax/storage/replication
      fixed SOURCE field of .frm
      
      
      mysql-test/r/func_in.result:
        definer information added to CREATE VIEW
      mysql-test/r/lowercase_view.result:
        definer information added to CREATE VIEW
      mysql-test/r/mysqldump.result:
        definer information added to CREATE VIEW
      mysql-test/r/rpl_view.result:
        check log of queries
      mysql-test/r/skip_grants.result:
        --skip-grants do not allow use user information
      mysql-test/r/sql_mode.result:
        definer information added to CREATE VIEW
      mysql-test/r/temp_table.result:
        definer information added to CREATE VIEW
      mysql-test/r/view.result:
        definer information added to CREATE VIEW
        test of storing/restoring definer information
      mysql-test/r/view_grant.result:
        test of grant check of definer information
        definer information added to CREATE VIEW
      mysql-test/t/rpl_view.test:
        check log of queries
      mysql-test/t/skip_grants.test:
        --skip-grants do not allow use user information
      mysql-test/t/view.test:
        test of storing/restoring definer information
      mysql-test/t/view_grant.test:
        test of grant check of definer information
      sql/mysql_priv.h:
        CREATE/ALTER VIEW print support
        set current user as definer procedure
      sql/share/errmsg.txt:
        new errors/warnings
      sql/sql_acl.cc:
        make find_acl_user public to allow to check user
      sql/sql_acl.h:
        make find_acl_user public to allow to check user
      sql/sql_lex.h:
        storing definer information
      sql/sql_parse.cc:
        send CREATE/ALTER VIEW for replication with full list of options
        set current user as definer procedure
      sql/sql_show.cc:
        new CREATE VIEW options printed
      sql/sql_view.cc:
        check of definer clause
        changes in .frm file
        definer information storage support
        now we store only original SELECT in SOURCE field of .frm
      sql/sql_yacc.yy:
        definer information sintax support
        getting SOURCE field information for .frm
      sql/table.h:
        definer information storage
      f7aeb6f9
  7. 13 Sep, 2005 1 commit
    • unknown's avatar
      Fixed BUG#12712: SET AUTOCOMMIT should fail within SP/functions/triggers · 065a9377
      unknown authored
        Second version after review. Allow 'set autocommit' in procedures, but not
        functions or triggers. Can return error in run-time (when a function calls
        a procedure).
      
      
      mysql-test/r/sp-error.result:
        New test case for BUG#12712.
      mysql-test/t/sp-error.test:
        New test case for BUG#12712.
      sql/set_var.cc:
        Made sys_autocommit external, to allow testing in sql_yacc.yy.
      sql/set_var.h:
        Made sys_autocommit external, to allow testing in sql_yacc.yy.
      sql/share/errmsg.txt:
        New error message for disallowing the setting of autocommit in stored functions and triggers.
      sql/sp_head.h:
        New flag: has 'set autocommit', and testing for this in is_not_allowed_in_function().
      sql/sql_yacc.yy:
        Disallow setting AUTOCOMMIT in stored function and triggers.
      065a9377
  8. 04 Sep, 2005 1 commit
  9. 02 Sep, 2005 1 commit
    • unknown's avatar
      Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures". · c910050a
      unknown authored
      The idea of the patch is to separate statement processing logic,
      such as parsing, validation of the parsed tree, execution and cleanup, 
      from global query processing logic, such as logging, resetting
      priorities of a thread, resetting stored procedure cache, resetting
      thread count of errors and warnings.
      This makes PREPARE and EXECUTE behave similarly to the rest of SQL
      statements and allows their use in stored procedures.
      This patch contains a change in behaviour:
      until recently for each SQL prepared statement command, 2 queries
      were written to the general log, e.g.
      [Query]   prepare stmt from @stmt_text;
      [Prepare] select * from t1 <-- contents of @stmt_text
      The chagne was necessary to prevent [Prepare] commands from being written
      to the general log when executing a stored procedure with Dynamic SQL.
      We should consider whether the old behavior is preferrable and probably
      restore it.
      This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
      in Dynamic SQL reported before it was disabled).
      
      
      mysql-test/r/not_embedded_server.result:
        Since we don't want to log Dynamic SQL in stored procedures,
        now the general log gets only one log entry per SQL statement.
      mysql-test/r/sp-error.result:
        - remove obsolete tests
        - a better error message for the case when a stored procedure that
        returns a result set is called from a function
      mysql-test/r/trigger.result:
        - a better error message for the case when a stored procedure that
        returns a result set is called from a trigger
      mysql-test/t/sp-error.test:
        - a better error message for the case when a stored procedure that
          returns a result set is called from a function.
        - move the comment to its place (end of file).
      mysql-test/t/trigger.test:
        - a better error message for the case when a stored procedure that
        returns a result set is called from a trigger
      sql/item_func.cc:
        - we need to pass sql_command explicitly to get_var_with_binlog, because
        when creating a query for SQL prepared statement thd->lex->sql_command
        points at SQLCOM_EXECUTE, which is not listed in the list of update
        queries.
      sql/log_event.h:
        - remove an extra copy of the previous sentence
      sql/mysql_priv.h:
        - fix declarations of sql_prepare.cc API
      sql/share/errmsg.txt:
        - a new error message, when one attempts to execute a prepared statement
        which is currently being executed (this can happen only in Dynamic SQL
        at the moment).
      sql/sp_head.cc:
        - extend sp_multi_results_command to return different flags for a
        command (and rename it)
        - add support for SQLCOM_PREPARE,SQLCOM_EXECUTE, SQLCOM_DEALLOCATE
          to sp_get_flags_for_command
        - replace multiple boolean sp_head members with uint m_flags
        - a fix for a crash when user variables are used in a stored procedure
          and binlog is on. A temporary fix for Bug#12637 "SP crashes the server 
         if it has update query with user var & binlog is enabled", which actually
         stands for stored functions: now instead of a crash we break
         replication if a user variable is used in a stored function which 
         is executed in prelocked mode.
      sql/sp_head.h:
        - replace multiple boolean flags of sp_head with uint m_flags;
        - add flag CONTAINS_DYNAMIC_SQL
        - use this flag to error if a stored procedure with Dynamic SQL is
          called from a function or trigger.
      sql/sql_class.cc:
        - Statement_map::insert should not delete a statement if it exists,
          now it's done externally to be able to handle the case when the
          statement being deleted is in use.
        - remove extra code (free_list is already reset in free_items)
      sql/sql_lex.cc:
        - add lex->stmt_prepare_mode; we can't rely on thd->command any more,
          because we don't reset it any more (Dynamic SQL requirement is that
          PS are as little intrusive as possible).
      sql/sql_lex.h:
        - declare bool LEX::stmt_prepare_mode
      sql/sql_parse.cc:
        - move prepared statement code to sql_prepare.cc
        - change declarations (refactored code)
        - better error message when one attempts to use Dynamic SQL or a 
          stored procedure that returns a result set in a function or trigger.
      sql/sql_prepare.cc:
        - major refactoring to ensure PREPARE/EXECUTE commands do not reset global THD
          state and allow their use in stored procedures.
        - add Prepared_statement::flags and use it to ensure no recursive execution
          of a prepared statement is possible
        - better comments
      sql/sql_yacc.yy:
        - enable PREPARE/EXECUTE/DEALLOCATE in stored procedures
        - produce an error message on attempt to use PREPARE/EXECUTE/DEALLOCATE
          in a stored function or trigger
      mysql-test/r/sp-dynamic.result:
        - sp-dynamic.test results
      mysql-test/t/sp-dynamic.test:
        - a new test for PREPARE/EXECUTE/DEALLOCATE in stored procedures.
      c910050a
  10. 18 Aug, 2005 2 commits
    • unknown's avatar
      Fix for bug #11896 "Partial locking in case of recursive trigger definitions". · b1921c85
      unknown authored
      If we are in stored function or trigger we should ensure that we won't change
      table that is already used by calling statement (this can damage table or
      easily cause infinite loops). Particularly this means that recursive triggers
      should be disallowed.
      
      
      mysql-test/r/sp-error.result:
        Added tests checking that in functions we don't allow to update tables which
        are used by statements which invoke these functions.
      mysql-test/r/trigger.result:
        Added test for bug #11896 "Partial locking in case of recursive trigger
        definitions".
      mysql-test/t/sp-error.test:
        Added tests checking that in functions we don't allow to update tables which
        are used by statements which invoke these functions.
      mysql-test/t/trigger.test:
        Added test for bug #11896 "Partial locking in case of recursive trigger
        definitions".
      sql/share/errmsg.txt:
        Added error messages for complaining about situations when in function or
        trigger we try to change table which is used in statement invoking this
        function or trigger.
      sql/sql_base.cc:
        open_table():
          If we are in stored function or trigger we should ensure that
          we won't change table that is already used by calling statement
          (this can damage table or easily cause infinite loops).
          So if we are opening table for writing, we should check that it
          is not already open by some calling stamement.
      b1921c85
    • unknown's avatar
      view.test: · c9fa6a47
      unknown authored
        Added a test case for bug #10970.
      view.result:
        Added a test case for bug #10970.
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
      sql_view.cc:
        Fixed bug #10970.
        In the function mysql_create_view if a view does not refer
        any tables directly the variable table must be updated
        after the call of open_and_lock_tables.
      errmsg.txt:
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
        (when fixing bug #10970).
      
      
      sql/share/errmsg.txt:
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
        (when fixing bug #10970).
      sql/sql_view.cc:
        Fixed bug #10970.
        In the function mysql_create_view if a view does not refer
        any tables directly the variable table must be updated
        after the call of open_and_lock_tables.
      mysql-test/r/view.result:
        Fixed bug #10970.
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
      mysql-test/t/view.test:
        Added a test case for bug #10970.
      c9fa6a47
  11. 15 Aug, 2005 1 commit
    • 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
  12. 12 Aug, 2005 1 commit
  13. 10 Aug, 2005 1 commit
    • 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
  14. 07 Aug, 2005 1 commit
    • unknown's avatar
      Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO · 9e5c20f3
      unknown authored
      Give the user a warning if he tries to destroy the default key cache.
      
      
      mysql-test/r/key_cache.result:
        Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
        The test result.
      mysql-test/t/key_cache.test:
        Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
        The test case.
      sql/share/errmsg.txt:
        Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
        The new message string.
      9e5c20f3
  15. 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
  16. 02 Aug, 2005 2 commits
    • unknown's avatar
      Generate a warning/error when DATE_SUB/ADD() functions calculate a date · 455ee425
      unknown authored
      that is outside the acceptable date range. (Bug #10627)
      
      
      mysql-test/r/func_date_add.result:
        Add new results
      mysql-test/t/func_date_add.test:
        Add new regression test
      sql/item_timefunc.cc:
        Add warning for error conditions in Item_date_add_interval::get_date()
      sql/share/errmsg.txt:
        Add new error message
      455ee425
    • unknown's avatar
      issue correct error message in case of view presence for duplicated table on update (BUG#10773) · 705118d1
      unknown authored
      frequently used command sequence replaced with inline function
      
      
      BitKeeper/etc/config:
        logging switching off
      mysql-test/r/lowercase_view.result:
        hided view underlying tables from error message
      mysql-test/r/view.result:
        hided view underlying tables from error message
      mysql-test/t/lowercase_view.test:
        hided view underlying tables from error message
      mysql-test/t/view.test:
        hided view underlying tables from error message
      sql/mysql_priv.h:
        subroutine which return correct error message
      sql/share/errmsg.txt:
        new error message
      sql/sql_base.cc:
        subroutine which issue correct error message in case of view presence for duplicated table on update
      sql/sql_delete.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_insert.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_parse.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_update.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_view.cc:
        frequently used command sequence replaced with inline function
      sql/table.cc:
        frequently used command sequence replaced with inline function
      sql/table.h:
        frequently used command sequence replaced with inline function
      705118d1
  17. 27 Jul, 2005 1 commit
    • 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
  18. 22 Jul, 2005 1 commit
    • unknown's avatar
      errmsg.txt: · d3e68446
      unknown authored
        Change an ` quote to ' (' is used everywhere else)
        This does not affect any test results.
      
      
      sql/share/errmsg.txt:
        Change an ` quote to ' (' is used everywhere else)
        This does not affect any test results.
      d3e68446
  19. 19 Jul, 2005 1 commit
    • 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
  20. 17 Jul, 2005 1 commit
    • unknown's avatar
      Federated Storage Engine, bug 9925 "Federated query processor (step 2 or step 3) not using logic in · 6771f8d0
      unknown authored
      WHERE statement"
      
      
      sql/ha_federated.cc:
        Changes per Jimw's review. 
        
        notes about some suggestions:
        
        1. Tried to replace my_sprintf with strxmov, but had problems. Couldn't 
           get the test suite to run at all, and could not find any particular
           error. Since this is something that is not critical, I'll leave it
           as is for now.
        2. I would like to use my_error to create all of my error messages, but 
           cannot figure out how to get it to take more than one argument to be
           passed to the error message (I tried this once but had errors, and 
           cannot find an example of how to get it to work despite seeing messages
           with obviously more than one arg
        3. Replaced all string building from literals to defined SQL string pieces
           such as "SELECT ", "FROM " ...
        4. Format fixes, spacing fixes completed
        5. Removed records_in_range records calculation functionality
      sql/ha_federated.h:
        Formatting changes, new defines for SQL query string tokens
      sql/share/errmsg.txt:
        changed 'SRC' to 'SOURCE' per Jimw's review
      6771f8d0
  21. 16 Jul, 2005 1 commit
    • unknown's avatar
      This is the same patch as 1.1937, with small variable declaration changes, memory · d887a692
      unknown authored
      deallocation cleanup
      
      
      mysql-test/r/federated.result:
        new test results
      mysql-test/t/federated.test:
        New tests, and added explains per Timour's suggestion. This will keep
                track of whether changes have been made to the optimiser that might affect
                Federated.
                Also changed the error codes to federated error codes in the error tests
      sql/ha_federated.cc:
        1. Not using MAX_REMOTE_SIZE, so removed
                 2. Changed all defines that were IO_SIZE to FEDERATED_QUERY_BUFFER_SIZE
                 3. Now using Federated Error Codes
                 4. Implemented ::info (gets valid 'records' number)
                 5. Implemented ::read_range_first - now uses indexes in range operations
                 6. Better allocation in get_share
                 7. Cleaned up memory bug in get_share
                 8. Better initial query "SELECT * FROM t1 WHERE 1=0" for check_foreign_data_src
                 9. emit_key_part_name and emit_key_part_element for read_range_first to not
                    have redundancy
                 10. Made sure all 'append's pass length, and use append("") to ensure proper
                     null termination of strings being built.
                 11. Better message creation. If ER_QUERY_ON_FOREIGN_DATA_SRC, I also pass
                     the actual error code and message from the foreign data src.
                 12. Cleaned up how the result set and share->scheme is freed.
      sql/share/errmsg.txt:
        New Federated error messages that are more tailored to the type of information
        we want to see when federated has an error.
      mysql-test/include/federated.inc:
        New bitkeeper file, include file for separating setup from main test suite
      mysql-test/include/federated_cleanup.inc:
        New BitKeeper file ``mysql-test/include/federated_cleanup.inc''
      sql/ha_federated.h:
        Added comments where needed, one was already commented about
      d887a692
  22. 13 Jul, 2005 1 commit
    • 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
  23. 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
  24. 01 Jul, 2005 2 commits
    • unknown's avatar
      "Fix" for bug #11394 "Recursion in SP crash server" and bug #11600 · 0f64a495
      unknown authored
      "Stored procedures: crash with function calling itself".
      
      Disallow recursive stored routines until we either make Item's and LEX
      reentrant safe or will use spearate sp_head instances (and thus separate
      LEX objects and Item trees) for each routine invocation.
      
      
      mysql-test/r/sp-error.result:
        Added tests for bug #11394 "Recursion in SP crash server" and
        bug #11600 "Stored procedures: crash with function calling itself".
        (We simply disallow recursion for stored routines).
      mysql-test/r/sp.result:
        Disabled test cases containing recursive stored routines until we will
        support for them.
      mysql-test/t/sp-error.test:
        Added tests for bug #11394 "Recursion in SP crash server" and
        bug #11600 "Stored procedures: crash with function calling itself".
        (We simply disallow recursion for stored routines).
      mysql-test/t/sp.test:
        Disabled test cases containing recursive stored routines until we will
        support for them.
      sql/share/errmsg.txt:
        Added error message saying that recursive stored routines are disallowed.
      sql/sp_head.cc:
        sp_head::execute():
          Since many Item's and LEX members can't be used in reentrant fashion
          we have to disable recursion for stored routines. So let us track
          routine invocations using sp_head::m_is_invoked member and raise
          error when one attempts to call routine recursively.
      sql/sp_head.h:
        sp_head:
          Added m_is_invoked member for tracking of routine invocations and
          preventing recursion.
      0f64a495
    • 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. 22 Jun, 2005 1 commit
  26. 20 Jun, 2005 2 commits
    • unknown's avatar
      Fix a formatting bug and add a test for it. · c8c0140e
      unknown authored
      sql/share/errmsg.txt:
        Fix a formatting bug.
      sql/sql_prepare.cc:
        Fix a formatting bug.
      tests/mysql_client_test.c:
        Test the server side error message.
      c8c0140e
    • unknown's avatar
      bug#10466: Datatype "timestamp" displays "YYYYMMDDHHMMSS" irrespective of display sizes. · d2b52d19
      unknown authored
       - Print warning that says display width is not supported for datatype TIMESTAMP, if user tries to create a TIMESTAMP column with display width.
       - Use display width for TIMESTAMP only in type_timestamp test to make sure warning is displayed correctly.
      
      
      mysql-test/include/ps_create.inc:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/alias.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/func_date_add.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/func_str.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/func_time.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/group_by.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/innodb.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_1general.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_2myisam.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_3innodb.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_4heap.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_5merge.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_6bdb.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/ps_7ndb.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/select.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/r/type_timestamp.result:
        When display width is used for a TIMESTAMP column a warning is printed that the display width will be ignored.
      mysql-test/r/update.result:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/alias.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/func_date_add.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/func_str.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/func_time.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/group_by.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/innodb.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/ps.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/ps_4heap.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/ps_5merge.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/select.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      mysql-test/t/update.test:
        Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
      sql/share/errmsg.txt:
        Correct swedish error message
      sql/sql_parse.cc:
        Print warning if datatype is TIMESTAMP and display width is used.
      d2b52d19
  27. 19 Jun, 2005 1 commit
  28. 07 Jun, 2005 1 commit
    • unknown's avatar
      Fix for bug #10015 "Crash in InnoDB if stored routines are used". · 49357ae8
      unknown authored
      We should not allow explicit or implicit transaction commits inside
      of stored functions or triggers (so in autocommit mode we should not
      do commits after execution of sub-statement).
      Also since we don't support nested statement transactions in 5.0,
      we shouldn't commit or rollback stmt transactions while we are inside
      stored functions or triggers. This should be fixed in later (>=5.1)
      releases.
      
      
      mysql-test/r/sp_trans.result:
        Added test for bug #10015 "Crash in InnoDB if stored routines are used"
        and for general transaction handling inside of functions.
      mysql-test/t/sp_trans.test:
        Added test for bug #10015 "Crash in InnoDB if stored routines are used"
        and for general transaction handling inside of functions.
      sql/handler.cc:
        ha_trans_commit()/ha_trans_rollback():
          Since we don't support nested statement transactions in 5.0,
          we can't commit or rollback stmt transactions while we are inside
          stored functions or triggers. So we simply do nothing now.
          This should be fixed in later ( >= 5.1) releases.
      sql/item_func.cc:
        Item_func_sp::execute():
          Set THD::transaction.in_sub_stmt flag to TRUE during stored function
          execution to prevent commits and rollbacks for statement level
          transactions, since doing them will ruin such transaction for
          stateemtn which calls this function.
      sql/share/errmsg.txt:
        Added error message which says that statements doing explicit or implicit
        commits are disallowed in triggers and stored functions.
      sql/sql_base.cc:
        close_thread_tables():
          Clarified comment about committing of statement transactions in
          prelocked mode.
      sql/sql_class.h:
        THD::transaction:
          Added in_sub_stmt method which indicates that we are executing
          statements from trigger or stored function now, and thus
          statement transaction belongs to statement which invoked this
          routine and we should not commit or rollback it while executing
          these sub-statements.
      sql/sql_parse.cc:
        end_active_trans()/begin_trans()/end_trans():
          We should not commit or rollback global (non-stmt) transaction
          if we are executing stored function or trigger. These checks will
          catch situation when we are trying to do commit or rollback in stored
          procedure which is called from function or trigger.
      sql/sql_trigger.h:
        Table_triggers_list::process_triggers():
          Set THD::transaction.in_sub_stmt flag to TRUE during trigger
          execution to prevent commits and rollbacks for statement level
          transactions, since doing them will ruin such transaction for
          stateemtn which invokes this trigger.
      sql/sql_yacc.yy:
        Prohibited usage of statements which do explicit or implicit commit or
        rollback inside of stored functions and triggers.
      49357ae8
  29. 12 May, 2005 1 commit
    • unknown's avatar
      A fix and test case for Bug#9478 "mysql_stmt_attr_set mysql_stmt_execute" · 2a8556f3
      unknown authored
      (crash on attempt to re-execute a statement with an open cursor) + 
      post-review fixes.
      
      
      include/errmsg.h:
        Add a special error message when we attempt to mysql_stmt_fetch
        from a statement which has no result set.
      libmysql/errmsg.c:
        Error message text for CR_NO_RESULT_SET
      libmysql/libmysql.c:
        Move the code which frees result sets on client and closes the cursor
        on server, resets long data state on client and server.
        This makes one function out of two (mysql_stmt_reset and
        mysql_stmt_free_result), thus aggregating all related reset work
        in one place.
      sql-common/client.c:
        Fix one place where we flushed the pending result set of a statement,
        but didn't set unbuffered_fetch_cancelled flag.
      sql/share/errmsg.txt:
        Fix format of ER_UNKNOWN_STMT_HANDLER error message (needs to
        be fixed separately in 4.1). Add two new error messages 
        for the case when we fetch from when there is no cursor
        and for the case when we attempt to execute a statement while there is
        a cursor.
      sql/sql_prepare.cc:
        Return error when we fetch while there is no open cursor and
        when we call execute while there is a pending cursor.
        Fix mysql_stmt_reset to close the open cursor if there is any.
      sql/sql_select.cc:
        free_items and free_root moved to Cursor::close().
      sql/sql_select.h:
        A comment added.
      tests/mysql_client_test.c:
        A test case for Bug#9478, test the case of mysql_stmt_reset
        called for client-side cached result set and for the case with open cursor.
        All strcpy replaced with strmov (review request).
      2a8556f3
  30. 05 May, 2005 1 commit
    • unknown's avatar
      Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146... · af12ff65
      unknown authored
        Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions).
        Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several
        limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible).
        Reason I don't propagate caller info to the binlog as planned is that on master and slave
        users may be different; even with that some caveats would remain.
      
      
      mysql-test/mysql-test-run.sh:
        In the testsuite we know what we do, we are not creating nasty routines, and breaking binlog is ok except in rpl_sp.
      mysql-test/r/blackhole.result:
        Updating results now that 4.1 has been merged
      mysql-test/valgrind.supp:
            Some suppressions for Valgrind (useful on my machine Suse 9.1);
            this is just adding to the already existing suppressions of pthread and dl.
      sql/item_func.cc:
            Don't binlog the substatements when executing a function. If the function
            is declared to modify data and does not complete, warning "broken binlog".
            Note that SELECT myfunc() will not be binlogged even if myfunc() updates data (will be documented);
            but INSERT INTO t VALUES(myfunc()) will be binlogged (what decides is if the caller
            gets binlogged; the function changes nothing to binlogging).
      sql/log_event.cc:
            Just making functions which can be re-used when we binlog more strings
            in status_vars in Query_log_event (e.g. one day "user", "host").
      sql/log_event.h:
        comment
      sql/mysql_priv.h:
            --log-bin-trust-routine-creators
      sql/mysqld.cc:
            --log-bin-trust-routine-creators
      sql/set_var.cc:
            --log-bin-trust-routine-creators
      sql/share/errmsg.txt:
        error messages to warn about problems with routines and binlog
      sql/slave.cc:
            If in a routine, replication table inclusion/exclusion rules always answer "replicate!" (see comment in code).
      sql/sp.cc:
            If binlog is on: errors if one wants to create a non-deterministic update routine
            (repeatability problem - note that the test is not perfect for functions) or does not have SUPER (because routines can easily
            be made to destroy slave's data with just CREATE ROUTINE and EXECUTE priv on master).
            --log-bin-trust-routine-creators removes these errors.
            Binlogging of CREATE PROCEDURE|FUNCTION.
      sql/sql_acl.cc:
            No thd==0 in tables_ok().
      sql/sql_parse.cc:
            Binlogging of CALL (and not of the substatements of the SP).
            If SP returns error, we don't binlog it (see comment); we push warning in this case.
            Binlogging of ALTER|DROP PROCEDURE|FUNCTION with safety messages.
      af12ff65
  31. 29 Apr, 2005 1 commit
    • unknown's avatar
      Fix for #6553 and #8776 (no errors on bad spatial data) · 1df25ccd
      unknown authored
      mysql-test/r/gis-rtree.result:
        test result fixed
      mysql-test/r/gis.result:
        test result fixed
      mysql-test/t/gis-rtree.test:
        test case fixed
      mysql-test/t/gis.test:
        test case added
      sql/field.cc:
        error messages launched now when we try to put bad spatial
        data in the GEOMETRY field
      sql/field.h:
        interface fixed
      sql/item_geofunc.cc:
        bad_data sign now instead of NULL now returned from
        Item_geometry_from_text::val_str
      sql/share/errmsg.txt:
        error message added
      sql/spatial.cc:
        bad_geometry data instance
      sql/spatial.h:
        bad_geometry_data declaration
      sql/sql_base.cc:
        messages now created in store_* function
      1df25ccd
  32. 27 Apr, 2005 1 commit
    • unknown's avatar
      Post-review fixes of the patch for BUG#8408: Stored procedure crash if function contains SHOW · 5c44e1ac
      unknown authored
      (Review on irc by monty)
      
      
      mysql-test/r/sp-error.result:
        Renamed a procedure and function to avoid confusion
      mysql-test/t/sp-error.test:
        Renamed a procedure and function to avoid confusion
      sql/item_func.cc:
        Corrected (and better) way to set/reset the client cap. flag in Item_func_sp::execute()
      sql/share/errmsg.txt:
        Changed the ER_SP_BADSELECT error; more accurate, and includes the procedure name.
      sql/sql_parse.cc:
        Include the procedure name in the new error message.
      5c44e1ac
  33. 26 Apr, 2005 1 commit
    • unknown's avatar
      Fixed BUG#8408: Stored procedure crash if function contains SHOW · ede52616
      unknown authored
        We simply have to disallow any kind of result set being sent back
        from a function. Can't see any way to make that to work.
      
      
      mysql-test/r/sp-error.result:
        New test case for BUG#8408.
      mysql-test/t/sp-error.test:
        New test case for BUG#8408.
      sql/item_func.cc:
        Disable result sets from functions but temporarily turning CLIENT_MULTI_RESULTS off.
      sql/share/errmsg.txt:
        Added error message for statements not allowed in functions (detected during parsing).
      sql/sql_yacc.yy:
        Don't allow result sets in functions.
      ede52616
  34. 20 Apr, 2005 1 commit
    • unknown's avatar
      Fixed BUG#7047: Stored procedure crash if alter procedure · c751c6ce
      unknown authored
        by simply disallowing alter procedure/function in an SP (as for drop).
      
      
      mysql-test/r/sp-error.result:
        Added test case for BUG#7047.
      mysql-test/t/sp-error.test:
        Added test case for BUG#7047.
      sql/share/errmsg.txt:
        Modified error message for "update procedure/function" too.
      sql/sql_yacc.yy:
        Don't allow alter procedure/function in an SP.
      c751c6ce
  35. 14 Apr, 2005 1 commit
    • unknown's avatar
      Fixed BUG#9598: stored procedure call within stored procedure · e0fdbeba
      unknown authored
                      overwrites IN variable
        and added error checking of variables for [IN]OUT parameters while
        rewriting the out parameter handling.
      
      
      mysql-test/r/sp-error.result:
        New test case for non-variable argument for [IN]OUT parameters.
        (And changed to qualified names in some other error messages.)
      mysql-test/r/sp.result:
        New test case for BUG#9598.
      mysql-test/t/sp-error.test:
        New test case for non-variable argument for [IN]OUT parameters.
      mysql-test/t/sp.test:
        New test case for BUG#9598.
      sql/item.h:
        Need to distinguish between SP local variable items and other items,
        for error checking and [IN]OUT parameter handling.
      sql/share/errmsg.txt:
        New error message for non-variable arguments for [IN]OUT parameters in stored procedures.
      sql/sp_head.cc:
        Rewrote the [IN]OUT parameter handling in procedure invokation, to make
        it work properly when using user variables in sub-calls.
        Also added error checking for non-variable arguments for such parameters
        (and changed to qualified names for wrong number of arg. errors).
      sql/sp_rcontext.cc:
        No need to keep track on the out index for an [IN]OUT parameter any more.
      sql/sp_rcontext.h:
        No need to keep track on the out index for an [IN]OUT parameter any more.
      e0fdbeba
  36. 08 Apr, 2005 1 commit
    • unknown's avatar
      Fixed BUG#9073: Able to declare two handlers for same condition in same scope · fc5db935
      unknown authored
      mysql-test/r/sp-error.result:
        Added test case for BUG#9073.
      mysql-test/t/sp-error.test:
        Added test case for BUG#9073.
      sql/share/errmsg.txt:
        New error message for duplicate condition handlers in stored procedures.
      sql/sp_pcontext.cc:
        Keep track on condition handlers in the same block for error checking.
      sql/sp_pcontext.h:
        Keep track on condition handlers in the same block for error checking.
      sql/sql_yacc.yy:
        Keep track on condition handlers in the same block for error checking.
      fc5db935