1. 16 Apr, 2004 1 commit
    • unknown's avatar
      Implementation of WL#1469 (Greedy algorithm to search for an optimal execution plan). · 4c56ede4
      unknown authored
      
      mysql-test/r/subselect.result:
        Table pre-sorting before optimization makes the optimizer select a different plan, this change fixes the plan.
      sql/mysql_priv.h:
        Added new status variable last_query_cost that contains the cost of the last compiled query.
      sql/mysqld.cc:
        * Added new system variable 'plan_search_depth' to control the exhaustiveness of the search for an optimal query plan.
        * Added new system variable 'heuristic' to control the use of query optimization heuristic.
        * Added new status variable 'last_query_cost' that contains the cost of the last compiled query.
      sql/set_var.cc:
        * Added new system variable 'plan_search_depth' to control the exhaustiveness of the search for an optimal query plan.
        * Added new system variable 'heuristic' to control the use of query optimization heuristic.
      sql/sql_class.h:
        * Added new system variable 'plan_search_depth' to control the exhaustiveness of the search for an optimal query plan.
        * Added new system variable 'heuristic' to control the use of query optimization heuristic.
      sql/sql_select.cc:
        Added a combined greedy/exhaustive query optimization algorithm.
        * The greedy search algorithm is implemented in function 'greedy_search'.
        * The exhaustive search with controlled search depth is implemented in function 'find_best_limited_depth', a modification of 'find_best'.
        * The selection of the best access path and its cost computation is factored out from 'find_best' into function 'best_access_path'.
        * In addition:
          - added pre-sorting for the query tables before they get optimized
          - factored out the optimization of STRAIGHT_JOIN into a separate procedure
      sql/sql_select.h:
        Added new field to st_position to support the greedy optimizer.
        Added a comment to class JOIN.
      sql/sql_show.cc:
        Added a case to 'mysqld_show' to print double status variables.
      sql/structs.h:
        Added a new type of status variables SHOW_DOUBLE
      BitKeeper/etc/logging_ok:
        Logging to logging@openlogging.org accepted
      4c56ede4
  2. 06 Apr, 2004 3 commits
    • unknown's avatar
      Fixed BUG#2780: Stored procedure exit handler ignored for warnings. · 8468cde4
      unknown authored
      Actually catch pushed warnings.
      
      
      mysql-test/r/sp.result:
        New test case for BUG#2780.
      mysql-test/t/sp.test:
        New test case for BUG#2780.
      sql/sql_error.cc:
        Actually attempt to catch pushed warnings when running SPs.
      8468cde4
    • unknown's avatar
      Fixed BUG#2776: Stored procedure crash if variable assigned to default. · c22ccc13
      unknown authored
      Keep track on the default value and use it. (Or NULL, if not declared.)
      
      
      mysql-test/r/sp.result:
        New testcases for BUG#2776.
      mysql-test/t/sp.test:
        New testcases for BUG#2776.
      sql/sp_pcontext.cc:
        Initialize local variable default value.
      sql/sp_pcontext.h:
        New method for saving default value.
      sql/sql_yacc.yy:
        If DEFAULT is use as a value in SET variable = ... in an SP, actually use the default.
      c22ccc13
    • unknown's avatar
      Fixed BUG#2772: Function with character set clause fails in stored procedures. · 91dcd011
      unknown authored
      Complex return types were not stored correctly in the mysql.proc table.
      
      
      mysql-test/r/sp.result:
        New testcase for BUG2772.
      mysql-test/t/sp.test:
        New testcase for BUG2772.
      sql/sp_head.cc:
        Pick up character set for "returns" types in functions and add it separately,
        since it's missed when extracting the type during the parser. (Due to LALR
        behaviour.)
      sql/sp_head.h:
        Save the character set for returns clause in functions.
      sql/sql_yacc.yy:
        Pick up character set for "returns" types in functions since it's missed otherwise.
        (Due to LALR behaviour.)
      91dcd011
  3. 05 Apr, 2004 1 commit
    • unknown's avatar
      Fixed BUG#3287: Stored procedure handler scope outside of begin/end. · 4a7c72e9
      unknown authored
      Backpatching overwrote already backpatched instructions, which made it
      skip the hpop instruction; possibly not only a problem for handlers,
      but this is one known case when it happened.
      
      
      mysql-test/r/sp-error.result:
        New testcase for BUG#3287
      mysql-test/t/sp-error.test:
        New testcase for BUG#3287
      sql/sp_head.cc:
        Made the debug printout of hpush_jump instructions somewhat clearer.
      sql/sp_head.h:
        Don't backpatch the same instruction more than once.
      4a7c72e9
  4. 29 Mar, 2004 4 commits
    • unknown's avatar
      Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0 · c489c6ab
      unknown authored
      into sanja.is.com.ua:/home/bell/mysql/bk/work-limit-5.0
      
      
      c489c6ab
    • unknown's avatar
      after review patch · 0a073770
      unknown authored
      commant for function
      
      
      sql/item_subselect.cc:
        redusing number of parameters
      sql/sql_derived.cc:
        redusing number of parameters
      sql/sql_lex.cc:
        redusing number of parameters
        comment for function
      sql/sql_lex.h:
        redusing number of parameters
      sql/sql_parse.cc:
        redusing number of parameters
      sql/sql_select.cc:
        redusing number of parameters
      sql/sql_union.cc:
        redusing number of parameters
      0a073770
    • unknown's avatar
      Fixed BUG#3287: Stored Procedure Case Statement Not SQL:2003 Compliant. · 5c7f368b
      unknown authored
      
      include/mysqld_error.h:
        New error code for missing ELSE in SP CASE statement.
      include/sql_state.h:
        New error code for missing ELSE in SP CASE statement.
      mysql-test/r/sp-error.result:
        Test case for missing ELSE in SP CASE statement.
      mysql-test/t/sp-error.test:
        Test case for missing ELSE in SP CASE statement.
      sql/share/czech/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/danish/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/dutch/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/english/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/estonian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/french/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/german/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/greek/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/hungarian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/italian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/japanese/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/korean/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/norwegian-ny/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/norwegian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/polish/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/portuguese/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/romanian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/russian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/serbian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/slovak/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/spanish/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/swedish/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/share/ukrainian/errmsg.txt:
        New error message for missing ELSE in SP CASE statement.
      sql/sql_yacc.yy:
        Generate run-time error instruction when no ELSE in SP CASE statement.
      5c7f368b
    • unknown's avatar
      Enforce standard declaration order in SPs. · 7456a3e9
      unknown authored
      Added new test cases for this, and adjusted old tests accordingly,
      and new error codes and messages.
      Fixed bugs in some tests (bug2673 and use test).
      Added debug printing of instructions in SPs.
      
      
      include/mysqld_error.h:
        New error codes for non-standard declaration order in SPs.
      include/sql_state.h:
        New error codes for non-standard declaration order in SPs.
      mysql-test/r/sp-error.result:
        Enforce standard declaration order.
        Fixed syntax error in use-test.
        New test cases for wrong order.
      mysql-test/r/sp.result:
        Enforce strict declaration order.
        Fixed platform dependent bug2673 test.
      mysql-test/t/sp-error.test:
        Enforce standard declaration order.
        Fixed syntax error in use-test.
        New test cases for wrong order.
      mysql-test/t/sp.test:
        Enforce strict declaration order.
        Fixed platform dependent bug2673 test.
      sql/share/czech/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/danish/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/dutch/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/english/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/estonian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/french/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/german/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/greek/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/hungarian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/italian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/japanese/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/korean/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/norwegian-ny/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/norwegian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/polish/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/portuguese/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/romanian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/russian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/serbian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/slovak/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/spanish/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/swedish/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/share/ukrainian/errmsg.txt:
        New error messages for strict (standard) declaration order in SPs.
      sql/sp_head.cc:
        Debug printing of instructions in procedures.
        New error instruction for future use.
      sql/sp_head.h:
        Debug printing of instructions in procedures.
        New error instruction for future use.
      sql/sql_string.cc:
        New methods needed by debug printing of instruction in SPs.
      sql/sql_string.h:
        New methods needed by debug printing of instruction in SPs.
      sql/sql_yacc.yy:
        Check for standard order of declarations in SPs.
      7456a3e9
  5. 28 Mar, 2004 1 commit
  6. 27 Mar, 2004 1 commit
    • unknown's avatar
      merge · c375d868
      unknown authored
      
      mysql-test/r/union.result:
        Auto merged
      c375d868
  7. 23 Mar, 2004 1 commit
    • unknown's avatar
      Fixed BUG#3259: Stored procedure names are case sensitive. · 220494bd
      unknown authored
      Procedure names were unintentionally case-sensitive when read from the database
      (but case-insensitive when fetched from the cache).
      Note that the DB-part of qualified names is still case-sensitive (for consistency
      with other usage in mysql).
      
      
      Docs/sp-imp-spec.txt:
        Removed "binary" from name and specific_name columns in mysql.proc definition.
      mysql-test/r/sp.result:
        Test case for BUG#3259; SP names were supposed to be case-insensitive.
      mysql-test/t/sp.test:
        Test case for BUG#3259; SP names were supposed to be case-insensitive.
      scripts/mysql_create_system_tables.sh:
        Removed "binary" from name and specific_name columns in mysql.proc definition.
      scripts/mysql_fix_privilege_tables.sql:
        Removed "binary" from name and specific_name columns in mysql.proc definition,
        and added a corresponding ALTER TABLE to fix existing tables.
      sql/sp.cc:
        Added missing init of variable.
      220494bd
  8. 22 Mar, 2004 1 commit
    • unknown's avatar
      WL#1366: Use the schema (db) associated with an SP. · 645d19f6
      unknown authored
      Phase 4 (final): Remove associated stored procedures when a database is dropped.
      
      
      mysql-test/r/sp-security.result:
        drop database now deletes associated SPs.
      mysql-test/r/sp.result:
        drop database now deletes associated SPs.
      mysql-test/t/sp-security.test:
        drop database now deletes associated SPs.
      mysql-test/t/sp.test:
        drop database now deletes associated SPs.
      sql/sp.cc:
        New function for deleting all SPs associated with a database.
      sql/sp.h:
        New function for deleting all SPs associated with a database.
      sql/sp_cache.cc:
        New function for just invalidating all SP caches (when dropping a database).
      sql/sp_cache.h:
        New function for just invalidating all SP caches (when dropping a database).
      sql/sql_db.cc:
        When dropping a database, also delete all associated SPs.
      645d19f6
  9. 19 Mar, 2004 1 commit
    • unknown's avatar
      WL#1366: Use the schema (db) associated with an SP. · d2ad3cff
      unknown authored
      Phase 3: Made qualified names work for functions as well.
      
      
      mysql-test/r/sp-security.result:
        New testcases for functions with qualified names.
      mysql-test/t/sp-security.test:
        New testcases for functions with qualified names.
      sql/item_func.cc:
        Added error handling for stored function, if it doesn't exist.
      sql/item_func.h:
        Set null_value if execution of a stored function fails.
      sql/mysql_priv.h:
        Reverted previous change: No optional args for mysql_change_db().
        (SPs use a specially tailored function instead.)
      sql/sp.cc:
        Copied mysql_change_db() from sql_db.cc and modified specially for SPs.
      sql/sp_head.cc:
        Fixed error handling for errors in functions during query/statement execution.
      sql/sql_db.cc:
        Reverted previous change: No optional args for mysql_change_db().
        (SPs use a specially tailored function instead.)
      sql/sql_yacc.yy:
        Reworked the stored function/UDF invokation parsing and added qualified names
        for stored functions. UDFs now have precedence over stored functions (whith
        unqualified name). When using an unqualified name, only IDENT_sys is allowed
        (i.e. no unreserved keywords), since we get unresolvable reduce/reduce conflicts
        otherwise.
      d2ad3cff
  10. 18 Mar, 2004 1 commit
    • unknown's avatar
      Merge · edf20030
      unknown authored
      
      mysql-test/r/sp.result:
        Auto merged
      mysql-test/t/sp.test:
        Auto merged
      sql/sp.cc:
        SCCS merged
      edf20030
  11. 17 Mar, 2004 2 commits
    • unknown's avatar
      Merge mysql.com:/usr/local/bk/mysql-5.0 · b440d2cf
      unknown authored
      into mysql.com:/home/pem/work/mysql-5.0-merge
      
      
      b440d2cf
    • unknown's avatar
      Fix BUG#2674: Crash if return system variable in stored procedures. · 36dd9723
      unknown authored
      Had to initialize some fields in lex before parsing an SP read from
      mysql.proc.
      
      
      mysql-test/r/sp.result:
        New test case for BUG#2674.
      mysql-test/t/sp.test:
        New test case for BUG#2674.
      sql/sp.cc:
        We need to initialize some thd->lex fields (e.g. unit master pointers) since
        LEX::uncacheable() depends on this, and it's called when looking up system
        variables during parsing.
      36dd9723
  12. 15 Mar, 2004 1 commit
  13. 11 Mar, 2004 1 commit
    • unknown's avatar
      WL#1366: Use the schema (db) associated with an SP. · eb4aa092
      unknown authored
      Phase 2: Make SPs belong to a DB, and use qualified names.
        As a side effect, using USE in an SP is no longer allowed.
        (It just doesn't work otherwise.)
      
      
      include/mysqld_error.h:
        New error code (USE is no longer allowed in a stored procedure).
      include/sql_state.h:
        New error state (USE is no longer allowed in a stored procedure).
      mysql-test/r/sp-error.result:
        Updated result for test of USE in SP (not allowed now).
      mysql-test/r/sp-security.result:
        Updated test results for new db column and qualified procedured names.
      mysql-test/r/sp.result:
        Updated results for USE in SP (as it's no longer allowed), and
        for new db column in status result.
      mysql-test/t/sp-error.test:
        Moved test of USE in SP from sp.test (as it's no longer allowed).
      mysql-test/t/sp-security.test:
        Ajusted tests for new db column and qualified procedured names.
      mysql-test/t/sp.test:
        Moved test of USE in SP to sp-error.test (as it's no longer allowed).
        Adjusted tests for new db column in status result.
      sql/mysql_priv.h:
        mysql_change_db() now has optional arguments for use by SP with qualified names.
      sql/share/czech/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/danish/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/dutch/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/english/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/estonian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/french/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/german/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/greek/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/hungarian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/italian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/japanese/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/korean/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/norwegian-ny/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/norwegian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/polish/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/portuguese/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/romanian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/russian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/serbian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/slovak/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/spanish/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/swedish/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/share/ukrainian/errmsg.txt:
        New error message: USE is not allowed in a stored procedure.
      sql/sp.cc:
        SPs are now "belong" to a DB and may have qualified names.
        New functions for changing DB ("use") when parsing and invoking SPs.
      sql/sp.h:
        New functions for changing DB ("use") when parsing and invoking SPs.
      sql/sp_cache.cc:
        Use the qualified name in the SP cache.
      sql/sp_head.cc:
        New function for allocating a qualified SP name (used in sql_yacc.yy).
        Change DB when executing an SP (if needed).
        Moved thd_mem_root swap functions from sp_head.h.
      sql/sp_head.h:
        New function for allocating a qualified SP name (used in sql_yacc.yy).
        Moved thd_mem_root swap functions to sp_head.cc.
      sql/sql_db.cc:
        mysql_change_db() now has optional arguments for use by SP with qualified names
        (for use when reading an SP from database and executing it); also allow "unusing"
        a database, i.e. setting thd->thd to "".
      sql/sql_yacc.yy:
        Initialize qualfied SP names correctly.
        USE is no longer allowed in an SP.
      eb4aa092
  14. 02 Mar, 2004 2 commits
    • unknown's avatar
      Merge mysql.com:/usr/local/bk/mysql-5.0 · 5aa57221
      unknown authored
      into mysql.com:/home/pem/work/mysql-5.0
      
      
      sql/sp_head.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      5aa57221
    • unknown's avatar
      Fixed BUG#2777: Stored procedure doesn't observe definer's rights. · 857b5957
      unknown authored
      SQL SECURITY DEFINER must enforce reduced rights too, not just additional rights.
      
      
      mysql-test/r/sp-security.result:
        Test case for BUG#2777: Make sure that SQL SECURITY DEFINER enforces reduced rights.
      mysql-test/t/sp-security.test:
        Test case for BUG#2777: Make sure that SQL SECURITY DEFINER enforces reduced rights.
      sql/sql_acl.cc:
        Clear rights before changing them in acl_getroot_no_password so that
        reduced rights work too, and take care of db acls as well.
      857b5957
  15. 01 Mar, 2004 1 commit
    • unknown's avatar
      Fixed small race condition, when global query_id was modified · 23a6b4ed
      unknown authored
      without proper locking.
      
      
      sql/sp_head.cc:
        Added missing locking of LOCK_thread_count to place where ::query_id is 
        modified.
      sql/sql_parse.cc:
        Added comment to the only place where we are modifying ::query_id
        without following locking protocol, to avoid mistakes in future.
      BitKeeper/etc/logging_ok:
        Logging to logging@openlogging.org accepted
      23a6b4ed
  16. 17 Feb, 2004 2 commits
    • unknown's avatar
      WL#1366: Use the schema (db) associated with an SP. · e55c4ed1
      unknown authored
      Phase 1: Introduced sp_name class, for qualified name support.
      
      
      sql/item_func.cc:
        Introduced sp_name class; moved some methods from item_func.h.
      sql/item_func.h:
        Introduced sp_name class; moved some methods to item_func.cc.
      sql/sp.cc:
        Introduced sp_name class, for qualified name support.
      sql/sp.h:
        Introduced sp_name class, for qualified name support.
      sql/sp_cache.cc:
        Introduced sp_name class, for qualified name support.
      sql/sp_cache.h:
        Introduced sp_name class, for qualified name support.
      sql/sp_head.cc:
        Introduced sp_name class, for qualified name support.
      sql/sp_head.h:
        Introduced sp_name class, for qualified name support.
      sql/sql_lex.h:
        Introduced sp_name class, for qualified name support.
      sql/sql_parse.cc:
        Introduced sp_name class, for qualified name support.
      sql/sql_yacc.yy:
        Introduced sp_name class, for qualified name support.
      e55c4ed1
    • unknown's avatar
      Merge mysql.com:/usr/local/bk/mysql-5.0 · 7444a50a
      unknown authored
      into mysql.com:/home/pem/work/mysql-5.0
      
      
      7444a50a
  17. 16 Feb, 2004 2 commits
  18. 13 Feb, 2004 7 commits
  19. 12 Feb, 2004 7 commits