1. 12 Oct, 2006 1 commit
    • unknown's avatar
      BUG#20953: create proc with a create view that uses local vars/params · 6d1fdc73
      unknown authored
                 should fail to create
      
      The problem was that this type of errors was checked during view
      creation, which doesn't happen when CREATE VIEW is a statement of
      a created stored routine.
      
      The solution is to perform the checks at parse time.  The idea of the
      fix is that the parser checks if a construction just parsed is allowed
      in current circumstances by testing certain flags, and this flags are
      reset for VIEWs.
      
      The side effect of this change is that if the user already have
      such bogus routines, it will now get a error when trying to do
      
        SHOW CREATE PROCEDURE proc;
      
      (and some other) and when trying to execute such routine he will get
      
        ERROR 1457 (HY000): Failed to load routine test.p5. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
      
      However there should be very few such users (if any), and they may
      (and should) drop these bogus routines.
      
      
      mysql-test/r/sp-error.result:
        Add result for bug#20953: create proc with a create view that uses
        local vars/params should fail to create.
      mysql-test/r/view.result:
        Update results.
      mysql-test/t/sp-error.test:
        Add test case for bug#20953: create proc with a create view that uses
        local vars/params should fail to create.
      mysql-test/t/view.test:
        Add second test for variable in a view.
        Remove SP variable in a view test, as it tests wrong behaviour.
        Add test for derived table in a view.
      sql/sql_lex.cc:
        Remove LEX::variables_used.
      sql/sql_lex.h:
        Remove LEX::variables_used and add st_parsing_options structure and
        LEX::parsing_options member.
      sql/sql_view.cc:
        Move some error checking to sql/sql_yacc.yy.
      sql/sql_yacc.yy:
        Check for disallowed syntax in a CREATE VIEW at parse time to rise a
        error when it is used inside CREATE PROCEDURE and CREATE FUNCTION, as
        well as by itself.
      6d1fdc73
  2. 17 Jul, 2006 2 commits
    • unknown's avatar
      Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0 · ec4a7522
      unknown authored
      into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21013
      
      
      ec4a7522
    • unknown's avatar
      Bug#21013: Performance Degrades when importing data that uses Trigger · ca00a985
      unknown authored
                 and Stored Procedure
      
      The essence of the bug was that for every re-execution of stored
      routine or prepared statement new items for character set conversions
      were created, thus increasing the number of items and the time of their
      processing, and creating memory leak.
      
      No test case is provided since current test suite can't cover such type
      of bugs.
      
      
      mysql-test/r/sp.result:
        Add result for bug#21013: Performance Degrades when importing data
        that uses Trigger and Stored Procedure.
      mysql-test/t/sp.test:
        Add test case for bug#21013: Performance Degrades when importing data
        that uses Trigger and Stored Procedure.
      sql/item.cc:
        Switch arena only when in statement prepare mode.  Subsequent executions
        will use cached item tree.
      ca00a985
  3. 13 Jul, 2006 2 commits
    • unknown's avatar
      Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0 · 51dddb3a
      unknown authored
      into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18630
      
      
      sql/item_func.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_trigger.cc:
        Auto merged
      51dddb3a
    • unknown's avatar
      Bug#18630: Arguments of suid routine calculated in wrong security · 06bf59ad
      unknown authored
                 context.
      
      Routine arguments were evaluated in the security context of the routine
      itself, not in the caller's context.
      
      The bug is fixed the following way:
      
        - Item_func_sp::find_and_check_access() has been split into two
          functions: Item_func_sp::find_and_check_access() itself only
          finds the function and check that the caller have EXECUTE privilege
          on it.  New function set_routine_security_ctx() changes security
          context for SUID routines and checks that definer have EXECUTE
          privilege too.
      
        - new function sp_head::execute_trigger() is called from
          Table_triggers_list::process_triggers() instead of
          sp_head::execute_function(), and is effectively just as the
          sp_head::execute_function() is, with all non-trigger related code
          removed, and added trigger-specific security context switch.
      
        - call to Item_func_sp::find_and_check_access() stays outside
          of sp_head::execute_function(), and there is a code in
          sql_parse.cc before the call to sp_head::execute_procedure() that
          checks that the caller have EXECUTE privilege, but both
          sp_head::execute_function() and sp_head::execute_procedure() call
          set_routine_security_ctx() after evaluating their parameters,
          and restore the context after the body is executed.
      
      
      mysql-test/r/sp-security.result:
        Add test case for bug#18630: Arguments of suid routine calculated
        in wrong security context.
      mysql-test/t/sp-security.test:
        Add result for bug#18630: Arguments of suid routine calculated
        in wrong security context.
      sql/item_func.cc:
        Do not change security context before executing the function, as it
        will be changed after argument evaluation.
        Do not change security context in Item_func_sp::find_and_check_access().
      sql/item_func.h:
        Change prototype for Item_func_sp::find_and_check_access().
      sql/sp_head.cc:
        Add set_routine_security_ctx() function.
        Add sp_head::execute_trigger() method.
        Change security context in sp_head::execute_trigger(), and in
        sp_head::execute_function() and sp_head::execute_procedure()
        after argument evaluation.
        Move pop_all_cursors() call to sp_head::execute().
      sql/sp_head.h:
        Add declaration for sp_head::execute_trigger() and
        set_routine_security_ctx().
      sql/sql_parse.cc:
        Do not change security context before executing the procedure, as it
        will be changed after argument evaluation.
      sql/sql_trigger.cc:
        Call new sp_head::execute_trigger() instead of
        sp_head::execute_function(), which is responsible to switch
        security context.
      06bf59ad
  4. 12 Jul, 2006 3 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · f60d9a3e
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime
      
      
      f60d9a3e
    • unknown's avatar
      Fix a valgrind warning in type_date test. · a7dddd3b
      unknown authored
      
      sql/item_timefunc.cc:
        Fix a valgrind warning in type_date test.	
      a7dddd3b
    • unknown's avatar
      Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.0 · a08a6f9f
      unknown authored
      into  dl145k.mysql.com:/data0/mkindahl/bk/mysql-5.0-rpl
      
      
      ndb/include/kernel/GlobalSignalNumbers.h:
        Auto merged
      ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
        Auto merged
      ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
        Auto merged
      ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
        Auto merged
      ndb/src/ndbapi/ndberror.c:
        Auto merged
      sql/ha_ndbcluster.cc:
        Auto merged
      sql/handler.h:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      a08a6f9f
  5. 11 Jul, 2006 8 commits
    • unknown's avatar
      Post-merge fixes for Bug#19399 "Stored Procedures 'Lost Connection' · 3ff08ab8
      unknown authored
      when dropping/creating tables"
      
      
      mysql-test/r/ps.result:
        A post-merge fix.
      mysql-test/t/ps.test:
        A post-merge fix: all 5.0 tests should go after 4.1 tests.
      sql/sql_lex.cc:
        auxilliary -> auxiliary
      sql/sql_prepare.cc:
        auxilliary -> auxiliary
      sql/table.cc:
        Update st_table_list::reinit_before_use in 5.0 to include 5.0-specific
        cleanups.
      sql/table.h:
        st_table_list::reinit_before_use is public.
      3ff08ab8
    • unknown's avatar
      Merge bodhi.local:/opt/local/work/tmp_merge · d8b447a1
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
      
      
      ndb/src/mgmsrv/ConfigInfo.cpp:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/ps.result:
        Manual merge: use local.
      mysql-test/t/ps.test:
        Manual merge: remove duplicate test cases from ps.test.
      sql/sql_lex.cc:
        Manual merge.
      sql/sql_prepare.cc:
        Manual merge.
      sql/table.h:
        Manual merge.
      d8b447a1
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 67d53e36
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
      
      
      sql/sql_table.cc:
        Auto merged
      67d53e36
    • unknown's avatar
      Merge chilla.local:/home/mydev/mysql-5.0-release · 034522f4
      unknown authored
      into  chilla.local:/home/mydev/mysql-5.0-amerge
      
      
      sql/handler.h:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      034522f4
    • unknown's avatar
      Raise the version number. · 0859819a
      unknown authored
      0859819a
    • unknown's avatar
      Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0 · 0e694880
      unknown authored
      into  trift2.:/M50/mysql-5.0
      
      
      0e694880
    • unknown's avatar
      Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.0-rpl · fabab792
      unknown authored
      into  dl145k.mysql.com:/data0/mkindahl/bk/MERGE/mysql-5.0-merge
      
      
      ndb/include/kernel/GlobalSignalNumbers.h:
        Auto merged
      ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
        Auto merged
      ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
        Auto merged
      ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
        Auto merged
      ndb/src/ndbapi/ndberror.c:
        Auto merged
      fabab792
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · aedfd072
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
      
      
      sql/opt_range.cc:
        Auto merged
      support-files/mysql.spec.sh:
        Auto merged
      mysql-test/Makefile.am:
        Manual merge.
      aedfd072
  6. 10 Jul, 2006 21 commits
  7. 09 Jul, 2006 2 commits
    • unknown's avatar
      BUG#20919 temp tables closing fails when binlog is off · 868fee4d
      unknown authored
      closing temp tables through end_thread
      had a flaw in binlog-off branch of close_temporary_tables where
      next table to close was reset via table->next
       for (table= thd->temporary_tables; table; table= table->next)
      which was wrong since the current table instance got destoyed at
      	close_temporary(table, 1);
      
      The fix adapts binlog-on branch method to engage the loop's internal 'next' variable which holds table->next prior table's destoying.
      
      
      
      sql/sql_base.cc:
        no-binlog branch is fixed: scanning across temporary_tables must be careful to save next table since the current is being destroyed inside of close_temporary. 
        binlog-is-open case is ok.
      868fee4d
    • unknown's avatar
      Fix compiler warnings in sql_udf.h: ISO C++ forbids casting · 46079624
      unknown authored
      between pointer to function and pointer to object.
      
      
      sql/item_func.cc:
        Use typedef names instead of hard-coded types for udf init/deinit
        functions.
      sql/sql_udf.cc:
        Use typedef names for udf function types.
      46079624
  8. 08 Jul, 2006 1 commit
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · cad24c09
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
      
      
      myisam/mi_create.c:
        Auto merged
      mysql-test/r/myisam.result:
        Auto merged
      mysql-test/t/myisam.test:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_trigger.cc:
        Auto merged
      support-files/mysql.spec.sh:
        Auto merged
      mysql-test/r/federated.result:
        Manual merge.
      mysql-test/t/federated.test:
        Manual merge.
      cad24c09