1. 25 Aug, 2006 2 commits
  2. 24 Aug, 2006 3 commits
    • unknown's avatar
      Fix for bug#21416 SP: Recursion level higher than zero needed for non-recursive call · 807ecdf4
      unknown authored
      The following procedure was not possible if max_sp_recursion_depth is 0
      create procedure show_proc() show create procedure show_proc;
        
      Actually there is no recursive call but the limit is checked.
        
      Solved by temporarily increasing the thread's limit just before the fetch from cache
      and decreasing after that.
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        Test for bug #21416 SP: Recursion level higher than zero needed for non-recursive call
      sql/sp.cc:
        Increase the max_sp_recursion_depth temporarily for SHOW CREATE PROCEDURE call.
        This call is in fact not recursive but is counted as such. Outcome, it will work
        always but if max_sp_recursion_depth is reached we are going to cache one more
        sp_head instance.
      807ecdf4
    • unknown's avatar
      Polishing (was the part of original patch for BUG#16899): · 2f0a610f
      unknown authored
      Changed trigger-handling code so that there will be the one
      place for generate statement string for replication log
      and for trigger file.
      
      
      sql/sql_trigger.cc:
        Changed trigger-handling code so that there will be the one
        place for generate statement string for replication log
        and for trigger file.
      sql/sql_trigger.h:
        Changed trigger-handling code so that there will be the one
        place for generate statement string for replication log
        and for trigger file.
      2f0a610f
    • unknown's avatar
      BUG#21166: Prepared statement causes signal 11 on second execution · 965a3970
      unknown authored
      Changes in an item tree done by optimizer weren't properly
      registered and went unnoticed, which resulted in preliminary freeing
      of used memory.
      
      
      mysql-test/r/ps.result:
        Add result for bug#21166: Prepared statement causes signal 11
        on second execution.
      mysql-test/t/ps.test:
        Add test case for bug#21166: Prepared statement causes signal 11
        on second execution.
      sql/item.cc:
        Move Item::transform() and Item_default_value::transform() from
        item.h here and use THD::change_item_tree() instead of plain
        assignment.
        Change Item_field::set_no_const_sub() to be used with Item::walk()
        instead of Item::transform().
      sql/item.h:
        Move definition of Item::transform() and Item_default_value::transform()
        to item.cc.
        Change Item::set_no_const_sub() to be used with Item::walk()
        instead of Item::transform().
      sql/item_cmpfunc.cc:
        Use Item::walk() to execute Item::set_no_const_sub().
        Use THD::change_item_tree() instead of plain assignment.
      sql/item_func.cc:
        Add assert and comment to Item_func::traverse_cond().
      sql/item_row.cc:
        Use THD::change_item_tree() instead of plain assignment.
      sql/item_strfunc.cc:
        Move Item_func_make_set::transform() from item_strfunc.h here and use
        THD::change_item_tree() instead of plain assignment.
      sql/item_strfunc.h:
        Move definition of Item_func_make_set::transform() to item_strfunc.cc.
      965a3970
  3. 23 Aug, 2006 2 commits
    • unknown's avatar
      Fix for BUG#16899: Possible buffer overflow in handling of DEFINER-clause · f96ee72f
      unknown authored
        
      User name (host name) has limit on length. The server code relies on these
      limits when storing the names. The problem was that sometimes these limits
      were not checked properly, so that could lead to buffer overflow.
      
      The fix is to check length of user/host name in parser and if string is too
      long, throw an error.
      
      
      mysql-test/r/grant.result:
        Updated result file.
      mysql-test/r/sp.result:
        Updated result file.
      mysql-test/r/trigger.result:
        Updated result file.
      mysql-test/r/view.result:
        Updated result file.
      mysql-test/t/grant.test:
        Added test for BUG#16899.
      mysql-test/t/sp.test:
        Added test for BUG#16899.
      mysql-test/t/trigger.test:
        Added test for BUG#16899.
      mysql-test/t/view.test:
        Added test for BUG#16899.
      sql/mysql_priv.h:
        Added prototype for new function.
      sql/share/errmsg.txt:
        Added new resources.
      sql/sql_acl.cc:
        Remove outdated checks.
      sql/sql_parse.cc:
        Add a new function for checking string length.
      sql/sql_yacc.yy:
        Check length of user/host name.
      f96ee72f
    • unknown's avatar
      Bug#8153 (Stored procedure with subquery and continue handler, wrong result) · 09e9b2f6
      unknown authored
      Implemented code review comments
      Test cleanup
      
      
      sql/protocol.cc:
        Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
        
        Implemented code review comments
      09e9b2f6
  4. 22 Aug, 2006 3 commits
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · 5e1039b2
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.0-8153
      
      
      mysql-test/r/sp.result:
        Auto merged
      mysql-test/t/sp.test:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      5e1039b2
    • unknown's avatar
      Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0 · b5cbed72
      unknown authored
      into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21051-2
      
      
      include/mysql_com.h:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      b5cbed72
    • unknown's avatar
      BUG#21051: RESET QUERY CACHE very slow when query_cache_type=0 · 877477f1
      unknown authored
      There were two problems: RESET QUERY CACHE took a long time to complete
      and other threads were blocked during this time.
      
      The patch does three things:
        1 fixes a bug with improper use of test-lock-test_again technique.
            AKA Double-Checked Locking is applicable here only in few places.
        2 Somewhat improves performance of RESET QUERY CACHE.
            Do my_hash_reset() instead of deleting elements one by one.  Note
            however that the slowdown also happens when inserting into sorted
            list of free blocks, should be rewritten using balanced tree.
        3 Makes RESET QUERY CACHE non-blocking.
            The patch adjusts the locking protocol of the query cache in the
            following way: it introduces a flag flush_in_progress, which is
            set when Query_cache::flush_cache() is in progress.  This call
            sets the flag on enter, and then releases the lock.  Every other
            call is able to acquire the lock, but does nothing if
            flush_in_progress is set (as if the query cache is disabled).
            The only exception is the concurrent calls to
            Query_cache::flush_cache(), that are blocked until the flush is
            over.  When leaving Query_cache::flush_cache(), the lock is
            acquired and the flag is reset, and one thread waiting on
            Query_cache::flush_cache() (if any) is notified that it may
            proceed.
      
      
      include/mysql_com.h:
        Add comment for NET::query_cache_query.
      sql/net_serv.cc:
        Use query_cache_init_query() for initialization of
        NET::query_cache_query if query cache is used.
        Do not access net->query_cache_query without a lock.
      sql/sql_cache.cc:
        Fix bug with accessing query_cache_size, Query_cache_query::wri and
        thd->net.query_cache_query before acquiring the lock---leave
        double-check locking only in safe places.
        Wherever we check that cache is usable (query_cache_size > 0) we now
        also check that flush_in_progress is false, i.e. we are not in the
        middle of cache flush.
        Add Query_cache::not_in_flush_or_wait() method and use it in
        Query_cache::flush_cache(), so that threads doing cache flush will
        wait it to finish, while other threads will bypass the cache as if
        it is disabled.
        Extract Query_cache::free_query_internal() from Query_cache::free_query(),
        which does not removes elements from the hash, and use it together with
        my_hash_reset() in Query_cache::flush_cache().
      sql/sql_cache.h:
        Add declarations for new members and methods.
        Make is_cacheable() a static method.
        Add query_cache_init_query() function.
      sql/sql_class.cc:
        Use query_cache_init_query() for initialization of
        NET::query_cache_query.
      877477f1
  5. 21 Aug, 2006 2 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · e84fd6df
      unknown authored
      into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg21216-2
      
      
      e84fd6df
    • unknown's avatar
      Fix for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes · 8daf4e83
      unknown authored
      server to crash".
      
      Crash caused by assertion failure happened when one ran SHOW OPEN TABLES
      while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
      or any other command that takes name-lock) in other connection.
      For non-debug version of server problem exposed itself as wrong output
      of SHOW OPEN TABLES statement (it was missing name-locked tables).
      Finally in 5.1 both debug and non-debug versions simply crashed in
      this situation due to NULL-pointer dereference.
      
      This problem was caused by the fact that table placeholders which were
      added to table cache in order to obtain name-lock had TABLE_SHARE::table_name
      set to 0. Therefore they broke assumption that this member is non-0 for
      all tables in table cache which was checked by assert in list_open_tables()
      (in 5.1 this function simply relies on it).
      The fix simply sets this member for such placeholders to appropriate value
      making this assumption true again.
      
      This patch also includes test for similar bug 12212 "Crash that happens
      during removing of database name from cache" reappeared in 5.1 as bug 19403.
      
      
      mysql-test/r/drop.result:
        Added test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES
        causes server to crash" and bug#12212/19403 "Crash that happens during
        removing of database name from cache".
      mysql-test/t/drop.test:
        Added test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES
        causes server to crash" and bug#12212/19403 "Crash that happens during
        removing of database name from cache".
      sql/lock.cc:
        lock_table_name():
          Our code assumes that TABLE_SHARE::table_name for objects in table cache
          is non-NULL (for example look at assertion in list_open_tables()). This
          was not true for table placeholders that were added to table cache for
          name-locking. So let us set this member for such placeholders.
      8daf4e83
  6. 19 Aug, 2006 1 commit
    • unknown's avatar
      WL#3432 (Compile the Parser with a --debug --verbose option) · cd2c9eec
      unknown authored
      Corrected build issues : the build can not be conditional.
      to keep a unique source .tar.gz distribution.
      
      
      configure.in:
        Rolling back previous change
      sql/Makefile.am:
        Partially rolling back previous change.
        The build has to be unconditional, for the source .tar.gz distribution
      sql/mysql_priv.h:
        WL#3432 (Compile the Parser with a --debug --verbose option)
      sql/sql_parse.cc:
        WL#3432 (Compile the Parser with a --debug --verbose option)
        
        Moved turn_parser_debug_on to sql_yacc.yy
      sql/sql_yacc.yy:
        WL#3432 (Compile the Parser with a --debug --verbose option)
        
        Moved turn_parser_debug_on to sql_yacc.yy
      cd2c9eec
  7. 17 Aug, 2006 1 commit
    • unknown's avatar
      WL#3432 (Compile the Parser with a --debug --verbose option) · dec9116f
      unknown authored
      Changed the automake build process :
      - ./configure.in
      - ./sql/Makefile.am
      to compile an instrumented parser for debug=yes or debug=full builds
      
      Changed the (primary) runtime invocation of the parser :
      - sql/sql_parse.cc
      to generate bison traces in stderr when the DBUG "parser_debug" flag is set.
      
      
      configure.in:
        WL#3432 (Compile the Parser with a --debug --verbose option)
        
        New Automake condition : MYSQL_CONF_DEBUG
      sql/Makefile.am:
        WL#3432 (Compile the Parser with a --debug --verbose option)
        
        In Debug mode, compile sql_yacc.yy with --debug --verbose
      sql/sql_parse.cc:
        WL#3432 (Compile the Parser with a --debug --verbose option)
        
        Conditionally turn the bison parser debug on at runtime.
      dec9116f
  8. 15 Aug, 2006 1 commit
  9. 03 Aug, 2006 1 commit
    • unknown's avatar
      Bug#8153 (Stored procedure with subquery and continue handler, wrong result) · f748b691
      unknown authored
      Before this fix,
      - a runtime error in a statement in a stored procedure with no error handlers
      was properly detected (as expected)
      - a runtime error in a statement with an error handler inherited from a non
      local runtime context (i.e., proc a with a handler, calling proc b) was
      properly detected (as expected)
      - a runtime error in a statement with a *local* error handler was executed
      as follows :
      a) the statement would succeed, regardless of the error condition, (bug)
      b) the error handler would be called (as expected).
      
      The root cause is that functions like my_messqge_sql would "forget" to set
      the thread flag thd->net.report_error to 1, because of the check involving
      sp_rcontext::found_handler_here().
      Failure to set this flag would cause, later in the call stack,
      in Item_func::fix_fields() at line 190, the code to return FALSE and consider
      that executing the statement was successful.
      
      With this fix :
      - error handling code, that was duplicated in different places in the code,
      is now implemented in sp_rcontext::handle_error(),
      - handle_error() correctly sets thd->net.report_error when a handler is
      present, regardless of the handler location (local, or in the call stack).
      
      A test case, bug8153_subselect, has been written to demonstrate the change
      of behavior before and after the fix.
      
      Another test case, bug8153_function_a, as also been writen.
      This test has the same behavior before and after the fix.
      This test has been written to demonstrate that the previous expected
      result of procedure bug18787, was incorrect, since select no_such_function()
      should fail and therefore not produce a result.
      
      The incorrect result for bug18787 has the same root cause as Bug#8153,
      and the expected result has been adjusted.
      
      
      sql/mysqld.cc:
        Bug#8153, use sp_rcontext::handle_error() to handle errors.
      sql/sql_error.cc:
        Bug#8153, use sp_rcontext::handle_error() to handle errors.
      sql/protocol.cc:
        Bug#8153, use sp_rcontext::handle_error() to handle errors.
      sql/sp_rcontext.h:
        Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
      sql/sp_rcontext.cc:
        Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
      mysql-test/t/sp.test:
        Bug#8153, added test cases.
      mysql-test/r/sp.result:
        Bug#8153, added test cases, fixed expected result of bug18787.
      f748b691
  10. 02 Aug, 2006 15 commits
    • unknown's avatar
      Disable a failing test case (filed a p1 bug) · 3c8150b7
      unknown authored
      3c8150b7
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · e44e344c
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
      
      
      sql/item.cc:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/sql_view.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      sql/table.h:
        Auto merged
      mysql-test/r/sp.result:
        Manual merge.
      mysql-test/r/udf.result:
        Manual merge.
      mysql-test/t/sp.test:
        Manual merge.
      mysql-test/t/udf.test:
        Manual merge.
      e44e344c
    • unknown's avatar
      A post-merge fix. · a0efaba3
      unknown authored
      a0efaba3
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 1cf65f31
      unknown authored
      into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      client/mysql.cc:
        Auto merged
      1cf65f31
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1 · a5812433
      unknown authored
      into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      mysql-test/r/ps_1general.result:
        Auto merged
      mysql-test/t/ps_1general.test:
        Auto merged
      a5812433
    • unknown's avatar
      Merge moonbone.local:/work/tmp_merge-4.1-opt-mysql · 0825bad9
      unknown authored
      into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      mysql-test/Makefile.am:
        Auto merged
      scripts/make_win_src_distribution.sh:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      client/mysqltest.c:
        Manual merge
      0825bad9
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0 · c102fe94
      unknown authored
      into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      client/mysql.cc:
        Auto merged
      mysql-test/r/date_formats.result:
        Auto merged
      mysql-test/r/func_str.result:
        Auto merged
      mysql-test/t/date_formats.test:
        Auto merged
      mysql-test/t/func_str.test:
        Auto merged
      mysql-test/t/udf.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/time.cc:
        Auto merged
      mysql-test/r/sp.result:
        Manual merge
      mysql-test/t/sp.test:
        Manual merge
      c102fe94
    • unknown's avatar
      Merge moonbone.local:/work/tmp_merge-4.1 · 328e8c74
      unknown authored
      into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
      
      
      328e8c74
    • unknown's avatar
      Merge moonbone.local:/work/tmp_merge-4.1 · 84ece59c
      unknown authored
      into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
      
      
      sql/item_strfunc.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      84ece59c
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-4.1 · 504e3756
      unknown authored
      into  mysql.com:/home/hf/work/mysql-4.1.20317
      
      
      504e3756
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · f3919e92
      unknown authored
      into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
      
      
      include/mysql.h:
        Auto merged
      include/sql_common.h:
        Auto merged
      libmysql/libmysql.c:
        Auto merged
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/r/mysqldump.result:
        Auto merged
      mysql-test/t/udf.test:
        Auto merged
      ndb/src/mgmsrv/ConfigInfo.cpp:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_lex.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql-common/client.c:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      sql/table.h:
        Auto merged
      mysql-test/r/ps.result:
        Manual merge.
      mysql-test/r/sp.result:
        Manual merge.
      mysql-test/t/ps.test:
        Manual merge.
      mysql-test/t/sp.test:
        Manual merge.
      sql/sql_prepare.cc:
        Manual merge.
      sql/table.cc:
        Manual merge.
      tests/mysql_client_test.c:
        Manual merge.
      f3919e92
    • unknown's avatar
      Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0 · ed19079c
      unknown authored
      into  lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-5.0
      
      
      ed19079c
    • unknown's avatar
      Fix a compilation failiure on QNX · cb6e70a5
      unknown authored
      
      sql/udf_example.c:
        Declare tmp_error at the beginning of the block (this is C now)
      cb6e70a5
    • unknown's avatar
      Bug #21396: Wrong error number generated for a missing table · a29f10e8
      unknown authored
      
      BitKeeper/etc/collapsed:
        BitKeeper file /home/georg/work/mysql/prod/mysql-5.0/BitKeeper/etc/collapsed
      mysys/my_open.c:
        Win64 bit fix: Replacing 32-bit value (0xFFFFFFFF) by a generic error constant.
      a29f10e8
    • unknown's avatar
      .del-sp.test.orig: · 53cc83fe
      unknown authored
        Delete: mysql-test/t/sp.test.orig
      
      
      BitKeeper/deleted/.del-sp.test.orig:
        Delete: mysql-test/t/sp.test.orig
      53cc83fe
  11. 01 Aug, 2006 9 commits