An error occurred fetching the project authors.
  1. 28 Jun, 2006 1 commit
    • unknown's avatar
      Bug #18005: Creating a trigger on mysql.event leads to server crash on scheduler startup · 88afd72b
      unknown authored
      Bug #18361: Triggers on mysql.user table cause server crash
      
       Because they do not work, we do not allow creating triggers on tables
       within the 'mysql' schema.
      
       (They may be made to work and re-enabled at some later date, but not
       in 5.0 or 5.1.)
      
      
      mysql-test/r/trigger.result:
        Add new results
      mysql-test/t/trigger.test:
        Add new regression test for creating triggers on system schema
      sql/share/errmsg.txt:
        Add new error message
      sql/sql_trigger.cc:
        Disallow creating triggers on tables in the 'mysql' schema
      88afd72b
  2. 20 Jun, 2006 1 commit
    • unknown's avatar
      bug #19672 (paths in embedded server are trucated in error messages) · c072416c
      unknown authored
      It fact, filenames are truncated in normal server as well, just we
      get bigger filenames in embedded server tests, but that can potentially
      get some problems in both cases.
      I modified file-related error messages to allow longer filenames
      
      
      sql/share/errmsg.txt:
        error messages fixed to keep longer filenames uncut
      c072416c
  3. 12 May, 2006 1 commit
    • unknown's avatar
      Bug#14635: Accept NEW.x as INOUT parameters to stored procedures · afe2520e
      unknown authored
      from within triggers
      
      Add support for passing NEW.x as INOUT and OUT parameters to stored
      procedures.  Passing NEW.x as INOUT parameter requires SELECT and
      UPDATE privileges on that column, and passing it as OUT parameter
      requires only UPDATE privilege.
      
      
      mysql-test/r/sp-error.result:
        Update the result for new message.
      mysql-test/r/trigger-grant.result:
        Add result for bug#14635.
      mysql-test/r/trigger.result:
        Add result for bug#14635.
      mysql-test/t/trigger-grant.test:
        Add test case for bug#14635.
      mysql-test/t/trigger.test:
        Add test case for bug#14635.
      sql/item.cc:
        Add implementations of set_value() and set_required_privilege() methods
        of Settable_routine_parameter interface.
        
        Use Item_trigger_field::want_privilege instead of
        Item_trigger_field::access_type.
        
        Reset privileges on Item_trigger_field::cleanup().
      sql/item.h:
        Add interface class Settable_routine_parameter and interface query
        method to Item class.  Item_splocal and Item_trigger_field implement
        this interface.
        
        For Item_trigger_field:
         - add read_only attribute and is_read_only() method.
         - remove access_type and add original_privilege and want_privilege
           instead.
         - add set_value() method.
         - add reset_privilege() method.
      sql/item_func.cc:
        Add implementations of set_value() method of Settable_routine_parameter
        interface.
      sql/item_func.h:
        Item_func_get_user_var implements Settable_routine_parameter interface.
      sql/share/errmsg.txt:
        Update english ER_SP_NOT_VAR_ARG message.
      sql/sp_head.cc:
        Use Settable_routine_parameter interface for parameter update.
      sql/sql_yacc.yy:
        Set read_only and want_privilege members in Item_trigger_field
        appropriately.  For NEW.x trigger variable used in left-hand-side
        of SET statement the latter is set to UPDATE_ACL, otherwise it is
        set to SELECT_ACL (but see Item_trigger_field::set_required_privilege(),
        where it may be updated to different value).
      afe2520e
  4. 26 Apr, 2006 1 commit
  5. 20 Apr, 2006 1 commit
    • unknown's avatar
      Fixed bug#18739: non-standard HAVING extension was allowed in strict ANSI sql mode. · 4b7c4cd2
      unknown authored
      The SQL standard doesn't allow to use in HAVING clause fields that are not 
      present in GROUP BY clause and not under any aggregate function in the HAVING
      clause. However, mysql allows using such fields. This extension assume that 
      the non-grouping fields will have the same group-wise values. Otherwise, the 
      result will be unpredictable. This extension allowed in strict 
      MODE_ONLY_FULL_GROUP_BY sql mode results in misunderstanding of HAVING 
      capabilities.
      
      The new error message ER_NON_GROUPING_FIELD_USED message is added. It says
      "non-grouping field '%-.64s' is used in %-.64s clause". This message is
      supposed to be used for reporting errors when some field is not found in the
      GROUP BY clause but have to be present there. Use cases for this message are 
      this bug and when a field is present in a SELECT item list not under any 
      aggregate function and there is GROUP BY clause present which doesn't mention 
      that field. It renders the ER_WRONG_FIELD_WITH_GROUP error message obsolete as
      being more descriptive.
      The resolve_ref_in_select_and_group() function now reports the 
      ER_NON_GROUPING_FIELD_FOUND error if the strict mode is set and the field for 
      HAVING clause is found in the SELECT item list only.
      
      
      
      sql/share/errmsg.txt:
        Added the new ER_NON_GROUPING_FIELD_USED error message for the bug#14169.
      mysql-test/t/having.test:
        Added test case for the bug#18739:  non-standard HAVING extension was allowed in strict ANSI sql mode.
      mysql-test/r/having.result:
        Added test case for the bug#18739:  non-standard HAVING extension was allowed in strict ANSI sql mode.
      sql/sql_select.cc:
        Added TODO comment to change the ER_WRONG_FIELD_WITH_GROUP to more detailed ER_NON_GROUPING_FIELD_USED message.
      sql/item.cc:
        Fixed bug#18739: non-standard HAVING extension was allowed in strict ANSI sql mode.
        The resolve_ref_in_select_and_group() function now reports the
        ER_NON_GROUPING_FIELD_FOUND error if the strict MODE_ONLY_FULL_GROUP_BY mode
        is set and the field for HAVING clause is found in the SELECT item list only.
      4b7c4cd2
  6. 13 Apr, 2006 1 commit
  7. 12 Apr, 2006 2 commits
    • unknown's avatar
      Post-merge fixes. Add a new error message for max_prepared_stmt_count · c5ed5c4b
      unknown authored
      limit.
      
      
      mysql-test/r/ps.result:
        Post-merge fixes.
      mysql-test/t/ps.test:
        Post-merge fixes.
      sql/share/errmsg.txt:
        Add a new error message for max_prepared_stmt_count limit,
        we can do it in 5.0
      sql/sql_class.cc:
        Post-merge fixes.
      sql/sql_class.h:
        Post-merge fixes.
      sql/sql_prepare.cc:
        Post-merge fixes.
      c5ed5c4b
    • unknown's avatar
      bug #15860 (SPATIAL keys in INNODB) · f01b0ac2
      unknown authored
      mysql-test/r/innodb.result:
        result added
      mysql-test/t/innodb.test:
        testcase
      sql/ha_myisam.cc:
        HA_CAN_RTREEKEYS added to ha_myisam
      sql/handler.h:
        HA_CAN_RTREEKEYS defined
      sql/share/errmsg.txt:
        error message added
      sql/sql_table.cc:
        check that the handler allows SPATIAL keys
      f01b0ac2
  8. 10 Mar, 2006 1 commit
    • unknown's avatar
      Bug#17261 Passing a variable from a stored procedure to UDF crashes mysqld · e52ff555
      unknown authored
       - Update of test toolsand Makefiles to make it possible to test always test udf's as part 
      of the mysql test suite
      
      
      mysql-test/mysql-test-run.pl:
        Add the path where mysqld will udf_example.so used by the udf test
      mysql-test/r/udf.result:
        Update test results
      mysql-test/t/udf.test:
        Update tests
        The "--error 0" directives should actually be changed to the correct error number returned but that error  number is lost. W e do however get the right error message and that is checked in 
        the .result file.
      sql/Makefile.am:
        Build shared library udf_example.so
      sql/share/errmsg.txt:
        Update the max length of %s string from 64 to 128
      sql/sql_udf.cc:
        Add DBUG_PRINT just before dl_open
      sql/udf_example.cc:
        Use isalpha instade of my_isalpha
      e52ff555
  9. 17 Feb, 2006 1 commit
    • unknown's avatar
      WL#2645 (CHECK TABLE FOR UPGRADE) · bf840404
      unknown authored
      necessary implementation in the server
      mysql_upgrade script added
      
      
      client/mysqlcheck.c:
        --check-upgrade option added
      include/my_base.h:
        errcode added
      include/myisam.h:
        option added
      scripts/Makefile.am:
        mysql_upgrade script added
      sql/handler.cc:
        checks for old types/bugs added
      sql/handler.h:
        declarations regarding checks for upgrade
      sql/lex.h:
        sym added
      sql/share/errmsg.txt:
        error message added
      sql/slave.cc:
        now ha_repair is for public use
      sql/sql_table.cc:
        upgrade in ha_repair implemented
      sql/sql_yacc.yy:
        CHECK ... FOR UPGRADE added to syntax
      bf840404
  10. 09 Feb, 2006 1 commit
    • unknown's avatar
      Fixed BUG#16896: Stored function: unused AGGREGATE-clause in CREATE FUNCTION · 0fd78492
      unknown authored
        Check if AGGREGATE was given with a stored (non-UDF) function, and return
        error in that case.
        Also made udf_example/udf_test work again, by adding a missing *_init()
        function. (_init() functions required unless --allow_suspicious_udfs is
        given to the server, since March 2005 - it seems udf_example wasn't updated
        at the time.)
      
      
      mysql-test/r/sp-error.result:
        Updated results for BUG#16896.
      mysql-test/t/sp-error.test:
        Added test case for BUG#16896.
      sql/share/errmsg.txt:
        New error message: ER_SP_NO_AGGREGATE
      sql/sql_yacc.yy:
        Check if AGGREGATE was used when creating a stored function (i.e. not an UDF).
      sql/udf_example.cc:
        Added myfunc_int_init() function to make it work when the server is running without
        --allow_suspicious_udfs.
      0fd78492
  11. 17 Jan, 2006 1 commit
    • unknown's avatar
      Bug#15206: "Misleading message "No data to FETCH": · 13f5fca9
      unknown authored
      reword the misleading message.
      
      
      mysql-test/r/sp-error.result:
        Test results fixed (Bug#15206)
      mysql-test/r/sp.result:
        Test results fixed (Bug#15206)
      mysql-test/r/type_decimal.result:
        Disable an unportable test case (Bug#7670)
      mysql-test/r/variables.result:
        Test results fixed (Bug#15206)
      mysql-test/r/view_grant.result:
        Test results fixed (Bug#15206)
      mysql-test/t/type_decimal.test:
        Remove an unportable (QNX) test case (Bug#7670). The test output
        depends on system-specific sprintf() implementation.
        The original complain was about erroneous conversion to long long,
        which was applied prior to conversion to double: but the expected
        behaviour can't be achieved until we have an own string -> double
        conversion function.
      13f5fca9
  12. 11 Jan, 2006 1 commit
    • unknown's avatar
      Fixing BUG#15658: Server crashes after creating function as empty string · 1e968057
      unknown authored
        Empty strings (and names with trailing spaces) should not be allowed.
      
      
      mysql-test/r/sp-error.result:
        New testcase for BUG#15658
      mysql-test/t/sp-error.test:
        New testcase for BUG#15658
      sql/share/errmsg.txt:
        New error message for bad stored routine names.
      sql/sp_head.cc:
        Added function for checking SP names. (Mustn't be empty or contain trailing spaces.)
      sql/sp_head.h:
        Added function for checking SP names.
      sql/sql_yacc.yy:
        Check db and name for stored routines.
      1e968057
  13. 20 Dec, 2005 1 commit
    • unknown's avatar
      errmsg.txt: · 3b94794f
      unknown authored
        Fix typo.
      
      
      sql/share/errmsg.txt:
        Fix typo.
      3b94794f
  14. 02 Dec, 2005 1 commit
  15. 25 Nov, 2005 1 commit
    • unknown's avatar
      Fixed BUG#14233: Crash after tampering with the mysql.proc table · d4088df5
      unknown authored
        Post-review version. Some minor review fixes, but also changed the way
        some errors are handled: Don't return specific parse errors; instead
        always use the more general "table corrupt" error (amended accordingly).
      
      
      mysql-test/r/sp-destruct.result:
        Updated results.
      mysql-test/r/sp-error.result:
        Updated for fully qualified name in "no return" error message.
      mysql-test/t/sp-destruct.test:
        Adopted the more consistent error handling for a corrupted mysql.proc table.
        (No more "parse error" et al).
      sql/share/errmsg.txt:
        Changed ER_SP_PROC_TABLE_CORRUPT to be more explicit.
      sql/sp.cc:
        Review fixes.
        Changed the handling of parse errors, and added the routine name to the "table corrupt" error message.
      sql/sql_base.cc:
        Review changes: Change error tests and added comments.
      sql/sql_parse.cc:
        Mored ER_SP_NORETURN test of functions to sql_yacc.yy for more general error handling.
      sql/sql_yacc.yy:
        Mored ER_SP_NORETURN test of functions from sql_parse.cc for more general error handling.
      d4088df5
  16. 24 Nov, 2005 1 commit
    • unknown's avatar
      Don't use PATH_MAX for FN_REFLEN as this uses too much stack space · 97bfd41f
      unknown authored
      Larger stack size neaded for open table on x86 64 bit
      Fix failing test cases
      Deleted symlink from bk
      
      
      BitKeeper/etc/ignore:
        added libmysqld/ha_blackhole.cc
      BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a:
        Delete: libmysqld/ha_blackhole.cc
      include/my_global.h:
        Don't use PATH_MAX for FN_REFLEN as this uses too much stack space.
        (With a PATH_MAX of 4096, we use 80K for opening a table as there is several objects of size FN_REFLEN on stack)
      mysql-test/r/federated.result:
        Update results after error message changes
      mysql-test/r/grant.result:
        Update results after error message changes
      mysql-test/r/grant2.result:
        Update results after error message changes
      sql/ha_federated.cc:
        Fix error messages to be more consistent
      sql/mysql_priv.h:
        Stack size to have when opening a table
        (This was needed on x86 64 bit Linux)
      sql/share/errmsg.txt:
        Remove quotes around error string for federated as two quotes in the output looks strange
      sql/sql_base.cc:
        More correct stack size
      sql/sql_parse.cc:
        Set thread_stack before store_globals()
      sql/unireg.h:
        More correct MAX_DBKEY_LENGTH
      97bfd41f
  17. 22 Nov, 2005 2 commits
    • unknown's avatar
      Recursion support made for SP (BUG#10100). · 164ce4c5
      unknown authored
      client/mysqltest.c:
        An expected error messages hiding from the log if disable_result_log is in force.
      mysql-test/r/sp-dynamic.result:
        The test expanded for case of allowed/disalowed recursion.
      mysql-test/r/sp-error.result:
        Error messages changed.
        Test of bug11394() made with allowed recursion.
      mysql-test/r/sp.result:
        Tests for recursion.
      mysql-test/r/trigger.result:
        Check that triggers are not affected by this patch.
      mysql-test/r/variables.result:
        Test of max_sp_recursion_depth variable.
      mysql-test/t/sp-dynamic.test:
        The test expanded for case of allowed/disalowed recursion.
      mysql-test/t/sp-error.test:
        Error messages changed.
        Test of bug11394() made with allowed recursion.
      mysql-test/t/sp.test:
        Tests for recursion.
      mysql-test/t/trigger.test:
        Check that triggers are not affected by this patch.
      mysql-test/t/variables.test:
        Test of max_sp_recursion_depth variable.
      sql/item_func.cc:
        sp_find_function() and sp_find_procedure() joined to sp_find_routine()
          function as it was mentioned in TODO.
      sql/mysqld.cc:
        max_sp_recursion_depth variable added.
      sql/set_var.cc:
        max_sp_recursion_depth variable added.
      sql/share/errmsg.txt:
        An error message changed.
        An error message added.
      sql/sp.cc:
        sp_find_function() and sp_find_procedure() joined to sp_find_routine()
          function as it was mentioned in TODO.
        Temory LEX is allocated on a stack, not on a heap.
        Recursion support added for stored procedures.
      sql/sp.h:
        sp_find_function() and sp_find_procedure() joined to sp_find_routine()
          function as it was mentioned in TODO.
      sql/sp_head.cc:
        Initialization of new sp_head fields to get correct list of instances
          contained one instance only.
        Stack requirement for SP instruction is increased.
        Stack free space is checked before mem root initialisation to avoid
          memory leak.
        Pointer to the free instance management added before and after
          SP execution.
      sql/sp_head.h:
        New sp_head variables added to support inst of instances of SP
          for recursion and pointer on ths first free to use instance.
      sql/sql_base.cc:
        open_table() consume a lot of stack space so we check free stack space before it.
      sql/sql_class.h:
        max_sp_recursion_depth variable added.
      sql/sql_parse.cc:
        sp_find_function() and sp_find_procedure() joined to sp_find_routine()
          function as it was mentioned in TODO.
      164ce4c5
    • unknown's avatar
      German error messages · 3a84f6e2
      unknown authored
      3a84f6e2
  18. 20 Nov, 2005 1 commit
    • unknown's avatar
      Inefficient usage of String::append() fixed. · fe63e095
      unknown authored
      Bad examples of usage of a string with its length fixed.
      The incorrect length in the trigger file configuration descriptor
        fixed (BUG#14090).
      A hook for unknown keys added to the parser to support old .TRG files.
      
      
      sql/field.cc:
        Inefficient usage of String::append() fixed.
        Bad examples of usage of a string with its length fixed.
      sql/ha_berkeley.cc:
        A bad example of usage of a string with its length fixed.
      sql/ha_federated.cc:
        Inefficient usage of String::append() fixed.
      sql/ha_myisammrg.cc:
        Bad examples of usage of a string with its length fixed.
      sql/handler.cc:
        Inefficient usage of String::append() fixed.
      sql/item.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item.h:
        A bad example of usage of a string with its length fixed.
      sql/item_cmpfunc.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_func.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_strfunc.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_subselect.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_sum.cc:
        Bad examples of usage of a string with its length fixed.
        Inefficient usage of String::append() fixed.
      sql/item_timefunc.cc:
        Inefficient using of String::append() fixed.
        Bad examples of usage of a string with its length fixed.
      sql/item_uniq.h:
        Bad examples of usage of a string with its length fixed.
      sql/key.cc:
        Bad examples of usage of a string with its length fixed.
      sql/log.cc:
        Bad examples of usage of a string with its length fixed.
      sql/log_event.cc:
        Bad examples of usage of a string with its length fixed.
      sql/mysqld.cc:
        The dummy parser hook allocated.
      sql/opt_range.cc:
        Inefficient usage of String::append() fixed.
      sql/parse_file.cc:
        Bad examples of usage of a string with its length fixed.
        A hook for unknown keys added to the parser.
      sql/parse_file.h:
        A hook for unknown keys added to the parser.
      sql/protocol.cc:
        A bad example of usage of a string with its length fixed.
      sql/repl_failsafe.cc:
        Bad examples of usage of a string with its length fixed.
      sql/share/errmsg.txt:
        A warning for old format config file.
      sql/slave.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sp.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sp_head.cc:
        Bad examples of usage of a string with its length fixed.
      sql/spatial.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_acl.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_analyse.cc:
        Bad examples of usage of a string with its length fixed.
        Inefficient usage of String::append() fixed.
      sql/sql_lex.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_load.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_parse.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_prepare.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_select.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_show.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_string.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_string.h:
        The macro definition moved to sql_string.h to
          be accessible in all parts of server.
      sql/sql_table.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_trigger.cc:
        Bad examples of usage of a string with its length fixed.
        The incorrect length in the trigger file configuration descriptor
          fixed (BUG#14090).
        The hook for processing incorrect sql_mode record added.
      sql/sql_view.cc:
        A dummy  hook used for parsing views.
      sql/structs.h:
        The macro definition moved to sql_string.h to be
          accessible in all parts of server.
      sql/table.cc:
        A bad example of usage of a string with its length fixed.
      sql/tztime.cc:
        A bad example of usage of a string with its length fixed.
      fe63e095
  19. 17 Nov, 2005 1 commit
  20. 10 Nov, 2005 2 commits
    • unknown's avatar
      WL#2818 (Add creator to the trigger definition for privilege · 7dbea7df
      unknown authored
      checks on trigger activation)
      
      
      mysql-test/r/information_schema.result:
        Update result file: a new column DEFINER has been added to
        INFORMATION_SCHEMA.TRIGGERS.
      mysql-test/r/mysqldump.result:
        Update result file: a new column DEFINER has been added to
        INFORMATION_SCHEMA.TRIGGERS.
      mysql-test/r/rpl_ddl.result:
        Update result file: a new column DEFINER has been added to
        INFORMATION_SCHEMA.TRIGGERS.
      mysql-test/r/rpl_sp.result:
        Update result file: a new clause DEFINER has been added to
        CREATE TRIGGER statement.
      mysql-test/r/rpl_trigger.result:
        Results for new test cases were added.
      mysql-test/r/skip_grants.result:
        Error message has been changed.
      mysql-test/r/trigger.result:
        Added DEFINER column.
      mysql-test/r/view.result:
        Error messages have been changed.
      mysql-test/r/view_grant.result:
        Error messages have been changed.
      mysql-test/t/mysqldump.test:
        Drop created procedure to not affect further tests.
      mysql-test/t/rpl_trigger.test:
        Add tests for new column in information schema.
      mysql-test/t/skip_grants.test:
        Error tag has been renamed.
      mysql-test/t/view.test:
        Error tag has been renamed.
      mysql-test/t/view_grant.test:
        Error tag has been changed.
      sql/item_func.cc:
        Fix typo in comments.
      sql/mysql_priv.h:
        A try to minimize copy&paste:
          - introduce operations to be used from sql_yacc.yy;
          - introduce an operation to be used from trigger and
            view processing code.
      sql/share/errmsg.txt:
        - Rename ER_NO_VIEW_USER to ER_MALFORMED_DEFINER in order to
          be shared for view and trigger implementations;
        - Fix a typo;
        - Add a new error code for trigger warning.
      sql/sp.cc:
        set_info() was split into set_info() and set_definer().
      sql/sp_head.cc:
        set_info() was split into set_info() and set_definer().
      sql/sp_head.h:
        set_info() was split into set_info() and set_definer().
      sql/sql_acl.cc:
        Add a new check: exit from the cycle if the table is NULL.
      sql/sql_lex.h:
        - Rename create_view_definer to definer, since it is used for views
          and triggers;
        - Change st_lex_user to LEX_USER, since st_lex_user is a structure.
          So, formally, it should be "struct st_lex_user", which is longer
          than just LEX_USER;
        - Add trigger_definition_begin.
      sql/sql_parse.cc:
        - Add a new check: exit from the cycle if the table is NULL;
        - Implement definer-related functions.
      sql/sql_show.cc:
        Add DEFINER column.
      sql/sql_trigger.cc:
        Add DEFINER support for triggers.
      sql/sql_trigger.h:
        Add DEFINER support for triggers.
      sql/sql_view.cc:
        Rename create_view_definer to definer.
      sql/sql_yacc.yy:
        Add support for DEFINER-clause in CREATE TRIGGER statement.
        
        Since CREATE TRIGGER and CREATE VIEW can be similar at the start,
        yacc is unable to distinguish between them. So, had to modify both
        statements in order to make it parsable by yacc.
      mysql-test/r/trigger-compat.result:
        Result file for triggers backward compatibility test.
      mysql-test/r/trigger-grant.result:
        Result file of the test for WL#2818.
      mysql-test/t/trigger-compat.test:
        Triggers backward compatibility test: check that the server
        still can load triggers w/o definer attribute and modify
        tables with such triggers (add a new trigger, etc).
      mysql-test/t/trigger-grant.test:
        Test for WL#2818 -- check that DEFINER support in triggers
        works properly
      7dbea7df
    • unknown's avatar
      WL#2971 "change log-bin-trust-routine-creators=0 to apply only to functions". · 5d9c8e95
      unknown authored
      Indeed now that stored procedures CALL is not binlogged, but instead the invoked substatements are,
      the restrictions applied by log-bin-trust-routine-creators=0 are superfluous for procedures.
      They still need to apply to functions where function calls are written to the binlog (for example as "DO myfunc(3)").
      We rename the variable to log-bin-trust-function-creators but allow the old name until some future version (and issue a warning if old name is used).
      
      
      mysql-test/mysql-test-run.pl:
        update to new option name
      mysql-test/mysql-test-run.sh:
        update to new option name
      mysql-test/mysql_test_run_new.c:
        update to new option name
      mysql-test/r/rpl_sp.result:
        result update
      mysql-test/t/rpl_sp-slave.opt:
        we need to skip this error to not hit BUG#14769
      mysql-test/t/rpl_sp.test:
        Test update:
        1) as log-bin-trust-routine-creators now affects only functions, the testing of this option, which was
        mainly done on procedures, is moved to functions
        2) cleanup is simplified; and instead of many SHOW BINLOG EVENTS we do a big one in the end, which is more
        maintainable.
        3) we test a few more function and procedures cases to see how they replicate.
        4) removing out-of-date comments
      sql/item_func.cc:
        This warning is wrong since binlogging of functions was changed in August. If a function fails
        in the middle, it will be binlogged with its error code (i.e. properly).
      sql/mysql_priv.h:
        variable name changed
      sql/mysqld.cc:
        option name changes. A precision about --read-only.
      sql/set_var.cc:
        a new class sys_var_trust_routine_creators to be able to issue a "this is a deprecated variable" warning if used.
      sql/set_var.h:
        new class to be able to issue a "this is a deprecated variable" warning if used.
      sql/share/errmsg.txt:
        routine -> function
      sql/sp.cc:
        log-bin-trust-routine-creators now applies only to functions.
      sql/sql_parse.cc:
        1) sending ER_FAILED_ROUTINE_BREAK_BINLOG is wrong since August as we don't binlog CALL anymore but instead binlog the substatements;
        the clear_error() goes away too as it was necessary only when we created a binlog event from the "CALL" statement.
        2) log-bin-trust-routine-creators now applies only to functions.
      sql/sql_trigger.cc:
        comments.
      5d9c8e95
  21. 06 Nov, 2005 1 commit
  22. 03 Nov, 2005 1 commit
  23. 02 Nov, 2005 1 commit
    • unknown's avatar
      #view.test#: · 8a809365
      unknown authored
        new file
      sql_table.cc, handler.h:
        Fixed bug #14540.
        Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
        to report that an operation cannot be applied for views.
      view.test, view.result:
        Added a test case for bug #14540.
      errmsg.txt:
        Fixed bug #14540.
        Added error ER_CHECK_NOT_BASE_TABLE.
      
      
      mysql-test/r/view.result:
        Added a test case for bug #14540.
      mysql-test/t/view.test:
        Added a test case for bug #14540.
      sql/handler.h:
        Fixed bug #14540.
        Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
        to report that an operation cannot be applied for views.
      sql/share/errmsg.txt:
        Added error ER_CHECK_NOT_BASE_TABLE.
      sql/sql_table.cc:
        Fixed bug #14540.
        Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
        to report that an operation cannot be applied for views.
      8a809365
  24. 27 Oct, 2005 1 commit
    • unknown's avatar
      support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787) · 24ac4019
      unknown authored
      mysql-test/r/information_schema.result:
        error message changed
      mysql-test/r/sp.result:
        error message changed
      mysql-test/r/sql_mode.result:
        fixed test suite
      mysql-test/r/view.result:
        error message changed
      mysql-test/r/view_grant.result:
        test of underlying view tables check
      mysql-test/t/sql_mode.test:
        fixed test suite
      mysql-test/t/view_grant.test:
        test of underlying view tables check
      sql/item.cc:
        check of underlying tables privilege added
      sql/item.h:
        Name the resolution context points to the security  context of view (if item belong to the view)
      sql/item_func.cc:
        a view error hiding for execution of prepared function belonged to a view
        fixed checking privileges if stored functions belonds to some view
      sql/mysql_priv.h:
        refult of derived table processing functions changed to bool
        Security_context added as an argument to find_field_in_table()
      sql/share/errmsg.txt:
        error message fixed
      sql/sql_acl.cc:
        Storing requested privileges of tables added
        View underlying tables privilege check added
      sql/sql_base.cc:
        View underlying tables privilege check added
      sql/sql_cache.cc:
        Code cleunup: we should not register underlying tables of view second time
      sql/sql_delete.cc:
        ancestor -> merge_underlying_list renaming
      sql/sql_derived.cc:
        refult of derived table processing functions changed to bool
        do not give SELECT_ACL for TEMPTABLE views
      sql/sql_lex.h:
        The comment added
      sql/sql_parse.cc:
        registration of requested privileges added
      sql/sql_prepare.cc:
        registration of requested privileges added
      sql/sql_update.cc:
        manipulation of requested privileges for underlying tables made the same as for table which we are updating
      sql/sql_view.cc:
        underlying tables of view security check support added
      sql/table.cc:
        renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
      sql/table.h:
        storege for reuested privileges added
      24ac4019
  25. 26 Oct, 2005 1 commit
    • unknown's avatar
      Fixed BUG#14233: Crash after tampering with the mysql.proc table · 9349f18b
      unknown authored
        Added error checking for errors when attempting to use stored procedures
        after the mysql.proc table has been dropped, corrupted, or tampered with.
        Test cases were put in a separate file (sp-destruct.test).
      
      
      mysql-test/t/sp.test:
        Added comment.
      sql/share/errmsg.txt:
        New error message for corrupted mysql.proc table.
      sql/sp.cc:
        Check and return error code when caching stored routines.
        In the case when no error message has been set, set one.
      sql/sp.h:
        Return error code from stored routine cache function.
      sql/sql_base.cc:
        Check for error from sp_cache_routines_* calls.
      sql/sql_trigger.h:
        Updated friend declaration for sp_cache_routines*.
      mysql-test/r/sp-destruct.result:
        New test file for destruction of the mysql.proc table.
      mysql-test/t/sp-destruct.test:
        New result file for destruction of the mysql.proc table.
      9349f18b
  26. 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
  27. 05 Oct, 2005 1 commit
  28. 30 Sep, 2005 1 commit
  29. 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
  30. 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
  31. 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
  32. 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
  33. 04 Sep, 2005 1 commit
  34. 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
  35. 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
  36. 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