1. 15 Aug, 2005 2 commits
    • unknown's avatar
      Fixed typo in error numbers · b49978e3
      unknown authored
      b49978e3
    • unknown's avatar
      Save and clear run context before executing a stored function or trigger and restore it afterwards. · 262075d1
      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''
      262075d1
  2. 12 Aug, 2005 7 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · ae8f5845
      unknown authored
      into  mysql.com:/home/my/mysql-5.0
      
      
      sql/ha_ndbcluster.cc:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_union.cc:
        Manual merge (trivial)
      ae8f5845
    • unknown's avatar
      Fixes during review of new pushed code · efcca089
      unknown authored
      Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      
      
      sql/ha_berkeley.cc:
        Removed not used variable (and options)
      sql/ha_berkeley.h:
        Removed not used argument
      sql/ha_ndbcluster.cc:
        Remove compiler warning
      sql/init.cc:
        Simplify code
      sql/item_sum.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/mysql_priv.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/mysqld.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_class.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_delete.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_derived.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_lex.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_parse.cc:
        Indentation fixes
      sql/sql_select.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_select.h:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_show.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_union.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_update.cc:
        Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
      sql/sql_yacc.yy:
        Changed variable name i to more descriptive name
        Removed compiler warning
      efcca089
    • unknown's avatar
      sql_view.cc: · 73f13424
      unknown authored
        A safety correction.
      
      
      sql/sql_view.cc:
        A safety correction.
      73f13424
    • unknown's avatar
      Merge rurik.mysql.com:/home/igor/mysql-5.0 · 8846db58
      unknown authored
      into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
      
      8846db58
    • unknown's avatar
      sql_base.cc: · 09d116ea
      unknown authored
        Fixed bug #12470.
        A misplaced initialization of the cond_count counter
        resulted in a wrong calculation of it. This caused a memory
        corruption since this counter was used as a parameter of
        some memory allocation.
      view.test:
        Added a test case for bug #12470.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #12470.
      sql/sql_base.cc:
        Fixed bug #12470.
        A misplaced initialization of the cond_count counter
        resulted in a wrong calculation of it. This caused a memory
        corruption since this counter was used as a parameter of
        some memory allocation.
      09d116ea
    • unknown's avatar
      Add SLEEP(seconds) function, which always returns 0 after the given · 7ef207a8
      unknown authored
      number of seconds (which can include microseconds). (Bug #6760)
      
      
      mysql-test/r/func_misc.result:
        Add new results
      mysql-test/t/func_misc.test:
        Add new regression test.
      sql/item_create.cc:
        Add create_func_sleep()
      sql/item_create.h:
        Add create_func_sleep()
      sql/item_func.cc:
        Add sleep() implementation
      sql/item_func.h:
        Add class for sleep() function
      sql/lex.h:
        Handle SLEEP() function
      7ef207a8
    • unknown's avatar
      Fix which include file is used to decide whether to skip rpl_openssl, the · 2f15f8b4
      unknown authored
      earlier change wasn't correct. (But the other changes to the test were.)
      
      
      mysql-test/t/rpl_openssl.test:
        Use correct include file
      2f15f8b4
  3. 11 Aug, 2005 16 commits
    • unknown's avatar
      sql_base.cc: · b9ebcf40
      unknown authored
        Fixed bug #12382.
        INSERT statement effectively changed thd->set_query_id to 0,
        while SELECT statement changed it to 0. As a result
        the insert_fields function that expanded '*' was called
        with different values of thd->set_query_id for the query
        SELECT * FROM view depending on whether it was run after
        an INSERT or after a SELECT statement. This was corrected
        by restoring the old value of thd->set_query_id when
        returning from the function setup_fields where possible
        reset could occur.
        If the value of thd->set_query_id == 0 then the fields
        substituted instead of '*' were not registered as used
        for bitmaps used_keys. This caused selection of an invalid
        execution plan for the query SELECT * from <view>.
      view.result, view.test:
        Added a test case for bug #12382.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #12382.
      mysql-test/r/view.result:
        Added a test case for bug #12382.
      sql/sql_base.cc:
        Fixed bug #12382.
        INSERT statement effectively changed thd->set_query_id to 0,
        while SELECT statement changed it to 0. As a result
        the insert_fields function that expanded '*' was called
        with different values of thd->set_query_id for the query
        SELECT * FROM view depending on whether it was run after
        an INSERT or after a SELECT statement. This was corrected
        by restoring the old value of thd->set_query_id when
        returning from the function setup_fields where possible
        reset could occur.
        If the value of thd->set_query_id == 0 then the fields
        substituted instead of '*' were not registered as used
        for bitmaps used_keys. This caused selection of an invalid
        execution plan for the query SELECT * from <view>.
      b9ebcf40
    • unknown's avatar
      Merge mysql.com:/home/jimw/my/mysql-5.0-12457 · f7f6b3e9
      unknown authored
      into  mysql.com:/home/jimw/my/mysql-5.0-clean
      
      f7f6b3e9
    • unknown's avatar
      Merge mysql.com:/home/jimw/my/mysql-5.0-12324 · 0bca7fc5
      unknown authored
      into  mysql.com:/home/jimw/my/mysql-5.0-clean
      
      0bca7fc5
    • unknown's avatar
      Build YASSL libraries with libtool so correct PIC settings are used · 0b09e381
      unknown authored
      automatically. (Bug #12324)
      
      
      extra/yassl/src/Makefile.am:
        Build library with libtool
      extra/yassl/taocrypt/src/Makefile.am:
        Build library with libtool
      0b09e381
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.0 · 7ff12362
      unknown authored
      into quadxeon.mysql.com:/users/vtkachenko/bk/mysql-5.0-tmp
      
      
      sql/ha_innodb.cc:
        Auto merged
      7ff12362
    • unknown's avatar
      Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-5.0 · e628ef7a
      unknown authored
      into  xiphis.org:/usr/home/antony/work2/merge-5.0
      
      e628ef7a
    • unknown's avatar
      fix after merge · f5c9eaa0
      unknown authored
      
      mysql-test/r/bigint.result:
        fix test after merge
      mysql-test/r/query_cache.result:
        fix test after merge
      mysql-test/r/type_datetime.result:
        fix test after merge
      f5c9eaa0
    • unknown's avatar
      Fixed some warning and error messages so that they use · a98025fa
      unknown authored
      sql_print_warning() and sql_print_error() instead of fprintf to stderr.
      Above functions are tuned for different platforms so that the behavior
      is consistent around platforms. Using fprintf() different behavior can
      be expected at least on Windows and Unix.
      
      a98025fa
    • unknown's avatar
      set_var.cc, mysqld.cc, ha_innodb.h, ha_innodb.cc, srv0srv.c, srv0srv.h: · 5b8d65b8
      unknown authored
        Added innodb_commit_concurrency variable
      
      
      innobase/include/srv0srv.h:
        Added innodb_commit_concurrency variable
      innobase/srv/srv0srv.c:
        Added innodb_commit_concurrency variable
      sql/ha_innodb.cc:
        Added innodb_commit_concurrency variable
      sql/ha_innodb.h:
        Added innodb_commit_concurrency variable
      sql/mysqld.cc:
        Added innodb_commit_concurrency variable
      sql/set_var.cc:
        Added innodb_commit_concurrency variable
      5b8d65b8
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · a665a807
      unknown authored
      into  mysql.com:/home/my/mysql-5.0
      
      
      mysql-test/t/sp.test:
        Auto merged
      sql/sp_head.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sp_cache.cc:
        manual merge
      a665a807
    • unknown's avatar
      Cleanups during review of new code · 8fd5120d
      unknown authored
      
      mysql-test/t/sp.test:
        Use --disable_parsing instead of comments
      sql/lock.cc:
        Remove compiler warning
      sql/mysqld.cc:
        Always send valid flag argument to reload_acl_and_cache()
      sql/sp_cache.cc:
        Simple optimization
        Don't use mutex to read 'long' variable
        Indentation fixes
      sql/sp_head.cc:
        Fix comments to use /* */
        Set proc_info to 0 after close_thread_tables()
      sql/sql_base.cc:
        remove not needed test
      sql/sql_parse.cc:
        Always send valid flag argument to reload_acl_and_cache()
        Fixed indentation
        Ensure we get an error if reset_master() fails.
      8fd5120d
    • unknown's avatar
      Merge xiphis.org:/usr/home/antony/work2/mysql-4.1 · 1ea2747f
      unknown authored
      into  xiphis.org:/usr/home/antony/work2/merge-5.0
      
      
      client/mysql.cc:
        Auto merged
      client/mysqldump.c:
        Auto merged
      client/mysqltest.c:
        Auto merged
      myisam/ft_boolean_search.c:
        Auto merged
      myisammrg/myrg_static.c:
        Auto merged
      mysql-test/r/func_str.result:
        Auto merged
      mysql-test/r/rpl_drop_temp.result:
        Auto merged
      mysql-test/r/type_datetime.result:
        Auto merged
      mysql-test/t/bigint.test:
        Auto merged
      mysql-test/t/func_str.test:
        Auto merged
      mysql-test/t/rpl_drop_temp.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sql_cache.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql-common/my_time.c:
        Auto merged
      include/my_sys.h:
        manual merge 4.1->5.0
      mysql-test/r/bigint.result:
        manual merge 4.1->5.0
      mysql-test/r/subselect.result:
        manual merge 4.1->5.0
      mysql-test/t/subselect.test:
        manual merge 4.1->5.0
      mysys/charset.c:
        manual merge 4.1->5.0
      sql/ha_ndbcluster.cc:
        manual merge 4.1->5.0
      sql/item_strfunc.cc:
        manual merge 4.1->5.0
      sql/sql_base.cc:
        manual merge 4.1->5.0
      sql/sql_select.cc:
        manual merge 4.1->5.0
      sql/sql_union.cc:
        manual merge 4.1->5.0
      strings/Makefile.am:
        manual merge 4.1->5.0
      tests/mysql_client_test.c:
        manual merge 4.1->5.0
      1ea2747f
    • unknown's avatar
      query_cache_notembedded.test, query_cache_notembedded.result: · 1e3c1e7a
      unknown authored
        postmerge fix
      
      
      mysql-test/r/query_cache_notembedded.result:
        postmerge fix
      mysql-test/t/query_cache_notembedded.test:
        postmerge fix
      1e3c1e7a
    • unknown's avatar
      merge · 8ea6e80f
      unknown authored
      
      BitKeeper/deleted/.del-query_cache_notembedded.result:
        Delete: mysql-test/r/query_cache_notembedded.result
      BitKeeper/deleted/.del-query_cache_notembedded.test:
        Delete: mysql-test/t/query_cache_notembedded.test
      mysql-test/r/func_str.result:
        Auto merged
      mysql-test/t/func_str.test:
        Auto merged
      8ea6e80f
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 2dd771c4
      unknown authored
      into  mysql.com:/home/dlenev/src/mysql-5.0-bg11973-2
      
      
      sql/item_subselect.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      mysql-test/r/trigger.result:
        SCCS merged
      mysql-test/t/trigger.test:
        SCCS merged
      2dd771c4
    • unknown's avatar
      make the same filenames as in 4.1 · c22c1a6e
      unknown authored
      
      mysql-test/t/query_cache_notembedded.test:
        Rename: mysql-test/t/query_cache_noembeded.test -> mysql-test/t/query_cache_notembedded.test
      mysql-test/r/query_cache_notembedded.result:
        Rename: mysql-test/r/query_cache_noembeded.result -> mysql-test/r/query_cache_notembedded.result
      c22c1a6e
  4. 10 Aug, 2005 15 commits
    • unknown's avatar
      Merge xiphis.org:/usr/home/antony/work2/p2-bug10109.3 · c6a5f50b
      unknown authored
      into  xiphis.org:/usr/home/antony/work2/p2-bug10109.4
      
      
      mysql-test/t/insert_update.test:
        Auto merged
      mysql-test/r/insert_update.result:
        Auto merged
      sql/sql_class.h:
        discard bug10109 changes from 4.1
      sql/sql_insert.cc:
        merge bug10109 from 4.1 to 5.0
      sql/sql_parse.cc:
        discard bug10109 changes from 4.1
      c6a5f50b
    • unknown's avatar
      Merge mysql.com:/home/psergey/mysql-5.0-bug12228-r4 · 7d79899c
      unknown authored
      into mysql.com:/home/psergey/mysql-5.0-bug12228-r5
      
      
      mysql-test/r/type_bit.result:
        Auto merged
      mysql-test/t/sp-threads.test:
        Auto merged
      mysql-test/t/type_bit.test:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      7d79899c
    • unknown's avatar
      BUG#12228: Post review fixes: Added test case, code cleanup. · c6a42c58
      unknown authored
      
      mysql-test/r/sp-threads.result:
        Testcase for BUG#12228
      mysql-test/t/sp-threads.test:
        Testcase for BUG#12228
      sql/sp_cache.cc:
        BUG#12228: Post-review fixes: small code cleanup
      sql/sp_cache.h:
        BUG#12228: Post-review fixes: fixed the comment
      sql/sql_parse.cc:
        BUG#12228: Post-review fixes: in mysql_parse, flush obsolete SPs from the caches only if 
         the query hasn't been handled by the query cache.
      sql/sql_prepare.cc:
        BUG#12228: Post-review fixes: in mysql_stmt_prepare/execute, flush SP caches 
         "closer to the execution"
      c6a42c58
    • unknown's avatar
      Fix rpl_openssl test to actually work. (Bug #12457, Bug #10860) · 1fdc7e67
      unknown authored
      
      mysql-test/r/rpl_openssl.result:
        Update results
      mysql-test/t/rpl_openssl.test:
        Test whether server has SSL support, not whether the client is using SSL.
        Use 'localhost' in user we create to avoid problems with anonymous user.
      1fdc7e67
    • unknown's avatar
      block using QC in case of having tables locked by LOCK... (BUG#12385) · f6f34c13
      unknown authored
      
      sql/sql_cache.cc:
        block QC using if tables are locked with LOCK
        unlock QC
      mysql-test/r/query_cache_noembeded.result:
        New BitKeeper file ``mysql-test/r/query_cache_noembeded.result''
      mysql-test/t/query_cache_noembeded.test:
        New BitKeeper file ``mysql-test/t/query_cache_noembeded.test''
      f6f34c13
    • unknown's avatar
      A fix and a test case for Bug#12243 "MySQL Server crashes with 2 · 21239c9f
      unknown authored
      cursors (+ commit)" and Bug#11832 "Server crash with InnoDB + Cursors"
      See comments to the changed files.
      
      
      innobase/include/read0read.h:
        - add cursor_view_t::n_mysql_tables_in_use
      innobase/read/read0read.c:
        - maintain cursor_view_t::n_mysql_tables_in_use. InnoDB
        maintains trx->n_mysql_tables_in_use to know when it can auto-commit
        a read-only statement. When this count drops to zero,
        MySQL has ended processing of such statement and InnoDB can commit.
        Cursors should not break this invariant, and should exclude the tables
        used in a cursor from the count of active tables.
        When a cursor is closed, the number of its tables is added back, 
        to ensure that close_thread_tables->unlock_external->
        ha_innobase::external_lock(F_UNLCK) won't drop the count in trx 
        below zero.
      innobase/row/row0sel.c:
        - remove the restoration of the global read view from 
        row_search_for_mysql: MySQL may call row_search_for_mysql
        more than once when fetching a row for a cursor (e.g. if there
        is a WHERE clause that filters out some rows).
      sql/ha_innodb.cc:
        - add more verbose printout for the case when we close an InnoDB
        connection without priorlly issuing a commit or rollback. The problem
        should be investigated.
      tests/mysql_client_test.c:
        - add a test case for Bug#12243 "MySQL Server crashes with 2 cursors 
        (+ commit)"
      21239c9f
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 689f32a1
      unknown authored
      into  mysql.com:/home/kostja/mysql/mysql-5.0-12243
      
      689f32a1
    • unknown's avatar
      Fix coding style. · a08a841a
      unknown authored
      a08a841a
    • unknown's avatar
      Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-5.0 · 04c545c6
      unknown authored
      into  linux.site:/home/reggie/bk/mysql-5.0-new
      
      
      server-tools/instance-manager/IMService.cpp:
        Auto merged
      04c545c6
    • unknown's avatar
      error message fixed · 45a155f7
      unknown authored
      45a155f7
    • unknown's avatar
      Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0 · bfa12451
      unknown authored
      into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
      
      bfa12451
    • unknown's avatar
      A fix for Bug#11901 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY join in · 33e8f20c
      unknown authored
      subqry order by server crash": failing DBUG_ASSERT(curr_join == this)
      when opening a cursor.
      Ensure that for top-level join curr_join == join (always), 
      and thus fix the failing assert.
      curr_join is a hack to ensure that uncacheable subqueries can be
      re-evaluated safely, and should be never different from main join
      in case of top-level join.
      
      
      sql/sql_select.cc:
        - utilize tmp_join only if we evaluate an uncacheable subquery.
      sql/sql_select.h:
        - implement JOIN::is_top_level_join()
      tests/mysql_client_test.c:
        A test case for Bug#11901 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY
         join in subqry order by server crash"
      33e8f20c
    • unknown's avatar
      Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1 · b3978e43
      unknown authored
      into  mysql.com:/usr/local/home/marty/MySQL/mysql-4.1
      
      
      sql/ha_ndbcluster.cc:
        Auto merged
      b3978e43
    • unknown's avatar
      Merge mysql.com:/usr/local/home/marty/MySQL/mysql-4.1 · d1bb342d
      unknown authored
      into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
      
      
      sql/ha_ndbcluster.cc:
        SCCS merged
      d1bb342d
    • unknown's avatar
      4a6c3e08