List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:May 8 2009 2:48pm
Subject:bzr commit into mysql-5.1-telco-6.2-merge branch (jonas:2838)
View as plain text  
#At file:///home/jonas/src/mysql-5.1-telco-6.2-merge/ based on revid:jonas@stripped

 2838 Jonas Oreland	2009-05-08 [merge]
      merge 5.1.34 into 5.1-telco-6.2-merge

    D  mysql-test/suite/sys_vars/r/event_scheduler_func.result
    D  mysql-test/suite/sys_vars/t/event_scheduler_func.test
    A  mysql-test/extra/rpl_tests/rpl_loadfile.test
    A  mysql-test/r/lock_multi_bug38499.result
    A  mysql-test/r/lock_multi_bug38691.result
    A  mysql-test/r/mysql-bug41486.result
    A  mysql-test/suite/rpl/r/rpl_row_wide_table.result
    A  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
    A  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
    A  mysql-test/suite/rpl/r/rpl_stm_loadfile.result
    A  mysql-test/suite/rpl/t/rpl_row_wide_table.test
    A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
    A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
    A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt
    A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
    A  mysql-test/suite/rpl/t/rpl_stm_loadfile.test
    A  mysql-test/t/lock_multi_bug38499.test
    A  mysql-test/t/lock_multi_bug38691.test
    A  mysql-test/t/mysql-bug41486.test
    M  client/my_readline.h
    M  client/mysql.cc
    M  client/mysqladmin.cc
    M  client/mysqlbinlog.cc
    M  client/mysqlcheck.c
    M  client/mysqldump.c
    M  client/mysqlslap.c
    M  client/mysqltest.cc
    M  client/readline.cc
    M  client/sql_string.cc
    M  configure.in
    M  extra/comp_err.c
    M  extra/yassl/src/buffer.cpp
    M  extra/yassl/taocrypt/include/block.hpp
    M  extra/yassl/taocrypt/src/algebra.cpp
    M  extra/yassl/taocrypt/src/asn.cpp
    M  include/my_sys.h
    M  libmysql/libmysql.c
    M  libmysqld/CMakeLists.txt
    M  libmysqld/examples/CMakeLists.txt
    M  mysql-test/extra/binlog_tests/binlog.test
    M  mysql-test/include/concurrent.inc
    M  mysql-test/include/ndb_backup.inc
    M  mysql-test/lib/My/SafeProcess/safe_process.cc
    M  mysql-test/r/concurrent_innodb_safelog.result
    M  mysql-test/r/concurrent_innodb_unsafelog.result
    M  mysql-test/r/create.result
    M  mysql-test/r/ctype_collate.result
    M  mysql-test/r/index_merge_myisam.result
    M  mysql-test/r/information_schema.result
    M  mysql-test/r/key_cache.result
    M  mysql-test/r/lock_multi.result
    M  mysql-test/r/mysqlbinlog.result
    M  mysql-test/r/select.result
    M  mysql-test/r/union.result
    M  mysql-test/r/variables.result
    M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
    M  mysql-test/suite/binlog/r/binlog_row_binlog.result
    M  mysql-test/suite/binlog/r/binlog_stm_binlog.result
    M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
    M  mysql-test/suite/federated/federated.result
    M  mysql-test/suite/federated/federated.test
    M  mysql-test/suite/funcs_1/r/is_columns_is.result
    M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
    M  mysql-test/suite/funcs_1/r/processlist_priv_ps.result
    M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
    M  mysql-test/suite/funcs_1/r/processlist_val_ps.result
    M  mysql-test/suite/ndb/r/ndb_alter_table_online.result
    M  mysql-test/suite/ndb/r/ndb_blob_restore.result
    M  mysql-test/suite/ndb/r/ndb_restore.result
    M  mysql-test/suite/ndb/r/ndb_restore_partition.result
    M  mysql-test/suite/ndb/r/ndb_restore_print.result
    M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
    M  mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
    M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
    M  mysql-test/suite/rpl/r/rpl_do_grant.result
    M  mysql-test/suite/rpl/r/rpl_loaddatalocal.result
    M  mysql-test/suite/rpl/r/rpl_loadfile.result
    M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
    M  mysql-test/suite/rpl/r/rpl_slave_load_in.result
    M  mysql-test/suite/rpl/r/rpl_stm_log.result
    M  mysql-test/suite/rpl/r/rpl_temporary.result
    M  mysql-test/suite/rpl/r/rpl_timezone.result
    M  mysql-test/suite/rpl/t/disabled.def
    M  mysql-test/suite/rpl/t/rpl_do_grant.test
    M  mysql-test/suite/rpl/t/rpl_loaddatalocal.test
    M  mysql-test/suite/rpl/t/rpl_loadfile.test
    M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
    M  mysql-test/suite/rpl/t/rpl_slave_load_in.test
    M  mysql-test/suite/rpl/t/rpl_temporary.test
    M  mysql-test/suite/rpl/t/rpl_timezone.test
    M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
    M  mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
    M  mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
    M  mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
    M  mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
    M  mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
    M  mysql-test/suite/sys_vars/r/interactive_timeout_func.result
    M  mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
    M  mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
    M  mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
    M  mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
    M  mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
    M  mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
    M  mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
    M  mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
    M  mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
    M  mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
    M  mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
    M  mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
    M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
    M  mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
    M  mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result
    M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
    M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
    M  mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
    M  mysql-test/suite/sys_vars/r/slow_query_log_func.result
    M  mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
    M  mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
    M  mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
    M  mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
    M  mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
    M  mysql-test/suite/sys_vars/t/concurrent_insert_func.test
    M  mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
    M  mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
    M  mysql-test/suite/sys_vars/t/interactive_timeout_func.test
    M  mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
    M  mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
    M  mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test
    M  mysql-test/suite/sys_vars/t/slow_query_log_func.test
    M  mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
    M  mysql-test/suite/sys_vars/t/timestamp_func.test
    M  mysql-test/suite/sys_vars/t/wait_timeout_func.test
    M  mysql-test/t/ctype_collate.test
    M  mysql-test/t/disabled.def
    M  mysql-test/t/index_merge_myisam.test
    M  mysql-test/t/information_schema.test
    M  mysql-test/t/lock_multi.test
    M  mysql-test/t/select.test
    M  mysql-test/t/union.test
    M  mysql-test/t/upgrade.test
    M  mysql-test/t/variables.test
    M  mysys/array.c
    M  mysys/base64.c
    M  mysys/charset.c
    M  mysys/checksum.c
    M  mysys/default.c
    M  mysys/default_modify.c
    M  mysys/hash.c
    M  mysys/mf_keycache.c
    M  mysys/mf_tempdir.c
    M  mysys/my_append.c
    M  mysys/my_compress.c
    M  mysys/my_conio.c
    M  mysys/my_copy.c
    M  mysys/my_error.c
    M  mysys/my_getopt.c
    M  mysys/my_getwd.c
    M  mysys/my_new.cc
    M  mysys/my_pread.c
    M  mysys/my_quick.c
    M  mysys/my_read.c
    M  mysys/string.c
    M  scripts/mysqld_safe.sh
    M  server-tools/instance-manager/buffer.cc
    M  server-tools/instance-manager/instance.cc
    M  server-tools/instance-manager/instance_map.cc
    M  server-tools/instance-manager/options.cc
    M  server-tools/instance-manager/options.h
    M  server-tools/instance-manager/parse.h
    M  sql-common/client.c
    M  sql-common/my_user.c
    M  sql/event_data_objects.cc
    M  sql/event_parse_data.cc
    M  sql/events.cc
    M  sql/gen_lex_hash.cc
    M  sql/item.cc
    M  sql/item.h
    M  sql/item_create.cc
    M  sql/item_func.cc
    M  sql/item_strfunc.cc
    M  sql/item_timefunc.cc
    M  sql/lock.cc
    M  sql/log_event.cc
    M  sql/log_event.h
    M  sql/log_event_old.cc
    M  sql/mysql_priv.h
    M  sql/mysqld.cc
    M  sql/net_serv.cc
    M  sql/opt_range.cc
    M  sql/rpl_utility.h
    M  sql/set_var.cc
    M  sql/set_var.h
    M  sql/slave.cc
    M  sql/sp_head.cc
    M  sql/sp_head.h
    M  sql/spatial.h
    M  sql/sql_cache.cc
    M  sql/sql_class.cc
    M  sql/sql_class.h
    M  sql/sql_connect.cc
    M  sql/sql_crypt.cc
    M  sql/sql_error.cc
    M  sql/sql_insert.cc
    M  sql/sql_lex.cc
    M  sql/sql_lex.h
    M  sql/sql_load.cc
    M  sql/sql_parse.cc
    M  sql/sql_plugin.cc
    M  sql/sql_prepare.cc
    M  sql/sql_profile.cc
    M  sql/sql_repl.cc
    M  sql/sql_select.cc
    M  sql/sql_select.h
    M  sql/sql_servers.cc
    M  sql/sql_show.cc
    M  sql/sql_string.cc
    M  sql/sql_table.cc
    M  sql/sql_trigger.cc
    M  sql/sql_udf.cc
    M  sql/sql_view.cc
    M  sql/strfunc.cc
    M  sql/table.cc
    M  sql/tztime.cc
    M  sql/udf_example.c
    M  sql/uniques.cc
    M  storage/archive/azio.c
    M  storage/archive/azlib.h
    M  storage/archive/ha_archive.cc
    M  storage/csv/ha_tina.cc
    M  storage/csv/ha_tina.h
    M  storage/csv/transparent_file.cc
    M  storage/csv/transparent_file.h
    M  storage/federated/ha_federated.cc
    M  storage/federated/ha_federated.h
    M  storage/heap/hp_write.c
    M  storage/ibmdb2i/Makefile.am
    M  storage/innobase/handler/ha_innodb.cc
    M  storage/innobase/include/pars0pars.h
    M  storage/myisam/ha_myisam.cc
    M  storage/myisam/mi_check.c
    M  storage/myisam/mi_packrec.c
    M  storage/myisam/mi_search.c
    M  storage/myisam/rt_index.c
    M  storage/myisammrg/ha_myisammrg.cc
    M  strings/Makefile.am
    M  strings/ctype.c
    M  strings/my_vsnprintf.c
    M  tests/bug25714.c
    M  tests/mysql_client_test.c
    2555.345.45 Jonathan Perkin	2009-04-02 {mysql-5.1.34}
                Apply http://lists.mysql.com/commits/70427 to fix Win32 builds with VS 2005.

        M  include/config-win.h
    2555.345.44 MySQL Build Team	2009-04-01
                Add new headers to noinst_HEADERS (ibmdb2i storage engine)

        M  storage/ibmdb2i/Makefile.am
    2555.345.43 Jonathan Perkin	2009-03-31
                Apply 64-bit fix from Azundris.

        M  mysys/safemalloc.c
    2555.345.42 Georgi Kodinov	2009-03-27 {clone-5.1.34-build} [merge]
                merged tree name change

        M  .bzr-mysql/default.conf
        1810.3870.4 Georgi Kodinov	2009-03-27 {clone-5.0.80-build}
                    tree name changed

            M  .bzr-mysql/default.conf
    2555.345.41 Georgi Kodinov	2009-03-27 [merge]
                null-merged 5.0 specific compilation warning

        1810.3870.3 Georgi Kodinov	2009-03-27
                    fixed a compilation warning

            M  sql/sql_insert.cc
    2555.345.40 Georgi Kodinov	2009-03-27 [merge]
                auto-merge

        M  mysql-test/suite/rpl/r/rpl_temporary.result
        M  mysql-test/suite/rpl/t/rpl_temporary.test
         2555.371.2 Tatiana A. Nurnberg	2009-03-27 [merge]
                    auto-merge

            D  mysql-test/std_data/bug32880.ARN
            D  mysql-test/std_data/bug32880.ARZ
            D  mysql-test/std_data/bug32880.frm
            M  mysql-test/r/archive.result
            M  mysql-test/suite/funcs_1/r/processlist_priv_ps.result
            M  mysql-test/suite/funcs_1/r/processlist_val_ps.result
            M  mysql-test/suite/rpl/r/rpl_loadfile.result
            M  mysql-test/suite/rpl/t/rpl_loadfile.test
            M  mysql-test/t/archive.test
            M  mysql-test/t/upgrade.test
            M  storage/archive/ha_archive.cc
         2555.371.1 Tatiana A. Nurnberg	2009-03-27
                    Bug#43748: crash when non-super user tries to kill the replication threads
                    
                    Test was flakey on some machines and showed spurious
                    reds for races.
                    
                    New-and-improved test makes do with fewer statements,
                    no mysqltest-variables, and no backticks. Should hope-
                    fully be more robust. Heck, it's debatable whether we
                    should have a test for this, anyway.
             @ mysql-test/suite/rpl/r/rpl_temporary.result
                streamlined
             @ mysql-test/suite/rpl/t/rpl_temporary.test
                streamlined

            M  mysql-test/suite/rpl/r/rpl_temporary.result
            M  mysql-test/suite/rpl/t/rpl_temporary.test
    2555.345.39 Georgi Kodinov	2009-03-27
                disabled a failing test suite due to bug #42311

        M  mysql-test/suite/rpl/t/disabled.def
    2555.345.38 Georgi Kodinov	2009-03-27
                Worked around the problem described in bug #43884.

        M  mysql-test/suite/rpl/r/rpl_loadfile.result
        M  mysql-test/suite/rpl/t/rpl_loadfile.test
    2555.345.37 Georgi Kodinov	2009-03-26
                fixed unupdated test suites.

        M  mysql-test/suite/funcs_1/r/processlist_priv_ps.result
        M  mysql-test/suite/funcs_1/r/processlist_val_ps.result
    2555.345.36 Georgi Kodinov	2009-03-26
                removed an unix-ism in a test

        M  mysql-test/t/upgrade.test
    2555.345.35 Sergey Glukhov	2009-03-26
                fixed archive test. It might be OOM error on boxes with low amount of memory.
                It leads to crash because there is no OOM check in ha_archive::unpack_row().
                The fix:
                added OOM error check
         @ mysql-test/r/archive.result
            remover test case
         @ mysql-test/std_data/bug32880.ARN
            remover test case
         @ mysql-test/std_data/bug32880.ARZ
            remover test case
         @ mysql-test/std_data/bug32880.frm
            remover test case
         @ mysql-test/t/archive.test
            remover test case
         @ storage/archive/ha_archive.cc
            fixed archive test. It might be OOM error on boxes with low amount of memory.
            It leads to crash because there is no OOM check in ha_archive::unpack_row().
            The fix:
            added OOM error check

        D  mysql-test/std_data/bug32880.ARN
        D  mysql-test/std_data/bug32880.ARZ
        D  mysql-test/std_data/bug32880.frm
        M  mysql-test/r/archive.result
        M  mysql-test/t/archive.test
        M  storage/archive/ha_archive.cc
    2555.345.34 Andrei Elkin	2009-03-26 [merge]
                merge from 5.1-pe-stage to a local tree

        M  mysql-test/extra/binlog_tests/binlog.test
        M  mysql-test/suite/binlog/r/binlog_row_binlog.result
        M  mysql-test/suite/binlog/r/binlog_stm_binlog.result
        M  mysql-test/suite/rpl/r/rpl_temporary.result
        M  mysql-test/suite/rpl/t/rpl_temporary.test
        M  sql/sp_head.cc
        M  sql/sql_class.cc
        M  sql/sql_class.h
        M  sql/sql_parse.cc
         2555.370.2 Ramil Kalimullin	2009-03-25 [merge]
                    Manual merge.

            M  mysql-test/extra/binlog_tests/binlog.test
            M  mysql-test/suite/binlog/r/binlog_row_binlog.result
            M  mysql-test/suite/binlog/r/binlog_stm_binlog.result
            M  sql/sp_head.cc
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_parse.cc
            1810.3870.2 Ramil Kalimullin	2009-03-25 [merge]
                        Auto-merge

                M  mysql-test/r/rpl_temporary.result
                M  mysql-test/t/rpl_temporary.test
                M  sql/sql_class.cc
                M  sql/sql_class.h
                M  sql/sql_parse.cc
            1810.3870.1 Ramil Kalimullin	2009-03-25
                        Fix for bug#35383: binlog playback and replication breaks
                        due to name_const substitution
                        
                        Problem:
                        "In general, statements executed within a stored procedure
                        are written to the binary log using the same rules that
                        would apply were the statements to be executed in standalone
                        fashion. Some special care is taken when logging procedure
                        statements because statement execution within procedures
                        is not quite the same as in non-procedure context".
                        
                        For example, each reference to a local variable in SP's
                        statements is replaced by NAME_CONST(var_name, var_value).
                        Queries like
                        "CREATE TABLE ... SELECT FUNC(local_var ..."
                        are logged as
                        "CREATE TABLE ... SELECT FUNC(NAME_CONST("local_var", var_value) ..."
                        that leads to differrent field names and
                        might result in "Incorrect column name" if var_value is long enough.
                        
                        Fix: in 5.x we'll issue a warning in such a case.
                        In 6.0 we should get rid of NAME_CONST().
                        
                        Note: this issue and change should be described in the documentation
                        ("Binary Logging of Stored Programs").
                 @ mysql-test/r/binlog.result
                    Fix for bug#35383: binlog playback and replication breaks
                    due to name_const substitution
                      - test result.
                 @ mysql-test/t/binlog.test
                    Fix for bug#35383: binlog playback and replication breaks
                    due to name_const substitution
                      - test case.
                 @ sql/sp_head.cc
                    Fix for bug#35383: binlog playback and replication breaks 
                    due to name_const substitution
                      - set thd->query_name_consts if there's NAME_CONST()
                    substitution(s).
                 @ sql/sql_parse.cc
                    Fix for bug#35383: binlog playback and replication breaks 
                    due to name_const substitution
                      - issue a warning if there's NAME_CONST() substitution and
                    binary logging is on for "CREATE TABLE ... SELECT ...".

                M  mysql-test/r/binlog.result
                M  mysql-test/t/binlog.test
                M  sql/sp_head.cc
                M  sql/sql_class.cc
                M  sql/sql_class.h
                M  sql/sql_parse.cc
         2555.370.1 Tatiana A. Nurnberg	2009-03-25 [merge]
                    Bug#43748: crash when non-super user tries to kill the replication threads
                    
                    manual merge. also adds test specific to 5.1+
             @ mysql-test/suite/rpl/r/rpl_temporary.result
                show that a non-privileged user trying to
                kill system-threads no longer crashes the
                server. test in 5.1+ only.
             @ mysql-test/suite/rpl/t/rpl_temporary.test
                show that a non-privileged user trying to
                kill system-threads no longer crashes the
                server. test in 5.1+ only.
             @ sql/sql_class.cc
                manual merge
             @ sql/sql_class.h
                manual merge
             @ sql/sql_parse.cc
                manual merge

            M  mysql-test/suite/rpl/r/rpl_temporary.result
            M  mysql-test/suite/rpl/t/rpl_temporary.test
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_parse.cc
        1810.3852.13 Tatiana A. Nurnberg	2009-03-25
                    Bug#43748: crash when non-super user tries to kill the replication threads
                    
                    Fine-tuning. Broke out comparison into method by
                    suggestion of Davi. Clarified comments. Reverting
                    test-case which I find too brittle; proper test
                    case in 5.1+.

            M  mysql-test/r/rpl_temporary.result
            M  mysql-test/t/rpl_temporary.test
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_parse.cc
        1810.3852.12 Georgi Kodinov	2009-03-25
                    Bug#43748: crash when non-super user tries to kill the replication threads
                    
                    (Pushing for Azundris)
                          
                    We allow security-contexts with NULL users (for
                    system-threads and for unauthenticated users).
                    If a non-SUPER-user tried to KILL such a thread,
                    we tried to compare the user-fields to see whether
                    they owned that thread. Comparing against NULL was
                    not a good idea.
                          
                    If KILLer does not have SUPER-privilege, we
                    specifically check whether both KILLer and KILLee
                    have a non-NULL user before testing for string-
                    equality. If either is NULL, we reject the KILL.
             @ mysql-test/r/rpl_temporary.result
                Try to have a non-SUPER user KILL a system thread.
             @ mysql-test/t/rpl_temporary.test
                Try to have a non-SUPER user KILL a system thread.
             @ sql/sql_parse.cc
                Make sure security contexts of both KILLer *and*
                        KILLee are non-NULL before testing for string-equality!

            M  mysql-test/r/rpl_temporary.result
            M  mysql-test/t/rpl_temporary.test
            M  sql/sql_parse.cc
    2555.345.33 Andrei Elkin	2009-03-26
                bug#42977
                compilation warning fixed

        M  sql/log_event.cc
    2555.345.32 Andrei Elkin	2009-03-25
                Bug#42977 RBR logs for rows with more than 250 column results in corrupt binlog
                            
                The issue happened to be two-fold.
                The table map event was recorded into binlog having
                an incorrect size when number of columns exceeded 251. 
                The Row-based event had incorrect recording and restoring m_width member within
                the same as above conditions.
                
                Fixed with correcting m_data_size and m_width.
         @ mysql-test/suite/rpl/r/rpl_row_wide_table.result
            the new test results.
         @ mysql-test/suite/rpl/t/rpl_row_wide_table.test
            regression test for bug#42977.
         @ sql/log_event.cc
            0. all buffers that used in net_store_length() are augmented with 1 for safety
            to be able to contain the magic and the content of ulonglong as well;
            1. Rows_log_event::get_data_size() yieled incorrect size |m_width/8| whereas 
               it should be m_width;
            2. Table_map_log_event::Table_map_log_event yieled incorrect value for
               `m_data_size' probably presuming 1-byte integer max for the column number;
         @ sql/rpl_utility.h
            DBUG_PRINT_BITSET() macro is left 256-cols limited but has made safe and commented.

        A  mysql-test/suite/rpl/r/rpl_row_wide_table.result
        A  mysql-test/suite/rpl/t/rpl_row_wide_table.test
        M  sql/log_event.cc
        M  sql/rpl_utility.h
    2555.345.31 Leonard Zhou	2009-03-25 [merge]
                Merge

        M  mysql-test/t/mysql-bug41486.test
         2555.369.1 Alexey Kopytov	2009-03-25
                    Disabled embedded server in the test case for bug #41486.
             @ mysql-test/t/mysql-bug41486.test
                Disabled embedded server in the test case for bug #41486.

            M  mysql-test/t/mysql-bug41486.test
    2555.345.30 Leonard Zhou	2009-03-25 [merge]
                Empty merge for fixing only in 5.0

        1810.3852.11 Leonard Zhou	2009-03-25
                    Fix the test case error in PB.

            M  mysql-test/r/rpl_timezone.result
            M  mysql-test/t/rpl_timezone.test
    2555.345.29 Alexey Kopytov	2009-03-25
                Fix for bug #43801: mysql.test takes too long, fails due to 
                                    expired timeout on debx86-b in PB
                
                Turned off general log when importing DB dump in the test 
                case for bug #41486 due to the bug in CSV engine code that 
                makes logging long SQL query too slow.
         @ mysql-test/r/mysql-bug41486.result
            Turned off general log when importing DB dump in the test 
            case for bug #41486 due to the bug in CSV engine code that 
            makes logging long SQL query too slow.
         @ mysql-test/t/mysql-bug41486.test
            Turned off general log when importing DB dump in the test 
            case for bug #41486 due to the bug in CSV engine code that 
            makes logging long SQL query too slow.

        M  mysql-test/r/mysql-bug41486.result
        M  mysql-test/t/mysql-bug41486.test
    2555.345.28 Leonard Zhou	2009-03-25
                Fix test case erro in sles10-ia64-a. 
                
                Reset master before next test.
         @ mysql-test/suite/rpl/r/rpl_timezone.result
            Test result.
         @ mysql-test/suite/rpl/t/rpl_timezone.test
            Reset master before next test.

        M  mysql-test/suite/rpl/r/rpl_timezone.result
        M  mysql-test/suite/rpl/t/rpl_timezone.test
    2555.345.27 Alexey Kopytov	2009-03-24 [merge]
                Automerge.

        1810.3852.10 Alexey Kopytov	2009-03-24 [merge]
                    Automerge.

            A  mysql-test/include/wait_until_disconnected.inc
            A  mysql-test/r/mysql-bug41486.result
            A  mysql-test/t/mysql-bug41486.test
            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
    2555.345.26 Alexey Kopytov	2009-03-24 [merge]
                Automerge.

        A  mysql-test/r/mysql-bug41486.result
        A  mysql-test/t/mysql-bug41486.test
        M  mysql-test/r/mysql.result
        M  mysql-test/t/mysql.test
         2555.353.3 Alexey Kopytov	2009-03-24 [merge]
                    Manuel merge.

            A  mysql-test/r/mysql-bug41486.result
            A  mysql-test/t/mysql-bug41486.test
            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
        1810.3865.3 Alexey Kopytov	2009-03-24
                    Fix for bug #43801: mysql.test takes too long, fails due to 
                                        expired timeout on debx86-b in PB 
                    
                    Moved the resource-intensive test case for bug #41486 into 
                    a separate test file to reduce execution time for mysql.test. 
             @ mysql-test/include/wait_until_disconnected.inc
                Used in mysql-bug41486.test.
             @ mysql-test/r/mysql-bug41486.result
                Moved the resource-intensive test case for bug #41486 into 
                a separate test file to reduce execution time for mysql.test.
             @ mysql-test/r/mysql.result
                Moved the resource-intensive test case for bug #41486 into 
                a separate test file to reduce execution time for mysql.test.
             @ mysql-test/t/mysql-bug41486.test
                Moved the resource-intensive test case for bug #41486 into 
                a separate test file to reduce execution time for mysql.test.
             @ mysql-test/t/mysql.test
                Moved the resource-intensive test case for bug #41486 into 
                a separate test file to reduce execution time for mysql.test.

            A  mysql-test/include/wait_until_disconnected.inc
            A  mysql-test/r/mysql-bug41486.result
            A  mysql-test/t/mysql-bug41486.test
            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
    2555.345.25 Luis Soares	2009-03-24
                BUG#39701: Mixed binlog format does not switch to row mode on
                LOAD_FILE
                            
                LOAD_FILE is not safe to replicate in STATEMENT mode, because it
                depends on a file (which is loaded on master and may not exist in
                slave(s)). This leads to scenarios on which the slave replicates the
                statement with 'load_file' and it will try to load the file from local
                file system. Given that the file may not exist in the slave filesystem
                the operation will not succeed (probably returning NULL), causing
                master and slave(s) to diverge. However, when using MIXED mode
                replication, this can be made to work, if the statement including
                LOAD_FILE is marked as unsafe, triggering a switch to ROW mode,
                meaning that the contents of the file are written to binlog as row
                events. Consequently, the contents from the file in the master will
                reach the slave via the binlog.
                           
                This patch addresses this bug by marking the load_file function as
                unsafe. When in mixed mode and when LOAD_FILE is issued, there will be
                a switch to row mode. Furthermore, when in statement mode, the
                LOAD_FILE will raise a warning that the statement is unsafe in that
                mode.
         @ mysql-test/extra/rpl_tests/rpl_loadfile.test
            Extra file that is "sourced" on both rpl_loadfile and rpl_stm_loadfile
            test files.
         @ mysql-test/suite/rpl/r/rpl_loadfile.result
            Updated with the results from the test case added to this file.
         @ mysql-test/suite/rpl/r/rpl_stm_loadfile.result
            Result file for rpl_loadfile test split with the warnings in statement
            mode.
         @ mysql-test/suite/rpl/t/rpl_loadfile.test
            After splitting the original rpl_loadfile file, this one is only 
            required to be executed in mixed or row format.
            Appended the test for 39701 to this file.
         @ mysql-test/suite/rpl/t/rpl_stm_loadfile.test
            Split the original rpl_loadfile test because load_file now raises
            a warning when in statement mode. The goal of this split is 
            two-fold: i) make the test case more resilient; ii) assert that 
            warnings are indeed raised when in statement mode.
         @ sql/item_create.cc
            Added the set_stmt_unsafe call to lex.

        A  mysql-test/extra/rpl_tests/rpl_loadfile.test
        A  mysql-test/suite/rpl/r/rpl_stm_loadfile.result
        A  mysql-test/suite/rpl/t/rpl_stm_loadfile.test
        M  mysql-test/suite/rpl/r/rpl_loadfile.result
        M  mysql-test/suite/rpl/t/rpl_loadfile.test
        M  sql/item_create.cc
    2555.345.24 Georgi Kodinov	2009-03-24
                Fixed initialization order warining.

        M  sql/sql_insert.cc
    2555.345.23 Georgi Kodinov	2009-03-24 [merge]
                merged 5.0-bugteam -> 5.1-bugteam

        M  client/mysqltest.cc
        M  mysys/default.c
        M  mysys/my_new.cc
        M  sql/opt_range.cc
        M  sql/sql_class.cc
        M  strings/Makefile.am
        1810.3852.9 Leonard Zhou	2009-03-24 [merge]
                    Merge

            D  sql-bench/TODO
            A  mysql-test/r/lock_multi_bug38499.result
            A  mysql-test/r/lock_multi_bug38691.result
            A  mysql-test/t/lock_multi_bug38499.test
            A  mysql-test/t/lock_multi_bug38691.test
            M  client/my_readline.h
            M  client/mysql.cc
            M  client/mysql_upgrade.c
            M  client/mysqladmin.cc
            M  client/mysqlbinlog.cc
            M  client/mysqlcheck.c
            M  client/mysqldump.c
            M  client/mysqlmanager-pwgen.c
            M  client/mysqltest.c
            M  client/readline.cc
            M  client/sql_string.cc
            M  configure.in
            M  extra/comp_err.c
            M  extra/yassl/src/buffer.cpp
            M  extra/yassl/src/cert_wrapper.cpp
            M  extra/yassl/src/ssl.cpp
            M  extra/yassl/src/yassl_imp.cpp
            M  extra/yassl/src/yassl_int.cpp
            M  extra/yassl/taocrypt/include/block.hpp
            M  extra/yassl/taocrypt/src/algebra.cpp
            M  extra/yassl/taocrypt/src/asn.cpp
            M  heap/hp_write.c
            M  include/my_md5.h
            M  include/my_sys.h
            M  innobase/include/pars0pars.h
            M  innobase/pars/pars0pars.c
            M  innobase/rem/rem0cmp.c
            M  libmysql/libmysql.c
            M  libmysql/manager.c
            M  myisam/mi_check.c
            M  myisam/mi_open.c
            M  myisam/mi_packrec.c
            M  myisam/mi_search.c
            M  myisam/rt_index.c
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/include/wait_until_count_sessions.inc
            M  mysql-test/r/consistent_snapshot.result
            M  mysql-test/r/ctype_collate.result
            M  mysql-test/r/dirty_close.result
            M  mysql-test/r/explain.result
            M  mysql-test/r/federated.result
            M  mysql-test/r/flush_block_commit.result
            M  mysql-test/r/flush_block_commit_notembedded.result
            M  mysql-test/r/flush_read_lock_kill.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/ndb_restore.result
            M  mysql-test/r/ndb_restore_print.result
            M  mysql-test/r/read_only.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-security.result
            M  mysql-test/r/union.result
            M  mysql-test/r/view.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/suite/funcs_1/r/innodb_func_view.result
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/funcs_1/r/myisam_views.result
            M  mysql-test/t/alter_table-big.test
            M  mysql-test/t/connect.test
            M  mysql-test/t/consistent_snapshot.test
            M  mysql-test/t/ctype_collate.test
            M  mysql-test/t/dirty_close.test
            M  mysql-test/t/explain.test
            M  mysql-test/t/federated.test
            M  mysql-test/t/flush_block_commit.test
            M  mysql-test/t/flush_block_commit_notembedded.test
            M  mysql-test/t/flush_read_lock_kill.test
            M  mysql-test/t/init_connect.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/read_only.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/sp-security.test
            M  mysql-test/t/sp_notembedded.test
            M  mysql-test/t/ssl-big.test
            M  mysql-test/t/ssl.test
            M  mysql-test/t/ssl_compress.test
            M  mysql-test/t/status.test
            M  mysql-test/t/type_bit_innodb.test
            M  mysql-test/t/union.test
            M  mysql-test/t/user_limits.test
            M  mysql-test/t/view.test
            M  mysql-test/t/view_grant.test
            M  mysql-test/t/wait_timeout.test
            M  mysql-test/t/xa.test
            M  mysys/base64.c
            M  mysys/default.c
            M  mysys/errors.c
            M  mysys/md5.c
            M  mysys/mf_iocache2.c
            M  mysys/my_fstream.c
            M  mysys/my_new.cc
            M  mysys/my_pread.c
            M  mysys/my_static.c
            M  mysys/my_write.c
            M  mysys/safemalloc.c
            M  mysys/string.c
            M  server-tools/instance-manager/buffer.cc
            M  server-tools/instance-manager/commands.cc
            M  server-tools/instance-manager/instance.cc
            M  server-tools/instance-manager/instance_map.cc
            M  server-tools/instance-manager/instance_options.cc
            M  server-tools/instance-manager/listener.cc
            M  server-tools/instance-manager/mysql_connection.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/parse.cc
            M  server-tools/instance-manager/parse.h
            M  server-tools/instance-manager/parse_output.cc
            M  server-tools/instance-manager/protocol.cc
            M  server-tools/instance-manager/user_map.cc
            M  sql-common/client.c
            M  sql-common/my_user.c
            M  sql/gen_lex_hash.cc
            M  sql/ha_archive.cc
            M  sql/ha_federated.cc
            M  sql/ha_innodb.cc
            M  sql/handler.cc
            M  sql/item.cc
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_strfunc.h
            M  sql/item_sum.cc
            M  sql/item_timefunc.cc
            M  sql/lock.cc
            M  sql/log.cc
            M  sql/log_event.cc
            M  sql/mysqld.cc
            M  sql/net_serv.cc
            M  sql/opt_range.cc
            M  sql/opt_sum.cc
            M  sql/parse_file.cc
            M  sql/protocol.cc
            M  sql/set_var.cc
            M  sql/slave.cc
            M  sql/sp.cc
            M  sql/sp_head.cc
            M  sql/spatial.cc
            M  sql/sql_acl.cc
            M  sql/sql_base.cc
            M  sql/sql_cache.cc
            M  sql/sql_class.cc
            M  sql/sql_crypt.cc
            M  sql/sql_db.cc
            M  sql/sql_derived.cc
            M  sql/sql_error.cc
            M  sql/sql_handler.cc
            M  sql/sql_help.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_load.cc
            M  sql/sql_parse.cc
            M  sql/sql_prepare.cc
            M  sql/sql_repl.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_trigger.cc
            M  sql/sql_udf.cc
            M  sql/sql_view.cc
            M  sql/table.cc
            M  sql/tztime.cc
            M  sql/udf_example.c
            M  sql/uniques.cc
            M  sql/unireg.cc
            M  strings/Makefile.am
            M  strings/ctype-mb.c
            M  strings/ctype-simple.c
            M  strings/ctype-ucs2.c
            M  strings/my_vsnprintf.c
            M  strings/xml.c
            M  tests/bug25714.c
            M  tests/mysql_client_test.c
            M  tools/mysqlmanager.c
            M  vio/viosocket.c
        1810.3867.4 Matthias Leich	2009-03-23 [merge]
                    Merge of fixes into actual tree

            A  mysql-test/r/lock_multi_bug38499.result
            A  mysql-test/r/lock_multi_bug38691.result
            A  mysql-test/t/lock_multi_bug38499.test
            A  mysql-test/t/lock_multi_bug38691.test
            M  mysql-test/t/lock_multi.test
        1810.3867.3 Sergey Glukhov	2009-03-23
                    remove compiler warnings
             @ client/mysqltest.c
                remove compiler warnings

            M  client/mysqltest.c
        1810.3867.2 Tatiana A. Nurnberg	2009-03-23 [merge]
                    auto-merge

            D  sql-bench/TODO
            A  mysql-test/include/master-slave-end.inc
            A  mysql-test/include/start_slave.inc
            A  mysql-test/include/stop_slave.inc
            A  mysql-test/include/wait_for_slave_sql_error.inc
            A  mysql-test/include/wait_for_slave_sql_error_and_skip.inc
            A  mysql-test/include/wait_show_condition.inc
            A  mysql-test/r/innodb_bug42419.result
            A  mysql-test/r/lowercase_utf8.result
            A  mysql-test/r/rpl_filter_tables_not_exist.result
            A  mysql-test/t/innodb_bug42419.test
            A  mysql-test/t/lowercase_utf8-master.opt
            A  mysql-test/t/lowercase_utf8.test
            A  mysql-test/t/rpl_filter_tables_not_exist-slave.opt
            A  mysql-test/t/rpl_filter_tables_not_exist.test
            M  CMakeLists.txt
            M  client/my_readline.h
            M  client/mysql.cc
            M  client/mysql_upgrade.c
            M  client/mysqladmin.cc
            M  client/mysqlbinlog.cc
            M  client/mysqlcheck.c
            M  client/mysqldump.c
            M  client/mysqlmanager-pwgen.c
            M  client/mysqltest.c
            M  client/readline.cc
            M  client/sql_string.cc
            M  configure.in
            M  extra/comp_err.c
            M  extra/perror.c
            M  extra/yassl/src/buffer.cpp
            M  extra/yassl/src/cert_wrapper.cpp
            M  extra/yassl/src/ssl.cpp
            M  extra/yassl/src/yassl_imp.cpp
            M  extra/yassl/src/yassl_int.cpp
            M  extra/yassl/taocrypt/include/block.hpp
            M  extra/yassl/taocrypt/src/algebra.cpp
            M  extra/yassl/taocrypt/src/asn.cpp
            M  heap/hp_write.c
            M  include/config-win.h
            M  include/my_base.h
            M  include/my_global.h
            M  include/my_md5.h
            M  include/my_sys.h
            M  innobase/buf/buf0lru.c
            M  innobase/dict/dict0crea.c
            M  innobase/include/db0err.h
            M  innobase/include/pars0pars.h
            M  innobase/include/rem0rec.h
            M  innobase/include/rem0rec.ic
            M  innobase/include/trx0undo.h
            M  innobase/pars/pars0pars.c
            M  innobase/rem/rem0cmp.c
            M  innobase/row/row0mysql.c
            M  innobase/trx/trx0rec.c
            M  innobase/trx/trx0undo.c
            M  libmysql/libmysql.c
            M  libmysql/manager.c
            M  myisam/mi_check.c
            M  myisam/mi_open.c
            M  myisam/mi_packrec.c
            M  myisam/mi_search.c
            M  myisam/rt_index.c
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/include/wait_until_count_sessions.inc
            M  mysql-test/r/archive_gis.result
            M  mysql-test/r/backup.result
            M  mysql-test/r/bdb_gis.result
            M  mysql-test/r/check.result
            M  mysql-test/r/consistent_snapshot.result
            M  mysql-test/r/ctype_collate.result
            M  mysql-test/r/dirty_close.result
            M  mysql-test/r/explain.result
            M  mysql-test/r/federated.result
            M  mysql-test/r/flush_block_commit.result
            M  mysql-test/r/flush_block_commit_notembedded.result
            M  mysql-test/r/flush_read_lock_kill.result
            M  mysql-test/r/fulltext.result
            M  mysql-test/r/func_group.result
            M  mysql-test/r/func_math.result
            M  mysql-test/r/func_str.result
            M  mysql-test/r/gis.result
            M  mysql-test/r/grant.result
            M  mysql-test/r/grant2.result
            M  mysql-test/r/group_min_max.result
            M  mysql-test/r/information_schema.result
            M  mysql-test/r/information_schema_db.result
            M  mysql-test/r/innodb_gis.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/multi_update.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqldump-max.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/mysqltest.result
            M  mysql-test/r/ndb_gis.result
            M  mysql-test/r/ndb_restore.result
            M  mysql-test/r/ndb_restore_print.result
            M  mysql-test/r/openssl_1.result
            M  mysql-test/r/packet.result
            M  mysql-test/r/preload.result
            M  mysql-test/r/ps.result
            M  mysql-test/r/read_only.result
            M  mysql-test/r/repair.result
            M  mysql-test/r/row.result
            M  mysql-test/r/rpl_failed_optimize.result
            M  mysql-test/r/select.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-security.result
            M  mysql-test/r/sp.result
            M  mysql-test/r/subselect.result
            M  mysql-test/r/synchronization.result
            M  mysql-test/r/trigger-compat.result
            M  mysql-test/r/type_float.result
            M  mysql-test/r/union.result
            M  mysql-test/r/variables.result
            M  mysql-test/r/view.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/r/windows.result
            M  mysql-test/suite/funcs_1/r/innodb_func_view.result
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/funcs_1/r/memory_func_view.result
            M  mysql-test/suite/funcs_1/r/memory_views.result
            M  mysql-test/suite/funcs_1/r/myisam_func_view.result
            M  mysql-test/suite/funcs_1/r/myisam_views.result
            M  mysql-test/t/alter_table-big.test
            M  mysql-test/t/backup.test
            M  mysql-test/t/check.test
            M  mysql-test/t/compress.test
            M  mysql-test/t/connect.test
            M  mysql-test/t/consistent_snapshot.test
            M  mysql-test/t/ctype_collate.test
            M  mysql-test/t/dirty_close.test
            M  mysql-test/t/explain.test
            M  mysql-test/t/federated.test
            M  mysql-test/t/flush_block_commit.test
            M  mysql-test/t/flush_block_commit_notembedded.test
            M  mysql-test/t/flush_read_lock_kill.test
            M  mysql-test/t/fulltext.test
            M  mysql-test/t/func_math.test
            M  mysql-test/t/func_str.test
            M  mysql-test/t/gis.test
            M  mysql-test/t/grant.test
            M  mysql-test/t/grant2.test
            M  mysql-test/t/group_min_max.test
            M  mysql-test/t/information_schema.test
            M  mysql-test/t/init_connect.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/multi_update.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqldump-compat.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/ndb_autodiscover.test
            M  mysql-test/t/overflow.test
            M  mysql-test/t/packet.test
            M  mysql-test/t/ps.test
            M  mysql-test/t/query_cache_notembedded.test
            M  mysql-test/t/read_only.test
            M  mysql-test/t/row.test
            M  mysql-test/t/rpl_trigger.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/sp-security.test
            M  mysql-test/t/sp-threads.test
            M  mysql-test/t/sp_notembedded.test
            M  mysql-test/t/ssl-big.test
            M  mysql-test/t/ssl.test
            M  mysql-test/t/ssl_compress.test
            M  mysql-test/t/status.test
            M  mysql-test/t/subselect.test
            M  mysql-test/t/synchronization.test
            M  mysql-test/t/timezone_grant.test
            M  mysql-test/t/trigger-compat.test
            M  mysql-test/t/type_bit_innodb.test
            M  mysql-test/t/type_float.test
            M  mysql-test/t/union.test
            M  mysql-test/t/user_limits.test
            M  mysql-test/t/variables.test
            M  mysql-test/t/view.test
            M  mysql-test/t/view_grant.test
            M  mysql-test/t/wait_timeout.test
            M  mysql-test/t/windows.test
            M  mysql-test/t/xa.test
            M  mysys/base64.c
            M  mysys/default.c
            M  mysys/errors.c
            M  mysys/md5.c
            M  mysys/mf_iocache2.c
            M  mysys/my_fstream.c
            M  mysys/my_new.cc
            M  mysys/my_pread.c
            M  mysys/my_static.c
            M  mysys/my_write.c
            M  mysys/safemalloc.c
            M  mysys/string.c
            M  scripts/mysqldumpslow.sh
            M  server-tools/instance-manager/buffer.cc
            M  server-tools/instance-manager/commands.cc
            M  server-tools/instance-manager/instance.cc
            M  server-tools/instance-manager/instance_map.cc
            M  server-tools/instance-manager/instance_options.cc
            M  server-tools/instance-manager/listener.cc
            M  server-tools/instance-manager/mysql_connection.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/parse.cc
            M  server-tools/instance-manager/parse.h
            M  server-tools/instance-manager/parse_output.cc
            M  server-tools/instance-manager/protocol.cc
            M  server-tools/instance-manager/user_map.cc
            M  sql-common/client.c
            M  sql-common/my_user.c
            M  sql/gen_lex_hash.cc
            M  sql/ha_archive.cc
            M  sql/ha_federated.cc
            M  sql/ha_innodb.cc
            M  sql/handler.cc
            M  sql/item.cc
            M  sql/item.h
            M  sql/item_cmpfunc.cc
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_strfunc.h
            M  sql/item_sum.cc
            M  sql/item_timefunc.cc
            M  sql/lock.cc
            M  sql/log.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/mysqld.cc
            M  sql/net_serv.cc
            M  sql/opt_range.cc
            M  sql/opt_sum.cc
            M  sql/parse_file.cc
            M  sql/protocol.cc
            M  sql/set_var.cc
            M  sql/slave.cc
            M  sql/sp.cc
            M  sql/sp_head.cc
            M  sql/spatial.cc
            M  sql/sql_acl.cc
            M  sql/sql_base.cc
            M  sql/sql_cache.cc
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_crypt.cc
            M  sql/sql_db.cc
            M  sql/sql_derived.cc
            M  sql/sql_error.cc
            M  sql/sql_handler.cc
            M  sql/sql_help.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_load.cc
            M  sql/sql_parse.cc
            M  sql/sql_prepare.cc
            M  sql/sql_repl.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_trigger.cc
            M  sql/sql_udf.cc
            M  sql/sql_update.cc
            M  sql/sql_view.cc
            M  sql/sql_yacc.yy
            M  sql/table.cc
            M  sql/tztime.cc
            M  sql/udf_example.c
            M  sql/uniques.cc
            M  sql/unireg.cc
            M  strings/Makefile.am
            M  strings/ctype-mb.c
            M  strings/ctype-simple.c
            M  strings/ctype-ucs2.c
            M  strings/my_vsnprintf.c
            M  strings/xml.c
            M  tests/bug25714.c
            M  tests/mysql_client_test.c
            M  tools/mysqlmanager.c
            M  vio/viosocket.c
        1810.3866.5 Narayanan V	2009-03-20 [merge]
                    merging with mysql-5.0-bugteam

            M  strings/Makefile.am
            1810.3869.1 Narayanan V	2009-03-11
                        Bug#42937 strings/CHARSET_INFO.txt not included in source distributions
                        
                        The reference manual has instructions for adding new character
                        sets, and refers to the string/CHARSET_INFO.txt file. This file
                        is currently not present in the distribution.
                        
                        Modify the build to include this file in the distribution.
                 @ strings/Makefile.am
                    modify EXTRA_DIST to include the CHARSET_INFO file.

                M  strings/Makefile.am
        1810.3866.4 Davi Arnaut	2009-03-19
                    Bug#43461: invalid comparison with string literal in default.c
                    
                    Don't compare string literals as it results in unspecified behavior.
             @ mysys/default.c
                Test for a empty string.

            M  mysys/default.c
            M  mysys/my_new.cc
            M  sql/sql_class.cc
        1810.3866.3 Ignacio Galarza	2009-03-19 [merge]
                    auto-merge

            M  client/my_readline.h
            M  client/mysql.cc
            M  client/mysqldump.c
            M  client/readline.cc
            M  mysql-test/r/ctype_collate.result
            M  mysql-test/r/federated.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/union.result
            M  mysql-test/t/ctype_collate.test
            M  mysql-test/t/federated.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/union.test
            M  sql/item.cc
            M  sql/tztime.cc
            1810.3864.9 Bernt M. Johnsen	2009-03-19 [merge]
                        Bug#43329 merge from 5.0 GCA-branch

                M  mysql-test/r/union.result
                M  mysql-test/t/union.test
        1810.3866.2 Ignacio Galarza	2009-03-19 [merge]
                    auto-merge

            D  sql-bench/TODO
            A  mysql-test/include/master-slave-end.inc
            A  mysql-test/include/start_slave.inc
            A  mysql-test/include/stop_slave.inc
            A  mysql-test/include/wait_for_slave_sql_error.inc
            A  mysql-test/include/wait_for_slave_sql_error_and_skip.inc
            A  mysql-test/include/wait_show_condition.inc
            A  mysql-test/r/innodb_bug42419.result
            A  mysql-test/r/lowercase_utf8.result
            A  mysql-test/r/rpl_filter_tables_not_exist.result
            A  mysql-test/t/innodb_bug42419.test
            A  mysql-test/t/lowercase_utf8-master.opt
            A  mysql-test/t/lowercase_utf8.test
            A  mysql-test/t/rpl_filter_tables_not_exist-slave.opt
            A  mysql-test/t/rpl_filter_tables_not_exist.test
            M  CMakeLists.txt
            M  client/mysql.cc
            M  client/mysqldump.c
            M  client/mysqlmanager-pwgen.c
            M  client/sql_string.cc
            M  configure.in
            M  extra/perror.c
            M  include/config-win.h
            M  include/my_base.h
            M  include/my_global.h
            M  include/my_md5.h
            M  include/my_sys.h
            M  innobase/buf/buf0lru.c
            M  innobase/dict/dict0crea.c
            M  innobase/include/db0err.h
            M  innobase/include/rem0rec.h
            M  innobase/include/rem0rec.ic
            M  innobase/include/trx0undo.h
            M  innobase/row/row0mysql.c
            M  innobase/trx/trx0rec.c
            M  innobase/trx/trx0undo.c
            M  libmysql/libmysql.c
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/include/wait_until_count_sessions.inc
            M  mysql-test/r/archive_gis.result
            M  mysql-test/r/backup.result
            M  mysql-test/r/bdb_gis.result
            M  mysql-test/r/check.result
            M  mysql-test/r/consistent_snapshot.result
            M  mysql-test/r/dirty_close.result
            M  mysql-test/r/explain.result
            M  mysql-test/r/flush_block_commit.result
            M  mysql-test/r/flush_block_commit_notembedded.result
            M  mysql-test/r/flush_read_lock_kill.result
            M  mysql-test/r/fulltext.result
            M  mysql-test/r/func_group.result
            M  mysql-test/r/func_math.result
            M  mysql-test/r/func_str.result
            M  mysql-test/r/gis.result
            M  mysql-test/r/grant.result
            M  mysql-test/r/grant2.result
            M  mysql-test/r/group_min_max.result
            M  mysql-test/r/information_schema.result
            M  mysql-test/r/information_schema_db.result
            M  mysql-test/r/innodb_gis.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/multi_update.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqldump-max.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/mysqltest.result
            M  mysql-test/r/ndb_gis.result
            M  mysql-test/r/ndb_restore.result
            M  mysql-test/r/ndb_restore_print.result
            M  mysql-test/r/openssl_1.result
            M  mysql-test/r/packet.result
            M  mysql-test/r/preload.result
            M  mysql-test/r/ps.result
            M  mysql-test/r/read_only.result
            M  mysql-test/r/repair.result
            M  mysql-test/r/row.result
            M  mysql-test/r/rpl_failed_optimize.result
            M  mysql-test/r/select.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-security.result
            M  mysql-test/r/sp.result
            M  mysql-test/r/subselect.result
            M  mysql-test/r/synchronization.result
            M  mysql-test/r/trigger-compat.result
            M  mysql-test/r/type_float.result
            M  mysql-test/r/variables.result
            M  mysql-test/r/view.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/r/windows.result
            M  mysql-test/suite/funcs_1/r/innodb_func_view.result
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/funcs_1/r/memory_func_view.result
            M  mysql-test/suite/funcs_1/r/memory_views.result
            M  mysql-test/suite/funcs_1/r/myisam_func_view.result
            M  mysql-test/suite/funcs_1/r/myisam_views.result
            M  mysql-test/t/alter_table-big.test
            M  mysql-test/t/backup.test
            M  mysql-test/t/check.test
            M  mysql-test/t/compress.test
            M  mysql-test/t/connect.test
            M  mysql-test/t/consistent_snapshot.test
            M  mysql-test/t/dirty_close.test
            M  mysql-test/t/explain.test
            M  mysql-test/t/flush_block_commit.test
            M  mysql-test/t/flush_block_commit_notembedded.test
            M  mysql-test/t/flush_read_lock_kill.test
            M  mysql-test/t/fulltext.test
            M  mysql-test/t/func_math.test
            M  mysql-test/t/func_str.test
            M  mysql-test/t/gis.test
            M  mysql-test/t/grant.test
            M  mysql-test/t/grant2.test
            M  mysql-test/t/group_min_max.test
            M  mysql-test/t/information_schema.test
            M  mysql-test/t/init_connect.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/multi_update.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqldump-compat.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/ndb_autodiscover.test
            M  mysql-test/t/overflow.test
            M  mysql-test/t/packet.test
            M  mysql-test/t/ps.test
            M  mysql-test/t/query_cache_notembedded.test
            M  mysql-test/t/read_only.test
            M  mysql-test/t/row.test
            M  mysql-test/t/rpl_trigger.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/sp-security.test
            M  mysql-test/t/sp-threads.test
            M  mysql-test/t/sp_notembedded.test
            M  mysql-test/t/ssl-big.test
            M  mysql-test/t/ssl.test
            M  mysql-test/t/ssl_compress.test
            M  mysql-test/t/status.test
            M  mysql-test/t/subselect.test
            M  mysql-test/t/synchronization.test
            M  mysql-test/t/timezone_grant.test
            M  mysql-test/t/trigger-compat.test
            M  mysql-test/t/type_bit_innodb.test
            M  mysql-test/t/type_float.test
            M  mysql-test/t/user_limits.test
            M  mysql-test/t/variables.test
            M  mysql-test/t/view.test
            M  mysql-test/t/view_grant.test
            M  mysql-test/t/wait_timeout.test
            M  mysql-test/t/windows.test
            M  mysql-test/t/xa.test
            M  mysys/errors.c
            M  mysys/md5.c
            M  mysys/my_fstream.c
            M  mysys/my_pread.c
            M  mysys/my_write.c
            M  scripts/mysqldumpslow.sh
            M  sql/ha_innodb.cc
            M  sql/item.cc
            M  sql/item.h
            M  sql/item_cmpfunc.cc
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_sum.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/mysqld.cc
            M  sql/opt_range.cc
            M  sql/protocol.cc
            M  sql/sql_acl.cc
            M  sql/sql_base.cc
            M  sql/sql_cache.cc
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_handler.cc
            M  sql/sql_parse.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_update.cc
            M  sql/sql_yacc.yy
            M  sql/table.cc
            M  tests/mysql_client_test.c
            M  tools/mysqlmanager.c
    2555.345.22 Leonard Zhou	2009-03-24 [merge]
                Merge

        D  mysql-test/suite/sys_vars/r/event_scheduler_func.result
        D  mysql-test/suite/sys_vars/t/event_scheduler_func.test
        M  mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
        M  mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
        M  mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
        M  mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
        M  mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
        M  mysql-test/suite/sys_vars/r/interactive_timeout_func.result
        M  mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
        M  mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
        M  mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
        M  mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
        M  mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
        M  mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
        M  mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
        M  mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
        M  mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
        M  mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
        M  mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
        M  mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
        M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
        M  mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
        M  mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result
        M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
        M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
        M  mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
        M  mysql-test/suite/sys_vars/r/slow_query_log_func.result
        M  mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
        M  mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
        M  mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
        M  mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
        M  mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
        M  mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
        M  mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
        M  mysql-test/suite/sys_vars/t/interactive_timeout_func.test
        M  mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
        M  mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
        M  mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test
        M  mysql-test/suite/sys_vars/t/slow_query_log_func.test
        M  mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
        M  mysql-test/suite/sys_vars/t/timestamp_func.test
        M  mysql-test/suite/sys_vars/t/wait_timeout_func.test
         2555.368.2 Horst Hunger	2009-03-24 [merge]
                    Merge to be able to push.

            A  mysql-test/r/lock_multi_bug38499.result
            A  mysql-test/r/lock_multi_bug38691.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
            A  mysql-test/t/lock_multi_bug38499.test
            A  mysql-test/t/lock_multi_bug38691.test
            M  client/mysql.cc
            M  client/mysqladmin.cc
            M  client/mysqlbinlog.cc
            M  client/mysqlcheck.c
            M  client/mysqldump.c
            M  client/mysqlslap.c
            M  client/mysqltest.cc
            M  client/sql_string.cc
            M  extra/comp_err.c
            M  extra/yassl/src/buffer.cpp
            M  extra/yassl/taocrypt/include/block.hpp
            M  extra/yassl/taocrypt/src/algebra.cpp
            M  extra/yassl/taocrypt/src/asn.cpp
            M  include/config-win.h
            M  libmysql/libmysql.c
            M  mysql-test/lib/My/SafeProcess/safe_process.cc
            M  mysql-test/r/index_merge_myisam.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/union.result
            M  mysql-test/suite/rpl/r/rpl_slave_load_in.result
            M  mysql-test/suite/rpl/t/disabled.def
            M  mysql-test/suite/rpl/t/rpl_slave_load_in.test
            M  mysql-test/suite/sys_vars/t/concurrent_insert_func.test
            M  mysql-test/t/index_merge_myisam.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/union.test
            M  mysys/array.c
            M  mysys/base64.c
            M  mysys/charset.c
            M  mysys/checksum.c
            M  mysys/default.c
            M  mysys/default_modify.c
            M  mysys/hash.c
            M  mysys/mf_keycache.c
            M  mysys/mf_tempdir.c
            M  mysys/my_append.c
            M  mysys/my_compress.c
            M  mysys/my_conio.c
            M  mysys/my_copy.c
            M  mysys/my_getwd.c
            M  mysys/my_pread.c
            M  mysys/my_quick.c
            M  mysys/my_read.c
            M  mysys/safemalloc.c
            M  mysys/string.c
            M  server-tools/instance-manager/buffer.cc
            M  server-tools/instance-manager/instance.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/parse.h
            M  sql-common/client.c
            M  sql-common/my_user.c
            M  sql/event_data_objects.cc
            M  sql/event_parse_data.cc
            M  sql/events.cc
            M  sql/gen_lex_hash.cc
            M  sql/item.h
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_timefunc.cc
            M  sql/lock.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/log_event_old.cc
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/net_serv.cc
            M  sql/opt_range.cc
            M  sql/set_var.cc
            M  sql/set_var.h
            M  sql/slave.cc
            M  sql/sp_head.h
            M  sql/spatial.h
            M  sql/sql_cache.cc
            M  sql/sql_class.h
            M  sql/sql_connect.cc
            M  sql/sql_crypt.cc
            M  sql/sql_error.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_lex.h
            M  sql/sql_load.cc
            M  sql/sql_prepare.cc
            M  sql/sql_profile.cc
            M  sql/sql_repl.cc
            M  sql/sql_select.h
            M  sql/sql_servers.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_trigger.cc
            M  sql/sql_udf.cc
            M  sql/sql_view.cc
            M  sql/strfunc.cc
            M  sql/tztime.cc
            M  sql/udf_example.c
            M  sql/uniques.cc
            M  storage/archive/azio.c
            M  storage/archive/azlib.h
            M  storage/csv/ha_tina.cc
            M  storage/csv/ha_tina.h
            M  storage/csv/transparent_file.cc
            M  storage/csv/transparent_file.h
            M  storage/federated/ha_federated.cc
            M  storage/federated/ha_federated.h
            M  storage/heap/hp_write.c
            M  storage/innobase/handler/ha_innodb.cc
            M  storage/innobase/include/pars0pars.h
            M  storage/myisam/ha_myisam.cc
            M  storage/myisam/mi_check.c
            M  storage/myisam/mi_packrec.c
            M  storage/myisam/mi_search.c
            M  storage/myisam/rt_index.c
            M  storage/myisammrg/ha_myisammrg.cc
            M  strings/ctype.c
            M  strings/my_vsnprintf.c
            M  tests/bug25714.c
            M  tests/mysql_client_test.c
         2555.368.1 Horst Hunger	2009-03-20
                    Reviewed fix for bug#37962 also including the revised result files for failing system variable tests.

            D  mysql-test/suite/sys_vars/r/event_scheduler_func.result
            D  mysql-test/suite/sys_vars/t/event_scheduler_func.test
            M  mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
            M  mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
            M  mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
            M  mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
            M  mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
            M  mysql-test/suite/sys_vars/r/interactive_timeout_func.result
            M  mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
            M  mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
            M  mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
            M  mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
            M  mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
            M  mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
            M  mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
            M  mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
            M  mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
            M  mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
            M  mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
            M  mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
            M  mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result
            M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
            M  mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
            M  mysql-test/suite/sys_vars/r/slow_query_log_func.result
            M  mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
            M  mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
            M  mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
            M  mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
            M  mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
            M  mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
            M  mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
            M  mysql-test/suite/sys_vars/t/interactive_timeout_func.test
            M  mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
            M  mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
            M  mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test
            M  mysql-test/suite/sys_vars/t/slow_query_log_func.test
            M  mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
            M  mysql-test/suite/sys_vars/t/timestamp_func.test
            M  mysql-test/suite/sys_vars/t/wait_timeout_func.test
    2555.345.21 Leonard Zhou	2009-03-24 [merge]
                Merge

        M  storage/csv/ha_tina.cc
        M  storage/csv/ha_tina.h
        M  storage/csv/transparent_file.cc
        M  storage/csv/transparent_file.h
         2555.367.1 Sergey Glukhov	2009-03-24
                    compiler warning fix
             @ storage/csv/ha_tina.cc
                compiler warning fix
             @ storage/csv/ha_tina.h
                compiler warning fix
             @ storage/csv/transparent_file.cc
                compiler warning fix
             @ storage/csv/transparent_file.h
                compiler warning fix

            M  storage/csv/ha_tina.cc
            M  storage/csv/ha_tina.h
            M  storage/csv/transparent_file.cc
            M  storage/csv/transparent_file.h
    2555.345.20 Leonard Zhou	2009-03-24 [merge]
                Merge

        M  mysql-test/suite/rpl/r/rpl_timezone.result
        M  mysql-test/suite/rpl/t/rpl_timezone.test
        M  sql/sql_insert.cc
        1810.3852.8 Leonard Zhou	2009-03-24
                    BUG#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging
                    
                    When do 'insert delayed' operation, the time_zone info doesn't be keeped in the row info.
                    So when we do insert sometime later, time_zone didn't write into binlog.
                    This will cause wrong result for timestamp column in slave.
                    
                    Our solution is that adding time_zone info with the delayed-row and
                    restoring time_zone from row-info when execute that row in the furture by another thread.
                    So we can write correct time_zone info into binlog and got correct result in slave.
             @ mysql-test/r/rpl_timezone.result
                Test result
             @ mysql-test/t/rpl_timezone.test
                Add test for bug#41719
             @ sql/sql_insert.cc
                Add time_zone info in the delayed-row and restore time_zone when execute the row in the furture by another thread.

            M  mysql-test/r/rpl_timezone.result
            M  mysql-test/t/rpl_timezone.test
            M  sql/sql_insert.cc
    2555.345.19 Matthias Leich	2009-03-23 [merge]
                Merge 5.0 -> 5.1 of fix for the bugs 43015 and 43065

        A  mysql-test/r/lock_multi_bug38499.result
        A  mysql-test/r/lock_multi_bug38691.result
        A  mysql-test/t/lock_multi_bug38499.test
        A  mysql-test/t/lock_multi_bug38691.test
        M  mysql-test/r/lock_multi.result
        M  mysql-test/t/lock_multi.test
        1810.3868.1 Matthias Leich	2009-03-23
                    Fix for Bug#43015 and Bug#43065
                    
                       Details for Bug#43015 main.lock_multi: Weak code (sleeps etc.)
                       -------------------------------------------------------------
                       - The fix for bug 42003 already removed a lot of the weaknesses mentioned.
                       - Tests showed that there are unfortunately no improvements of this tests
                         in MySQL 5.1 which could be ported back to 5.0.
                       - Remove a superfluous "--sleep 1" around line 195
                    
                       Details for Bug#43065 main.lock_multi: This test is too big if the disk is slow
                       -------------------------------------------------------------------------------
                       - move the subtests for the bugs 38499 and 36691 into separate scripts
                       - runtime under excessive parallel I/O load after applying the fix
                         lock_multi           [ pass ]          22887
                         lock_multi_bug38499  [ pass ]         536926
                         lock_multi_bug38691  [ pass ]         258498

            A  mysql-test/r/lock_multi_bug38499.result
            A  mysql-test/r/lock_multi_bug38691.result
            A  mysql-test/t/lock_multi_bug38499.test
            A  mysql-test/t/lock_multi_bug38691.test
            M  mysql-test/r/lock_multi.result
            M  mysql-test/t/lock_multi.test
    2555.345.18 Georgi Kodinov	2009-03-23
                Disabled the failing test case until bug #43440 is resolved

        M  mysql-test/suite/rpl/t/disabled.def
    2555.345.17 Georgi Kodinov	2009-03-23 [merge]
                merged 5.1-main -> 5.1-bugteam

        M  client/mysqltest.cc
        M  mysql-test/lib/My/SafeProcess/safe_process.cc
        2555.336.17 Alexander Nozdrin	2009-03-19
                    Fix default.conf

            M  .bzr-mysql/default.conf
        2555.336.16 Magnus Svensson	2009-03-19 [merge]
                    Merge

            M  client/mysqltest.cc
             2555.366.1 Magnus Svensson	2009-03-13
                        Bug#43361 msyql_client_test output lost
                         - Print the output(if any) from the command that failed, in many 
                           cases this will make it possible to immediately see what went wrong.

                M  client/mysqltest.cc
        2555.336.15 Bjorn Munch	2009-03-18 [merge]
                    merge from main

            D  mysql-test/include/wait_for_query_to_suceed.inc
            D  mysql-test/suite/sys_vars/t/completion_type_func-master.opt
            D  sql-bench/TODO
            A  mysql-test/include/wait_for_query_to_succeed.inc
            A  mysql-test/include/wait_show_condition.inc
            A  mysql-test/r/innodb_bug42419.result
            A  mysql-test/r/lowercase_utf8.result
            A  mysql-test/suite/binlog/r/binlog_sql_mode.result
            A  mysql-test/suite/binlog/t/binlog_sql_mode.test
            A  mysql-test/suite/rpl/r/rpl_drop_if_exists.result
            A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_in.result
            A  mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
            A  mysql-test/suite/rpl/t/rpl_drop_if_exists.test
            A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
            A  mysql-test/suite/rpl/t/rpl_slave_load_in.test
            A  mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
            A  mysql-test/t/innodb_bug42419.test
            A  mysql-test/t/lowercase_utf8-master.opt
            A  mysql-test/t/lowercase_utf8.test
            A  storage/ibmdb2i/
            A  storage/ibmdb2i/CMakeLists.txt
            A  storage/ibmdb2i/Makefile.am
            A  storage/ibmdb2i/db2i_blobCollection.cc
            A  storage/ibmdb2i/db2i_blobCollection.h
            A  storage/ibmdb2i/db2i_charsetSupport.cc
            A  storage/ibmdb2i/db2i_charsetSupport.h
            A  storage/ibmdb2i/db2i_collationSupport.cc
            A  storage/ibmdb2i/db2i_collationSupport.h
            A  storage/ibmdb2i/db2i_constraints.cc
            A  storage/ibmdb2i/db2i_conversion.cc
            A  storage/ibmdb2i/db2i_errors.cc
            A  storage/ibmdb2i/db2i_errors.h
            A  storage/ibmdb2i/db2i_file.cc
            A  storage/ibmdb2i/db2i_file.h
            A  storage/ibmdb2i/db2i_global.h
            A  storage/ibmdb2i/db2i_iconv.h
            A  storage/ibmdb2i/db2i_ileBridge.cc
            A  storage/ibmdb2i/db2i_ileBridge.h
            A  storage/ibmdb2i/db2i_ioBuffers.cc
            A  storage/ibmdb2i/db2i_ioBuffers.h
            A  storage/ibmdb2i/db2i_misc.h
            A  storage/ibmdb2i/db2i_myconv.cc
            A  storage/ibmdb2i/db2i_myconv.h
            A  storage/ibmdb2i/db2i_rir.cc
            A  storage/ibmdb2i/db2i_safeString.h
            A  storage/ibmdb2i/db2i_sqlStatementStream.cc
            A  storage/ibmdb2i/db2i_sqlStatementStream.h
            A  storage/ibmdb2i/db2i_validatedPointer.h
            A  storage/ibmdb2i/ha_ibmdb2i.cc
            A  storage/ibmdb2i/ha_ibmdb2i.h
            A  storage/ibmdb2i/plug.in
            M  .bzrignore
            M  CMakeLists.txt
            M  client/mysql.cc
            M  client/mysqldump.c
            M  client/mysqltest.cc
            M  client/sql_string.cc
            M  config/ac-macros/ha_ndbcluster.m4
            M  config/ac-macros/plugins.m4
            M  configure.in
            M  include/config-win.h
            M  include/my_getopt.h
            M  include/my_global.h
            M  include/my_md5.h
            M  include/my_sys.h
            M  libmysql/libmysql.c
            M  libmysqld/lib_sql.cc
            M  mysql-test/include/handler.inc
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/include/setup_fake_relay_log.inc
            M  mysql-test/include/wait_until_count_sessions.inc
            M  mysql-test/lib/My/CoreDump.pm
            M  mysql-test/lib/My/SafeProcess/safe_process_win.cc
            M  mysql-test/lib/mtr_gcov.pl
            M  mysql-test/mysql-test-run.pl
            M  mysql-test/r/archive_gis.result
            M  mysql-test/r/backup.result
            M  mysql-test/r/connect.result
            M  mysql-test/r/consistent_snapshot.result
            M  mysql-test/r/ddl_i18n_koi8r.result
            M  mysql-test/r/ddl_i18n_utf8.result
            M  mysql-test/r/dirty_close.result
            M  mysql-test/r/events_bugs.result
            M  mysql-test/r/explain.result
            M  mysql-test/r/flush_block_commit.result
            M  mysql-test/r/flush_block_commit_notembedded.result
            M  mysql-test/r/flush_read_lock_kill.result
            M  mysql-test/r/fulltext.result
            M  mysql-test/r/func_group.result
            M  mysql-test/r/func_math.result
            M  mysql-test/r/func_str.result
            M  mysql-test/r/gis.result
            M  mysql-test/r/grant.result
            M  mysql-test/r/group_by.result
            M  mysql-test/r/group_min_max.result
            M  mysql-test/r/handler_innodb.result
            M  mysql-test/r/handler_myisam.result
            M  mysql-test/r/information_schema.result
            M  mysql-test/r/information_schema_db.result
            M  mysql-test/r/innodb-autoinc.result
            M  mysql-test/r/innodb_gis.result
            M  mysql-test/r/lock.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/log_tables.result
            M  mysql-test/r/lowercase_table3.result
            M  mysql-test/r/merge.result
            M  mysql-test/r/multi_update.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqlcheck.result
            M  mysql-test/r/mysqldump-max.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/mysqltest.result
            M  mysql-test/r/openssl_1.result
            M  mysql-test/r/packet.result
            M  mysql-test/r/parser.result
            M  mysql-test/r/partition.result
            M  mysql-test/r/partition_error.result
            M  mysql-test/r/partition_mgm_err.result
            M  mysql-test/r/preload.result
            M  mysql-test/r/ps.result
            M  mysql-test/r/query_cache_debug.result
            M  mysql-test/r/query_cache_notembedded.result
            M  mysql-test/r/read_only.result
            M  mysql-test/r/repair.result
            M  mysql-test/r/row.result
            M  mysql-test/r/select.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-error.result
            M  mysql-test/r/sp-security.result
            M  mysql-test/r/sp.result
            M  mysql-test/r/sp_trans.result
            M  mysql-test/r/strict.result
            M  mysql-test/r/subselect.result
            M  mysql-test/r/synchronization.result
            M  mysql-test/r/system_mysql_db.result
            M  mysql-test/r/trigger-compat.result
            M  mysql-test/r/type_blob.result
            M  mysql-test/r/type_datetime.result
            M  mysql-test/r/type_float.result
            M  mysql-test/r/type_timestamp.result
            M  mysql-test/r/variables.result
            M  mysql-test/r/view.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/r/warnings.result
            M  mysql-test/r/windows.result
            M  mysql-test/suite/binlog/r/binlog_unsafe.result
            M  mysql-test/suite/binlog/t/binlog_unsafe.test
            M  mysql-test/suite/funcs_1/r/innodb_func_view.result
            M  mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
            M  mysql-test/suite/funcs_1/r/innodb_trig_0102.result
            M  mysql-test/suite/funcs_1/r/innodb_trig_0407.result
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
            M  mysql-test/suite/funcs_1/r/is_columns_memory.result
            M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
            M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
            M  mysql-test/suite/funcs_1/r/memory_func_view.result
            M  mysql-test/suite/funcs_1/r/memory_storedproc_08.result
            M  mysql-test/suite/funcs_1/r/memory_trig_0102.result
            M  mysql-test/suite/funcs_1/r/memory_trig_0407.result
            M  mysql-test/suite/funcs_1/r/memory_views.result
            M  mysql-test/suite/funcs_1/r/myisam_func_view.result
            M  mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
            M  mysql-test/suite/funcs_1/r/myisam_trig_0102.result
            M  mysql-test/suite/funcs_1/r/myisam_trig_0407.result
            M  mysql-test/suite/funcs_1/r/myisam_views.result
            M  mysql-test/suite/funcs_1/r/ndb_func_view.result
            M  mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
            M  mysql-test/suite/funcs_1/r/ndb_trig_0102.result
            M  mysql-test/suite/funcs_1/r/ndb_trig_0407.result
            M  mysql-test/suite/funcs_1/r/ndb_views.result
            M  mysql-test/suite/funcs_1/r/storedproc.result
            M  mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
            M  mysql-test/suite/funcs_1/t/storedproc.test
            M  mysql-test/suite/funcs_1/triggers/triggers_0102.inc
            M  mysql-test/suite/funcs_1/triggers/triggers_0407.inc
            M  mysql-test/suite/ndb/r/ndb_gis.result
            M  mysql-test/suite/ndb_team/t/ndb_autodiscover.test
            M  mysql-test/suite/parts/inc/partition_auto_increment.inc
            M  mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
            M  mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
            M  mysql-test/suite/parts/r/partition_alter1_1_innodb.result
            M  mysql-test/suite/parts/r/partition_alter1_1_myisam.result
            M  mysql-test/suite/parts/r/partition_alter2_1_innodb.result
            M  mysql-test/suite/parts/r/partition_alter2_1_myisam.result
            M  mysql-test/suite/parts/r/partition_alter2_2_innodb.result
            M  mysql-test/suite/parts/r/partition_alter2_2_myisam.result
            M  mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
            M  mysql-test/suite/parts/r/partition_auto_increment_ndb.result
            M  mysql-test/suite/parts/r/partition_basic_innodb.result
            M  mysql-test/suite/parts/r/partition_basic_myisam.result
            M  mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
            M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
            M  mysql-test/suite/rpl/r/rpl_row_until.result
            M  mysql-test/suite/rpl/r/rpl_sp.result
            M  mysql-test/suite/rpl/t/rpl_cross_version.test
            M  mysql-test/suite/rpl/t/rpl_row_until.test
            M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
            M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
            M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
            M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
            M  mysql-test/suite/sys_vars/r/completion_type_func.result
            M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
            M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
            M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
            M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
            M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
            M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
            M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
            M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
            M  mysql-test/suite/sys_vars/r/max_connections_basic.result
            M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
            M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
            M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
            M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
            M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
            M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
            M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
            M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
            M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
            M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
            M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
            M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
            M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
            M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
            M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
            M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
            M  mysql-test/suite/sys_vars/t/completion_type_func.test
            M  mysql-test/t/alter_table-big.test
            M  mysql-test/t/backup.test
            M  mysql-test/t/check.test
            M  mysql-test/t/compress.test
            M  mysql-test/t/connect.test
            M  mysql-test/t/consistent_snapshot.test
            M  mysql-test/t/ddl_i18n_koi8r.test
            M  mysql-test/t/ddl_i18n_utf8.test
            M  mysql-test/t/dirty_close.test
            M  mysql-test/t/disabled.def
            M  mysql-test/t/drop.test
            M  mysql-test/t/events_bugs.test
            M  mysql-test/t/explain.test
            M  mysql-test/t/flush_block_commit.test
            M  mysql-test/t/flush_block_commit_notembedded.test
            M  mysql-test/t/flush_read_lock_kill.test
            M  mysql-test/t/fulltext.test
            M  mysql-test/t/func_group.test
            M  mysql-test/t/func_math.test
            M  mysql-test/t/func_str.test
            M  mysql-test/t/gis.test
            M  mysql-test/t/grant.test
            M  mysql-test/t/group_by.test
            M  mysql-test/t/group_min_max.test
            M  mysql-test/t/information_schema.test
            M  mysql-test/t/init_connect.test
            M  mysql-test/t/innodb-autoinc.test
            M  mysql-test/t/innodb_mysql.test
            M  mysql-test/t/lock.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/log_tables.test
            M  mysql-test/t/lowercase_table3.test
            M  mysql-test/t/merge.test
            M  mysql-test/t/multi_update.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqldump-compat.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/overflow.test
            M  mysql-test/t/packet.test
            M  mysql-test/t/partition.test
            M  mysql-test/t/partition_error.test
            M  mysql-test/t/ps.test
            M  mysql-test/t/query_cache_28249.test
            M  mysql-test/t/query_cache_debug.test
            M  mysql-test/t/query_cache_notembedded.test
            M  mysql-test/t/read_only.test
            M  mysql-test/t/rename.test
            M  mysql-test/t/row.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/sp-security.test
            M  mysql-test/t/sp-threads.test
            M  mysql-test/t/sp_notembedded.test
            M  mysql-test/t/ssl-big.test
            M  mysql-test/t/ssl.test
            M  mysql-test/t/ssl_compress.test
            M  mysql-test/t/status.test
            M  mysql-test/t/strict.test
            M  mysql-test/t/subselect.test
            M  mysql-test/t/synchronization.test
            M  mysql-test/t/timezone_grant.test
            M  mysql-test/t/trigger-compat.test
            M  mysql-test/t/type_bit_innodb.test
            M  mysql-test/t/type_datetime.test
            M  mysql-test/t/type_float.test
            M  mysql-test/t/user_limits.test
            M  mysql-test/t/variables.test
            M  mysql-test/t/view.test
            M  mysql-test/t/view_grant.test
            M  mysql-test/t/wait_timeout.test
            M  mysql-test/t/windows.test
            M  mysql-test/t/xa.test
            M  mysys/default.c
            M  mysys/errors.c
            M  mysys/md5.c
            M  mysys/my_fstream.c
            M  mysys/my_getopt.c
            M  mysys/my_pread.c
            M  mysys/my_write.c
            M  plugin/Makefile.am
            M  scripts/mysql_system_tables.sql
            M  scripts/mysql_system_tables_fix.sql
            M  scripts/mysqldumpslow.sh
            M  sql-bench/test-create.sh
            M  sql-common/my_time.c
            M  sql/ha_partition.cc
            M  sql/handler.cc
            M  sql/item.cc
            M  sql/item.h
            M  sql/item_cmpfunc.cc
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_sum.cc
            M  sql/log.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/opt_range.cc
            M  sql/protocol.cc
            M  sql/rpl_record.cc
            M  sql/rpl_rli.cc
            M  sql/rpl_rli.h
            M  sql/set_var.cc
            M  sql/share/errmsg.txt
            M  sql/sp.cc
            M  sql/sql_base.cc
            M  sql/sql_cache.cc
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_handler.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_lex.h
            M  sql/sql_load.cc
            M  sql/sql_parse.cc
            M  sql/sql_plugin.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_view.cc
            M  sql/sql_yacc.yy
            M  sql/table.cc
            M  sql/unireg.cc
            M  storage/Makefile.am
            M  storage/innobase/btr/btr0sea.c
            M  storage/innobase/dict/dict0load.c
            M  storage/innobase/handler/ha_innodb.cc
            M  storage/innobase/include/rem0rec.h
            M  storage/innobase/include/rem0rec.ic
            M  storage/innobase/include/trx0roll.h
            M  storage/innobase/lock/lock0lock.c
            M  storage/innobase/trx/trx0roll.c
            M  storage/innobase/trx/trx0trx.c
            M  storage/myisam/ha_myisam.cc
            M  storage/myisam/mi_locking.c
            M  storage/myisam/myisamchk.c
            M  storage/myisam/myisamdef.h
            M  storage/myisammrg/ha_myisammrg.cc
            M  storage/myisammrg/ha_myisammrg.h
            M  storage/myisammrg/myrg_open.c
            M  support-files/my-huge.cnf.sh
            M  support-files/my-large.cnf.sh
            M  support-files/my-medium.cnf.sh
            M  support-files/my-small.cnf.sh
            M  tests/mysql_client_test.c
        2555.336.14 Bjorn Munch	2009-03-12
                    Bug #43597 Fix for Bug 43410 breaks build on Power Mac due to incomplete sys/resource.h
                    Added include of sys/time.h

            M  mysql-test/lib/My/SafeProcess/safe_process.cc
        2555.336.13 Bjorn Munch	2009-03-11 [merge]
                    back-merge of merge to main

        2555.336.12 Bjorn Munch	2009-03-11
                    Bug #43532 mtr should not rely on diff to report test results
                    mtr on Windows does not give decent diff due to missing diff install
                    Modified to look for 'mtrdiff' if diff not available.

            M  client/mysqltest.cc
    2555.345.16 Tatiana A. Nurnberg	2009-03-23 [merge]
                auto-merge

        A  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
        A  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
        A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
        A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
        A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt
        A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
        M  mysql-test/suite/rpl/r/rpl_slave_load_in.result
        M  mysql-test/suite/rpl/t/rpl_slave_load_in.test
        M  sql/log_event.cc
        M  sql/slave.cc
         2555.365.2 Alfranio Correia	2009-03-23
                    Post-fix BUG#42861.

            M  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
            M  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
            M  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
            M  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
         2555.365.1 Alfranio Correia	2009-03-22 [merge]
                    auto-merge 5.1-bugteam (local) --> 5.1-bugteam

            A  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
            M  mysql-test/suite/rpl/r/rpl_slave_load_in.result
            M  mysql-test/suite/rpl/t/rpl_slave_load_in.test
            M  sql/log_event.cc
            M  sql/slave.cc
         2555.364.1 Alfranio Correia	2009-03-18
                    Bug #42861 Assigning invalid directories to --slave-load-tmpdir crashes the slave
                    
                    Compiling with debug and assigning an invalid directory to --slave-load-tmpdir
                    was crashing the slave due to the following assertion DBUG_ASSERT(! is_set() ||
                    can_overwrite_status). This assertion assumes that a thread can change its
                    state once (i.e. ok,error, etc) before aborting, cleaning/resuming or completing
                    its execution unless the overwrite flag (i.e. can_overwrite_status) is true.
                    
                    The Append_block_log_event::do_apply_event which is responsible for creating
                    temporary file(s) was not cleaning the thread state. Thus a failure while
                    trying to create a file in an invalid temporary directory was causing the crash.
                    
                    To fix the problem we check if the temporary directory is valid before starting
                    the SQL Thread and reset the thread state before creating a file in
                    Append_block_log_event::do_apply_event.

            A  mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt
            A  mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
            M  mysql-test/suite/rpl/r/rpl_slave_load_in.result
            M  mysql-test/suite/rpl/t/rpl_slave_load_in.test
            M  sql/log_event.cc
            M  sql/slave.cc
    2555.345.15 Tatiana A. Nurnberg	2009-03-23 [merge]
                auto-merge

        M  client/mysql.cc
        1810.3867.1 Tatiana A. Nurnberg	2009-03-23
                    Bug#43254: SQL_SELECT_LIMIT=0 crashes command line client
                    
                    When asking what database is selected, client expected
                    to *always* get an answer from the server.
                    
                    We now handle failure more gracefully.
                    
                    See comments in ticket for a discussion of what happens,
                    and how things interlock.
             @ client/mysql.cc
                Handle empty result-sets gracefully, as opposed
                to just result sets with n>0 items that may themselves
                be empty.

            M  client/mysql.cc
    2555.345.14 Tatiana A. Nurnberg	2009-03-20 [merge]
                auto-merge

        M  client/mysql.cc
         2555.288.6 Tatiana A. Nurnberg	2009-03-19
                    Bug#43153: Version comment is too long
                    
                    mysql-client used static buffer to concatenate server-
                    version and version_comment. Sufficiently long comments
                    could get cut off. This was harmless, but looked daft.
                    
                    Now using a dynamic buffer instead.
             @ client/mysql.cc
                Use dynamic rather than static buffer for server
                information. If we can get both version and comment,
                concat them and use that. Otherwise, try to use just
                version. If that fails too, return empty string so
                overly trusting callers do not crash. Release memory
                as needed.

            M  client/mysql.cc
    2555.345.13 Tatiana A. Nurnberg	2009-03-20 [merge]
                auto-merge

        M  client/mysql_upgrade.c
        M  mysql-test/r/mysqlbinlog.result
        M  mysys/base64.c
        M  sql/log_event.cc
        M  sql/sql_cache.cc
        M  sql/sql_servers.cc
        M  sql/sql_view.cc
        M  storage/csv/transparent_file.cc
         2555.363.2 Georgi Kodinov	2009-03-20
                    Fixed the failing tests. Addendum to the fix for bug #22504.

            M  mysql-test/r/mysqlbinlog.result
         2555.363.1 Georgi Kodinov	2009-03-20
                    fixed compilation warnings. addendum to the fix for bug 29125

            M  client/mysql_upgrade.c
            M  mysys/base64.c
            M  sql/log_event.cc
            M  sql/sql_cache.cc
            M  sql/sql_servers.cc
            M  sql/sql_view.cc
            M  storage/csv/transparent_file.cc
    2555.345.12 Georgi Kodinov	2009-03-20
                Fixed a prototype to match the actual function signature (addendum to the
                fix for 29125).

        M  mysys/hash.c
    2555.345.11 Georgi Kodinov	2009-03-20
                reverting a bogus fix into 5.1-bugteam

        M  configure.in
        M  include/Makefile.am
    2555.345.10 Chad MILLER	2009-03-19 [merge]
                Merge contributed automake changes, and 5.1 upstream.

        M  client/mysql_upgrade.c
        M  client/mysqladmin.cc
        M  client/mysqlbinlog.cc
        M  client/mysqlcheck.c
        M  client/mysqldump.c
        M  client/mysqlslap.c
        M  client/mysqltest.cc
        M  client/sql_string.cc
        M  extra/comp_err.c
        M  extra/yassl/src/buffer.cpp
        M  extra/yassl/taocrypt/include/block.hpp
        M  extra/yassl/taocrypt/src/algebra.cpp
        M  extra/yassl/taocrypt/src/asn.cpp
        M  include/config-win.h
        M  libmysql/libmysql.c
        M  mysql-test/r/index_merge_myisam.result
        M  mysql-test/r/union.result
        M  mysql-test/t/index_merge_myisam.test
        M  mysql-test/t/union.test
        M  mysys/array.c
        M  mysys/base64.c
        M  mysys/charset.c
        M  mysys/checksum.c
        M  mysys/default.c
        M  mysys/default_modify.c
        M  mysys/hash.c
        M  mysys/mf_keycache.c
        M  mysys/mf_tempdir.c
        M  mysys/my_append.c
        M  mysys/my_compress.c
        M  mysys/my_conio.c
        M  mysys/my_copy.c
        M  mysys/my_getwd.c
        M  mysys/my_pread.c
        M  mysys/my_quick.c
        M  mysys/my_read.c
        M  mysys/safemalloc.c
        M  mysys/string.c
        M  server-tools/instance-manager/buffer.cc
        M  server-tools/instance-manager/instance.cc
        M  server-tools/instance-manager/options.cc
        M  server-tools/instance-manager/parse.h
        M  sql-common/client.c
        M  sql-common/my_user.c
        M  sql/event_data_objects.cc
        M  sql/event_parse_data.cc
        M  sql/events.cc
        M  sql/gen_lex_hash.cc
        M  sql/item.h
        M  sql/item_func.cc
        M  sql/item_strfunc.cc
        M  sql/item_timefunc.cc
        M  sql/lock.cc
        M  sql/log_event.cc
        M  sql/log_event.h
        M  sql/log_event_old.cc
        M  sql/mysql_priv.h
        M  sql/mysqld.cc
        M  sql/net_serv.cc
        M  sql/opt_range.cc
        M  sql/set_var.cc
        M  sql/set_var.h
        M  sql/sp_head.h
        M  sql/spatial.h
        M  sql/sql_class.h
        M  sql/sql_connect.cc
        M  sql/sql_crypt.cc
        M  sql/sql_error.cc
        M  sql/sql_insert.cc
        M  sql/sql_lex.cc
        M  sql/sql_lex.h
        M  sql/sql_load.cc
        M  sql/sql_prepare.cc
        M  sql/sql_profile.cc
        M  sql/sql_repl.cc
        M  sql/sql_select.h
        M  sql/sql_servers.cc
        M  sql/sql_string.cc
        M  sql/sql_table.cc
        M  sql/sql_trigger.cc
        M  sql/sql_udf.cc
        M  sql/sql_view.cc
        M  sql/strfunc.cc
        M  sql/udf_example.c
        M  sql/uniques.cc
        M  storage/archive/azio.c
        M  storage/archive/azlib.h
        M  storage/csv/ha_tina.cc
        M  storage/csv/ha_tina.h
        M  storage/csv/transparent_file.h
        M  storage/federated/ha_federated.cc
        M  storage/federated/ha_federated.h
        M  storage/heap/hp_write.c
        M  storage/innobase/handler/ha_innodb.cc
        M  storage/innobase/include/pars0pars.h
        M  storage/myisam/ha_myisam.cc
        M  storage/myisam/mi_check.c
        M  storage/myisam/mi_packrec.c
        M  storage/myisam/mi_search.c
        M  storage/myisam/rt_index.c
        M  storage/myisammrg/ha_myisammrg.cc
        M  strings/ctype.c
        M  strings/my_vsnprintf.c
        M  tests/bug25714.c
        M  tests/mysql_client_test.c
        2555.291.25 Sergey Petrunia	2009-03-19 [merge]
                    Merge

            M  client/mysql_upgrade.c
            M  client/mysqladmin.cc
            M  client/mysqlbinlog.cc
            M  client/mysqlcheck.c
            M  client/mysqldump.c
            M  client/mysqlslap.c
            M  client/mysqltest.cc
            M  client/sql_string.cc
            M  extra/comp_err.c
            M  extra/yassl/src/buffer.cpp
            M  extra/yassl/taocrypt/include/block.hpp
            M  extra/yassl/taocrypt/src/algebra.cpp
            M  extra/yassl/taocrypt/src/asn.cpp
            M  include/config-win.h
            M  libmysql/libmysql.c
            M  mysql-test/r/union.result
            M  mysql-test/t/union.test
            M  mysys/array.c
            M  mysys/base64.c
            M  mysys/charset.c
            M  mysys/checksum.c
            M  mysys/default.c
            M  mysys/default_modify.c
            M  mysys/hash.c
            M  mysys/mf_keycache.c
            M  mysys/mf_tempdir.c
            M  mysys/my_append.c
            M  mysys/my_compress.c
            M  mysys/my_conio.c
            M  mysys/my_copy.c
            M  mysys/my_getwd.c
            M  mysys/my_pread.c
            M  mysys/my_quick.c
            M  mysys/my_read.c
            M  mysys/safemalloc.c
            M  mysys/string.c
            M  server-tools/instance-manager/buffer.cc
            M  server-tools/instance-manager/instance.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/parse.h
            M  sql-common/client.c
            M  sql-common/my_user.c
            M  sql/event_data_objects.cc
            M  sql/event_parse_data.cc
            M  sql/events.cc
            M  sql/gen_lex_hash.cc
            M  sql/item.h
            M  sql/item_func.cc
            M  sql/item_strfunc.cc
            M  sql/item_timefunc.cc
            M  sql/lock.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/log_event_old.cc
            M  sql/net_serv.cc
            M  sql/sp_head.h
            M  sql/spatial.h
            M  sql/sql_class.h
            M  sql/sql_connect.cc
            M  sql/sql_crypt.cc
            M  sql/sql_error.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_lex.h
            M  sql/sql_load.cc
            M  sql/sql_prepare.cc
            M  sql/sql_profile.cc
            M  sql/sql_repl.cc
            M  sql/sql_servers.cc
            M  sql/sql_string.cc
            M  sql/sql_table.cc
            M  sql/sql_trigger.cc
            M  sql/sql_udf.cc
            M  sql/sql_view.cc
            M  sql/udf_example.c
            M  sql/uniques.cc
            M  storage/archive/azio.c
            M  storage/archive/azlib.h
            M  storage/csv/ha_tina.cc
            M  storage/csv/ha_tina.h
            M  storage/csv/transparent_file.h
            M  storage/federated/ha_federated.cc
            M  storage/federated/ha_federated.h
            M  storage/heap/hp_write.c
            M  storage/innobase/handler/ha_innodb.cc
            M  storage/innobase/include/pars0pars.h
            M  storage/myisam/ha_myisam.cc
            M  storage/myisam/mi_check.c
            M  storage/myisam/mi_packrec.c
            M  storage/myisam/mi_search.c
            M  storage/myisam/rt_index.c
            M  storage/myisammrg/ha_myisammrg.cc
            M  strings/ctype.c
            M  strings/my_vsnprintf.c
            M  tests/bug25714.c
            M  tests/mysql_client_test.c
             2555.288.5 Ignacio Galarza	2009-03-19 [merge]
                        auto-merge

                A  mysql-test/std_data/bug32880.ARN
                A  mysql-test/std_data/bug32880.ARZ
                A  mysql-test/std_data/bug32880.frm
                M  client/my_readline.h
                M  client/mysql.cc
                M  client/mysqldump.c
                M  client/readline.cc
                M  configure.in
                M  libmysqld/CMakeLists.txt
                M  libmysqld/examples/CMakeLists.txt
                M  mysql-test/include/concurrent.inc
                M  mysql-test/r/archive.result
                M  mysql-test/r/ctype_collate.result
                M  mysql-test/r/mysql.result
                M  mysql-test/r/union.result
                M  mysql-test/suite/federated/federated.result
                M  mysql-test/suite/federated/federated.test
                M  mysql-test/suite/funcs_1/r/is_columns_is.result
                M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
                M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
                M  mysql-test/suite/rpl/r/rpl_do_grant.result
                M  mysql-test/suite/rpl/r/rpl_loaddatalocal.result
                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/r/rpl_stm_log.result
                M  mysql-test/suite/rpl/t/rpl_do_grant.test
                M  mysql-test/suite/rpl/t/rpl_loaddatalocal.test
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
                M  mysql-test/suite/sys_vars/t/concurrent_insert_func.test
                M  mysql-test/t/archive.test
                M  mysql-test/t/ctype_collate.test
                M  mysql-test/t/disabled.def
                M  mysql-test/t/mysql.test
                M  mysql-test/t/union.test
                M  mysys/my_error.c
                M  scripts/mysqld_safe.sh
                M  sql/item.cc
                M  sql/log_event.cc
                M  sql/sql_parse.cc
                M  sql/sql_select.cc
                M  sql/table.cc
                M  sql/tztime.cc
                M  storage/archive/ha_archive.cc
                 2555.362.1 Bernt M. Johnsen	2009-03-19 [merge]
                            Bug#43329 merge from 5.1 GCA branch

                    M  mysql-test/r/union.result
                    M  mysql-test/t/union.test
                 2555.361.1 Bernt M. Johnsen	2009-03-19 [merge]
                            Bug#43329 Prepared for push on 5.1

                    M  mysql-test/r/union.result
                    M  mysql-test/t/union.test
                1810.3855.13 Bernt M. Johnsen	2009-03-18
                            Bug#43329 prepared for commit on 5.0

                    M  mysql-test/r/union.result
                    M  mysql-test/t/union.test
             2555.288.4 Ignacio Galarza	2009-03-19 [merge]
                        auto-merge

                M  config/ac-macros/ha_ndbcluster.m4
                M  config/ac-macros/plugins.m4
                M  include/my_sys.h
                M  mysql-test/include/concurrent.inc
                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/r/concurrent_innodb_safelog.result
                M  mysql-test/r/concurrent_innodb_unsafelog.result
                M  mysql-test/r/create.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/r/key_cache.result
                M  mysql-test/r/select.result
                M  mysql-test/r/variables.result
                M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
                M  mysql-test/suite/ndb/r/ndb_restore.result
                M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                M  mysql-test/suite/ndb/r/ndb_restore_print.result
                M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
                M  mysql-test/t/information_schema.test
                M  mysql-test/t/select.test
                M  mysql-test/t/variables.test
                M  mysys/default.c
                M  mysys/my_getopt.c
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/sql_plugin.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
             2555.288.3 Ignacio Galarza	2009-03-17 [merge]
                        auto-merge

                D  mysql-test/include/wait_for_query_to_suceed.inc
                D  mysql-test/suite/sys_vars/t/completion_type_func-master.opt
                D  sql-bench/TODO
                A  mysql-test/collections/
                A  mysql-test/collections/README
                A  mysql-test/collections/README.experimental
                A  mysql-test/collections/default.daily
                A  mysql-test/collections/default.experimental
                A  mysql-test/collections/default.push
                A  mysql-test/collections/default.weekly
                A  mysql-test/include/wait_for_query_to_succeed.inc
                A  mysql-test/include/wait_show_condition.inc
                A  mysql-test/r/innodb_bug42419.result
                A  mysql-test/r/lowercase_utf8.result
                A  mysql-test/suite/binlog/r/binlog_sql_mode.result
                A  mysql-test/suite/binlog/t/binlog_sql_mode.test
                A  mysql-test/suite/rpl/r/rpl_drop_if_exists.result
                A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
                A  mysql-test/suite/rpl/r/rpl_slave_load_in.result
                A  mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
                A  mysql-test/suite/rpl/t/rpl_drop_if_exists.test
                A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
                A  mysql-test/suite/rpl/t/rpl_slave_load_in.test
                A  mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
                A  mysql-test/t/innodb_bug42419.test
                A  mysql-test/t/lowercase_utf8-master.opt
                A  mysql-test/t/lowercase_utf8.test
                A  storage/ibmdb2i/
                A  storage/ibmdb2i/CMakeLists.txt
                A  storage/ibmdb2i/Makefile.am
                A  storage/ibmdb2i/db2i_blobCollection.cc
                A  storage/ibmdb2i/db2i_blobCollection.h
                A  storage/ibmdb2i/db2i_charsetSupport.cc
                A  storage/ibmdb2i/db2i_charsetSupport.h
                A  storage/ibmdb2i/db2i_collationSupport.cc
                A  storage/ibmdb2i/db2i_collationSupport.h
                A  storage/ibmdb2i/db2i_constraints.cc
                A  storage/ibmdb2i/db2i_conversion.cc
                A  storage/ibmdb2i/db2i_errors.cc
                A  storage/ibmdb2i/db2i_errors.h
                A  storage/ibmdb2i/db2i_file.cc
                A  storage/ibmdb2i/db2i_file.h
                A  storage/ibmdb2i/db2i_global.h
                A  storage/ibmdb2i/db2i_iconv.h
                A  storage/ibmdb2i/db2i_ileBridge.cc
                A  storage/ibmdb2i/db2i_ileBridge.h
                A  storage/ibmdb2i/db2i_ioBuffers.cc
                A  storage/ibmdb2i/db2i_ioBuffers.h
                A  storage/ibmdb2i/db2i_misc.h
                A  storage/ibmdb2i/db2i_myconv.cc
                A  storage/ibmdb2i/db2i_myconv.h
                A  storage/ibmdb2i/db2i_rir.cc
                A  storage/ibmdb2i/db2i_safeString.h
                A  storage/ibmdb2i/db2i_sqlStatementStream.cc
                A  storage/ibmdb2i/db2i_sqlStatementStream.h
                A  storage/ibmdb2i/db2i_validatedPointer.h
                A  storage/ibmdb2i/ha_ibmdb2i.cc
                A  storage/ibmdb2i/ha_ibmdb2i.h
                A  storage/ibmdb2i/plug.in
                M  .bzrignore
                M  CMakeLists.txt
                M  client/mysql.cc
                M  client/mysqldump.c
                M  client/mysqltest.cc
                M  client/sql_string.cc
                M  cmd-line-utils/libedit/makelist.sh
                M  cmd-line-utils/libedit/readline.c
                M  cmd-line-utils/libedit/readline/readline.h
                M  cmd-line-utils/libedit/vi.c
                M  config/ac-macros/plugins.m4
                M  configure.in
                M  include/config-win.h
                M  include/my_getopt.h
                M  include/my_global.h
                M  include/my_md5.h
                M  include/my_sys.h
                M  libmysql/libmysql.c
                M  libmysqld/lib_sql.cc
                M  mysql-test/Makefile.am
                M  mysql-test/include/check-warnings.test
                M  mysql-test/include/handler.inc
                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/include/setup_fake_relay_log.inc
                M  mysql-test/include/wait_until_count_sessions.inc
                M  mysql-test/lib/My/ConfigFactory.pm
                M  mysql-test/lib/My/CoreDump.pm
                M  mysql-test/lib/My/Platform.pm
                M  mysql-test/lib/My/SafeProcess.pm
                M  mysql-test/lib/My/SafeProcess/safe_process.cc
                M  mysql-test/lib/My/SafeProcess/safe_process_win.cc
                M  mysql-test/lib/mtr_gcov.pl
                M  mysql-test/lib/mtr_report.pm
                M  mysql-test/lib/mtr_unique.pm
                M  mysql-test/mysql-test-run.pl
                M  mysql-test/r/archive_gis.result
                M  mysql-test/r/backup.result
                M  mysql-test/r/connect.result
                M  mysql-test/r/consistent_snapshot.result
                M  mysql-test/r/ddl_i18n_koi8r.result
                M  mysql-test/r/ddl_i18n_utf8.result
                M  mysql-test/r/dirty_close.result
                M  mysql-test/r/events_bugs.result
                M  mysql-test/r/explain.result
                M  mysql-test/r/flush_block_commit.result
                M  mysql-test/r/flush_block_commit_notembedded.result
                M  mysql-test/r/flush_read_lock_kill.result
                M  mysql-test/r/fulltext.result
                M  mysql-test/r/func_group.result
                M  mysql-test/r/func_math.result
                M  mysql-test/r/func_str.result
                M  mysql-test/r/gis.result
                M  mysql-test/r/grant.result
                M  mysql-test/r/group_by.result
                M  mysql-test/r/group_min_max.result
                M  mysql-test/r/handler_innodb.result
                M  mysql-test/r/handler_myisam.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/r/information_schema_db.result
                M  mysql-test/r/innodb-autoinc.result
                M  mysql-test/r/innodb_gis.result
                M  mysql-test/r/lock.result
                M  mysql-test/r/lock_multi.result
                M  mysql-test/r/log_tables.result
                M  mysql-test/r/lowercase_table3.result
                M  mysql-test/r/merge.result
                M  mysql-test/r/multi_update.result
                M  mysql-test/r/mysql.result
                M  mysql-test/r/mysqlbinlog.result
                M  mysql-test/r/mysqlbinlog_row_trans.result
                M  mysql-test/r/mysqlcheck.result
                M  mysql-test/r/mysqldump-max.result
                M  mysql-test/r/mysqldump.result
                M  mysql-test/r/mysqltest.result
                M  mysql-test/r/openssl_1.result
                M  mysql-test/r/packet.result
                M  mysql-test/r/parser.result
                M  mysql-test/r/partition.result
                M  mysql-test/r/partition_error.result
                M  mysql-test/r/partition_mgm_err.result
                M  mysql-test/r/preload.result
                M  mysql-test/r/ps.result
                M  mysql-test/r/query_cache_debug.result
                M  mysql-test/r/query_cache_notembedded.result
                M  mysql-test/r/read_only.result
                M  mysql-test/r/repair.result
                M  mysql-test/r/row.result
                M  mysql-test/r/select.result
                M  mysql-test/r/show_check.result
                M  mysql-test/r/skip_name_resolve.result
                M  mysql-test/r/sp-error.result
                M  mysql-test/r/sp-security.result
                M  mysql-test/r/sp.result
                M  mysql-test/r/sp_trans.result
                M  mysql-test/r/strict.result
                M  mysql-test/r/subselect.result
                M  mysql-test/r/synchronization.result
                M  mysql-test/r/system_mysql_db.result
                M  mysql-test/r/trigger-compat.result
                M  mysql-test/r/type_blob.result
                M  mysql-test/r/type_datetime.result
                M  mysql-test/r/type_float.result
                M  mysql-test/r/type_timestamp.result
                M  mysql-test/r/variables.result
                M  mysql-test/r/view.result
                M  mysql-test/r/view_grant.result
                M  mysql-test/r/warnings.result
                M  mysql-test/r/windows.result
                M  mysql-test/suite/binlog/r/binlog_truncate_myisam.result
                M  mysql-test/suite/binlog/r/binlog_unsafe.result
                M  mysql-test/suite/binlog/t/binlog_truncate_innodb.test
                M  mysql-test/suite/binlog/t/binlog_truncate_myisam.test
                M  mysql-test/suite/binlog/t/binlog_unsafe.test
                M  mysql-test/suite/funcs_1/r/innodb_func_view.result
                M  mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
                M  mysql-test/suite/funcs_1/r/innodb_trig_0102.result
                M  mysql-test/suite/funcs_1/r/innodb_trig_0407.result
                M  mysql-test/suite/funcs_1/r/innodb_views.result
                M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
                M  mysql-test/suite/funcs_1/r/is_columns_memory.result
                M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
                M  mysql-test/suite/funcs_1/r/memory_func_view.result
                M  mysql-test/suite/funcs_1/r/memory_storedproc_08.result
                M  mysql-test/suite/funcs_1/r/memory_trig_0102.result
                M  mysql-test/suite/funcs_1/r/memory_trig_0407.result
                M  mysql-test/suite/funcs_1/r/memory_views.result
                M  mysql-test/suite/funcs_1/r/myisam_func_view.result
                M  mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
                M  mysql-test/suite/funcs_1/r/myisam_trig_0102.result
                M  mysql-test/suite/funcs_1/r/myisam_trig_0407.result
                M  mysql-test/suite/funcs_1/r/myisam_views.result
                M  mysql-test/suite/funcs_1/r/ndb_func_view.result
                M  mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
                M  mysql-test/suite/funcs_1/r/ndb_trig_0102.result
                M  mysql-test/suite/funcs_1/r/ndb_trig_0407.result
                M  mysql-test/suite/funcs_1/r/ndb_views.result
                M  mysql-test/suite/funcs_1/r/storedproc.result
                M  mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
                M  mysql-test/suite/funcs_1/t/storedproc.test
                M  mysql-test/suite/funcs_1/triggers/triggers_0102.inc
                M  mysql-test/suite/funcs_1/triggers/triggers_0407.inc
                M  mysql-test/suite/ndb/r/ndb_gis.result
                M  mysql-test/suite/ndb_team/t/ndb_autodiscover.test
                M  mysql-test/suite/parts/inc/partition_auto_increment.inc
                M  mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
                M  mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
                M  mysql-test/suite/parts/r/partition_alter1_1_innodb.result
                M  mysql-test/suite/parts/r/partition_alter1_1_myisam.result
                M  mysql-test/suite/parts/r/partition_alter2_1_innodb.result
                M  mysql-test/suite/parts/r/partition_alter2_1_myisam.result
                M  mysql-test/suite/parts/r/partition_alter2_2_innodb.result
                M  mysql-test/suite/parts/r/partition_alter2_2_myisam.result
                M  mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
                M  mysql-test/suite/parts/r/partition_auto_increment_ndb.result
                M  mysql-test/suite/parts/r/partition_basic_innodb.result
                M  mysql-test/suite/parts/r/partition_basic_myisam.result
                M  mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
                M  mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
                M  mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
                M  mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
                M  mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
                M  mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
                M  mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
                M  mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
                M  mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
                M  mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
                M  mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
                M  mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
                M  mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
                M  mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
                M  mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
                M  mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
                M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
                M  mysql-test/suite/rpl/r/rpl_row_until.result
                M  mysql-test/suite/rpl/r/rpl_sp.result
                M  mysql-test/suite/rpl/t/rpl_cross_version.test
                M  mysql-test/suite/rpl/t/rpl_row_until.test
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
                M  mysql-test/suite/sys_vars/r/completion_type_func.result
                M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
                M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
                M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
                M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
                M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
                M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
                M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
                M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_connections_basic.result
                M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
                M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
                M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
                M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
                M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
                M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
                M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
                M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
                M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
                M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
                M  mysql-test/suite/sys_vars/t/completion_type_func.test
                M  mysql-test/t/alter_table-big.test
                M  mysql-test/t/backup.test
                M  mysql-test/t/check.test
                M  mysql-test/t/compress.test
                M  mysql-test/t/connect.test
                M  mysql-test/t/consistent_snapshot.test
                M  mysql-test/t/ddl_i18n_koi8r.test
                M  mysql-test/t/ddl_i18n_utf8.test
                M  mysql-test/t/dirty_close.test
                M  mysql-test/t/disabled.def
                M  mysql-test/t/drop.test
                M  mysql-test/t/events_bugs.test
                M  mysql-test/t/explain.test
                M  mysql-test/t/flush_block_commit.test
                M  mysql-test/t/flush_block_commit_notembedded.test
                M  mysql-test/t/flush_read_lock_kill.test
                M  mysql-test/t/fulltext.test
                M  mysql-test/t/func_group.test
                M  mysql-test/t/func_math.test
                M  mysql-test/t/func_str.test
                M  mysql-test/t/gis.test
                M  mysql-test/t/grant.test
                M  mysql-test/t/group_by.test
                M  mysql-test/t/group_min_max.test
                M  mysql-test/t/information_schema.test
                M  mysql-test/t/init_connect.test
                M  mysql-test/t/innodb-autoinc.test
                M  mysql-test/t/innodb_mysql.test
                M  mysql-test/t/lock.test
                M  mysql-test/t/lock_multi.test
                M  mysql-test/t/log_tables.test
                M  mysql-test/t/lowercase_table3.test
                M  mysql-test/t/merge.test
                M  mysql-test/t/multi_update.test
                M  mysql-test/t/mysql.test
                M  mysql-test/t/mysqlbinlog.test
                M  mysql-test/t/mysqldump-compat.test
                M  mysql-test/t/mysqldump.test
                M  mysql-test/t/mysqltest.test
                M  mysql-test/t/overflow.test
                M  mysql-test/t/packet.test
                M  mysql-test/t/partition.test
                M  mysql-test/t/partition_error.test
                M  mysql-test/t/ps.test
                M  mysql-test/t/query_cache_28249.test
                M  mysql-test/t/query_cache_debug.test
                M  mysql-test/t/query_cache_notembedded.test
                M  mysql-test/t/read_only.test
                M  mysql-test/t/rename.test
                M  mysql-test/t/row.test
                M  mysql-test/t/show_check.test
                M  mysql-test/t/skip_name_resolve.test
                M  mysql-test/t/sp-security.test
                M  mysql-test/t/sp-threads.test
                M  mysql-test/t/sp_notembedded.test
                M  mysql-test/t/ssl-big.test
                M  mysql-test/t/ssl.test
                M  mysql-test/t/ssl_compress.test
                M  mysql-test/t/status.test
                M  mysql-test/t/strict.test
                M  mysql-test/t/subselect.test
                M  mysql-test/t/synchronization.test
                M  mysql-test/t/timezone_grant.test
                M  mysql-test/t/trigger-compat.test
                M  mysql-test/t/type_bit_innodb.test
                M  mysql-test/t/type_datetime.test
                M  mysql-test/t/type_float.test
                M  mysql-test/t/user_limits.test
                M  mysql-test/t/variables.test
                M  mysql-test/t/view.test
                M  mysql-test/t/view_grant.test
                M  mysql-test/t/wait_timeout.test
                M  mysql-test/t/windows.test
                M  mysql-test/t/xa.test
                M  mysys/default.c
                M  mysys/errors.c
                M  mysys/md5.c
                M  mysys/my_fstream.c
                M  mysys/my_getopt.c
                M  mysys/my_pread.c
                M  mysys/my_write.c
                M  plugin/Makefile.am
                M  scripts/mysql_system_tables.sql
                M  scripts/mysql_system_tables_fix.sql
                M  scripts/mysqldumpslow.sh
                M  sql-bench/test-create.sh
                M  sql-common/my_time.c
                M  sql/ha_partition.cc
                M  sql/handler.cc
                M  sql/item.cc
                M  sql/item.h
                M  sql/item_cmpfunc.cc
                M  sql/item_func.cc
                M  sql/item_strfunc.cc
                M  sql/item_sum.cc
                M  sql/log.cc
                M  sql/log_event.cc
                M  sql/log_event.h
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/opt_range.cc
                M  sql/protocol.cc
                M  sql/rpl_record.cc
                M  sql/rpl_rli.cc
                M  sql/rpl_rli.h
                M  sql/set_var.cc
                M  sql/share/errmsg.txt
                M  sql/sp.cc
                M  sql/sql_base.cc
                M  sql/sql_cache.cc
                M  sql/sql_class.cc
                M  sql/sql_class.h
                M  sql/sql_handler.cc
                M  sql/sql_insert.cc
                M  sql/sql_lex.cc
                M  sql/sql_lex.h
                M  sql/sql_load.cc
                M  sql/sql_parse.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                M  sql/sql_string.cc
                M  sql/sql_table.cc
                M  sql/sql_view.cc
                M  sql/sql_yacc.yy
                M  sql/table.cc
                M  sql/unireg.cc
                M  storage/Makefile.am
                M  storage/innobase/btr/btr0sea.c
                M  storage/innobase/dict/dict0load.c
                M  storage/innobase/handler/ha_innodb.cc
                M  storage/innobase/include/rem0rec.h
                M  storage/innobase/include/rem0rec.ic
                M  storage/innobase/include/trx0roll.h
                M  storage/innobase/lock/lock0lock.c
                M  storage/innobase/trx/trx0roll.c
                M  storage/innobase/trx/trx0trx.c
                M  storage/myisam/ha_myisam.cc
                M  storage/myisam/mi_locking.c
                M  storage/myisam/myisamchk.c
                M  storage/myisam/myisamdef.h
                M  storage/myisammrg/ha_myisammrg.cc
                M  storage/myisammrg/ha_myisammrg.h
                M  storage/myisammrg/myrg_open.c
                M  support-files/Makefile.am
                M  support-files/my-huge.cnf.sh
                M  support-files/my-large.cnf.sh
                M  support-files/my-medium.cnf.sh
                M  support-files/my-small.cnf.sh
                M  support-files/mysql.spec.sh
                M  tests/mysql_client_test.c
             2555.288.2 Ignacio Galarza	2009-02-13 [merge]
                        Bug#29125 Windows Server X64: so many compiler warnings
                        - Remove bothersome warning messages.  This change focuses on the warnings 
                        that are covered by the ignore file: support-files/compiler_warnings.supp.
                        - Strings are guaranteed to be max uint in length

                M  client/mysql_upgrade.c
                M  client/mysqladmin.cc
                M  client/mysqlbinlog.cc
                M  client/mysqlcheck.c
                M  client/mysqldump.c
                M  client/mysqlslap.c
                M  client/mysqltest.cc
                M  client/sql_string.cc
                M  extra/comp_err.c
                M  extra/yassl/src/buffer.cpp
                M  extra/yassl/taocrypt/include/block.hpp
                M  extra/yassl/taocrypt/src/algebra.cpp
                M  extra/yassl/taocrypt/src/asn.cpp
                M  include/config-win.h
                M  libmysql/libmysql.c
                M  mysys/array.c
                M  mysys/base64.c
                M  mysys/charset.c
                M  mysys/checksum.c
                M  mysys/default.c
                M  mysys/default_modify.c
                M  mysys/hash.c
                M  mysys/mf_keycache.c
                M  mysys/mf_tempdir.c
                M  mysys/my_append.c
                M  mysys/my_compress.c
                M  mysys/my_conio.c
                M  mysys/my_copy.c
                M  mysys/my_getwd.c
                M  mysys/my_pread.c
                M  mysys/my_quick.c
                M  mysys/my_read.c
                M  mysys/safemalloc.c
                M  mysys/string.c
                M  server-tools/instance-manager/buffer.cc
                M  server-tools/instance-manager/instance.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/parse.h
                M  sql-common/client.c
                M  sql-common/my_user.c
                M  sql/event_data_objects.cc
                M  sql/event_parse_data.cc
                M  sql/events.cc
                M  sql/gen_lex_hash.cc
                M  sql/item.h
                M  sql/item_func.cc
                M  sql/item_strfunc.cc
                M  sql/item_timefunc.cc
                M  sql/lock.cc
                M  sql/log_event.cc
                M  sql/log_event.h
                M  sql/log_event_old.cc
                M  sql/net_serv.cc
                M  sql/sp_head.h
                M  sql/spatial.h
                M  sql/sql_class.h
                M  sql/sql_connect.cc
                M  sql/sql_crypt.cc
                M  sql/sql_error.cc
                M  sql/sql_insert.cc
                M  sql/sql_lex.cc
                M  sql/sql_lex.h
                M  sql/sql_load.cc
                M  sql/sql_prepare.cc
                M  sql/sql_profile.cc
                M  sql/sql_repl.cc
                M  sql/sql_servers.cc
                M  sql/sql_string.cc
                M  sql/sql_table.cc
                M  sql/sql_trigger.cc
                M  sql/sql_udf.cc
                M  sql/sql_view.cc
                M  sql/udf_example.c
                M  sql/uniques.cc
                M  storage/archive/azio.c
                M  storage/archive/azlib.h
                M  storage/csv/ha_tina.cc
                M  storage/csv/ha_tina.h
                M  storage/csv/transparent_file.h
                M  storage/federated/ha_federated.cc
                M  storage/federated/ha_federated.h
                M  storage/heap/hp_write.c
                M  storage/innobase/handler/ha_innodb.cc
                M  storage/innobase/include/pars0pars.h
                M  storage/myisam/ha_myisam.cc
                M  storage/myisam/mi_check.c
                M  storage/myisam/mi_packrec.c
                M  storage/myisam/mi_search.c
                M  storage/myisam/rt_index.c
                M  storage/myisammrg/ha_myisammrg.cc
                M  strings/ctype.c
                M  strings/my_vsnprintf.c
                M  tests/bug25714.c
                M  tests/mysql_client_test.c
            1810.3866.1 Ignacio Galarza	2009-02-10
                        Bug#29125 Windows Server X64: so many compiler warnings
                        - Remove bothersome warning messages.  This change focuses on the warnings 
                        that are covered by the ignore file: support-files/compiler_warnings.supp.
                        - Strings are guaranteed to be max uint in length

                M  client/mysql.cc
                M  client/mysql_upgrade.c
                M  client/mysqladmin.cc
                M  client/mysqlbinlog.cc
                M  client/mysqlcheck.c
                M  client/mysqldump.c
                M  client/mysqltest.c
                M  client/sql_string.cc
                M  extra/comp_err.c
                M  extra/yassl/src/buffer.cpp
                M  extra/yassl/src/cert_wrapper.cpp
                M  extra/yassl/src/ssl.cpp
                M  extra/yassl/src/yassl_imp.cpp
                M  extra/yassl/src/yassl_int.cpp
                M  extra/yassl/taocrypt/include/block.hpp
                M  extra/yassl/taocrypt/src/algebra.cpp
                M  extra/yassl/taocrypt/src/asn.cpp
                M  heap/hp_write.c
                M  include/my_sys.h
                M  innobase/include/pars0pars.h
                M  innobase/pars/pars0pars.c
                M  innobase/rem/rem0cmp.c
                M  libmysql/libmysql.c
                M  libmysql/manager.c
                M  myisam/mi_check.c
                M  myisam/mi_open.c
                M  myisam/mi_packrec.c
                M  myisam/mi_search.c
                M  myisam/rt_index.c
                M  mysys/base64.c
                M  mysys/default.c
                M  mysys/mf_iocache2.c
                M  mysys/my_static.c
                M  mysys/safemalloc.c
                M  mysys/string.c
                M  server-tools/instance-manager/buffer.cc
                M  server-tools/instance-manager/commands.cc
                M  server-tools/instance-manager/instance.cc
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/instance_options.cc
                M  server-tools/instance-manager/listener.cc
                M  server-tools/instance-manager/mysql_connection.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/parse.cc
                M  server-tools/instance-manager/parse.h
                M  server-tools/instance-manager/parse_output.cc
                M  server-tools/instance-manager/protocol.cc
                M  server-tools/instance-manager/user_map.cc
                M  sql-common/client.c
                M  sql-common/my_user.c
                M  sql/gen_lex_hash.cc
                M  sql/ha_archive.cc
                M  sql/ha_federated.cc
                M  sql/ha_innodb.cc
                M  sql/handler.cc
                M  sql/item.cc
                M  sql/item_func.cc
                M  sql/item_strfunc.cc
                M  sql/item_strfunc.h
                M  sql/item_timefunc.cc
                M  sql/lock.cc
                M  sql/log.cc
                M  sql/log_event.cc
                M  sql/mysqld.cc
                M  sql/net_serv.cc
                M  sql/opt_range.cc
                M  sql/opt_sum.cc
                M  sql/parse_file.cc
                M  sql/protocol.cc
                M  sql/set_var.cc
                M  sql/slave.cc
                M  sql/sp.cc
                M  sql/sp_head.cc
                M  sql/spatial.cc
                M  sql/sql_acl.cc
                M  sql/sql_base.cc
                M  sql/sql_cache.cc
                M  sql/sql_crypt.cc
                M  sql/sql_db.cc
                M  sql/sql_derived.cc
                M  sql/sql_error.cc
                M  sql/sql_handler.cc
                M  sql/sql_help.cc
                M  sql/sql_insert.cc
                M  sql/sql_lex.cc
                M  sql/sql_load.cc
                M  sql/sql_parse.cc
                M  sql/sql_prepare.cc
                M  sql/sql_repl.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                M  sql/sql_string.cc
                M  sql/sql_table.cc
                M  sql/sql_trigger.cc
                M  sql/sql_udf.cc
                M  sql/sql_view.cc
                M  sql/table.cc
                M  sql/udf_example.c
                M  sql/uniques.cc
                M  sql/unireg.cc
                M  strings/ctype-mb.c
                M  strings/ctype-simple.c
                M  strings/ctype-ucs2.c
                M  strings/my_vsnprintf.c
                M  strings/xml.c
                M  tests/bug25714.c
                M  tests/mysql_client_test.c
                M  vio/viosocket.c
        2555.291.24 Sergey Petrunia	2009-03-19 [merge]
                    Merge @@optimizer_switch no_xxx -> xxx=off change to 6.0

            M  client/my_readline.h
            M  client/mysql.cc
            M  client/mysqldump.c
            M  client/readline.cc
            M  mysql-test/r/ctype_collate.result
            M  mysql-test/r/mysql.result
            M  mysql-test/suite/federated/federated.result
            M  mysql-test/suite/federated/federated.test
            M  mysql-test/suite/rpl/r/rpl_loaddatalocal.result
            M  mysql-test/suite/rpl/r/rpl_stm_log.result
            M  mysql-test/suite/rpl/t/rpl_loaddatalocal.test
            M  mysql-test/suite/sys_vars/t/concurrent_insert_func.test
            M  mysql-test/t/ctype_collate.test
            M  mysql-test/t/mysql.test
            M  mysys/my_error.c
            M  scripts/mysqld_safe.sh
            M  sql/item.cc
            M  sql/log_event.cc
            M  sql/tztime.cc
        2555.291.23 Sergey Petrunia	2009-03-18 [merge]
                    Merge

            M  configure.in
            M  libmysqld/CMakeLists.txt
            M  libmysqld/examples/CMakeLists.txt
            M  mysql-test/include/concurrent.inc
            M  mysql-test/suite/funcs_1/r/is_columns_is.result
            M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
            M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
            M  mysql-test/t/disabled.def
            M  sql/sql_select.cc
            M  sql/table.cc
        2555.291.22 Sergey Petrunia	2009-03-18 [merge]
                    Merge

            A  mysql-test/std_data/bug32880.ARN
            A  mysql-test/std_data/bug32880.ARZ
            A  mysql-test/std_data/bug32880.frm
            M  mysql-test/include/concurrent.inc
            M  mysql-test/r/archive.result
            M  mysql-test/r/concurrent_innodb_safelog.result
            M  mysql-test/r/concurrent_innodb_unsafelog.result
            M  mysql-test/r/create.result
            M  mysql-test/r/information_schema.result
            M  mysql-test/r/key_cache.result
            M  mysql-test/r/variables.result
            M  mysql-test/suite/ndb/r/ndb_restore_partition.result
            M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
            M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
            M  mysql-test/suite/rpl/r/rpl_do_grant.result
            M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
            M  mysql-test/suite/rpl/t/rpl_do_grant.test
            M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
            M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
            M  mysql-test/t/archive.test
            M  mysql-test/t/information_schema.test
            M  mysql-test/t/variables.test
            M  mysys/my_getopt.c
            M  sql/sql_parse.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  storage/archive/ha_archive.cc
        2555.291.21 Sergey Petrunia	2009-03-16
                    Fix wrong parameter name which caused compile failure on windows
             @ sql/mysql_priv.h
                Fix wrong parameter name which caused compile failure on windows

            M  sql/mysql_priv.h
        2555.291.20 Sergey Petrunia	2009-03-16 [merge]
                    Merge

            M  include/my_sys.h
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/r/select.result
            M  mysql-test/suite/ndb/r/ndb_restore.result
            M  mysql-test/suite/ndb/r/ndb_restore_print.result
            M  mysql-test/t/select.test
            M  mysys/default.c
            M  server-tools/instance-manager/instance_map.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/options.h
            M  sql-common/client.c
            M  sql/sql_plugin.cc
            M  sql/sql_select.cc
        2555.291.19 Sergey Petrunia	2009-03-16
                    @@optimizer_switch switch from no_xxx to xxx={on|off} syntax:
                    - Fix valgrind warning on attempt to run a "SET optimizer_switch=number" statement.
                      Need to call c_ptr_safe() as strings returned by non-string items are not 
                      necessarily null-terminated.
             @ sql/set_var.cc
                @@optimizer_switch switch from no_xxx to xxx={on|off} syntax:
                - Fix valgrind warning on attempt to run a "SET optimizer_switch=number" statement.
                  Need to call c_ptr_safe() as strings returned by non-string items are not 
                  necessarily null-terminated.

            M  sql/set_var.cc
        2555.291.18 Sergey Petrunia	2009-03-14 [merge]
                    Merge 

            D  sql-bench/TODO
            M  client/mysqldump.c
            M  config/ac-macros/ha_ndbcluster.m4
            M  config/ac-macros/plugins.m4
            M  mysql-test/r/innodb-autoinc.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/variables.result
            M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
            M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
            M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
            M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
            M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
            M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
            M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
            M  mysql-test/t/innodb-autoinc.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/type_bit_innodb.test
            M  mysql-test/t/variables.test
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/set_var.cc
            M  sql/sql_plugin.cc
            M  storage/innobase/btr/btr0sea.c
            M  storage/innobase/handler/ha_innodb.cc
        2555.291.17 Sergey Petrunia	2009-03-14
                    @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
             @ mysql-test/r/index_merge_myisam.result
                More tests
             @ mysql-test/t/index_merge_myisam.test
                More tests
             @ sql/mysql_priv.h
                @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
             @ sql/mysqld.cc
                @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
             @ sql/set_var.cc
                @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
             @ sql/set_var.h
                @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
             @ sql/strfunc.cc
                @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes

            M  mysql-test/r/index_merge_myisam.result
            M  mysql-test/t/index_merge_myisam.test
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/set_var.cc
            M  sql/set_var.h
            M  sql/strfunc.cc
        2555.291.16 Sergey Petrunia	2009-03-11 [merge]
                    Merge

            A  mysql-test/collections/
            A  mysql-test/collections/README
            A  mysql-test/collections/README.experimental
            A  mysql-test/collections/default.daily
            A  mysql-test/collections/default.experimental
            A  mysql-test/collections/default.push
            A  mysql-test/collections/default.weekly
            A  storage/ibmdb2i/
            A  storage/ibmdb2i/CMakeLists.txt
            A  storage/ibmdb2i/Makefile.am
            A  storage/ibmdb2i/db2i_blobCollection.cc
            A  storage/ibmdb2i/db2i_blobCollection.h
            A  storage/ibmdb2i/db2i_charsetSupport.cc
            A  storage/ibmdb2i/db2i_charsetSupport.h
            A  storage/ibmdb2i/db2i_collationSupport.cc
            A  storage/ibmdb2i/db2i_collationSupport.h
            A  storage/ibmdb2i/db2i_constraints.cc
            A  storage/ibmdb2i/db2i_conversion.cc
            A  storage/ibmdb2i/db2i_errors.cc
            A  storage/ibmdb2i/db2i_errors.h
            A  storage/ibmdb2i/db2i_file.cc
            A  storage/ibmdb2i/db2i_file.h
            A  storage/ibmdb2i/db2i_global.h
            A  storage/ibmdb2i/db2i_iconv.h
            A  storage/ibmdb2i/db2i_ileBridge.cc
            A  storage/ibmdb2i/db2i_ileBridge.h
            A  storage/ibmdb2i/db2i_ioBuffers.cc
            A  storage/ibmdb2i/db2i_ioBuffers.h
            A  storage/ibmdb2i/db2i_misc.h
            A  storage/ibmdb2i/db2i_myconv.cc
            A  storage/ibmdb2i/db2i_myconv.h
            A  storage/ibmdb2i/db2i_rir.cc
            A  storage/ibmdb2i/db2i_safeString.h
            A  storage/ibmdb2i/db2i_sqlStatementStream.cc
            A  storage/ibmdb2i/db2i_sqlStatementStream.h
            A  storage/ibmdb2i/db2i_validatedPointer.h
            A  storage/ibmdb2i/ha_ibmdb2i.cc
            A  storage/ibmdb2i/ha_ibmdb2i.h
            A  storage/ibmdb2i/plug.in
            M  config/ac-macros/plugins.m4
            M  include/my_md5.h
            M  mysql-test/Makefile.am
            M  mysql-test/include/check-warnings.test
            M  mysql-test/include/wait_until_count_sessions.inc
            M  mysql-test/lib/My/ConfigFactory.pm
            M  mysql-test/lib/My/Platform.pm
            M  mysql-test/lib/My/SafeProcess.pm
            M  mysql-test/lib/My/SafeProcess/safe_process.cc
            M  mysql-test/lib/mtr_report.pm
            M  mysql-test/lib/mtr_unique.pm
            M  mysql-test/mysql-test-run.pl
            M  mysql-test/r/connect.result
            M  mysql-test/r/consistent_snapshot.result
            M  mysql-test/r/dirty_close.result
            M  mysql-test/r/events_bugs.result
            M  mysql-test/r/explain.result
            M  mysql-test/r/flush_block_commit.result
            M  mysql-test/r/flush_block_commit_notembedded.result
            M  mysql-test/r/flush_read_lock_kill.result
            M  mysql-test/r/lock_multi.result
            M  mysql-test/r/log_tables.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqltest.result
            M  mysql-test/r/read_only.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-security.result
            M  mysql-test/r/system_mysql_db.result
            M  mysql-test/r/variables.result
            M  mysql-test/r/view.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/suite/funcs_1/r/innodb_func_view.result
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
            M  mysql-test/t/alter_table-big.test
            M  mysql-test/t/connect.test
            M  mysql-test/t/consistent_snapshot.test
            M  mysql-test/t/dirty_close.test
            M  mysql-test/t/events_bugs.test
            M  mysql-test/t/explain.test
            M  mysql-test/t/flush_block_commit.test
            M  mysql-test/t/flush_block_commit_notembedded.test
            M  mysql-test/t/flush_read_lock_kill.test
            M  mysql-test/t/init_connect.test
            M  mysql-test/t/lock_multi.test
            M  mysql-test/t/log_tables.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/read_only.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/sp-security.test
            M  mysql-test/t/sp_notembedded.test
            M  mysql-test/t/ssl-big.test
            M  mysql-test/t/ssl.test
            M  mysql-test/t/ssl_compress.test
            M  mysql-test/t/status.test
            M  mysql-test/t/user_limits.test
            M  mysql-test/t/variables.test
            M  mysql-test/t/view.test
            M  mysql-test/t/view_grant.test
            M  mysql-test/t/wait_timeout.test
            M  mysql-test/t/xa.test
            M  mysys/md5.c
            M  plugin/Makefile.am
            M  scripts/mysql_system_tables.sql
            M  scripts/mysql_system_tables_fix.sql
            M  sql/item_strfunc.cc
            M  sql/item_sum.cc
            M  sql/mysqld.cc
            M  sql/table.cc
            M  storage/Makefile.am
        2555.291.15 Sergey Petrunia	2009-03-11
                    Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ mysql-test/r/index_merge_myisam.result
                Testcases
             @ mysql-test/t/index_merge_myisam.test
                Testcases
             @ sql/mysql_priv.h
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ sql/mysqld.cc
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ sql/opt_range.cc
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ sql/set_var.cc
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ sql/set_var.h
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
             @ sql/strfunc.cc
                Change optimizer_switch from no_xxx to xxx=on/xx=off.
                - Add functions to parse the new syntax

            M  mysql-test/r/index_merge_myisam.result
            M  mysql-test/t/index_merge_myisam.test
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/opt_range.cc
            M  sql/set_var.cc
            M  sql/set_var.h
            M  sql/strfunc.cc
        2555.291.14 Sergey Petrunia	2009-03-10
                    Post-merge fixes
             @ sql/mysqld.cc
                Post-merge fixes

            M  sql/mysqld.cc
        2555.291.13 Sergey Petrunia	2009-03-10 [merge]
                    Merge

            D  mysql-test/suite/sys_vars/t/completion_type_func-master.opt
            A  mysql-test/include/wait_show_condition.inc
            A  mysql-test/r/innodb_bug42419.result
            A  mysql-test/r/lowercase_utf8.result
            A  mysql-test/suite/binlog/r/binlog_sql_mode.result
            A  mysql-test/suite/binlog/t/binlog_sql_mode.test
            A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
            A  mysql-test/suite/rpl/r/rpl_slave_load_in.result
            A  mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
            A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
            A  mysql-test/suite/rpl/t/rpl_slave_load_in.test
            A  mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
            A  mysql-test/t/innodb_bug42419.test
            A  mysql-test/t/lowercase_utf8-master.opt
            A  mysql-test/t/lowercase_utf8.test
            M  .bzrignore
            M  CMakeLists.txt
            M  client/mysql.cc
            M  client/mysqldump.c
            M  cmd-line-utils/libedit/makelist.sh
            M  cmd-line-utils/libedit/readline.c
            M  cmd-line-utils/libedit/readline/readline.h
            M  cmd-line-utils/libedit/vi.c
            M  configure.in
            M  include/config-win.h
            M  include/my_getopt.h
            M  include/my_global.h
            M  include/my_sys.h
            M  libmysqld/lib_sql.cc
            M  mysql-test/Makefile.am
            M  mysql-test/include/handler.inc
            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/lib/My/CoreDump.pm
            M  mysql-test/lib/mtr_gcov.pl
            M  mysql-test/mysql-test-run.pl
            M  mysql-test/r/backup.result
            M  mysql-test/r/ddl_i18n_koi8r.result
            M  mysql-test/r/ddl_i18n_utf8.result
            M  mysql-test/r/func_math.result
            M  mysql-test/r/grant.result
            M  mysql-test/r/group_by.result
            M  mysql-test/r/group_min_max.result
            M  mysql-test/r/handler_innodb.result
            M  mysql-test/r/handler_myisam.result
            M  mysql-test/r/information_schema_db.result
            M  mysql-test/r/lock.result
            M  mysql-test/r/merge.result
            M  mysql-test/r/mysql.result
            M  mysql-test/r/mysqlbinlog.result
            M  mysql-test/r/mysqlcheck.result
            M  mysql-test/r/mysqldump-max.result
            M  mysql-test/r/mysqldump.result
            M  mysql-test/r/mysqltest.result
            M  mysql-test/r/openssl_1.result
            M  mysql-test/r/partition.result
            M  mysql-test/r/partition_error.result
            M  mysql-test/r/partition_mgm_err.result
            M  mysql-test/r/preload.result
            M  mysql-test/r/ps.result
            M  mysql-test/r/query_cache_debug.result
            M  mysql-test/r/repair.result
            M  mysql-test/r/row.result
            M  mysql-test/r/show_check.result
            M  mysql-test/r/skip_name_resolve.result
            M  mysql-test/r/sp-error.result
            M  mysql-test/r/sp.result
            M  mysql-test/r/sp_trans.result
            M  mysql-test/r/strict.result
            M  mysql-test/r/trigger-compat.result
            M  mysql-test/r/type_blob.result
            M  mysql-test/r/type_timestamp.result
            M  mysql-test/r/variables.result
            M  mysql-test/r/view_grant.result
            M  mysql-test/r/warnings.result
            M  mysql-test/suite/binlog/r/binlog_unsafe.result
            M  mysql-test/suite/binlog/t/binlog_unsafe.test
            M  mysql-test/suite/funcs_1/r/innodb_views.result
            M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
            M  mysql-test/suite/funcs_1/r/is_columns_memory.result
            M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
            M  mysql-test/suite/funcs_1/r/memory_views.result
            M  mysql-test/suite/funcs_1/r/myisam_views.result
            M  mysql-test/suite/funcs_1/r/ndb_views.result
            M  mysql-test/suite/ndb_team/t/ndb_autodiscover.test
            M  mysql-test/suite/parts/inc/partition_auto_increment.inc
            M  mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
            M  mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
            M  mysql-test/suite/parts/r/partition_alter1_1_innodb.result
            M  mysql-test/suite/parts/r/partition_alter1_1_myisam.result
            M  mysql-test/suite/parts/r/partition_alter2_1_innodb.result
            M  mysql-test/suite/parts/r/partition_alter2_1_myisam.result
            M  mysql-test/suite/parts/r/partition_alter2_2_innodb.result
            M  mysql-test/suite/parts/r/partition_alter2_2_myisam.result
            M  mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
            M  mysql-test/suite/parts/r/partition_auto_increment_ndb.result
            M  mysql-test/suite/parts/r/partition_basic_innodb.result
            M  mysql-test/suite/parts/r/partition_basic_myisam.result
            M  mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
            M  mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
            M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
            M  mysql-test/suite/rpl/r/rpl_row_until.result
            M  mysql-test/suite/rpl/r/rpl_sp.result
            M  mysql-test/suite/rpl/t/rpl_row_until.test
            M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
            M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
            M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
            M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
            M  mysql-test/suite/sys_vars/r/completion_type_func.result
            M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
            M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
            M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
            M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
            M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
            M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
            M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
            M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
            M  mysql-test/suite/sys_vars/r/max_connections_basic.result
            M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
            M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
            M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
            M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
            M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
            M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
            M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
            M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
            M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
            M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
            M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
            M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
            M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
            M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
            M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
            M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
            M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
            M  mysql-test/suite/sys_vars/t/completion_type_func.test
            M  mysql-test/t/ddl_i18n_koi8r.test
            M  mysql-test/t/ddl_i18n_utf8.test
            M  mysql-test/t/disabled.def
            M  mysql-test/t/drop.test
            M  mysql-test/t/func_group.test
            M  mysql-test/t/func_math.test
            M  mysql-test/t/group_by.test
            M  mysql-test/t/group_min_max.test
            M  mysql-test/t/innodb_mysql.test
            M  mysql-test/t/lock.test
            M  mysql-test/t/merge.test
            M  mysql-test/t/mysql.test
            M  mysql-test/t/mysqlbinlog.test
            M  mysql-test/t/mysqldump-compat.test
            M  mysql-test/t/mysqldump.test
            M  mysql-test/t/mysqltest.test
            M  mysql-test/t/partition.test
            M  mysql-test/t/partition_error.test
            M  mysql-test/t/ps.test
            M  mysql-test/t/query_cache_28249.test
            M  mysql-test/t/query_cache_debug.test
            M  mysql-test/t/row.test
            M  mysql-test/t/show_check.test
            M  mysql-test/t/skip_name_resolve.test
            M  mysql-test/t/strict.test
            M  mysql-test/t/trigger-compat.test
            M  mysql-test/t/variables.test
            M  mysql-test/t/view_grant.test
            M  mysys/default.c
            M  mysys/errors.c
            M  mysys/my_fstream.c
            M  mysys/my_getopt.c
            M  mysys/my_pread.c
            M  mysys/my_write.c
            M  scripts/mysqldumpslow.sh
            M  sql/ha_partition.cc
            M  sql/handler.cc
            M  sql/item.cc
            M  sql/item.h
            M  sql/item_cmpfunc.cc
            M  sql/item_func.cc
            M  sql/log.cc
            M  sql/log_event.cc
            M  sql/log_event.h
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/opt_range.cc
            M  sql/protocol.cc
            M  sql/rpl_record.cc
            M  sql/rpl_rli.cc
            M  sql/rpl_rli.h
            M  sql/set_var.cc
            M  sql/share/errmsg.txt
            M  sql/sp.cc
            M  sql/sql_base.cc
            M  sql/sql_cache.cc
            M  sql/sql_class.cc
            M  sql/sql_class.h
            M  sql/sql_handler.cc
            M  sql/sql_insert.cc
            M  sql/sql_lex.cc
            M  sql/sql_lex.h
            M  sql/sql_load.cc
            M  sql/sql_parse.cc
            M  sql/sql_select.cc
            M  sql/sql_show.cc
            M  sql/sql_table.cc
            M  sql/sql_view.cc
            M  sql/sql_yacc.yy
            M  sql/unireg.cc
            M  storage/innobase/dict/dict0load.c
            M  storage/innobase/handler/ha_innodb.cc
            M  storage/innobase/include/rem0rec.h
            M  storage/innobase/include/rem0rec.ic
            M  storage/innobase/include/trx0roll.h
            M  storage/innobase/lock/lock0lock.c
            M  storage/innobase/trx/trx0roll.c
            M  storage/innobase/trx/trx0trx.c
            M  storage/myisam/ha_myisam.cc
            M  storage/myisam/mi_locking.c
            M  storage/myisam/myisamchk.c
            M  storage/myisam/myisamdef.h
            M  storage/myisammrg/ha_myisammrg.cc
            M  support-files/Makefile.am
            M  support-files/mysql.spec.sh
            M  tests/mysql_client_test.c
        2555.291.12 Sergey Petrunia	2009-02-23
                    - Backport @@optimizer_switch support from 6.0
                    - Add support for setting it as a server commandline argument
                    - Add support for those switches:
                      = no_index_merge
                      = no_index_merge_union
                      = no_index_merge_sort_union
                      = no_index_merge_intersection
             @ mysql-test/r/index_merge_myisam.result
                Testcases for index_merge related @@optimizer_switch flags.
             @ mysql-test/t/index_merge_myisam.test
                Testcases for index_merge related @@optimizer_switch flags.
             @ sql/mysql_priv.h
                - Backport @@optimizer_switch support from 6.0
                - Add support for setting it as a server commandline argument
                - Add support for those switches:
                  = no_index_merge
                  = no_index_merge_union
                  = no_index_merge_sort_union
                  = no_index_merge_intersection
             @ sql/mysqld.cc
                - Backport @@optimizer_switch support from 6.0
                - Add support for setting it as a server commandline argument
                - Add support for those switches:
                  = no_index_merge
                  = no_index_merge_union
                  = no_index_merge_sort_union
                  = no_index_merge_intersection
             @ sql/opt_range.cc
                - Backport @@optimizer_switch support from 6.0
                - Add support for setting it as a server commandline argument
                - Add support for those switches:
                  = no_index_merge
                  = no_index_merge_union
                  = no_index_merge_sort_union
                  = no_index_merge_intersection
             @ sql/set_var.cc
                - Backport @@optimizer_switch support from 6.0
                - Add support for setting it as a server commandline argument
             @ sql/set_var.h
                - Backport @@optimizer_switch support from 6.0
                - Add support for setting it as a server commandline argument
                - Add support for those switches:
                  = no_index_merge
                  = no_index_merge_union
                  = no_index_merge_sort_union
                  = no_index_merge_intersection
             @ sql/sql_class.h
                - Backport @@optimizer_switch support from 6.0
             @ sql/sql_select.h
                - Backport @@optimizer_switch support from 6.0

            M  mysql-test/r/index_merge_myisam.result
            M  mysql-test/t/index_merge_myisam.test
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/opt_range.cc
            M  sql/set_var.cc
            M  sql/set_var.h
            M  sql/sql_class.h
            M  sql/sql_select.h
     2555.345.9 Chad MILLER	2009-03-19 [merge]
                Merge bugteam and contributed two patches from 
                Antony Dovgal <tony @ daylessday.org> .  SCA signed and faxed to
                tel:+1-408-715-2540.  Patches tweaked by Chad.

        M  configure.in
        M  include/Makefile.am
         2555.360.2 Chad MILLER	2009-03-19
                    Copy include/config.h to include/my_config.h at configure-time.  Also,
                    continue to update it at make-time.
                    
                    One shouldn't need to run "make" on server source to get the stuff we say
                    plugins should use.

            M  configure.in
            M  include/Makefile.am
         2555.360.1 Chad MILLER	2009-03-18
                    Using autoconf definitions instead of manually appending to CFLAGS is 
                    smarter, and according to a contributer, it is necessary for plugin authors
                    using "--with-debug".

            M  configure.in
     2555.345.8 Horst Hunger	2009-03-19 [merge]
                due to merge.

        M  sql/tztime.cc
         2555.359.1 Staale Smedseng	2009-03-19 [merge]
                    Merge from 5.0-bugteam

            M  sql/tztime.cc
        1810.3864.8 Staale Smedseng	2009-03-19
                    Bug #42502 huge memory leak possible with timezone 
                    functions
                          
                    Unknown timezone specifications are properly rejected
                    by the server, but are copied into tz_storage before
                    rejection, and hence is retained until end of server 
                    life. With sufficiently large bogus timezone specs, 
                    it is easy to exhaust system memory.
                          
                    Allocation of memory for a copy of the timezone
                    name is delayed until after verification of validity,
                    at the cost of a memcpy of the timezone info. This 
                    only happens once, future lookups will hit the cached
                    structure.

            M  sql/tztime.cc
     2555.345.7 Horst Hunger	2009-03-19
                Reviewed patch for Bug#39862.

        M  mysql-test/suite/sys_vars/t/concurrent_insert_func.test
     2555.345.6 Alexey Kopytov	2009-03-19 [merge]
                Automerge.

        1810.3864.7 Alexey Kopytov	2009-03-19 [merge]
                    Automerge.

            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
     2555.345.5 Alexey Kopytov	2009-03-19 [merge]
                Automerge.

        M  mysql-test/r/mysql.result
        M  mysql-test/t/mysql.test
         2555.353.2 Alexey Kopytov	2009-03-19 [merge]
                    Automerge.

            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
        1810.3865.2 Alexey Kopytov	2009-03-19
                    Fixed test failures in 5.1/6.0 introduced by the patch
                    for bug #41486. Session max_allowed_packet is read-only
                    as of MySQL 5.1.31. In addition, the global variable
                    now has no effect on the current session.

            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
     2555.345.4 Sergey Glukhov	2009-03-19 [merge]
                5.0-bugteam->5.1-bugteam merge
         @ client/mysql.cc
            5.0-bugteam->5.1-bugteam merge
         @ mysql-test/r/ctype_collate.result
            5.0-bugteam->5.1-bugteam merge
         @ mysql-test/t/ctype_collate.test
            5.0-bugteam->5.1-bugteam merge
         @ sql/item.cc
            5.0-bugteam->5.1-bugteam merge

        M  client/mysql.cc
        M  mysql-test/r/ctype_collate.result
        M  mysql-test/t/ctype_collate.test
        M  sql/item.cc
        1810.3864.6 Sergey Glukhov	2009-03-19 [merge]
                    automerge
             @ client/mysqldump.c
                automerge
             @ mysql-test/r/federated.result
                automerge
             @ mysql-test/t/federated.test
                automerge

            M  client/mysqldump.c
            M  mysql-test/r/federated.result
            M  mysql-test/t/federated.test
        1810.3864.5 Sergey Glukhov	2009-03-19
                    Bug#41268 Help Text for \c is misleading in client command line interface
                    fixed help message
             @ client/mysql.cc
                fixed help message

            M  client/mysql.cc
        1810.3864.4 Sergey Glukhov	2009-03-19
                    Bug#41627 Illegal mix of collations in LEAST / GREATEST / CASE
                    Don't throw an error after checking the first and the second arguments.
                    Continue with checking the third and higher arguments and if some of
                    them is stronger according to coercibility rules,
                    then this argument's collation is set as result collation.
             @ mysql-test/r/ctype_collate.result
                test result
             @ mysql-test/t/ctype_collate.test
                test case
             @ sql/item.cc
                Don't throw an error after checking the first and the second arguments.
                Continue with checking the third and higher arguments and if some of
                them is stronger according to coercibility rules,
                then this argument's collation is set as result collation.

            M  mysql-test/r/ctype_collate.result
            M  mysql-test/t/ctype_collate.test
            M  sql/item.cc
     2555.345.3 Satya B	2009-03-19 [merge]
                Merge 5.0-bugteam to 5.1-bugteam

        M  client/mysqldump.c
        M  mysql-test/suite/federated/federated.result
        M  mysql-test/suite/federated/federated.test
        1810.3863.5 Satya B	2009-03-19 [merge]
                    merge to 5.0-bugteam

            M  client/my_readline.h
            M  client/mysql.cc
            M  client/readline.cc
            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
            M  sql/sql_show.cc
        1810.3863.4 Satya B	2009-03-19
                    Fix for BUG#21360 - mysqldump error on federated tables
                                            
                    When loading dump created by mysqldump tool an error is
                    thrown saying storage engine for the table doesn't have 
                    an option.
                                            
                    mysqldump tries to re-insert the data into the federated
                    table which causes the error. Since the data is already
                    available on the remote server, mysqldump shouldn't try
                    to dump the data again for FEDERATED tables.
                                            
                    As stated in the bug page, it can be considered similar
                    to the MERGE ENGINE with "view only" nature.
                                            
                    Fixed by adding the "FEDERATED ENGINE" to the exception
                    list to ignore the data.
             @ client/mysqldump.c
                Fixed check_if_ignore_table() to ignore FEDERATED engine
                when dumping the table data.
             @ mysql-test/r/federated.result
                Result file for BUG#21360
             @ mysql-test/t/federated.test
                Testcase for BUG#21360

            M  client/mysqldump.c
            M  mysql-test/r/federated.result
            M  mysql-test/t/federated.test
     2555.345.2 Leonard Zhou	2009-03-16 [merge]
                Merge

        D  mysql-test/suite/sys_vars/t/completion_type_func-master.opt
        D  sql-bench/TODO
        A  mysql-test/collections/
        A  mysql-test/collections/README
        A  mysql-test/collections/README.experimental
        A  mysql-test/collections/default.daily
        A  mysql-test/collections/default.experimental
        A  mysql-test/collections/default.push
        A  mysql-test/collections/default.weekly
        A  mysql-test/include/wait_show_condition.inc
        A  mysql-test/r/innodb_bug42419.result
        A  mysql-test/std_data/bug32880.ARN
        A  mysql-test/std_data/bug32880.ARZ
        A  mysql-test/std_data/bug32880.frm
        A  mysql-test/suite/binlog/r/binlog_sql_mode.result
        A  mysql-test/suite/binlog/t/binlog_sql_mode.test
        A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
        A  mysql-test/suite/rpl/r/rpl_slave_load_in.result
        A  mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
        A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
        A  mysql-test/suite/rpl/t/rpl_slave_load_in.test
        A  mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
        A  mysql-test/t/innodb_bug42419.test
        A  storage/ibmdb2i/
        A  storage/ibmdb2i/CMakeLists.txt
        A  storage/ibmdb2i/Makefile.am
        A  storage/ibmdb2i/db2i_blobCollection.cc
        A  storage/ibmdb2i/db2i_blobCollection.h
        A  storage/ibmdb2i/db2i_charsetSupport.cc
        A  storage/ibmdb2i/db2i_charsetSupport.h
        A  storage/ibmdb2i/db2i_collationSupport.cc
        A  storage/ibmdb2i/db2i_collationSupport.h
        A  storage/ibmdb2i/db2i_constraints.cc
        A  storage/ibmdb2i/db2i_conversion.cc
        A  storage/ibmdb2i/db2i_errors.cc
        A  storage/ibmdb2i/db2i_errors.h
        A  storage/ibmdb2i/db2i_file.cc
        A  storage/ibmdb2i/db2i_file.h
        A  storage/ibmdb2i/db2i_global.h
        A  storage/ibmdb2i/db2i_iconv.h
        A  storage/ibmdb2i/db2i_ileBridge.cc
        A  storage/ibmdb2i/db2i_ileBridge.h
        A  storage/ibmdb2i/db2i_ioBuffers.cc
        A  storage/ibmdb2i/db2i_ioBuffers.h
        A  storage/ibmdb2i/db2i_misc.h
        A  storage/ibmdb2i/db2i_myconv.cc
        A  storage/ibmdb2i/db2i_myconv.h
        A  storage/ibmdb2i/db2i_rir.cc
        A  storage/ibmdb2i/db2i_safeString.h
        A  storage/ibmdb2i/db2i_sqlStatementStream.cc
        A  storage/ibmdb2i/db2i_sqlStatementStream.h
        A  storage/ibmdb2i/db2i_validatedPointer.h
        A  storage/ibmdb2i/ha_ibmdb2i.cc
        A  storage/ibmdb2i/ha_ibmdb2i.h
        A  storage/ibmdb2i/plug.in
        M  .bzrignore
        M  CMakeLists.txt
        M  client/my_readline.h
        M  client/mysql.cc
        M  client/mysqldump.c
        M  client/readline.cc
        M  cmd-line-utils/libedit/makelist.sh
        M  cmd-line-utils/libedit/readline.c
        M  cmd-line-utils/libedit/readline/readline.h
        M  cmd-line-utils/libedit/vi.c
        M  config/ac-macros/ha_ndbcluster.m4
        M  config/ac-macros/plugins.m4
        M  configure.in
        M  include/config-win.h
        M  include/my_getopt.h
        M  include/my_global.h
        M  include/my_md5.h
        M  include/my_sys.h
        M  libmysqld/CMakeLists.txt
        M  libmysqld/examples/CMakeLists.txt
        M  libmysqld/lib_sql.cc
        M  mysql-test/Makefile.am
        M  mysql-test/include/check-warnings.test
        M  mysql-test/include/concurrent.inc
        M  mysql-test/include/handler.inc
        M  mysql-test/include/ndb_backup.inc
        M  mysql-test/include/wait_until_count_sessions.inc
        M  mysql-test/lib/My/ConfigFactory.pm
        M  mysql-test/lib/My/Platform.pm
        M  mysql-test/lib/My/SafeProcess.pm
        M  mysql-test/lib/My/SafeProcess/safe_process.cc
        M  mysql-test/lib/mtr_gcov.pl
        M  mysql-test/lib/mtr_report.pm
        M  mysql-test/lib/mtr_unique.pm
        M  mysql-test/mysql-test-run.pl
        M  mysql-test/r/archive.result
        M  mysql-test/r/concurrent_innodb_safelog.result
        M  mysql-test/r/concurrent_innodb_unsafelog.result
        M  mysql-test/r/connect.result
        M  mysql-test/r/consistent_snapshot.result
        M  mysql-test/r/create.result
        M  mysql-test/r/ddl_i18n_koi8r.result
        M  mysql-test/r/ddl_i18n_utf8.result
        M  mysql-test/r/dirty_close.result
        M  mysql-test/r/events_bugs.result
        M  mysql-test/r/explain.result
        M  mysql-test/r/flush_block_commit.result
        M  mysql-test/r/flush_block_commit_notembedded.result
        M  mysql-test/r/flush_read_lock_kill.result
        M  mysql-test/r/func_math.result
        M  mysql-test/r/grant.result
        M  mysql-test/r/group_by.result
        M  mysql-test/r/group_min_max.result
        M  mysql-test/r/handler_innodb.result
        M  mysql-test/r/handler_myisam.result
        M  mysql-test/r/information_schema.result
        M  mysql-test/r/information_schema_db.result
        M  mysql-test/r/innodb-autoinc.result
        M  mysql-test/r/innodb_mysql.result
        M  mysql-test/r/key_cache.result
        M  mysql-test/r/lock.result
        M  mysql-test/r/lock_multi.result
        M  mysql-test/r/log_tables.result
        M  mysql-test/r/merge.result
        M  mysql-test/r/mysql.result
        M  mysql-test/r/mysqlbinlog.result
        M  mysql-test/r/mysqlcheck.result
        M  mysql-test/r/mysqldump-max.result
        M  mysql-test/r/mysqldump.result
        M  mysql-test/r/mysqltest.result
        M  mysql-test/r/openssl_1.result
        M  mysql-test/r/partition.result
        M  mysql-test/r/partition_error.result
        M  mysql-test/r/partition_mgm_err.result
        M  mysql-test/r/preload.result
        M  mysql-test/r/ps.result
        M  mysql-test/r/read_only.result
        M  mysql-test/r/repair.result
        M  mysql-test/r/select.result
        M  mysql-test/r/show_check.result
        M  mysql-test/r/skip_name_resolve.result
        M  mysql-test/r/sp-security.result
        M  mysql-test/r/strict.result
        M  mysql-test/r/system_mysql_db.result
        M  mysql-test/r/trigger-compat.result
        M  mysql-test/r/variables.result
        M  mysql-test/r/view.result
        M  mysql-test/r/view_grant.result
        M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
        M  mysql-test/suite/binlog/r/binlog_unsafe.result
        M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
        M  mysql-test/suite/binlog/t/binlog_unsafe.test
        M  mysql-test/suite/funcs_1/r/innodb_func_view.result
        M  mysql-test/suite/funcs_1/r/innodb_views.result
        M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
        M  mysql-test/suite/funcs_1/r/is_columns_is.result
        M  mysql-test/suite/funcs_1/r/is_columns_memory.result
        M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
        M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
        M  mysql-test/suite/funcs_1/r/memory_views.result
        M  mysql-test/suite/funcs_1/r/myisam_views.result
        M  mysql-test/suite/funcs_1/r/ndb_views.result
        M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
        M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
        M  mysql-test/suite/ndb/r/ndb_restore.result
        M  mysql-test/suite/ndb/r/ndb_restore_partition.result
        M  mysql-test/suite/ndb/r/ndb_restore_print.result
        M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
        M  mysql-test/suite/ndb_team/t/ndb_autodiscover.test
        M  mysql-test/suite/parts/inc/partition_auto_increment.inc
        M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
        M  mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
        M  mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
        M  mysql-test/suite/parts/r/partition_alter1_1_innodb.result
        M  mysql-test/suite/parts/r/partition_alter1_1_myisam.result
        M  mysql-test/suite/parts/r/partition_alter2_1_innodb.result
        M  mysql-test/suite/parts/r/partition_alter2_1_myisam.result
        M  mysql-test/suite/parts/r/partition_alter2_2_innodb.result
        M  mysql-test/suite/parts/r/partition_alter2_2_myisam.result
        M  mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
        M  mysql-test/suite/parts/r/partition_auto_increment_ndb.result
        M  mysql-test/suite/parts/r/partition_basic_innodb.result
        M  mysql-test/suite/parts/r/partition_basic_myisam.result
        M  mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
        M  mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
        M  mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
        M  mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
        M  mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
        M  mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
        M  mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
        M  mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
        M  mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
        M  mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
        M  mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
        M  mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
        M  mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
        M  mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
        M  mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
        M  mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
        M  mysql-test/suite/rpl/r/rpl_do_grant.result
        M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
        M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
        M  mysql-test/suite/rpl/t/rpl_do_grant.test
        M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
        M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
        M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
        M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
        M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
        M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
        M  mysql-test/suite/sys_vars/r/completion_type_func.result
        M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
        M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
        M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
        M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
        M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
        M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
        M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
        M  mysql-test/suite/sys_vars/r/max_connections_basic.result
        M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
        M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
        M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
        M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
        M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
        M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
        M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
        M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
        M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
        M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
        M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
        M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
        M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
        M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
        M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
        M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
        M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
        M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
        M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
        M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
        M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
        M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
        M  mysql-test/suite/sys_vars/t/completion_type_func.test
        M  mysql-test/t/alter_table-big.test
        M  mysql-test/t/archive.test
        M  mysql-test/t/connect.test
        M  mysql-test/t/consistent_snapshot.test
        M  mysql-test/t/ddl_i18n_koi8r.test
        M  mysql-test/t/ddl_i18n_utf8.test
        M  mysql-test/t/dirty_close.test
        M  mysql-test/t/disabled.def
        M  mysql-test/t/drop.test
        M  mysql-test/t/events_bugs.test
        M  mysql-test/t/explain.test
        M  mysql-test/t/flush_block_commit.test
        M  mysql-test/t/flush_block_commit_notembedded.test
        M  mysql-test/t/flush_read_lock_kill.test
        M  mysql-test/t/func_group.test
        M  mysql-test/t/func_math.test
        M  mysql-test/t/group_by.test
        M  mysql-test/t/group_min_max.test
        M  mysql-test/t/information_schema.test
        M  mysql-test/t/init_connect.test
        M  mysql-test/t/innodb-autoinc.test
        M  mysql-test/t/innodb_mysql-master.opt
        M  mysql-test/t/innodb_mysql.test
        M  mysql-test/t/lock.test
        M  mysql-test/t/lock_multi.test
        M  mysql-test/t/log_tables.test
        M  mysql-test/t/merge.test
        M  mysql-test/t/mysql.test
        M  mysql-test/t/mysqlbinlog.test
        M  mysql-test/t/mysqldump-compat.test
        M  mysql-test/t/mysqldump.test
        M  mysql-test/t/mysqltest.test
        M  mysql-test/t/partition.test
        M  mysql-test/t/partition_error.test
        M  mysql-test/t/ps.test
        M  mysql-test/t/query_cache_28249.test
        M  mysql-test/t/read_only.test
        M  mysql-test/t/select.test
        M  mysql-test/t/show_check.test
        M  mysql-test/t/skip_name_resolve.test
        M  mysql-test/t/sp-security.test
        M  mysql-test/t/sp_notembedded.test
        M  mysql-test/t/ssl-big.test
        M  mysql-test/t/ssl.test
        M  mysql-test/t/ssl_compress.test
        M  mysql-test/t/status.test
        M  mysql-test/t/strict.test
        M  mysql-test/t/trigger-compat.test
        M  mysql-test/t/type_bit_innodb.test
        M  mysql-test/t/user_limits.test
        M  mysql-test/t/variables.test
        M  mysql-test/t/view.test
        M  mysql-test/t/view_grant.test
        M  mysql-test/t/wait_timeout.test
        M  mysql-test/t/xa.test
        M  mysys/default.c
        M  mysys/errors.c
        M  mysys/md5.c
        M  mysys/my_error.c
        M  mysys/my_fstream.c
        M  mysys/my_getopt.c
        M  mysys/my_pread.c
        M  mysys/my_write.c
        M  plugin/Makefile.am
        M  scripts/mysql_system_tables.sql
        M  scripts/mysql_system_tables_fix.sql
        M  scripts/mysqld_safe.sh
        M  scripts/mysqldumpslow.sh
        M  server-tools/instance-manager/instance_map.cc
        M  server-tools/instance-manager/options.cc
        M  server-tools/instance-manager/options.h
        M  sql-common/client.c
        M  sql/ha_partition.cc
        M  sql/handler.cc
        M  sql/item.cc
        M  sql/item_func.cc
        M  sql/item_strfunc.cc
        M  sql/item_sum.cc
        M  sql/log.cc
        M  sql/log_event.cc
        M  sql/log_event.h
        M  sql/mysql_priv.h
        M  sql/mysqld.cc
        M  sql/opt_range.cc
        M  sql/protocol.cc
        M  sql/rpl_record.cc
        M  sql/rpl_rli.cc
        M  sql/rpl_rli.h
        M  sql/set_var.cc
        M  sql/share/errmsg.txt
        M  sql/sp.cc
        M  sql/sql_base.cc
        M  sql/sql_cache.cc
        M  sql/sql_class.cc
        M  sql/sql_class.h
        M  sql/sql_handler.cc
        M  sql/sql_lex.cc
        M  sql/sql_lex.h
        M  sql/sql_load.cc
        M  sql/sql_parse.cc
        M  sql/sql_plugin.cc
        M  sql/sql_select.cc
        M  sql/sql_show.cc
        M  sql/sql_table.cc
        M  sql/sql_view.cc
        M  sql/sql_yacc.yy
        M  sql/table.cc
        M  sql/unireg.cc
        M  storage/Makefile.am
        M  storage/archive/ha_archive.cc
        M  storage/innobase/btr/btr0sea.c
        M  storage/innobase/dict/dict0load.c
        M  storage/innobase/handler/ha_innodb.cc
        M  storage/innobase/include/rem0rec.h
        M  storage/innobase/include/rem0rec.ic
        M  storage/innobase/include/trx0roll.h
        M  storage/innobase/lock/lock0lock.c
        M  storage/innobase/trx/trx0roll.c
        M  storage/innobase/trx/trx0trx.c
        M  storage/myisam/ha_myisam.cc
        M  storage/myisam/myisamchk.c
        M  storage/myisammrg/ha_myisammrg.cc
        M  support-files/Makefile.am
        M  support-files/mysql.spec.sh
        M  tests/mysql_client_test.c
        2555.346.12 Alexey Kopytov	2009-03-19 [merge]
                    Automerge.

            M  mysql-test/include/concurrent.inc
            M  mysql-test/t/disabled.def
            M  mysys/my_error.c
            M  scripts/mysqld_safe.sh
             2555.351.5 Chad MILLER	2009-03-18 [merge]
                        Merge bugteam and fix for 42675.

                M  mysys/my_error.c
                 2555.358.2 Chad MILLER	2009-03-17
                            Fix indentation.  tab -> spaces

                    M  mysys/my_error.c
                 2555.358.1 Chad MILLER	2009-03-17
                            Bug#42675: Dangling pointer leads to a client crash (mysys/my_error.c \
                            	patch enclosed)
                              
                            One call to my_error_unregister_all() would free pointers, but leave one
                            pointer to just-freed memory still assigned.  That's the bug.  Subsequent
                            calls of this function would try to follow pointers into deallocated, 
                            garbage memory and almost certainly SEGV.
                            
                            Now, after freeing a linked list, unset the initial pointer.

                    M  mysys/my_error.c
             2555.351.4 Chad MILLER	2009-03-18 [merge]
                        Merge fix for 39326 and bugteam tree.

                M  scripts/mysqld_safe.sh
                 2555.357.2 Chad MILLER	2009-03-16
                            Fix several quoting problems, and clean up IFS on failure in my_which().

                    M  scripts/mysqld_safe.sh
                 2555.357.1 Chad MILLER	2009-03-16
                            Bug#39326: mysqld_safe doesn't use --basedir value in search of \
                            	my_print_defaults
                            
                            Now use basedir to set an unset ledir and to find the location of
                            my_print_defaults .

                    M  scripts/mysqld_safe.sh
             2555.351.3 Horst Hunger	2009-03-18 [merge]
                        due to merge (pull)

                A  mysql-test/std_data/bug32880.ARN
                A  mysql-test/std_data/bug32880.ARZ
                A  mysql-test/std_data/bug32880.frm
                M  configure.in
                M  libmysqld/CMakeLists.txt
                M  libmysqld/examples/CMakeLists.txt
                M  mysql-test/r/archive.result
                M  mysql-test/r/create.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/suite/funcs_1/r/is_columns_is.result
                M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
                M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
                M  mysql-test/suite/rpl/r/rpl_do_grant.result
                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/t/rpl_do_grant.test
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
                M  mysql-test/t/archive.test
                M  mysql-test/t/information_schema.test
                M  mysys/my_getopt.c
                M  sql/sql_parse.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                M  sql/table.cc
                M  storage/archive/ha_archive.cc
             2555.351.2 Horst Hunger	2009-03-18
                        Due to bug#43733 I disabled "concurrent_innodb_(un)safelog.test" for embedded server.

                M  mysql-test/include/concurrent.inc
                M  mysql-test/t/disabled.def
        2555.346.11 Alexey Kopytov	2009-03-18 [merge]
                    Automerge.

            M  sql/sql_select.cc
            M  sql/table.cc
             2555.356.3 Tatiana A. Nurnberg	2009-03-18 [merge]
                        auto-merge

                M  configure.in
                M  libmysqld/CMakeLists.txt
                M  libmysqld/examples/CMakeLists.txt
                M  mysql-test/suite/funcs_1/r/is_columns_is.result
                M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
                M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
             2555.356.2 Tatiana A. Nurnberg	2009-03-18 [merge]
                        auto-merge

                D  mysql-test/suite/sys_vars/t/completion_type_func-master.opt
                D  sql-bench/TODO
                A  mysql-test/collections/
                A  mysql-test/collections/README
                A  mysql-test/collections/README.experimental
                A  mysql-test/collections/default.daily
                A  mysql-test/collections/default.experimental
                A  mysql-test/collections/default.push
                A  mysql-test/collections/default.weekly
                A  mysql-test/std_data/bug32880.ARN
                A  mysql-test/std_data/bug32880.ARZ
                A  mysql-test/std_data/bug32880.frm
                A  mysql-test/suite/binlog/r/binlog_sql_mode.result
                A  mysql-test/suite/binlog/t/binlog_sql_mode.test
                A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
                A  mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
                A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
                A  mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
                A  storage/ibmdb2i/
                A  storage/ibmdb2i/CMakeLists.txt
                A  storage/ibmdb2i/Makefile.am
                A  storage/ibmdb2i/db2i_blobCollection.cc
                A  storage/ibmdb2i/db2i_blobCollection.h
                A  storage/ibmdb2i/db2i_charsetSupport.cc
                A  storage/ibmdb2i/db2i_charsetSupport.h
                A  storage/ibmdb2i/db2i_collationSupport.cc
                A  storage/ibmdb2i/db2i_collationSupport.h
                A  storage/ibmdb2i/db2i_constraints.cc
                A  storage/ibmdb2i/db2i_conversion.cc
                A  storage/ibmdb2i/db2i_errors.cc
                A  storage/ibmdb2i/db2i_errors.h
                A  storage/ibmdb2i/db2i_file.cc
                A  storage/ibmdb2i/db2i_file.h
                A  storage/ibmdb2i/db2i_global.h
                A  storage/ibmdb2i/db2i_iconv.h
                A  storage/ibmdb2i/db2i_ileBridge.cc
                A  storage/ibmdb2i/db2i_ileBridge.h
                A  storage/ibmdb2i/db2i_ioBuffers.cc
                A  storage/ibmdb2i/db2i_ioBuffers.h
                A  storage/ibmdb2i/db2i_misc.h
                A  storage/ibmdb2i/db2i_myconv.cc
                A  storage/ibmdb2i/db2i_myconv.h
                A  storage/ibmdb2i/db2i_rir.cc
                A  storage/ibmdb2i/db2i_safeString.h
                A  storage/ibmdb2i/db2i_sqlStatementStream.cc
                A  storage/ibmdb2i/db2i_sqlStatementStream.h
                A  storage/ibmdb2i/db2i_validatedPointer.h
                A  storage/ibmdb2i/ha_ibmdb2i.cc
                A  storage/ibmdb2i/ha_ibmdb2i.h
                A  storage/ibmdb2i/plug.in
                M  .bzrignore
                M  CMakeLists.txt
                M  client/mysql.cc
                M  client/mysqldump.c
                M  cmd-line-utils/libedit/makelist.sh
                M  cmd-line-utils/libedit/readline.c
                M  cmd-line-utils/libedit/readline/readline.h
                M  cmd-line-utils/libedit/vi.c
                M  config/ac-macros/ha_ndbcluster.m4
                M  config/ac-macros/plugins.m4
                M  configure.in
                M  include/config-win.h
                M  include/my_getopt.h
                M  include/my_global.h
                M  include/my_md5.h
                M  include/my_sys.h
                M  libmysqld/lib_sql.cc
                M  mysql-test/Makefile.am
                M  mysql-test/include/check-warnings.test
                M  mysql-test/include/concurrent.inc
                M  mysql-test/include/handler.inc
                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/include/wait_until_count_sessions.inc
                M  mysql-test/lib/My/ConfigFactory.pm
                M  mysql-test/lib/My/Platform.pm
                M  mysql-test/lib/My/SafeProcess.pm
                M  mysql-test/lib/My/SafeProcess/safe_process.cc
                M  mysql-test/lib/mtr_gcov.pl
                M  mysql-test/lib/mtr_report.pm
                M  mysql-test/lib/mtr_unique.pm
                M  mysql-test/mysql-test-run.pl
                M  mysql-test/r/archive.result
                M  mysql-test/r/concurrent_innodb_safelog.result
                M  mysql-test/r/concurrent_innodb_unsafelog.result
                M  mysql-test/r/connect.result
                M  mysql-test/r/consistent_snapshot.result
                M  mysql-test/r/create.result
                M  mysql-test/r/ddl_i18n_koi8r.result
                M  mysql-test/r/ddl_i18n_utf8.result
                M  mysql-test/r/dirty_close.result
                M  mysql-test/r/events_bugs.result
                M  mysql-test/r/explain.result
                M  mysql-test/r/flush_block_commit.result
                M  mysql-test/r/flush_block_commit_notembedded.result
                M  mysql-test/r/flush_read_lock_kill.result
                M  mysql-test/r/func_math.result
                M  mysql-test/r/grant.result
                M  mysql-test/r/group_by.result
                M  mysql-test/r/group_min_max.result
                M  mysql-test/r/handler_innodb.result
                M  mysql-test/r/handler_myisam.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/r/information_schema_db.result
                M  mysql-test/r/innodb-autoinc.result
                M  mysql-test/r/key_cache.result
                M  mysql-test/r/lock.result
                M  mysql-test/r/lock_multi.result
                M  mysql-test/r/log_tables.result
                M  mysql-test/r/merge.result
                M  mysql-test/r/mysql.result
                M  mysql-test/r/mysqlbinlog.result
                M  mysql-test/r/mysqlcheck.result
                M  mysql-test/r/mysqldump-max.result
                M  mysql-test/r/mysqldump.result
                M  mysql-test/r/mysqltest.result
                M  mysql-test/r/openssl_1.result
                M  mysql-test/r/preload.result
                M  mysql-test/r/ps.result
                M  mysql-test/r/read_only.result
                M  mysql-test/r/repair.result
                M  mysql-test/r/select.result
                M  mysql-test/r/show_check.result
                M  mysql-test/r/skip_name_resolve.result
                M  mysql-test/r/sp-security.result
                M  mysql-test/r/strict.result
                M  mysql-test/r/system_mysql_db.result
                M  mysql-test/r/variables.result
                M  mysql-test/r/view.result
                M  mysql-test/r/view_grant.result
                M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                M  mysql-test/suite/binlog/r/binlog_unsafe.result
                M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                M  mysql-test/suite/binlog/t/binlog_unsafe.test
                M  mysql-test/suite/funcs_1/r/innodb_func_view.result
                M  mysql-test/suite/funcs_1/r/innodb_views.result
                M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
                M  mysql-test/suite/funcs_1/r/is_columns_memory.result
                M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
                M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
                M  mysql-test/suite/funcs_1/r/memory_views.result
                M  mysql-test/suite/funcs_1/r/myisam_views.result
                M  mysql-test/suite/funcs_1/r/ndb_views.result
                M  mysql-test/suite/ndb/r/ndb_restore.result
                M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                M  mysql-test/suite/ndb/r/ndb_restore_print.result
                M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/rpl/r/rpl_do_grant.result
                M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/t/rpl_do_grant.test
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
                M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
                M  mysql-test/suite/sys_vars/r/completion_type_func.result
                M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
                M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
                M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
                M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
                M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
                M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
                M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_connections_basic.result
                M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
                M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
                M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
                M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
                M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
                M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
                M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
                M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
                M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
                M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
                M  mysql-test/suite/sys_vars/t/completion_type_func.test
                M  mysql-test/t/alter_table-big.test
                M  mysql-test/t/archive.test
                M  mysql-test/t/connect.test
                M  mysql-test/t/consistent_snapshot.test
                M  mysql-test/t/ddl_i18n_koi8r.test
                M  mysql-test/t/ddl_i18n_utf8.test
                M  mysql-test/t/dirty_close.test
                M  mysql-test/t/drop.test
                M  mysql-test/t/events_bugs.test
                M  mysql-test/t/explain.test
                M  mysql-test/t/flush_block_commit.test
                M  mysql-test/t/flush_block_commit_notembedded.test
                M  mysql-test/t/flush_read_lock_kill.test
                M  mysql-test/t/func_group.test
                M  mysql-test/t/func_math.test
                M  mysql-test/t/group_by.test
                M  mysql-test/t/group_min_max.test
                M  mysql-test/t/information_schema.test
                M  mysql-test/t/init_connect.test
                M  mysql-test/t/innodb-autoinc.test
                M  mysql-test/t/lock.test
                M  mysql-test/t/lock_multi.test
                M  mysql-test/t/log_tables.test
                M  mysql-test/t/merge.test
                M  mysql-test/t/mysql.test
                M  mysql-test/t/mysqlbinlog.test
                M  mysql-test/t/mysqldump-compat.test
                M  mysql-test/t/mysqldump.test
                M  mysql-test/t/mysqltest.test
                M  mysql-test/t/ps.test
                M  mysql-test/t/query_cache_28249.test
                M  mysql-test/t/read_only.test
                M  mysql-test/t/select.test
                M  mysql-test/t/show_check.test
                M  mysql-test/t/skip_name_resolve.test
                M  mysql-test/t/sp-security.test
                M  mysql-test/t/sp_notembedded.test
                M  mysql-test/t/ssl-big.test
                M  mysql-test/t/ssl.test
                M  mysql-test/t/ssl_compress.test
                M  mysql-test/t/status.test
                M  mysql-test/t/strict.test
                M  mysql-test/t/type_bit_innodb.test
                M  mysql-test/t/user_limits.test
                M  mysql-test/t/variables.test
                M  mysql-test/t/view.test
                M  mysql-test/t/view_grant.test
                M  mysql-test/t/wait_timeout.test
                M  mysql-test/t/xa.test
                M  mysys/default.c
                M  mysys/errors.c
                M  mysys/md5.c
                M  mysys/my_fstream.c
                M  mysys/my_getopt.c
                M  mysys/my_pread.c
                M  mysys/my_write.c
                M  plugin/Makefile.am
                M  scripts/mysql_system_tables.sql
                M  scripts/mysql_system_tables_fix.sql
                M  scripts/mysqldumpslow.sh
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/item_func.cc
                M  sql/item_strfunc.cc
                M  sql/item_sum.cc
                M  sql/log.cc
                M  sql/log_event.cc
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/opt_range.cc
                M  sql/protocol.cc
                M  sql/rpl_record.cc
                M  sql/set_var.cc
                M  sql/share/errmsg.txt
                M  sql/sp.cc
                M  sql/sql_base.cc
                M  sql/sql_cache.cc
                M  sql/sql_class.cc
                M  sql/sql_class.h
                M  sql/sql_handler.cc
                M  sql/sql_lex.cc
                M  sql/sql_lex.h
                M  sql/sql_parse.cc
                M  sql/sql_plugin.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                M  sql/sql_table.cc
                M  sql/sql_view.cc
                M  sql/sql_yacc.yy
                M  sql/table.cc
                M  sql/unireg.cc
                M  storage/Makefile.am
                M  storage/archive/ha_archive.cc
                M  storage/innobase/btr/btr0sea.c
                M  storage/innobase/dict/dict0load.c
                M  storage/innobase/handler/ha_innodb.cc
                M  storage/innobase/include/rem0rec.h
                M  storage/innobase/include/rem0rec.ic
                M  storage/innobase/include/trx0roll.h
                M  storage/innobase/lock/lock0lock.c
                M  storage/innobase/trx/trx0roll.c
                M  storage/innobase/trx/trx0trx.c
                M  storage/myisam/ha_myisam.cc
                M  storage/myisam/myisamchk.c
                M  storage/myisammrg/ha_myisammrg.cc
                M  support-files/Makefile.am
                M  support-files/mysql.spec.sh
                M  tests/mysql_client_test.c
             2555.356.1 Tatiana A. Nurnberg	2009-03-11
                        Bug#36751: Segmentation fault in ctype-bin.c:308; Linux 86_64, with-max-indexes=128
                        
                        mysqld is optimized for the default
                        case (up to 64-indices); for a greater
                        number of indices it goes through a
                        different code path. As that code-path
                        is a compile-time option and can not
                        easily be covered in standard tests,
                        bitrot occurred. key-fields need an
                        explicit initialization in the non-
                        optimized case; this setup was
                        presumably not added when a new key-
                        vector was added.
                        
                        Changeset adds the necessary
                        initialisations.
                        
                        No test case added due to dependence
                        on compile-time option.
                 @ sql/sql_select.cc
                    Init merge_keys as well. If we don't,
                    things blow up badly outside of the
                    optimized-for-64-keys case!
                 @ sql/table.cc
                    Init merge_keys as well. If we don't,
                    things blow up badly outside of the
                    optimized-for-64-keys case!

                M  sql/sql_select.cc
                M  sql/table.cc
        2555.346.10 Alexey Kopytov	2009-03-18 [merge]
                    Automerge.

            M  configure.in
            M  libmysqld/CMakeLists.txt
            M  libmysqld/examples/CMakeLists.txt
            M  mysql-test/suite/funcs_1/r/is_columns_is.result
            M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
            M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
             2555.350.4 Vladislav Vaintroub	2009-03-18 [merge]
                        merge

                A  mysql-test/std_data/bug32880.ARN
                A  mysql-test/std_data/bug32880.ARZ
                A  mysql-test/std_data/bug32880.frm
                M  configure.in
                M  mysql-test/r/archive.result
                M  mysql-test/suite/funcs_1/r/is_columns_is.result
                M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
                M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
                M  mysql-test/suite/rpl/r/rpl_do_grant.result
                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/t/rpl_do_grant.test
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
                M  mysql-test/t/archive.test
                M  sql/sql_parse.cc
                M  storage/archive/ha_archive.cc
                 2555.355.2 Georgi Kodinov	2009-03-18
                            addendum to the 22047 fix : updated funcs_1 test suite

                    M  mysql-test/suite/funcs_1/r/is_columns_is.result
                    M  mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
                    M  mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
                 2555.355.1 Georgi Kodinov	2009-03-18 [merge]
                            merged 5.1-main -> 5.1-bugteam

                    M  configure.in
                 2555.354.1 Jonathan Perkin	2009-03-13
                            Raise version number after cloning 5.1.33

                    M  configure.in
             2555.350.3 Vladislav Vaintroub	2009-03-17
                        Bug #43715 Link errors when trying to link mysql_embedded.exe
                        
                        The reason for the error is incorrectly specified link dependencies
                        for mysql_embedded, mysqltest_embedded and mysql_client_test_embedded
                        in CMakeLists.txt (ADD_DEPENDENCIES should be TARGET_LINK_LIBRARIES)
                 @ libmysqld/CMakeLists.txt
                    changed library type for libmysqld to SHARED instead of
                    MODULE. MODULE in CMake notation is a shared library that 
                    is used only in dlopen/dlsym/LoadLibrary scenarios.
                    Hence it was impossible to use TARGET_LINK_LIBRARIES with
                    a MODULE.
                 @ libmysqld/examples/CMakeLists.txt
                    Use TARGET_LINK_LIBRARIES (instead of previously incorrectly 
                    used ADD_DEPENDENCIES) to specify link dependency from libmysqld

                M  libmysqld/CMakeLists.txt
                M  libmysqld/examples/CMakeLists.txt
         2555.346.9 Alexey Kopytov	2009-03-18 [merge]
                    Automerge.

            1810.3864.3 Alexey Kopytov	2009-03-18 [merge]
                        Automerge.

                M  client/my_readline.h
                M  client/mysql.cc
                M  client/readline.cc
                M  mysql-test/r/mysql.result
                M  mysql-test/t/mysql.test
         2555.346.8 Alexey Kopytov	2009-03-18 [merge]
                    Automerge.

            M  client/my_readline.h
            M  client/mysql.cc
            M  client/readline.cc
            M  mysql-test/r/mysql.result
            M  mysql-test/t/mysql.test
             2555.353.1 Alexey Kopytov	2009-03-18 [merge]
                        Manual merge.

                M  client/my_readline.h
                M  client/mysql.cc
                M  client/readline.cc
                M  mysql-test/r/mysql.result
                M  mysql-test/t/mysql.test
            1810.3865.1 Alexey Kopytov	2009-03-18
                        Fix for bug#41486: extra character appears in BLOB for every 
                                           ~40Mb after mysqldump/import 
                                
                        When the input string exceeds the maximum allowed size for the 
                        internal buffer, batch_readline() returns a truncated string. 
                        Since there was no way for a caller to determine whether the 
                        string was truncated or not, the command line client assumed 
                        batch_readline() to always return the whole input string and 
                        appended a newline character. This resulted in garbled data 
                        when importing dumps containing strings longer than the 
                        maximum input buffer size. 
                          
                        Fixed by adding a flag to the batch_readline() interface to 
                        signal a truncated string to the caller. 
                          
                        Other minor problems fixed during patch implementation: 
                         
                        - The maximum allowed buffer size for batch_readline() was set 
                        up depending on the client's max_allowed_packet value. It does 
                        not actully make any sense, as those variables are not 
                        related. The input buffer size limit is now always set to 1 
                        MB. 
                          
                        - fill_buffer() did not always set the EOF flag. 
                         
                        - The input buffer could actually grow twice as the specified 
                        limit due to insufficient checks in intern_read_line(). 
                 @ client/my_readline.h
                    Changed the interface of batch_readline().
                 @ client/mysql.cc
                    Honor the truncated flag returned by batch_readline() and do  
                    not append the newline character if it was set. Since we can't 
                    change the interfaces for readline()/fgets() used in the  
                    interactive mode, always assume the returned string was not  
                    truncated. In addition, always set the batch_readline()  
                    internal buffer to 1 MB, independently from the client's  
                    max_allowed_packet.
                 @ client/readline.cc
                    Added the 'truncated' argument do batch_readline() to signal 
                    truncated string to a caller. 
                    Fixed fill_buffer() to set the EOF flag correctly. 
                    Fixed checks in intern_read_line() to not allow the internal  
                    buffer grow past the specified limit.
                 @ mysql-test/r/mysql.result
                    Added a test case for bug #41486.
                 @ mysql-test/t/mysql.test
                    Added a test case for bug #41486.

                M  client/my_readline.h
                M  client/mysql.cc
                M  client/readline.cc
                M  mysql-test/r/mysql.result
                M  mysql-test/t/mysql.test
         2555.346.7 Guangbao Ni	2009-03-18 [merge]
                    Auto-merged from 5.1-bugteam

            A  mysql-test/std_data/bug32880.ARN
            A  mysql-test/std_data/bug32880.ARZ
            A  mysql-test/std_data/bug32880.frm
            M  mysql-test/r/archive.result
            M  mysql-test/t/archive.test
            M  storage/archive/ha_archive.cc
             2555.352.2 Satya B	2009-03-18 [merge]
                        merge to  5.1-bugteam branch

                D  sql-bench/TODO
                A  mysql-test/collections/
                A  mysql-test/collections/README
                A  mysql-test/collections/README.experimental
                A  mysql-test/collections/default.daily
                A  mysql-test/collections/default.experimental
                A  mysql-test/collections/default.push
                A  mysql-test/collections/default.weekly
                A  mysql-test/suite/binlog/r/binlog_sql_mode.result
                A  mysql-test/suite/binlog/t/binlog_sql_mode.test
                A  mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
                A  mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
                A  storage/ibmdb2i/
                A  storage/ibmdb2i/CMakeLists.txt
                A  storage/ibmdb2i/Makefile.am
                A  storage/ibmdb2i/db2i_blobCollection.cc
                A  storage/ibmdb2i/db2i_blobCollection.h
                A  storage/ibmdb2i/db2i_charsetSupport.cc
                A  storage/ibmdb2i/db2i_charsetSupport.h
                A  storage/ibmdb2i/db2i_collationSupport.cc
                A  storage/ibmdb2i/db2i_collationSupport.h
                A  storage/ibmdb2i/db2i_constraints.cc
                A  storage/ibmdb2i/db2i_conversion.cc
                A  storage/ibmdb2i/db2i_errors.cc
                A  storage/ibmdb2i/db2i_errors.h
                A  storage/ibmdb2i/db2i_file.cc
                A  storage/ibmdb2i/db2i_file.h
                A  storage/ibmdb2i/db2i_global.h
                A  storage/ibmdb2i/db2i_iconv.h
                A  storage/ibmdb2i/db2i_ileBridge.cc
                A  storage/ibmdb2i/db2i_ileBridge.h
                A  storage/ibmdb2i/db2i_ioBuffers.cc
                A  storage/ibmdb2i/db2i_ioBuffers.h
                A  storage/ibmdb2i/db2i_misc.h
                A  storage/ibmdb2i/db2i_myconv.cc
                A  storage/ibmdb2i/db2i_myconv.h
                A  storage/ibmdb2i/db2i_rir.cc
                A  storage/ibmdb2i/db2i_safeString.h
                A  storage/ibmdb2i/db2i_sqlStatementStream.cc
                A  storage/ibmdb2i/db2i_sqlStatementStream.h
                A  storage/ibmdb2i/db2i_validatedPointer.h
                A  storage/ibmdb2i/ha_ibmdb2i.cc
                A  storage/ibmdb2i/ha_ibmdb2i.h
                A  storage/ibmdb2i/plug.in
                M  .bzrignore
                M  CMakeLists.txt
                M  client/mysqldump.c
                M  cmd-line-utils/libedit/makelist.sh
                M  cmd-line-utils/libedit/readline.c
                M  cmd-line-utils/libedit/readline/readline.h
                M  cmd-line-utils/libedit/vi.c
                M  config/ac-macros/ha_ndbcluster.m4
                M  config/ac-macros/plugins.m4
                M  configure.in
                M  include/my_md5.h
                M  include/my_sys.h
                M  mysql-test/Makefile.am
                M  mysql-test/include/check-warnings.test
                M  mysql-test/include/concurrent.inc
                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/include/wait_until_count_sessions.inc
                M  mysql-test/lib/My/ConfigFactory.pm
                M  mysql-test/lib/My/Platform.pm
                M  mysql-test/lib/My/SafeProcess.pm
                M  mysql-test/lib/My/SafeProcess/safe_process.cc
                M  mysql-test/lib/mtr_gcov.pl
                M  mysql-test/lib/mtr_report.pm
                M  mysql-test/lib/mtr_unique.pm
                M  mysql-test/mysql-test-run.pl
                M  mysql-test/r/concurrent_innodb_safelog.result
                M  mysql-test/r/concurrent_innodb_unsafelog.result
                M  mysql-test/r/connect.result
                M  mysql-test/r/consistent_snapshot.result
                M  mysql-test/r/create.result
                M  mysql-test/r/dirty_close.result
                M  mysql-test/r/events_bugs.result
                M  mysql-test/r/explain.result
                M  mysql-test/r/flush_block_commit.result
                M  mysql-test/r/flush_block_commit_notembedded.result
                M  mysql-test/r/flush_read_lock_kill.result
                M  mysql-test/r/grant.result
                M  mysql-test/r/group_by.result
                M  mysql-test/r/group_min_max.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/r/information_schema_db.result
                M  mysql-test/r/innodb-autoinc.result
                M  mysql-test/r/key_cache.result
                M  mysql-test/r/lock.result
                M  mysql-test/r/lock_multi.result
                M  mysql-test/r/log_tables.result
                M  mysql-test/r/merge.result
                M  mysql-test/r/mysqlbinlog.result
                M  mysql-test/r/mysqlcheck.result
                M  mysql-test/r/mysqldump.result
                M  mysql-test/r/mysqltest.result
                M  mysql-test/r/preload.result
                M  mysql-test/r/ps.result
                M  mysql-test/r/read_only.result
                M  mysql-test/r/repair.result
                M  mysql-test/r/select.result
                M  mysql-test/r/show_check.result
                M  mysql-test/r/skip_name_resolve.result
                M  mysql-test/r/sp-security.result
                M  mysql-test/r/strict.result
                M  mysql-test/r/system_mysql_db.result
                M  mysql-test/r/variables.result
                M  mysql-test/r/view.result
                M  mysql-test/r/view_grant.result
                M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                M  mysql-test/suite/binlog/r/binlog_unsafe.result
                M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                M  mysql-test/suite/binlog/t/binlog_unsafe.test
                M  mysql-test/suite/funcs_1/r/innodb_func_view.result
                M  mysql-test/suite/funcs_1/r/innodb_views.result
                M  mysql-test/suite/funcs_1/r/is_columns_innodb.result
                M  mysql-test/suite/funcs_1/r/is_columns_memory.result
                M  mysql-test/suite/funcs_1/r/is_columns_myisam.result
                M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
                M  mysql-test/suite/funcs_1/r/memory_views.result
                M  mysql-test/suite/funcs_1/r/myisam_views.result
                M  mysql-test/suite/funcs_1/r/ndb_views.result
                M  mysql-test/suite/ndb/r/ndb_restore.result
                M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                M  mysql-test/suite/ndb/r/ndb_restore_print.result
                M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/rpl/r/rpl_failed_optimize.result
                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
                M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
                M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
                M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
                M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
                M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
                M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
                M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
                M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_connections_basic.result
                M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
                M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
                M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
                M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
                M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
                M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
                M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
                M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
                M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
                M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
                M  mysql-test/t/alter_table-big.test
                M  mysql-test/t/connect.test
                M  mysql-test/t/consistent_snapshot.test
                M  mysql-test/t/ddl_i18n_koi8r.test
                M  mysql-test/t/ddl_i18n_utf8.test
                M  mysql-test/t/dirty_close.test
                M  mysql-test/t/drop.test
                M  mysql-test/t/events_bugs.test
                M  mysql-test/t/explain.test
                M  mysql-test/t/flush_block_commit.test
                M  mysql-test/t/flush_block_commit_notembedded.test
                M  mysql-test/t/flush_read_lock_kill.test
                M  mysql-test/t/func_group.test
                M  mysql-test/t/group_by.test
                M  mysql-test/t/group_min_max.test
                M  mysql-test/t/information_schema.test
                M  mysql-test/t/init_connect.test
                M  mysql-test/t/innodb-autoinc.test
                M  mysql-test/t/lock.test
                M  mysql-test/t/lock_multi.test
                M  mysql-test/t/log_tables.test
                M  mysql-test/t/merge.test
                M  mysql-test/t/mysql.test
                M  mysql-test/t/mysqlbinlog.test
                M  mysql-test/t/mysqldump-compat.test
                M  mysql-test/t/mysqldump.test
                M  mysql-test/t/mysqltest.test
                M  mysql-test/t/ps.test
                M  mysql-test/t/read_only.test
                M  mysql-test/t/select.test
                M  mysql-test/t/show_check.test
                M  mysql-test/t/skip_name_resolve.test
                M  mysql-test/t/sp-security.test
                M  mysql-test/t/sp_notembedded.test
                M  mysql-test/t/ssl-big.test
                M  mysql-test/t/ssl.test
                M  mysql-test/t/ssl_compress.test
                M  mysql-test/t/status.test
                M  mysql-test/t/strict.test
                M  mysql-test/t/type_bit_innodb.test
                M  mysql-test/t/user_limits.test
                M  mysql-test/t/variables.test
                M  mysql-test/t/view.test
                M  mysql-test/t/view_grant.test
                M  mysql-test/t/wait_timeout.test
                M  mysql-test/t/xa.test
                M  mysys/default.c
                M  mysys/errors.c
                M  mysys/md5.c
                M  mysys/my_fstream.c
                M  mysys/my_getopt.c
                M  mysys/my_pread.c
                M  mysys/my_write.c
                M  plugin/Makefile.am
                M  scripts/mysql_system_tables.sql
                M  scripts/mysql_system_tables_fix.sql
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/item_func.cc
                M  sql/item_strfunc.cc
                M  sql/item_sum.cc
                M  sql/log.cc
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/opt_range.cc
                M  sql/protocol.cc
                M  sql/rpl_record.cc
                M  sql/set_var.cc
                M  sql/share/errmsg.txt
                M  sql/sp.cc
                M  sql/sql_cache.cc
                M  sql/sql_class.cc
                M  sql/sql_class.h
                M  sql/sql_lex.cc
                M  sql/sql_lex.h
                M  sql/sql_parse.cc
                M  sql/sql_plugin.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                M  sql/sql_table.cc
                M  sql/sql_yacc.yy
                M  sql/table.cc
                M  sql/unireg.cc
                M  storage/Makefile.am
                M  storage/innobase/btr/btr0sea.c
                M  storage/innobase/dict/dict0load.c
                M  storage/innobase/handler/ha_innodb.cc
                M  storage/innobase/include/rem0rec.h
                M  storage/innobase/include/rem0rec.ic
                M  storage/innobase/include/trx0roll.h
                M  storage/innobase/lock/lock0lock.c
                M  storage/innobase/trx/trx0roll.c
                M  storage/innobase/trx/trx0trx.c
                M  storage/myisammrg/ha_myisammrg.cc
                M  support-files/Makefile.am
                M  support-files/mysql.spec.sh
                M  tests/mysql_client_test.c
             2555.352.1 Satya B	2009-03-18
                        Fix for BUG#32880 - Repairing Archive table fails with internal error 144
                        
                        Any statement reading corrupt archive data file
                        (CHECK/REPAIR/SELECT/UPDATE/DELETE) may cause assertion
                        failure in debug builds. This assertion has been removed
                        and an error is returned instead.
                        
                        Also fixed that CHECK/REPAIR returns vague error message
                        when it mets corruption in archive data file. This is
                        fixed by returning proper error code.
                 @ mysql-test/r/archive.result
                    A test case for BUG#32880
                 @ mysql-test/std_data/bug32880.ARN
                    corrupted archive table to test check and repair table operation
                 @ mysql-test/std_data/bug32880.ARZ
                    corrupted archive table to test check and repair table operation
                 @ mysql-test/std_data/bug32880.frm
                    corrupted archive table to test check and repair table operation
                 @ mysql-test/t/archive.test
                    A test case for BUG#32880
                 @ storage/archive/ha_archive.cc
                    Fixed unpack_row() to return the error instead of throwing assertion 
                    and also fixed repair() to throw better error when repair table
                    operation fails on corrupted archive table

                A  mysql-test/std_data/bug32880.ARN
                A  mysql-test/std_data/bug32880.ARZ
                A  mysql-test/std_data/bug32880.frm
                M  mysql-test/r/archive.result
                M  mysql-test/t/archive.test
                M  storage/archive/ha_archive.cc
         2555.346.6 Guangbao Ni	2009-03-18 [merge]
                    Auto-merge from 5.1-bugteam

            M  mysql-test/include/concurrent.inc
            M  mysql-test/r/concurrent_innodb_safelog.result
            M  mysql-test/r/concurrent_innodb_unsafelog.result
            M  mysql-test/r/create.result
            M  mysql-test/r/information_schema.result
            M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
            M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
            M  mysql-test/t/information_schema.test
            M  mysys/my_getopt.c
            M  sql/sql_show.cc
             2555.341.9 Leonard Zhou	2009-03-18 [merge]
                        Merge

                M  client/mysqldump.c
                M  config/ac-macros/ha_ndbcluster.m4
                M  config/ac-macros/plugins.m4
                M  include/my_sys.h
                M  mysql-test/include/concurrent.inc
                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/r/concurrent_innodb_safelog.result
                M  mysql-test/r/concurrent_innodb_unsafelog.result
                M  mysql-test/r/create.result
                M  mysql-test/r/information_schema.result
                M  mysql-test/r/key_cache.result
                M  mysql-test/r/mysqldump.result
                M  mysql-test/r/select.result
                M  mysql-test/r/variables.result
                M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
                M  mysql-test/suite/ndb/r/ndb_restore.result
                M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                M  mysql-test/suite/ndb/r/ndb_restore_print.result
                M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
                M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
                M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
                M  mysql-test/t/information_schema.test
                M  mysql-test/t/mysqldump.test
                M  mysql-test/t/select.test
                M  mysql-test/t/variables.test
                M  mysys/default.c
                M  mysys/my_getopt.c
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/set_var.cc
                M  sql/sql_plugin.cc
                M  sql/sql_select.cc
                M  sql/sql_show.cc
                 2555.350.2 Tatiana A. Nurnberg	2009-03-17 [merge]
                            auto-merge

                    M  mysql-test/include/concurrent.inc
                    M  mysql-test/r/concurrent_innodb_safelog.result
                    M  mysql-test/r/concurrent_innodb_unsafelog.result
                    M  mysql-test/r/create.result
                    M  mysql-test/r/information_schema.result
                    M  mysql-test/t/information_schema.test
                    M  sql/sql_show.cc
                    2555.285.48 Georgi Kodinov	2009-03-17 [merge]
                                merge 5.0-bugteam -> 5.1-bugteam

                        1810.3864.2 Georgi Kodinov	2009-03-17 [merge]
                                    merged 5.0-bugteam -> bug 22047

                            M  mysql-test/include/ndb_backup.inc
                            M  mysql-test/r/ndb_restore.result
                            M  mysql-test/r/ndb_restore_print.result
                    2555.285.47 Georgi Kodinov	2009-03-17 [merge]
                                auto-merge

                        M  include/my_sys.h
                        M  mysql-test/include/concurrent.inc
                        M  mysql-test/include/ndb_backup.inc
                        M  mysql-test/r/concurrent_innodb_safelog.result
                        M  mysql-test/r/concurrent_innodb_unsafelog.result
                        M  mysql-test/r/key_cache.result
                        M  mysql-test/r/select.result
                        M  mysql-test/r/variables.result
                        M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                        M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                        M  mysql-test/suite/ndb/r/ndb_restore.result
                        M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                        M  mysql-test/suite/ndb/r/ndb_restore_print.result
                        M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                        M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                        M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
                        M  mysql-test/t/select.test
                        M  mysql-test/t/variables.test
                        M  mysys/default.c
                        M  mysys/my_getopt.c
                        M  server-tools/instance-manager/instance_map.cc
                        M  server-tools/instance-manager/options.cc
                        M  server-tools/instance-manager/options.h
                        M  sql-common/client.c
                        M  sql/sql_plugin.cc
                        M  sql/sql_select.cc
                         2555.351.1 Horst Hunger	2009-03-17
                                    Fix for bug 39484 after review. I inserted the review results (also including the patches itself):
                                    "Release_lock("hello")" is now also successful when delivering NULL, replaced two sleeps by wait_condition. The last two "sleep 1" have not been replaced as all tried wait conditions leaded to nondeterministic results, especially to succeeding concurrent updates. To replace the sleeps there should be some time planned (or internal knowledge of the server may help).
                                     

                            M  mysql-test/include/concurrent.inc
                            M  mysql-test/r/concurrent_innodb_safelog.result
                            M  mysql-test/r/concurrent_innodb_unsafelog.result
                    2555.285.46 Georgi Kodinov	2009-03-17 [merge]
                                Bug 22047: Time in SHOW PROCESSLIST for SQL thread in replication seems to 
                                become negative
                                
                                - merged the fix to 5.1
                                - extended to cover I_S.PROCESSLIST.TIME
                                - Changed the column type of I_S.PROCESSLIST.TIME from LOGNLONG
                                  UNSIGNED
                                  to LONG (to match the SHOW PROCESSLIST type)
                                - Added a test case

                        M  mysql-test/r/create.result
                        M  mysql-test/r/information_schema.result
                        M  mysql-test/t/information_schema.test
                        M  sql/sql_show.cc
                    1810.3864.1 Georgi Kodinov	2009-03-13
                                Bug #22047 : Time in SHOW PROCESSLIST for SQL thread in replication 
                                seems to become negative
                                
                                THD::start_time has a dual meaning : it's either the time since the process
                                entered a given state or is the transaction time returned by e.g. NOW().
                                This causes problems, as sometimes THD::start_time may be set to a value
                                that is correct and needed when used as a base for NOW(), but these times
                                may be arbitrary (SET @@timestamp) or non-local (coming from the master 
                                through the replication feed).
                                If one such non-local time is set there's no way to return a correct value
                                for e.g. SHOW PROCESSLIST or SELECT ... FROM INFORMATION_SCHEMA.PROCESSLIST.
                                Fixed by making the Time column in SHOW PROCESSLIST SIGNED LONG instead of 
                                UNSIGNED LONG and doing the correct conversions.
                                      
                                Note that no reliable test suite can be constructed, since it would require
                                knowing the local time and can't be achieved by the means of the current test
                                suite.
                         @ sql/sql_show.cc
                            Bug #22047: make the Time in SHOW PROCESSLIST LONG from 
                            LONG UNSIGNED

                        M  sql/sql_show.cc
                 2555.350.1 Tatiana A. Nurnberg	2009-03-17
                            36446: fix Windows warning

                    M  mysys/my_getopt.c
             2555.341.8 Leonard Zhou	2009-03-12
                        BUG#39858 rpl.rpl_rotate (rpl.rpl_rotate_logs) failed on pushbuild: result mismatch
                        
                        The method to purge binary log files produces different results in some platforms.
                        The reason is that the purge time is calculated based on table modified time and
                        that can't guarantee to purge master-bin.000002 in all platforms.(eg. windows)
                        
                        Use a new way that sets the time to purge binlog file 1 second after the last
                        modified time of master-bin.000002.
                        That can be sure that the file is always deleted in any platform.
                 @ mysql-test/suite/rpl/r/rpl_rotate_logs.result
                    Test result
                 @ mysql-test/suite/rpl/t/rpl_rotate_logs.test
                    Test file

                M  mysql-test/suite/rpl/r/rpl_rotate_logs.result
                M  mysql-test/suite/rpl/t/rpl_rotate_logs.test
         2555.346.5 Guangbao Ni	2009-03-18
                    Bug #42217      mysql.procs_priv does not get replicated
                    
                    mysql.procs_priv table itself does not get replicated.
                    Inserting routine privilege record into mysql.procs_priv table
                    is triggered by creating function/procedure statements
                    according to current user's privileges.
                    Because the current user of SQL thread has GLOBAL_ACL,
                    which doesn't need any check mysql.procs_priv privilege
                    when create/alter/execute routines.
                    Corresponding GLOBAL_ACL privilege user
                    doesn't insert routine privilege record into
                    mysql.procs_priv when creating a routine.
                    
                    Fixed by switching the current user of SQL thread to definer user if
                    the definer user exists on slave.
                    That populates procs_priv, otherwise to keep the SQL thread
                    user and procs_priv remains unchanged.
             @ mysql-test/suite/rpl/r/rpl_do_grant.result
                Test case result for routine privilege when definer user exist or not on slave
             @ mysql-test/suite/rpl/t/rpl_do_grant.test
                Test case result for routine privilege when definer user exist or not on slave
             @ sql/sql_parse.cc
                Switch current user of SQL thread to definer user if the definer user
                existes on slave when checking whether the routine privilege is
                needed to insert mysql.procs_priv table or not.

            M  mysql-test/suite/rpl/r/rpl_do_grant.result
            M  mysql-test/suite/rpl/t/rpl_do_grant.test
            M  sql/sql_parse.cc
         2555.346.4 Tatiana A. Nurnberg	2009-03-17 [merge]
                    auto-merge

            M  mysql-test/suite/ndb/r/ndb_restore_partition.result
            M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
            M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
            M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
            M  sql/sql_select.cc
             2555.349.4 Ramil Kalimullin	2009-03-17
                        Code clean-up.
                 @ sql/sql_select.cc
                    the if() separate arguments checks are slightly faster.

                M  sql/sql_select.cc
             2555.349.3 Patrick Crews	2009-03-16
                        Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call.
                        
                        Re-recording of .result files for additional tests that use this include file.

                M  mysql-test/suite/ndb/r/ndb_restore_partition.result
                M  mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/parts/r/ndb_dd_backuprestore.result
                M  mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
         2555.346.3 Tatiana A. Nurnberg	2009-03-16 [merge]
                    automerge

            M  mysql-test/include/ndb_backup.inc
            M  mysql-test/suite/ndb/r/ndb_restore.result
            M  mysql-test/suite/ndb/r/ndb_restore_print.result
             2555.349.2 Patrick Crews	2009-03-16 [merge]
                        merge

                M  include/my_sys.h
                M  mysql-test/r/select.result
                M  mysql-test/t/select.test
                M  mysys/default.c
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/sql_plugin.cc
                M  sql/sql_select.cc
             2555.349.1 Patrick Crews	2009-03-15 [merge]
                        merge 5.0 -> 5.1

                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/suite/ndb/r/ndb_restore.result
                M  mysql-test/suite/ndb/r/ndb_restore_print.result
            1810.3863.3 Patrick Crews	2009-03-15
                        Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call.
                        
                        Revised patch incorporating cleaner test code brought up during review.
                        Removed the use of grep and accomplished same actions via SQL / use of the server.
                        
                        Runs as before on *nix systems and now runs on Windows without Cygwin as well.

                M  mysql-test/include/ndb_backup.inc
                M  mysql-test/r/ndb_restore.result
                M  mysql-test/r/ndb_restore_print.result
         2555.346.2 Tatiana A. Nurnberg	2009-03-16 [merge]
                    manual merge

            M  config/ac-macros/ha_ndbcluster.m4
            M  config/ac-macros/plugins.m4
            M  include/my_sys.h
            M  mysql-test/r/key_cache.result
            M  mysql-test/r/select.result
            M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
            M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
            M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
            M  mysql-test/t/select.test
            M  mysys/default.c
            M  server-tools/instance-manager/instance_map.cc
            M  server-tools/instance-manager/options.cc
            M  server-tools/instance-manager/options.h
            M  sql-common/client.c
            M  sql/mysql_priv.h
            M  sql/mysqld.cc
            M  sql/sql_plugin.cc
            M  sql/sql_select.cc
             2555.347.5 Alexey Kopytov	2009-03-16 [merge]
                        Manual merge of patch for bug #40552 into the team tree.
                        Replaced a call to load_defaults() in sql_plugin.cc with 
                        its thread-safe version.

                M  include/my_sys.h
                M  mysys/default.c
                M  server-tools/instance-manager/instance_map.cc
                M  server-tools/instance-manager/options.cc
                M  server-tools/instance-manager/options.h
                M  sql-common/client.c
                M  sql/sql_plugin.cc
                 2555.348.1 Alexey Kopytov	2009-02-27
                            Fix for bug #40552: Race condition around default_directories  
                                                in load_defaults() 
                            
                            load_defaults(), my_search_option_files() and 
                            my_print_default_files()  utilized a global variable 
                            containing  a pointer to thread local memory. This could lead 
                            to race conditions when those functions were called with high 
                            concurrency. 
                            
                            Fixed by changing the interface of the said functions to avoid 
                            the necessity for using a global variable.
                            
                            Since we cannot change load_defaults() prototype for API
                            compatibility reasons, it was renamed my_load_defaults().
                            Now load_defaults() is a thread-unsafe wrapper around
                            a thread-safe version, my_load_defaults().
                     @ mysys/default.c
                        1. Added a thread-safe version of load_defaults(), changed
                        load_defaults() with the old interface to be a thread-unsafe
                        wrapper around the thread-safe version.
                        2. Always use a private MEM_ROOT in my_print_default_files, 
                        don't use a global variable.
                     @ sql-common/client.c
                        Use a thread-safe version of load_defaults().

                    M  include/my_sys.h
                    M  mysys/default.c
                    M  server-tools/instance-manager/instance_map.cc
                    M  server-tools/instance-manager/options.cc
                    M  server-tools/instance-manager/options.h
                    M  sql-common/client.c
             2555.347.4 Ramil Kalimullin	2009-03-16
                        Fix for bug #42957: no results from 
                        select where .. (col=col and col=col) or ... (false expression)
                        
                        Problem: optimizer didn't take into account a singular case 
                        when we eliminated all the predicates at the AND level of WHERE.
                        That may lead to wrong results.
                        
                        Fix: replace (a=a AND a=a...) with TRUE if we eliminated all the
                        predicates.
                 @ mysql-test/r/select.result
                    Fix for bug #42957: no results from 
                    select where .. (col=col and col=col) or ... (false expression)
                      - test result.
                 @ mysql-test/t/select.test
                    Fix for bug #42957: no results from 
                    select where .. (col=col and col=col) or ... (false expression)
                      - test case.
                 @ sql/sql_select.cc
                    Fix for bug #42957: no results from 
                    select where .. (col=col and col=col) or ... (false expression)
                      - replacing equality predicates by multiple equality items check
                    if we eliminate all the predicates at the AND level and 
                    replace them with TRUE if so.

                M  mysql-test/r/select.result
                M  mysql-test/t/select.test
                M  sql/sql_select.cc
             2555.347.3 Andrei Elkin	2009-03-13 [merge]
                        merge from 5.1-bt to a local branch

                M  config/ac-macros/ha_ndbcluster.m4
                M  config/ac-macros/plugins.m4
                M  mysql-test/suite/funcs_1/r/is_columns_mysql.result
                M  sql/mysql_priv.h
                M  sql/mysqld.cc
                M  sql/sql_plugin.cc
             2555.347.2 Andrei Elkin	2009-03-13 [merge]
                        merge from 5.1-bt to a local branch

                D  sql-bench/TODO
                A  mysql-test/collections/
                A  mysql-test/collections/README
                A  mysql-test/collections/README.experimental
                A  mysql-test/collections/default.daily
                A  mysql-test/collections/default.experimental
                A  mysql-test/collections/default.push
                A  mysql-test/collections/default.weekly
                A  storage/ibmdb2i/
                A  storage/ibmdb2i/CMakeLists.txt
                A  storage/ibmdb2i/Makefile.am
                A  storage/ibmdb2i/db2i_blobCollection.cc
                A  storage/ibmdb2i/db2i_blobCollection.h
                A  storage/ibmdb2i/db2i_charsetSupport.cc
                A  storage/ibmdb2i/db2i_charsetSupport.h
                A  storage/ibmdb2i/db2i_collationSupport.cc
                A  storage/ibmdb2i/db2i_collationSupport.h
                A  storage/ibmdb2i/db2i_constraints.cc
                A  storage/ibmdb2i/db2i_conversion.cc
                A  storage/ibmdb2i/db2i_errors.cc
                A  storage/ibmdb2i/db2i_errors.h
                A  storage/ibmdb2i/db2i_file.cc
                A  storage/ibmdb2i/db2i_file.h
                A  storage/ibmdb2i/db2i_global.h
                A  storage/ibmdb2i/db2i_iconv.h
                A  storage/ibmdb2i/db2i_ileBridge.cc
                A  storage/ibmdb2i/db2i_ileBridge.h
                A  storage/ibmdb2i/db2i_ioBuffers.cc
                A  storage/ibmdb2i/db2i_ioBuffers.h
                A  storage/ibmdb2i/db2i_misc.h
                A  storage/ibmdb2i/db2i_myconv.cc
                A  storage/ibmdb2i/db2i_myconv.h
                A  storage/ibmdb2i/db2i_rir.cc
                A  storage/ibmdb2i/db2i_safeString.h
                A  storage/ibmdb2i/db2i_sqlStatementStream.cc
                A  storage/ibmdb2i/db2i_sqlStatementStream.h
                A  storage/ibmdb2i/db2i_validatedPointer.h
                A  storage/ibmdb2i/ha_ibmdb2i.cc
                A  storage/ibmdb2i/ha_ibmdb2i.h
                A  storage/ibmdb2i/plug.in
                M  client/mysqldump.c
                M  cmd-line-utils/libedit/makelist.sh
                M  cmd-line-utils/libedit/readline.c
                M  cmd-line-utils/libedit/readline/readline.h
                M  cmd-line-utils/libedit/vi.c
                M  config/ac-macros/plugins.m4
                M  configure.in
                M  include/my_md5.h
                M  include/my_sys.h
                M  mysql-test/Makefile.am
                M  mysql-test/include/check-warnings.test
                M  mysql-test/include/wait_until_count_sessions.inc
                M  mysql-test/lib/My/ConfigFactory.pm
                M  mysql-test/lib/My/Platform.pm
                M  mysql-test/lib/My/SafeProcess.pm
                M  mysql-test/lib/My/SafeProcess/safe_process.cc
                M  mysql-test/lib/mtr_report.pm
                M  mysql-test/lib/mtr_unique.pm
                M  mysql-test/mysql-test-run.pl
                M  mysql-test/r/connect.result
                M  mysql-test/r/consistent_snapshot.result
                M  mysql-test/r/dirty_close.result
                M  mysql-test/r/events_bugs.result
                M  mysql-test/r/explain.result
                M  mysql-test/r/flush_block_commit.result
                M  mysql-test/r/flush_block_commit_notembedded.result
                M  mysql-test/r/flush_read_lock_kill.result
                M  mysql-test/r/innodb-autoinc.result
                M  mysql-test/r/lock.result
                M  mysql-test/r/lock_multi.result
                M  mysql-test/r/log_tables.result
                M  mysql-test/r/merge.result
                M  mysql-test/r/mysqlbinlog.result
                M  mysql-test/r/mysqldump.result
                M  mysql-test/r/mysqltest.result
                M  mysql-test/r/ps.result
                M  mysql-test/r/read_only.result
                M  mysql-test/r/show_check.result
                M  mysql-test/r/skip_name_resolve.result
                M  mysql-test/r/sp-security.result
                M  mysql-test/r/strict.result
                M  mysql-test/r/system_mysql_db.result
                M  mysql-test/r/variables.result
                M  mysql-test/r/view.result
                M  mysql-test/r/view_grant.result
                M  mysql-test/suite/funcs_1/r/innodb_func_view.result
                M  mysql-test/suite/funcs_1/r/innodb_views.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
                M  mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
                M  mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
                M  mysql-test/suite/sys_vars/r/connect_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/default_week_format_basic.result
                M  mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
                M  mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
                M  mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
                M  mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
                M  mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_connections_basic.result
                M  mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_error_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
                M  mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
                M  mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
                M  mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
                M  mysql-test/suite/sys_vars/r/max_sort_length_basic.result
                M  mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
                M  mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
                M  mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
                M  mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
                M  mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
                M  mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
                M  mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_32.result
                M  mysql-test/suite/sys_vars/r/server_id_basic_64.result
                M  mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
                M  mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
                M  mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
                M  mysql-test/suite/sys_vars/r/table_open_cache_basic.result
                M  mysql-test/t/alter_table-big.test
                M  mysql-test/t/connect.test
                M  mysql-test/t/consistent_snapshot.test
                M  mysql-test/t/dirty_close.test
                M  mysql-test/t/events_bugs.test
                M  mysql-test/t/explain.test
                M  mysql-test/t/flush_block_commit.test
                M  mysql-test/t/flush_block_commit_notembedded.test
                M  mysql-test/t/flush_read_lock_kill.test
                M  mysql-test/t/init_connect.test
                M  mysql-test/t/innodb-autoinc.test
                M  mysql-test/t/lock.test
                M  mysql-test/t/lock_multi.test
                M  mysql-test/t/log_tables.test
                M  mysql-test/t/merge.test
                M  mysql-test/t/mysqlbinlog.test
                M  mysql-test/t/mysqldump.test
                M  mysql-test/t/mysqltest.test
                M  mysql-test/t/read_only.test
                M  mysql-test/t/show_check.test
                M  mysql-test/t/skip_name_resolve.test
                M  mysql-test/t/sp-security.test
                M  mysql-test/t/sp_notembedded.test
                M  mysql-test/t/ssl-big.test
                M  mysql-test/t/ssl.test
                M  mysql-test/t/ssl_compress.test
                M  mysql-test/t/status.test
                M  mysql-test/t/strict.test
                M  mysql-test/t/type_bit_innodb.test
                M  mysql-test/t/user_limits.test
                M  mysql-test/t/variables.test
                M  mysql-test/t/view.test
                M  mysql-test/t/view_grant.test
                M  mysql-test/t/wait_timeout.test
                M  mysql-test/t/xa.test
                M  mysys/errors.c
                M  mysys/md5.c
                M  mysys/my_fstream.c
                M  mysys/my_pread.c
                M  mysys/my_write.c
                M  plugin/Makefile.am
                M  scripts/mysql_system_tables.sql
                M  scripts/mysql_system_tables_fix.sql
                M  sql/item_strfunc.cc
                M  sql/item_sum.cc
                M  sql/log.cc
                M  sql/mysqld.cc
                M  sql/set_var.cc
                M  sql/share/errmsg.txt
                M  sql/sql_cache.cc
                M  sql/sql_lex.cc
                M  sql/sql_lex.h
                M  sql/sql_parse.cc
                M  sql/sql_yacc.yy
                M  sql/table.cc
                M  sql/unireg.cc
                M  storage/Makefile.am
                M  storage/innobase/btr/btr0sea.c
                M  storage/innobase/handler/ha_innodb.cc
                M  storage/myisammrg/ha_myisammrg.cc
                M  support-files/Makefile.am
                M  support-files/mysql.spec.sh
             2555.347.1 Andrei Elkin	2009-03-06
                        Bug #40559   assertion failed in check_binlog_magic 
                        
                        The reason of the bug is in that the test makes a trick with relay log files and
                        did not reset fully at the end.
                        If mtr does not restart the test the new SQL thread tried to work with the old time
                        session data.
                        
                        Fixed with deploying RESET slave at the clean-up.
                 @ mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
                    adding RESET slave to force active mi and rli data struct to be reset.
                    The slave SQL thread will deal with a fresh structures each time it restarts.

                M  mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result
                M  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
         2555.346.1 Tatiana A. Nurnberg	2009-03-16
                    Bug#36446: Attempt to set @@join_buffer_size to its minimum value produces spurious warning
                    
                    If a sys-var has a base and a block-size>1, and then a
                    user-supplied value >= minimum ended up below minimum
                    thanks to block-size alignment, we threw a warning.
                    This meant for instance that when getting, then setting
                    the minimum, we'd see a warning. This was needlessly
                    confusing. (updated patch)

            M  mysql-test/r/variables.result
            M  mysql-test/t/variables.test
            M  mysys/my_getopt.c
     2555.345.1 Leonard Zhou	2009-03-16
                BUG#22504 load data infile sql statement in replication architecture get error
                
                The problem is issued because we set wrong start position and stop position of query string into binlog.
                That two values are stored as part of head info of query string.
                When we parse binlog, we first get position values then get the query string according position values.
                But seems that two values are not calculated correctly after the parse of Yacc.
                
                We don't want to touch so much of yacc because it may influence other codes.
                So just add one space after 'INTO' key word when parsing.
                This can easily resolve the problem.
         @ mysql-test/suite/rpl/r/rpl_loaddatalocal.result
            Test result
         @ mysql-test/suite/rpl/t/rpl_loaddatalocal.test
            Test case
         @ sql/log_event.cc
            Add space after 'INTO'.

        M  mysql-test/suite/rpl/r/rpl_loaddatalocal.result
        M  mysql-test/suite/rpl/r/rpl_stm_log.result
        M  mysql-test/suite/rpl/t/rpl_loaddatalocal.test
        M  sql/log_event.cc
=== modified file 'client/my_readline.h'
--- a/client/my_readline.h	2007-05-10 09:59:39 +0000
+++ b/client/my_readline.h	2009-03-18 08:27:49 +0000
@@ -29,5 +29,5 @@ typedef struct st_line_buffer
 
 extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
 extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
-extern char *batch_readline(LINE_BUFFER *buffer);
+extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
 extern void batch_readline_end(LINE_BUFFER *buffer);

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-02-25 09:34:27 +0000
+++ b/client/mysql.cc	2009-03-24 13:58:52 +0000
@@ -49,7 +49,7 @@ const char *VER= "14.14";
 #define MAX_COLUMN_LENGTH	     1024
 
 /* Buffer to hold 'version' and 'version_comment' */
-#define MAX_SERVER_VERSION_LENGTH     128
+static char *server_version= NULL;
 
 /* Array of options to pass to libemysqld */
 #define MAX_SERVER_ARGS               64
@@ -115,6 +115,8 @@ extern "C" {
 #define PROMPT_CHAR '\\'
 #define DEFAULT_DELIMITER ";"
 
+#define MAX_BATCH_BUFFER_SIZE (1024L * 1024L)
+
 typedef struct st_status
 {
   int exit_status;
@@ -1045,7 +1047,7 @@ static void fix_history(String *final_co
 
 static COMMANDS *find_command(char *name,char cmd_name);
 static bool add_line(String &buffer,char *line,char *in_string,
-                     bool *ml_comment);
+                     bool *ml_comment, bool truncated);
 static void remove_cntrl(String &buffer);
 static void print_table_data(MYSQL_RES *result);
 static void print_table_data_html(MYSQL_RES *result);
@@ -1117,7 +1119,7 @@ int main(int argc,char *argv[])
     exit(1);
   }
   if (status.batch && !status.line_buff &&
-      !(status.line_buff=batch_readline_init(opt_max_allowed_packet+512,stdin)))
+      !(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
   {
     free_defaults(defaults_argv);
     my_end(0);
@@ -1198,7 +1200,7 @@ int main(int argc,char *argv[])
 #endif
   sprintf(buff, "%s",
 #ifndef NOT_YET
-	  "Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n");
+	  "Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n");
 #else
 	  "Type 'help [[%]function name[%]]' to get help on usage of function.\n");
 #endif
@@ -1234,6 +1236,7 @@ sig_handler mysql_end(int sig)
   glob_buffer.free();
   old_buffer.free();
   processed_prompt.free();
+  my_free(server_version,MYF(MY_ALLOW_ZERO_PTR));
   my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
   my_free(opt_mysql_unix_port,MYF(MY_ALLOW_ZERO_PTR));
   my_free(histfile,MYF(MY_ALLOW_ZERO_PTR));
@@ -1810,13 +1813,14 @@ static int read_and_execute(bool interac
   ulong line_number=0;
   bool ml_comment= 0;  
   COMMANDS *com;
+  bool truncated= 0;
   status.exit_status=1;
   
   for (;;)
   {
     if (!interactive)
     {
-      line=batch_readline(status.line_buff);
+      line=batch_readline(status.line_buff, &truncated);
       /*
         Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
         Editors like "notepad" put this marker in
@@ -1913,7 +1917,7 @@ static int read_and_execute(bool interac
 #endif
       continue;
     }
-    if (add_line(glob_buffer,line,&in_string,&ml_comment))
+    if (add_line(glob_buffer,line,&in_string,&ml_comment, truncated))
       break;
   }
   /* if in batch mode, send last query even if it doesn't end with \g or go */
@@ -1999,7 +2003,7 @@ static COMMANDS *find_command(char *name
 
 
 static bool add_line(String &buffer,char *line,char *in_string,
-                     bool *ml_comment)
+                     bool *ml_comment, bool truncated)
 {
   uchar inchar;
   char buff[80], *pos, *out;
@@ -2247,9 +2251,10 @@ static bool add_line(String &buffer,char
   {
     uint length=(uint) (out-line);
 
-    if (length < 9 || 
-        my_strnncoll (charset_info, 
-                      (uchar *)line, 9, (const uchar *) "delimiter", 9))
+    if (!truncated &&
+        (length < 9 || 
+         my_strnncoll (charset_info, 
+                       (uchar *)line, 9, (const uchar *) "delimiter", 9)))
     {
       /* 
         Don't add a new line in case there's a DELIMITER command to be 
@@ -2662,7 +2667,7 @@ static void get_current_db()
       (res= mysql_use_result(&mysql)))
   {
     MYSQL_ROW row= mysql_fetch_row(res);
-    if (row[0])
+    if (row && row[0])
       current_db= my_strdup(row[0], MYF(MY_WME));
     mysql_free_result(res);
   }
@@ -3921,7 +3926,7 @@ static int com_source(String *buffer, ch
     return put_info(buff, INFO_ERROR, 0);
   }
 
-  if (!(line_buff=batch_readline_init(opt_max_allowed_packet+512,sql_file)))
+  if (!(line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, sql_file)))
   {
     my_fclose(sql_file,MYF(0));
     return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
@@ -4361,16 +4366,11 @@ select_limit, max_join_size);
 static const char *
 server_version_string(MYSQL *con)
 {
-  static char buf[MAX_SERVER_VERSION_LENGTH] = "";
-
   /* Only one thread calls this, so no synchronization is needed */
-  if (buf[0] == '\0')
+  if (server_version == NULL)
   {
-    char *bufp = buf;
     MYSQL_RES *result;
 
-    bufp= strnmov(buf, mysql_get_server_info(con), sizeof buf);
-
     /* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
     if (!mysql_query(con, "select @@version_comment limit 1") &&
         (result = mysql_use_result(con)))
@@ -4378,17 +4378,32 @@ server_version_string(MYSQL *con)
       MYSQL_ROW cur = mysql_fetch_row(result);
       if (cur && cur[0])
       {
-        bufp = strxnmov(bufp, sizeof buf - (bufp - buf), " ", cur[0], NullS);
+        /* version, space, comment, \0 */
+        size_t len= strlen(mysql_get_server_info(con)) + strlen(cur[0]) + 2;
+
+        if ((server_version= (char *) my_malloc(len, MYF(MY_WME))))
+        {
+          char *bufp;
+          bufp = strmov(server_version, mysql_get_server_info(con));
+          bufp = strmov(bufp, " ");
+          (void) strmov(bufp, cur[0]);
+        }
       }
       mysql_free_result(result);
     }
 
-    /* str*nmov doesn't guarantee NUL-termination */
-    if (bufp == buf + sizeof buf)
-      buf[sizeof buf - 1] = '\0';
+    /*
+      If for some reason we didn't get a version_comment, we'll
+      keep things simple.
+    */
+
+    if (server_version == NULL)
+    {
+      server_version= strdup(mysql_get_server_info(con));
+    }
   }
 
-  return buf;
+  return server_version ? server_version : "";
 }
 
 static int

=== modified file 'client/mysqladmin.cc'
--- a/client/mysqladmin.cc	2009-01-08 19:03:56 +0000
+++ b/client/mysqladmin.cc	2009-02-13 16:41:47 +0000
@@ -837,7 +837,7 @@ static int execute_commands(MYSQL *mysql
         bool old= (find_type(argv[0], &command_typelib, 2) ==
                    ADMIN_OLD_PASSWORD);
 #ifdef __WIN__
-        uint pw_len= strlen(pw);
+        uint pw_len= (uint) strlen(pw);
         if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
           printf("Warning: single quotes were not trimmed from the password by"
                  " your command\nline client, as you might have expected.\n");

=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2008-08-21 11:47:23 +0000
+++ b/client/mysqlbinlog.cc	2009-02-13 16:41:47 +0000
@@ -128,7 +128,7 @@ static Exit_status safe_connect();
 class Load_log_processor
 {
   char target_dir_name[FN_REFLEN];
-  int target_dir_name_len;
+  size_t target_dir_name_len;
 
   /*
     When we see first event corresponding to some LOAD DATA statement in
@@ -285,9 +285,9 @@ public:
   File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
   Exit_status load_old_format_file(NET* net, const char *server_fname,
                                    uint server_fname_len, File file);
-  Exit_status process_first_event(const char *bname, uint blen,
+  Exit_status process_first_event(const char *bname, size_t blen,
                                   const uchar *block,
-                                  uint block_len, uint file_id,
+                                  size_t block_len, uint file_id,
                                   Create_file_log_event *ce);
 };
 
@@ -305,7 +305,7 @@ public:
 File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
 							 char *filename)
 {
-  uint len;
+  size_t len;
   char *tail;
   File file;
   
@@ -319,7 +319,7 @@ File Load_log_processor::prepare_new_fil
     return -1;
   }
   
-  le->set_fname_outside_temp_buf(filename,len+strlen(tail));
+  le->set_fname_outside_temp_buf(filename,len+(uint) strlen(tail));
   
   return file;
 }
@@ -411,9 +411,9 @@ Exit_status Load_log_processor::load_old
   @retval OK_CONTINUE No error, the program should continue.
 */
 Exit_status Load_log_processor::process_first_event(const char *bname,
-                                                    uint blen,
+                                                    size_t blen,
                                                     const uchar *block,
-                                                    uint block_len,
+                                                    size_t block_len,
                                                     uint file_id,
                                                     Create_file_log_event *ce)
 {
@@ -456,7 +456,7 @@ Exit_status Load_log_processor::process_
   }
 
   if (ce)
-    ce->set_fname_outside_temp_buf(fname, strlen(fname));
+    ce->set_fname_outside_temp_buf(fname, (uint) strlen(fname));
 
   if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP)))
   {
@@ -1189,7 +1189,7 @@ static my_time_t convert_str_to_timestam
   long dummy_my_timezone;
   my_bool dummy_in_dst_time_gap;
   /* We require a total specification (date AND time) */
-  if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) !=
+  if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
       MYSQL_TIMESTAMP_DATETIME || was_cut)
   {
     error("Incorrect date and time argument: %s", str);

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2009-01-14 14:50:51 +0000
+++ b/client/mysqlcheck.c	2009-02-13 16:41:47 +0000
@@ -349,7 +349,7 @@ static int get_options(int *argc, char *
 
   if (!what_to_do)
   {
-    int pnlen = strlen(my_progname);
+    size_t pnlen= strlen(my_progname);
 
     if (pnlen < 6) /* name too short */
       what_to_do = DO_CHECK;
@@ -448,7 +448,8 @@ static int process_selected_tables(char 
       space is for more readable output in logs and in case of error
     */	  
     char *table_names_comma_sep, *end;
-    int i, tot_length = 0;
+    size_t tot_length= 0;
+    int             i= 0;
 
     for (i = 0; i < tables; i++)
       tot_length+= fixed_name_length(*(table_names + i)) + 2;
@@ -464,7 +465,7 @@ static int process_selected_tables(char 
       *end++= ',';
     }
     *--end = 0;
-    handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
+    handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
     my_free(table_names_comma_sep, MYF(0));
   }
   else
@@ -486,7 +487,7 @@ static uint fixed_name_length(const char
     else if (*p == '.')
       extra_length+= 2;
   }
-  return (p - name) + extra_length;
+  return (uint) ((p - name) + extra_length);
 }
 
 

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2009-05-08 09:57:18 +0000
+++ b/client/mysqldump.c	2009-05-08 14:43:21 +0000
@@ -802,7 +802,7 @@ get_one_option(int optid, const struct m
       opt_set_charset= 0;
       opt_compatible_mode_str= argument;
       opt_compatible_mode= find_set(&compatible_mode_typelib,
-                                    argument, strlen(argument),
+                                    argument, (uint) strlen(argument),
                                     &err_ptr, &err_len);
       if (err_len)
       {
@@ -4588,7 +4588,8 @@ char check_if_ignore_table(const char *t
     */
     if (!opt_no_data &&
         (!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
-         !strcmp(table_type,"MRG_ISAM")))
+         !strcmp(table_type,"MRG_ISAM") ||
+         !strcmp(table_type,"FEDERATED")))
       result= IGNORE_DATA;
   }
   mysql_free_result(res);

=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c	2008-11-25 02:04:58 +0000
+++ b/client/mysqlslap.c	2009-02-13 16:41:47 +0000
@@ -1929,7 +1929,7 @@ parse_option(const char *origin, option_
   char *ptr= (char *)origin;
   option_string **sptr= stmt;
   option_string *tmp;
-  uint length= strlen(origin);
+  size_t length= strlen(origin);
   uint count= 0; /* We know that there is always one */
 
   for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string),

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-05-08 09:57:18 +0000
+++ b/client/mysqltest.cc	2009-05-08 14:43:21 +0000
@@ -1321,7 +1321,7 @@ void log_msg(const char *fmt, ...)
 void cat_file(DYNAMIC_STRING* ds, const char* filename)
 {
   int fd;
-  uint len;
+  size_t len;
   char buff[512];
 
   if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
@@ -1450,6 +1450,7 @@ static int run_tool(const char *tool_pat
   Test if diff is present.  This is needed on Windows systems
   as the OS returns 1 whether diff is successful or if it is
   not present.
+  Takes name of diff program as argument
   
   We run diff -v and look for output in stdout.
   We don't redirect stderr to stdout to make for a simplified check
@@ -1457,11 +1458,12 @@ static int run_tool(const char *tool_pat
   not present.
 */
 
-int diff_check()
+int diff_check (const char *diff_name)
 {
     char buf[512]= {0};
     FILE *res_file;
-    const char *cmd = "diff -v";
+    char cmd[128];
+    my_snprintf (cmd, sizeof(cmd), "%s -v", diff_name);
     int have_diff = 0;
 
     if (!(res_file= popen(cmd, "r")))
@@ -1493,7 +1495,7 @@ void show_diff(DYNAMIC_STRING* ds,
                const char* filename1, const char* filename2)
 {
   DYNAMIC_STRING ds_tmp;
-  int have_diff = 0;
+  const char *diff_name = 0;
 
   if (init_dynamic_string(&ds_tmp, "", 256, 256))
     die("Out of memory");
@@ -1506,15 +1508,20 @@ void show_diff(DYNAMIC_STRING* ds,
      the way it's implemented does not work with default 'diff' on Solaris.
   */
 #ifdef __WIN__
-  have_diff = diff_check();
+  if (diff_check("diff"))
+    diff_name = "diff";
+  else if (diff_check("mtrdiff"))
+    diff_name = "mtrdiff";
+  else
+    diff_name = 0;
 #else
-  have_diff = 1;
+  diff_name = "diff";		// Otherwise always assume it's called diff
 #endif
 
-  if (have_diff)
+  if (diff_name)
   {
     /* First try with unified diff */
-    if (run_tool("diff",
+    if (run_tool(diff_name,
                  &ds_tmp, /* Get output from diff in ds_tmp */
                  "-u",
                  filename1,
@@ -1525,7 +1532,7 @@ void show_diff(DYNAMIC_STRING* ds,
       dynstr_set(&ds_tmp, "");
 
       /* Fallback to context diff with "diff -c" */
-      if (run_tool("diff",
+      if (run_tool(diff_name,
                    &ds_tmp, /* Get output from diff in ds_tmp */
                    "-c",
                    filename1,
@@ -1536,20 +1543,20 @@ void show_diff(DYNAMIC_STRING* ds,
 	dynstr_set(&ds_tmp, "");
 
 	/* Fallback to simple diff with "diff" */
-	if (run_tool("diff",
+	if (run_tool(diff_name,
 		     &ds_tmp, /* Get output from diff in ds_tmp */
 		     filename1,
 		     filename2,
 		     "2>&1",
 		     NULL) > 1) /* Most "diff" tools return >1 if error */
 	    {
-		have_diff= 0;
+		diff_name= 0;
 	    }
       }
     }
   }  
 
-  if (! have_diff)
+  if (! diff_name)
   {
     /*
       Fallback to dump both files to result file and inform
@@ -1619,7 +1626,7 @@ int compare_files2(File fd, const char* 
 {
   int error= RESULT_OK;
   File fd2;
-  uint len, len2;
+  size_t len, len2;
   char buff[512], buff2[512];
 
   if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0)
@@ -2711,7 +2718,8 @@ void do_exec(struct st_command *command)
       log_msg("exec of '%s' failed, error: %d, status: %d, errno: %d",
               ds_cmd.str, error, status, errno);
       dynstr_free(&ds_cmd);
-      die("command \"%s\" failed", command->first_argument);
+      die("command \"%s\" failed\n\nOutput from before failure:\n%s\n",
+          command->first_argument, ds_res.str);
     }
 
     DBUG_PRINT("info",
@@ -7244,7 +7252,7 @@ void init_re_comp(my_regex_t *re, const 
     char erbuf[100];
     int len= my_regerror(err, re, erbuf, sizeof(erbuf));
     die("error %s, %d/%d `%s'\n",
-	re_eprint(err), len, (int)sizeof(erbuf), erbuf);
+	re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
   }
 }
 
@@ -7300,7 +7308,7 @@ int match_re(my_regex_t *re, char *str)
     char erbuf[100];
     int len= my_regerror(err, re, erbuf, sizeof(erbuf));
     die("error %s, %d/%d `%s'\n",
-	re_eprint(err), len, (int)sizeof(erbuf), erbuf);
+	re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
   }
   return 0;
 }

=== modified file 'client/readline.cc'
--- a/client/readline.cc	2007-05-10 09:59:39 +0000
+++ b/client/readline.cc	2009-03-18 08:27:49 +0000
@@ -24,7 +24,7 @@ static bool init_line_buffer(LINE_BUFFER
 			    ulong max_size);
 static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
 static size_t fill_buffer(LINE_BUFFER *buffer);
-static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
+static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated);
 
 
 LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
@@ -42,12 +42,13 @@ LINE_BUFFER *batch_readline_init(ulong m
 }
 
 
-char *batch_readline(LINE_BUFFER *line_buff)
+char *batch_readline(LINE_BUFFER *line_buff, bool *truncated)
 {
   char *pos;
   ulong out_length;
+  DBUG_ASSERT(truncated != NULL);
 
-  if (!(pos=intern_read_line(line_buff,&out_length)))
+  if (!(pos=intern_read_line(line_buff,&out_length, truncated)))
     return 0;
   if (out_length && pos[out_length-1] == '\n')
     if (--out_length && pos[out_length-1] == '\r')  /* Remove '\n' */
@@ -149,6 +150,14 @@ static size_t fill_buffer(LINE_BUFFER *b
     read_count=(buffer->bufread - bufbytes)/IO_SIZE;
     if ((read_count*=IO_SIZE))
       break;
+    if (buffer->bufread * 2 > buffer->max_size)
+    {
+      /*
+        So we must grow the buffer but we cannot due to the max_size limit.
+        Return 0 w/o setting buffer->eof to signal this condition.
+      */
+      return 0;
+    }
     buffer->bufread *= 2;
     if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
 					      buffer->bufread+1,
@@ -172,11 +181,15 @@ static size_t fill_buffer(LINE_BUFFER *b
 
   DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
 
-  /* Kludge to pretend every nonempty file ends with a newline. */
-  if (!read_count && bufbytes && buffer->end[-1] != '\n')
+  if (!read_count)
   {
-    buffer->eof = read_count = 1;
-    *buffer->end = '\n';
+    buffer->eof = 1;
+    /* Kludge to pretend every nonempty file ends with a newline. */
+    if (bufbytes && buffer->end[-1] != '\n')
+    {
+      read_count = 1;
+      *buffer->end = '\n';
+    }
   }
   buffer->end_of_line=(buffer->start_of_line=buffer->buffer)+bufbytes;
   buffer->end+=read_count;
@@ -186,7 +199,7 @@ static size_t fill_buffer(LINE_BUFFER *b
 
 
 
-char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
+char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
 {
   char *pos;
   size_t length;
@@ -200,14 +213,23 @@ char *intern_read_line(LINE_BUFFER *buff
       pos++;
     if (pos == buffer->end)
     {
-      if ((uint) (pos - buffer->start_of_line) < buffer->max_size)
+      /*
+        fill_buffer() can return 0 either on EOF in which case we abort
+        or when the internal buffer has hit the size limit. In the latter case
+        return what we have read so far and signal string truncation.
+      */
+      if (!(length=fill_buffer(buffer)) || length == (uint) -1)
       {
-	if (!(length=fill_buffer(buffer)) || length == (size_t) -1)
-	  DBUG_RETURN(0);
-	continue;
+        if (buffer->eof)
+          DBUG_RETURN(0);
       }
+      else
+        continue;
       pos--;					/* break line here */
+      *truncated= 1;
     }
+    else
+      *truncated= 0;
     buffer->end_of_line=pos+1;
     *out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
     DBUG_RETURN(buffer->start_of_line);

=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc	2009-02-14 09:14:05 +0000
+++ b/client/sql_string.cc	2009-03-24 13:58:52 +0000
@@ -465,7 +465,7 @@ bool String::append(const char *s,uint32
 
 bool String::append(const char *s)
 {
-  return append(s, strlen(s));
+  return append(s, (uint) strlen(s));
 }
 
 

=== modified file 'configure.in'
--- a/configure.in	2009-05-08 09:57:18 +0000
+++ b/configure.in	2009-05-08 14:43:21 +0000
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
 #
 # When changing major version number please also check switch statement
 # in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.33-ndb-6.2.17)
+AM_INIT_AUTOMAKE(mysql, 5.1.34-ndb-6.2.17)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 NDB_VERSION_MAJOR=6

=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c	2007-10-05 17:58:20 +0000
+++ b/extra/comp_err.c	2009-02-13 16:41:47 +0000
@@ -660,7 +660,7 @@ static ha_checksum checksum_format_speci
       case 'u':
       case 'x':
       case 's':
-        chksum= my_checksum(chksum, start, p-start);
+        chksum= my_checksum(chksum, start, (uint) (p - start));
         start= 0; /* Not in format specifier anymore */
         break;
 

=== modified file 'extra/yassl/src/buffer.cpp'
--- a/extra/yassl/src/buffer.cpp	2007-01-29 15:54:40 +0000
+++ b/extra/yassl/src/buffer.cpp	2009-02-10 22:47:54 +0000
@@ -106,7 +106,7 @@ void input_buffer::add_size(uint i) 
 
 uint input_buffer::get_capacity()  const 
 { 
-    return end_ - buffer_; 
+    return (uint) (end_ - buffer_); 
 }
 
 
@@ -223,7 +223,7 @@ uint output_buffer::get_size() const 
 
 uint output_buffer::get_capacity() const 
 { 
-    return end_ - buffer_; 
+    return (uint) (end_ - buffer_); 
 }
 
 

=== modified file 'extra/yassl/taocrypt/include/block.hpp'
--- a/extra/yassl/taocrypt/include/block.hpp	2007-01-29 15:54:40 +0000
+++ b/extra/yassl/taocrypt/include/block.hpp	2009-02-10 22:47:54 +0000
@@ -78,7 +78,7 @@ typename A::pointer StdReallocate(A& a, 
     if (preserve) {
         A b = A();
         typename A::pointer newPointer = b.allocate(newSize, 0);
-        memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize));
+        memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize));
         a.deallocate(p, oldSize);
         STL::swap(a, b);
         return newPointer;

=== modified file 'extra/yassl/taocrypt/src/algebra.cpp'
--- a/extra/yassl/taocrypt/src/algebra.cpp	2007-03-23 12:43:09 +0000
+++ b/extra/yassl/taocrypt/src/algebra.cpp	2009-02-13 16:41:47 +0000
@@ -288,7 +288,7 @@ void AbstractGroup::SimultaneousMultiply
         r = buckets[i][buckets[i].size()-1];
         if (buckets[i].size() > 1)
         {
-            for (int j = buckets[i].size()-2; j >= 1; j--)
+            for (int j= (unsigned int) (buckets[i].size()) - 2; j >= 1; j--)
             {
                 Accumulate(buckets[i][j], buckets[i][j+1]);
                 Accumulate(r, buckets[i][j]);

=== modified file 'extra/yassl/taocrypt/src/asn.cpp'
--- a/extra/yassl/taocrypt/src/asn.cpp	2007-03-23 12:43:09 +0000
+++ b/extra/yassl/taocrypt/src/asn.cpp	2009-02-13 16:41:47 +0000
@@ -213,7 +213,7 @@ void PublicKey::AddToEnd(const byte* dat
 Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
     : key_(k, kSz)
 {
-        int sz = strlen(n);
+        size_t sz = strlen(n);
         memcpy(name_, n, sz);
         name_[sz] = 0;
 

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2009-03-06 09:38:14 +0000
+++ b/include/my_sys.h	2009-03-24 13:58:52 +0000
@@ -843,14 +843,17 @@ extern void *memdup_root(MEM_ROOT *root,
 extern int get_defaults_options(int argc, char **argv,
                                 char **defaults, char **extra_defaults,
                                 char **group_suffix);
+extern int my_load_defaults(const char *conf_file, const char **groups,
+                            int *argc, char ***argv, const char ***);
 extern int load_defaults(const char *conf_file, const char **groups,
-			 int *argc, char ***argv);
+                         int *argc, char ***argv);
 extern int modify_defaults_file(const char *file_location, const char *option,
                                 const char *option_value,
                                 const char *section_name, int remove_option);
 extern int my_search_option_files(const char *conf_file, int *argc,
                                   char ***argv, uint *args_used,
-                                  Process_option_func func, void *func_ctx);
+                                  Process_option_func func, void *func_ctx,
+                                  const char **default_directories);
 extern void free_defaults(char **argv);
 extern void my_print_default_files(const char *conf_file);
 extern void print_defaults(const char *conf_file, const char **groups);

=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c	2009-02-10 13:27:35 +0000
+++ b/libmysql/libmysql.c	2009-03-24 13:58:52 +0000
@@ -1617,7 +1617,7 @@ mysql_hex_string(char *to, const char *f
 ulong STDCALL
 mysql_escape_string(char *to,const char *from,ulong length)
 {
-  return escape_string_for_mysql(default_charset_info, to, 0, from, length);
+  return (uint) escape_string_for_mysql(default_charset_info, to, 0, from, length);
 }
 
 ulong STDCALL
@@ -1625,8 +1625,8 @@ mysql_real_escape_string(MYSQL *mysql, c
 			 ulong length)
 {
   if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
-    return escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
-  return escape_string_for_mysql(mysql->charset, to, 0, from, length);
+    return (uint) escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
+  return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
 }
 
 void STDCALL

=== modified file 'libmysqld/CMakeLists.txt'
--- a/libmysqld/CMakeLists.txt	2008-06-18 16:17:15 +0000
+++ b/libmysqld/CMakeLists.txt	2009-03-17 22:28:24 +0000
@@ -201,6 +201,6 @@ ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQ
 ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
 TARGET_LINK_LIBRARIES(mysqlserver)
 
-ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
+ADD_LIBRARY(libmysqld SHARED cmake_dummy.c libmysqld.def)
 ADD_DEPENDENCIES(libmysqld mysqlserver)
 TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)

=== modified file 'libmysqld/examples/CMakeLists.txt'
--- a/libmysqld/examples/CMakeLists.txt	2008-12-18 18:36:01 +0000
+++ b/libmysqld/examples/CMakeLists.txt	2009-03-17 22:28:24 +0000
@@ -30,12 +30,12 @@ ADD_EXECUTABLE(mysql_embedded ../../clie
                ../../client/mysql.cc ../../client/readline.cc
                ../../client/sql_string.cc)
 TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
-ADD_DEPENDENCIES(mysql_embedded libmysqld)
+TARGET_LINK_LIBRARIES(mysql_embedded libmysqld)
 
 ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
 TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
-ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
+TARGET_LINK_LIBRARIES(mysqltest_embedded libmysqld)
 
 ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
 TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
-ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
+TARGET_LINK_LIBRARIES(mysql_client_test_embedded libmysqld)

=== modified file 'mysql-test/extra/binlog_tests/binlog.test'
--- a/mysql-test/extra/binlog_tests/binlog.test	2008-10-02 05:56:07 +0000
+++ b/mysql-test/extra/binlog_tests/binlog.test	2009-03-25 19:41:16 +0000
@@ -164,6 +164,46 @@ DROP TABLE t1;
 DROP DATABASE bug39182;
 USE test;
 
+#
+# Bug#35383: binlog playback and replication breaks due to 
+# name_const substitution
+#
+DELIMITER //;
+CREATE PROCEDURE p1(IN v1 INT)
+BEGIN
+  CREATE TABLE t1 SELECT v1;
+  DROP TABLE t1;
+END//
+CREATE PROCEDURE p2()
+BEGIN
+  DECLARE v1 INT;
+  CREATE TABLE t1 SELECT v1+1;
+  DROP TABLE t1;
+END//
+CREATE PROCEDURE p3(IN v1 INT)
+BEGIN
+  CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
+  DROP TABLE t1;
+END//
+CREATE PROCEDURE p4(IN v1 INT)
+BEGIN
+  DECLARE v2 INT;
+  CREATE TABLE t1 SELECT 1, v1, v2;
+  DROP TABLE t1;
+  CREATE TABLE t1 SELECT 1, v1+1, v2;
+  DROP TABLE t1;
+END//
+DELIMITER ;//
+
+CALL p1(1);
+CALL p2();
+CALL p3(0);
+CALL p4(0);
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+
 --echo End of 5.0 tests
 
 # Test of a too big SET INSERT_ID: see if the truncated value goes

=== added file 'mysql-test/extra/rpl_tests/rpl_loadfile.test'
--- a/mysql-test/extra/rpl_tests/rpl_loadfile.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_loadfile.test	2009-03-24 18:27:33 +0000
@@ -0,0 +1,36 @@
+# Begin clean up test section
+--disable_warnings
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test 
+
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1  VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+delimiter |;
+create procedure test.p1()
+begin
+  INSERT INTO test.t1  VALUES(2,'test');
+  UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+delimiter ;|
+
+CALL test.p1();
+SELECT * FROM test.t1 ORDER BY blob_column;
+save_master_pos;
+sync_slave_with_master;
+connection slave;
+# Need to allow some time when NDB engine is used for
+# the injector thread to have time to populate binlog
+let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
+--source include/wait_condition.inc
+SELECT * FROM test.t1 ORDER BY blob_column;
+
+# Cleanup
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
+sync_slave_with_master;

=== modified file 'mysql-test/include/concurrent.inc'
--- a/mysql-test/include/concurrent.inc	2009-01-31 18:09:41 +0000
+++ b/mysql-test/include/concurrent.inc	2009-03-18 16:23:39 +0000
@@ -11,6 +11,11 @@
 #   $engine_type                     storage engine to be tested
 #
 # Last update:
+# 2009-02-13 HH "Release_lock("hello")" is now also successful when delivering NULL,
+#               replaced two sleeps by wait_condition. The last two "sleep 1" have not been
+#               replaced as all tried wait conditions leaded to nondeterministic results, especially
+#               to succeeding concurrent updates. To replace the sleeps there should be some time
+#               planned (or internal knowledge of the server may help).
 # 2006-08-02 ML test refactored
 #               old name was t/innodb_concurrent.test
 #               main code went into include/concurrent.inc
@@ -20,8 +25,9 @@
 #               new wrapper t/concurrent_innodb_safelog.test
 #
 
-connection default;
+--source include/not_embedded.inc
 
+connection default;
 #
 # Show prerequisites for this test.
 #
@@ -50,8 +56,6 @@ GRANT USAGE ON test.* TO mysqltest@local
 #
 # Preparatory cleanup.
 #
-DO release_lock("hello");
-DO release_lock("hello2");
 --disable_warnings
 drop table if exists t1;
 --enable_warnings
@@ -86,13 +90,14 @@ drop table if exists t1;
       connection thread2;
       --echo ** Start transaction for thread 2
       begin;
-      --echo ** Update will cause a table scan and a new ULL  will 
+      --echo ** Update will cause a table scan and a new ULL  will
       --echo ** be created and blocked on the first row where tipo=11.
       send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
-      sleep 1;
 
   --echo ** connection thread1
   connection thread1;
+  let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+  --source include/wait_condition.inc
   --echo ** Start new transaction for thread 1
   begin;
   --echo ** Update on t1 will cause a table scan which will be blocked because
@@ -111,7 +116,9 @@ drop table if exists t1;
   }
   --echo ** Release user level name lock from thread 1. This will cause the ULL
   --echo ** on thread 2 to end its wait.
-  select release_lock("hello");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+  DO release_lock("hello");
   --echo ** Table is now updated with a new eta on tipo=22 for thread 1.
   select * from t1;
 
@@ -119,7 +126,9 @@ drop table if exists t1;
       connection thread2;
       --echo ** Release the lock and collect result from update on thread 2
       reap;
-      select release_lock("hello");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+      DO release_lock("hello");
       --echo ** Table should have eta updates where tipo=11 but updates made by
       --echo ** thread 1 shouldn't be visible yet.
       select * from t1;
@@ -183,10 +192,11 @@ drop table t1;
       --echo ** This will cause a hang on the first row where tipo=1 until the
       --echo ** blocking ULL is released.
       send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
-      sleep 1;
 
-  --echo ** connection thread1
+--echo ** connection thread1
   connection thread1;
+  let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+  --source include/wait_condition.inc
   --echo ** Start transaction on thread 1
   begin;
   --echo ** Update on t1 will cause a table scan which will be blocked because
@@ -204,7 +214,9 @@ drop table t1;
     update t1 set tipo=1 where tipo=2;
   }
   --echo ** Release ULL. This will release the next waiting ULL on thread 2.
-  select release_lock("hello");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically)the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+  DO release_lock("hello");
   --echo ** The table should still be updated with updates for thread 1 only:
   select * from t1;
 
@@ -212,7 +224,9 @@ drop table t1;
       connection thread2;
       --echo ** Release the lock and collect result from thread 2:
       reap;
-      select release_lock("hello");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+      DO release_lock("hello");
       --echo ** Seen from thread 2 the table should have been updated on four
       --echo ** places.
       select * from t1;
@@ -264,15 +278,18 @@ drop table t1;
       --echo ** Update will create a table scan which creates a ULL where a=2;
       --echo ** this will hang waiting on thread 1.
       send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
-      sleep 1;
 
   --echo ** connection thread1
   connection thread1;
+  let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+  --source include/wait_condition.inc
   --echo ** Insert new values to t1 from thread 1; this created an implicit
   --echo ** commit since there are no on-going transactions.
   insert into t1 values (1,1);
   --echo ** Release the ULL (thread 2 updates will finish).
-  select release_lock("hello2");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+  DO release_lock("hello2");
   --echo ** ..but thread 1 will still see t1 as if nothing has happend:
   select * from t1;
 
@@ -280,7 +297,9 @@ drop table t1;
       connection thread2;
       --echo ** Collect results from thread 2 and release the lock.
       reap;
-      select release_lock("hello2");
+# Due to Bug#32782 User lock hash fails to find lock, which probably also cause Bug#39484 (main.concurrent_innodb_safelog fails sporadically) the success of the following
+# is also guaranteed for NULL. Replaced SELECT by DO (no result).
+      DO release_lock("hello2");
       --echo ** The table should look like the original+updates for thread 2,
       --echo ** and consist of new rows:
       select * from t1;
@@ -534,6 +553,9 @@ drop table t1;
       connection thread2;
       begin;
       send delete from t1 where tipo=2;
+# The sleep has not been replaced as all tried wait conditions leaded to sporadically
+# succeding update in the following thread. Also the used status variables '%lock%' and
+# 'innodb_deleted_rows' and infos in processlist where not sucessful.
       sleep 1;
 
   --echo ** connection thread1
@@ -594,8 +616,11 @@ drop table t1;
       connection thread2;
       begin;
       send delete from t1 where tipo=2;
+# The sleep has not been replaced as all tried wait conditions leaded to sporadically
+# succeding update in the following thread. Also the used status variables '%lock%' and
+# 'innodb_deleted_rows' and infos in processlist where not sucessful.
       sleep 1;
-  
+ 
   --echo ** connection thread1
   connection thread1;
   begin;

=== modified file 'mysql-test/include/ndb_backup.inc'
--- a/mysql-test/include/ndb_backup.inc	2009-05-08 09:57:18 +0000
+++ b/mysql-test/include/ndb_backup.inc	2009-05-08 14:43:21 +0000
@@ -3,28 +3,44 @@
 # in test cases and can be reused.                   #
 ######################################################
 
-# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
-#            'grep' call
-# This test is disabled on Windows via the next line until the above bug is
-# resolved
---source include/not_windows.inc
-
---disable_query_log
 --exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
 
-# there is no neat way to find the backupid, this is a hack to find it...
-let $dump_file= $MYSQLTEST_VARDIR/tmp/tmp.dat;
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $dump_file
+# To find the backupid, we must dump this data to a table, and SELECT
+# what we want into an outfile.  This could be accomplished with grep, but
+# grep isn't Windows-portable
 
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-
---replace_result $dump_file DUMP_FILE
-eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+--disable_query_log
+# create a table to help us out
+--disable_warnings # leave this on until done with the entire process
+# cleanup
+DROP TABLE IF EXISTS helper1;
+CREATE TABLE helper1(c1 VARCHAR(20));
+# dump raw data to file
+let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat;
+let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat;
+--error 0,1
+--remove_file $ndb_backup_file1
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1
+# load the table from the raw data file
+eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1;
+--remove_file $ndb_backup_file1
+# output what we need
+eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%'
+INTO OUTFILE '$ndb_backup_file2';
+# cleanup
+DROP TABLE helper1;
+--enable_warnings
+
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
+(id INT, backup_id INT) ENGINE = MEMORY;
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval LOAD DATA INFILE '$ndb_backup_file2' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+--remove_file $ndb_backup_file2
 
 # Load backup id into environment variable
 let the_backup_id=`SELECT  backup_id from test.backup_info`;
-DROP TABLE test.backup_info;
-
-remove_file $dump_file;
 
+DROP TABLE test.backup_info;
+--enable_query_log
 

=== modified file 'mysql-test/lib/My/SafeProcess/safe_process.cc'
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc	2009-03-09 13:31:39 +0000
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc	2009-03-12 15:07:13 +0000
@@ -45,6 +45,7 @@
 
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <stdarg.h>

=== modified file 'mysql-test/r/concurrent_innodb_safelog.result'
--- a/mysql-test/r/concurrent_innodb_safelog.result	2009-01-31 18:09:41 +0000
+++ b/mysql-test/r/concurrent_innodb_safelog.result	2009-03-17 13:43:43 +0000
@@ -7,8 +7,6 @@ SELECT @@global.innodb_locks_unsafe_for_
 0
 # keep_locks == 1
 GRANT USAGE ON test.* TO mysqltest@localhost;
-DO release_lock("hello");
-DO release_lock("hello2");
 drop table if exists t1;
 
 **
@@ -36,7 +34,7 @@ get_lock("hello",10)
 ** connection thread2
 ** Start transaction for thread 2
 begin;
-** Update will cause a table scan and a new ULL  will 
+** Update will cause a table scan and a new ULL  will
 ** be created and blocked on the first row where tipo=11.
 update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
 ** connection thread1
@@ -51,9 +49,7 @@ update t1 set eta=2 where tipo=22;
 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 ** Release user level name lock from thread 1. This will cause the ULL
 ** on thread 2 to end its wait.
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Table is now updated with a new eta on tipo=22 for thread 1.
 select * from t1;
 eta	tipo	c
@@ -70,9 +66,7 @@ eta	tipo	c
 90	11	kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
 ** connection thread2
 ** Release the lock and collect result from update on thread 2
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Table should have eta updates where tipo=11 but updates made by
 ** thread 1 shouldn't be visible yet.
 select * from t1;
@@ -194,9 +188,7 @@ begin;
 update t1 set tipo=1 where tipo=2;
 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 ** Release ULL. This will release the next waiting ULL on thread 2.
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** The table should still be updated with updates for thread 1 only:
 select * from t1;
 eta	tipo	c
@@ -213,9 +205,7 @@ eta	tipo	c
 90	11	kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
 ** connection thread2
 ** Release the lock and collect result from thread 2:
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Seen from thread 2 the table should have been updated on four
 ** places.
 select * from t1;
@@ -319,9 +309,7 @@ update t1 set b=10+get_lock(concat("hell
 ** commit since there are no on-going transactions.
 insert into t1 values (1,1);
 ** Release the ULL (thread 2 updates will finish).
-select release_lock("hello2");
-release_lock("hello2")
-1
+DO release_lock("hello2");
 ** ..but thread 1 will still see t1 as if nothing has happend:
 select * from t1;
 a	b
@@ -332,9 +320,7 @@ a	b
 1	1
 ** connection thread2
 ** Collect results from thread 2 and release the lock.
-select release_lock("hello2");
-release_lock("hello2")
-1
+DO release_lock("hello2");
 ** The table should look like the original+updates for thread 2,
 ** and consist of new rows:
 select * from t1;

=== modified file 'mysql-test/r/concurrent_innodb_unsafelog.result'
--- a/mysql-test/r/concurrent_innodb_unsafelog.result	2009-01-31 18:09:41 +0000
+++ b/mysql-test/r/concurrent_innodb_unsafelog.result	2009-03-17 13:43:43 +0000
@@ -7,8 +7,6 @@ SELECT @@global.innodb_locks_unsafe_for_
 1
 # keep_locks == 0
 GRANT USAGE ON test.* TO mysqltest@localhost;
-DO release_lock("hello");
-DO release_lock("hello2");
 drop table if exists t1;
 
 **
@@ -36,7 +34,7 @@ get_lock("hello",10)
 ** connection thread2
 ** Start transaction for thread 2
 begin;
-** Update will cause a table scan and a new ULL  will 
+** Update will cause a table scan and a new ULL  will
 ** be created and blocked on the first row where tipo=11.
 update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
 ** connection thread1
@@ -50,9 +48,7 @@ begin;
 update t1 set eta=2 where tipo=22;
 ** Release user level name lock from thread 1. This will cause the ULL
 ** on thread 2 to end its wait.
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Table is now updated with a new eta on tipo=22 for thread 1.
 select * from t1;
 eta	tipo	c
@@ -69,9 +65,7 @@ eta	tipo	c
 90	11	kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
 ** connection thread2
 ** Release the lock and collect result from update on thread 2
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Table should have eta updates where tipo=11 but updates made by
 ** thread 1 shouldn't be visible yet.
 select * from t1;
@@ -192,9 +186,7 @@ begin;
 ** do not match the WHERE condition are released.
 update t1 set tipo=1 where tipo=2;
 ** Release ULL. This will release the next waiting ULL on thread 2.
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** The table should still be updated with updates for thread 1 only:
 select * from t1;
 eta	tipo	c
@@ -211,9 +203,7 @@ eta	tipo	c
 90	11	kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
 ** connection thread2
 ** Release the lock and collect result from thread 2:
-select release_lock("hello");
-release_lock("hello")
-1
+DO release_lock("hello");
 ** Seen from thread 2 the table should have been updated on four
 ** places.
 select * from t1;
@@ -317,9 +307,7 @@ update t1 set b=10+get_lock(concat("hell
 ** commit since there are no on-going transactions.
 insert into t1 values (1,1);
 ** Release the ULL (thread 2 updates will finish).
-select release_lock("hello2");
-release_lock("hello2")
-1
+DO release_lock("hello2");
 ** ..but thread 1 will still see t1 as if nothing has happend:
 select * from t1;
 a	b
@@ -330,9 +318,7 @@ a	b
 1	1
 ** connection thread2
 ** Collect results from thread 2 and release the lock.
-select release_lock("hello2");
-release_lock("hello2")
-1
+DO release_lock("hello2");
 ** The table should look like the original+updates for thread 2,
 ** and consist of new rows:
 select * from t1;

=== modified file 'mysql-test/r/create.result'
--- a/mysql-test/r/create.result	2009-01-23 12:22:05 +0000
+++ b/mysql-test/r/create.result	2009-03-17 14:29:16 +0000
@@ -1731,7 +1731,7 @@ t1	CREATE TABLE `t1` (
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
@@ -1745,7 +1745,7 @@ t1	CREATE TEMPORARY TABLE `t1` (
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8

=== modified file 'mysql-test/r/ctype_collate.result'
--- a/mysql-test/r/ctype_collate.result	2008-02-12 19:09:16 +0000
+++ b/mysql-test/r/ctype_collate.result	2009-03-19 09:26:12 +0000
@@ -611,3 +611,22 @@ check table t1 extended;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
+select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
+least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
+a
+create table t1
+select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f1` varchar(1) CHARACTER SET latin5 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
+latin5_turkish_ci then 2 else 3 end;
+case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
+latin5_turkish_ci then 2 else 3 end
+3
+select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
+concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
+abc

=== modified file 'mysql-test/r/index_merge_myisam.result'
--- a/mysql-test/r/index_merge_myisam.result	2008-12-23 13:28:13 +0000
+++ b/mysql-test/r/index_merge_myisam.result	2009-03-14 18:58:23 +0000
@@ -1391,3 +1391,174 @@ WHERE
 `RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND
 `TESTID`='' AND `UCCHECK`='';
 drop table t1;
+#
+# Generic @@optimizer_switch tests (move those into a separate file if
+#  we get another @@optimizer_switch user)
+#
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set optimizer_switch='index_merge=off,index_merge_union=off';
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
+set optimizer_switch='index_merge_union=on';
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set optimizer_switch='default,index_merge_sort_union=off';
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
+set optimizer_switch=4;
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4'
+set optimizer_switch=NULL;
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
+set optimizer_switch='default,index_merge';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
+set optimizer_switch='index_merge=index_merge';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=index_merge'
+set optimizer_switch='index_merge=on,but...';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'but...'
+set optimizer_switch='index_merge=';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge='
+set optimizer_switch='index_merge';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
+set optimizer_switch='on';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'on'
+set optimizer_switch='index_merge=on,index_merge=off';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off'
+set optimizer_switch='index_merge_union=on,index_merge_union=default';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge_union=default'
+set optimizer_switch='default,index_merge=on,index_merge=off,default';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off,default'
+set optimizer_switch=default;
+set optimizer_switch='index_merge=off,index_merge_union=off,default';
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
+set optimizer_switch=default;
+select @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set @@global.optimizer_switch=default;
+select @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+#
+# Check index_merge's @@optimizer_switch flags
+#
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int, filler char(100), 
+key(a), key(b), key(c));
+insert into t1 select 
+A.a * B.a*10 + C.a*100, 
+A.a * B.a*10 + C.a*100,
+A.a, 
+'filler'
+from t0 A, t0 B, t0 C;
+This should use union:
+explain select * from t1 where a=1 or b=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	2	Using union(a,b); Using where
+This should use ALL:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a=1 or b=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	a,b	NULL	NULL	NULL	1000	Using where
+This should use sort-union:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=1 or b=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	2	Using sort_union(a,b); Using where
+This will use sort-union:
+set optimizer_switch=default;
+explain select * from t1 where a<1 or b <1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	38	Using sort_union(a,b); Using where
+This should use ALL:
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where a<1 or b <1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	a,b	NULL	NULL	NULL	1000	Using where
+This should use ALL:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a<1 or b <1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	a,b	NULL	NULL	NULL	1000	Using where
+This will use sort-union:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a<1 or b <1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	38	Using sort_union(a,b); Using where
+alter table t1 add d int, add key(d);
+update t1 set d=a;
+This will use sort_union:
+set optimizer_switch=default;
+explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b,c,d	a,b	5,5	NULL	3	Using sort_union(a,b); Using where
+And if we disable sort_union, union:
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b,c,d	c,d	5,5	NULL	100	Using union(c,d); Using where
+drop table t1;
+create table t1 (
+a int, b int, c int,
+filler1 char(200), filler2 char(200), 
+key(a),key(b),key(c)
+);
+insert into t1 
+select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a, 'foo', 'bar' 
+from t0 A, t0 B, t0 C, t0 D where D.a<5;
+This should be intersect:
+set optimizer_switch=default;
+explain select * from t1 where a=10 and b=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	1	Using intersect(a,b); Using where
+No intersect when index_merge is disabled:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a=10 and b=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	a,b	a	5	const	49	Using where
+No intersect if it is disabled:
+set optimizer_switch='default,index_merge_intersection=off';
+explain select * from t1 where a=10 and b=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	a,b	a	5	const	49	Using where
+Do intersect when union was disabled
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=10 and b=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	1	Using intersect(a,b); Using where
+Do intersect when sort_union was disabled
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where a=10 and b=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b	a,b	5,5	NULL	1	Using intersect(a,b); Using where
+This will use intersection inside a union:
+set optimizer_switch=default;
+explain select * from t1 where a=10 and b=10 or c=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b,c	a,b,c	5,5,5	NULL	6	Using union(intersect(a,b),c); Using where
+Should be only union left:
+set optimizer_switch='default,index_merge_intersection=off';
+explain select * from t1 where a=10 and b=10 or c=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b,c	a,c	5,5	NULL	54	Using union(a,c); Using where
+This will switch to sort-union (intersection will be gone, too,
+thats a known limitation:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=10 and b=10 or c=10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	a,b,c	a,c	5,5	NULL	54	Using sort_union(a,c); Using where
+set optimizer_switch=default;
+show variables like 'optimizer_switch';
+Variable_name	Value
+optimizer_switch	index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+drop table t0, t1;

=== modified file 'mysql-test/r/information_schema.result'
--- a/mysql-test/r/information_schema.result	2009-05-08 09:57:18 +0000
+++ b/mysql-test/r/information_schema.result	2009-05-08 14:43:21 +0000
@@ -1720,4 +1720,9 @@ SELECT CREATE_OPTIONS FROM INFORMATION_S
 CREATE_OPTIONS
 KEY_BLOCK_SIZE=1
 DROP TABLE t1;
+SET TIMESTAMP=@@TIMESTAMP + 10000000;
+SELECT 'OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
+TEST_RESULT
+OK
+SET TIMESTAMP=DEFAULT;
 End of 5.1 tests.

=== modified file 'mysql-test/r/key_cache.result'
--- a/mysql-test/r/key_cache.result	2008-03-27 16:43:17 +0000
+++ b/mysql-test/r/key_cache.result	2009-03-16 19:54:50 +0000
@@ -276,8 +276,6 @@ Variable_name	Value
 Key_blocks_unused	KEY_BLOCKS_UNUSED
 set global keycache2.key_buffer_size=0;
 set global keycache3.key_buffer_size=100;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '100'
 set global keycache3.key_buffer_size=0;
 create table t1 (mytext text, FULLTEXT (mytext));
 insert t1 values ('aaabbb');

=== modified file 'mysql-test/r/lock_multi.result'
--- a/mysql-test/r/lock_multi.result	2009-03-06 14:56:17 +0000
+++ b/mysql-test/r/lock_multi.result	2009-03-24 13:58:52 +0000
@@ -96,40 +96,6 @@ alter table t1 auto_increment=0;
 alter table t1 auto_increment=0;
 unlock tables;
 drop table t1;
-CREATE TABLE t1 (
-a int(11) unsigned default NULL,
-b varchar(255) default NULL,
-UNIQUE KEY a (a),
-KEY b (b)
-);
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
-CREATE TABLE t2 SELECT * FROM t1;
-CREATE TABLE t3 SELECT * FROM t1;
-# test altering of columns that multiupdate doesn't use
-# normal mode
-# PS mode
-# test altering of columns that multiupdate uses
-# normal mode
-# PS mode
-DROP TABLE t1, t2, t3;
-CREATE TABLE t1( a INT, b INT );
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
-# 1. test regular tables
-# 1.1. test altering of columns that multiupdate doesn't use
-# 1.1.1. normal mode
-# 1.1.2. PS mode
-# 1.2. test altering of columns that multiupdate uses
-# 1.2.1. normal mode
-# 1.2.2. PS mode
-ALTER TABLE t1 ADD COLUMN a INT;
-# 2. test UNIONs
-# 2.1. test altering of columns that multiupdate doesn't use
-# 2.1.1. normal mode
-# 2.1.2. PS mode
-# 2.2. test altering of columns that multiupdate uses
-# 2.2.1. normal mode
-# 2.2.2. PS mode
-DROP TABLE t1;
 End of 5.0 tests
 create table t1 (i int);
 lock table t1 read;

=== added file 'mysql-test/r/lock_multi_bug38499.result'
--- a/mysql-test/r/lock_multi_bug38499.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/lock_multi_bug38499.result	2009-03-23 14:22:31 +0000
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1( a INT, b INT );
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
+# 1. test regular tables
+# 1.1. test altering of columns that multiupdate doesn't use
+# 1.1.1. normal mode
+# 1.1.2. PS mode
+# 1.2. test altering of columns that multiupdate uses
+# 1.2.1. normal mode
+# 1.2.2. PS mode
+ALTER TABLE t1 ADD COLUMN a INT;
+# 2. test UNIONs
+# 2.1. test altering of columns that multiupdate doesn't use
+# 2.1.1. normal mode
+# 2.1.2. PS mode
+# 2.2. test altering of columns that multiupdate uses
+# 2.2.1. normal mode
+# 2.2.2. PS mode
+DROP TABLE t1;

=== added file 'mysql-test/r/lock_multi_bug38691.result'
--- a/mysql-test/r/lock_multi_bug38691.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/lock_multi_bug38691.result	2009-03-23 14:22:31 +0000
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS t1,t2,t3;
+CREATE TABLE t1 (
+a int(11) unsigned default NULL,
+b varchar(255) default NULL,
+UNIQUE KEY a (a),
+KEY b (b)
+);
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
+CREATE TABLE t2 SELECT * FROM t1;
+CREATE TABLE t3 SELECT * FROM t1;
+# test altering of columns that multiupdate doesn't use
+# normal mode
+# PS mode
+# test altering of columns that multiupdate uses
+# normal mode
+# PS mode
+DROP TABLE t1, t2, t3;

=== added file 'mysql-test/r/mysql-bug41486.result'
--- a/mysql-test/r/mysql-bug41486.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/mysql-bug41486.result	2009-03-25 07:32:01 +0000
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS t1;
+SET @old_max_allowed_packet= @@global.max_allowed_packet;
+SET @@global.max_allowed_packet = 2 * 1024 * 1024 + 1024;
+CREATE TABLE t1(data LONGBLOB);
+INSERT INTO t1 SELECT REPEAT('1', 2*1024*1024);
+SET @old_general_log = @@global.general_log;
+SET @@global.general_log = 0;
+SET @@global.general_log = @old_general_log;
+SELECT LENGTH(data) FROM t1;
+LENGTH(data)
+2097152
+DROP TABLE t1;
+SET @@global.max_allowed_packet = @old_max_allowed_packet;

=== modified file 'mysql-test/r/mysqlbinlog.result'
--- a/mysql-test/r/mysqlbinlog.result	2009-03-06 14:56:17 +0000
+++ b/mysql-test/r/mysqlbinlog.result	2009-03-20 14:49:43 +0000
@@ -44,16 +44,16 @@ SET TIMESTAMP=1000000000/*!*/;
 insert into t2 values ()
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 DELIMITER ;
 # End of log file
@@ -144,16 +144,16 @@ SET TIMESTAMP=1000000000/*!*/;
 insert into t2 values ()
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 DELIMITER ;
 # End of log file
@@ -359,29 +359,29 @@ SET @@session.collation_database=DEFAULT
 create table t1 (a varchar(64) character set utf8)
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
 SET @@session.collation_database=7/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
 SET @@session.collation_database=DEFAULT/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
 SET @@session.collation_database=7/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
 SET @@session.collation_database=DEFAULT/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO  table t1
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO  table t1 character set koi8r
 /*!*/;
 SET TIMESTAMP=1000000000/*!*/;
 drop table t1

=== modified file 'mysql-test/r/select.result'
--- a/mysql-test/r/select.result	2009-02-10 13:27:35 +0000
+++ b/mysql-test/r/select.result	2009-03-16 05:02:10 +0000
@@ -4416,4 +4416,32 @@ date_nokey
 Warnings:
 Warning	1292	Incorrect date value: '10:41:7' for column 'date_nokey' at row 1
 DROP TABLE A,C;
+CREATE TABLE t1 (a INT NOT NULL, b INT);
+INSERT INTO t1 VALUES (1, 1);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	100.00	
+Warnings:
+Note	1003	select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
+SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
+a	b
+1	1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	0.00	const row not found
+Warnings:
+Note	1003	select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	0.00	const row not found
+Warnings:
+Note	1003	select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	0.00	const row not found
+Warnings:
+Note	1003	select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/union.result'
--- a/mysql-test/r/union.result	2008-11-20 07:51:48 +0000
+++ b/mysql-test/r/union.result	2009-03-19 10:18:52 +0000
@@ -160,12 +160,12 @@ SELECT a FROM t1
 UNION
 SELECT a FROM t1
 ) alias;
-SELECT a INTO OUTFILE 'union.out.file' FROM (
+SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
 SELECT a FROM t1
 UNION
 SELECT a FROM t1 WHERE 0
 ) alias;
-SELECT a INTO DUMPFILE 'union.out.file2' FROM (
+SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
 SELECT a FROM t1
 UNION
 SELECT a FROM t1 WHERE 0
@@ -178,21 +178,21 @@ SELECT a INTO @v FROM t1
 SELECT a FROM (
 SELECT a FROM t1
 UNION
-SELECT a INTO OUTFILE 'union.out.file3' FROM t1
+SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
 ) alias;
 SELECT a FROM (
 SELECT a FROM t1
 UNION
-SELECT a INTO DUMPFILE 'union.out.file4' FROM t1
+SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
 ) alias;
 SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
+SELECT a FROM t1 UNION SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
+SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
 SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
 ERROR HY000: Incorrect usage of UNION and INTO
-SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
+SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
 ERROR HY000: Incorrect usage of UNION and INTO
-SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
+SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
 ERROR HY000: Incorrect usage of UNION and INTO
 DROP TABLE t1;
 CREATE TABLE t1 (

=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	2009-03-12 16:55:10 +0000
+++ b/mysql-test/r/variables.result	2009-03-16 15:11:45 +0000
@@ -27,6 +27,7 @@ set @my_slow_launch_time          =@@glo
 set @my_storage_engine            =@@global.storage_engine;
 set @my_thread_cache_size         =@@global.thread_cache_size;
 set @my_max_allowed_packet        =@@global.max_allowed_packet;
+set @my_join_buffer_size          =@@global.join_buffer_size;
 set @`test`=1;
 select @test, @`test`, @TEST, @`TEST`, @"teSt";
 @test	@`test`	@TEST	@`TEST`	@"teSt"
@@ -1018,6 +1019,11 @@ show variables like 'hostname';
 Variable_name	Value
 hostname	#
 End of 5.0 tests
+set join_buffer_size=1;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '1'
+set @save_join_buffer_size=@@join_buffer_size;
+set join_buffer_size=@save_join_buffer_size;
 set global binlog_cache_size         =@my_binlog_cache_size;
 set global connect_timeout           =@my_connect_timeout;
 set global delayed_insert_timeout    =@my_delayed_insert_timeout;
@@ -1048,6 +1054,7 @@ set global slow_launch_time          =@m
 set global storage_engine            =@my_storage_engine;
 set global thread_cache_size         =@my_thread_cache_size;
 set global max_allowed_packet        =@my_max_allowed_packet;
+set global join_buffer_size          =@my_join_buffer_size;
 show global variables where Variable_name='table_definition_cache' or
 Variable_name='table_lock_wait_timeout';
 Variable_name	Value

=== modified file 'mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result'
--- a/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result	2008-11-13 19:19:00 +0000
+++ b/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result	2009-03-06 18:19:29 +0000
@@ -38,4 +38,5 @@ DROP PROCEDURE IF EXISTS p2;
 DROP FUNCTION IF EXISTS f1;
 DROP TRIGGER IF EXISTS tr1;
 stop slave sql_thread;
+reset slave;
 SET @@global.relay_log_purge= @old_relay_log_purge;

=== modified file 'mysql-test/suite/binlog/r/binlog_row_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result	2008-10-02 05:56:07 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result	2009-03-25 19:41:16 +0000
@@ -1137,6 +1137,38 @@ DROP PROCEDURE p1;
 DROP TABLE t1;
 DROP DATABASE bug39182;
 USE test;
+CREATE PROCEDURE p1(IN v1 INT)
+BEGIN
+CREATE TABLE t1 SELECT v1;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE v1 INT;
+CREATE TABLE t1 SELECT v1+1;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p3(IN v1 INT)
+BEGIN
+CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p4(IN v1 INT)
+BEGIN
+DECLARE v2 INT;
+CREATE TABLE t1 SELECT 1, v1, v2;
+DROP TABLE t1;
+CREATE TABLE t1 SELECT 1, v1+1, v2;
+DROP TABLE t1;
+END//
+CALL p1(1);
+CALL p2();
+CALL p3(0);
+CALL p4(0);
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
 End of 5.0 tests
 reset master;
 create table t1 (id tinyint auto_increment primary key);

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2008-10-02 05:56:07 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2009-03-25 19:41:16 +0000
@@ -644,6 +644,38 @@ DROP PROCEDURE p1;
 DROP TABLE t1;
 DROP DATABASE bug39182;
 USE test;
+CREATE PROCEDURE p1(IN v1 INT)
+BEGIN
+CREATE TABLE t1 SELECT v1;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE v1 INT;
+CREATE TABLE t1 SELECT v1+1;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p3(IN v1 INT)
+BEGIN
+CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0;
+DROP TABLE t1;
+END//
+CREATE PROCEDURE p4(IN v1 INT)
+BEGIN
+DECLARE v2 INT;
+CREATE TABLE t1 SELECT 1, v1, v2;
+DROP TABLE t1;
+CREATE TABLE t1 SELECT 1, v1+1, v2;
+DROP TABLE t1;
+END//
+CALL p1(1);
+CALL p2();
+CALL p3(0);
+CALL p4(0);
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
 End of 5.0 tests
 reset master;
 create table t1 (id tinyint auto_increment primary key);

=== modified file 'mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test'
--- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test	2008-11-13 19:19:00 +0000
+++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test	2009-03-06 18:19:29 +0000
@@ -52,9 +52,10 @@ DROP FUNCTION IF EXISTS f1;
 DROP TRIGGER IF EXISTS tr1;
 enable_warnings;
 
-remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
-remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
 stop slave sql_thread;
+reset slave;
 source include/wait_for_slave_sql_to_stop.inc;
+remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
+remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
 
 SET @@global.relay_log_purge= @old_relay_log_purge;

=== modified file 'mysql-test/suite/federated/federated.result'
--- a/mysql-test/suite/federated/federated.result	2009-02-02 11:36:03 +0000
+++ b/mysql-test/suite/federated/federated.result	2009-03-19 08:49:51 +0000
@@ -2130,6 +2130,26 @@ SELECT t1.a FROM t1, t1 as t2 WHERE t2.b
 a
 DROP TABLE t1;
 DROP TABLE t1;
+#
+# BUG#21360 - mysqldump error on federated tables
+#
+#Switch to Connection Slave
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
+INSERT INTO  t1 VALUES ('text1'),('text2'),('text3'),('text4');
+#Switch to Connection Master
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED 
+CONNECTION='mysql://root@stripped:SLAVE_PORT/test/t1';
+# Dump table t1 using mysqldump tool
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+  `id` varchar(20) NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@stripped:SLAVE_PORT/test/t1';
+/*!40101 SET character_set_client = @saved_cs_client */;
+DROP TABLE t1;
+#Switch to Connection Slave
+DROP TABLE t1;
 End of 5.0 tests
 create server 's1' foreign data wrapper 'mysql' options (port 3306);
 drop server 's1';

=== modified file 'mysql-test/suite/federated/federated.test'
--- a/mysql-test/suite/federated/federated.test	2008-12-13 19:42:12 +0000
+++ b/mysql-test/suite/federated/federated.test	2009-03-19 08:49:51 +0000
@@ -1942,6 +1942,28 @@ DROP TABLE t1;
 connection master;
 DROP TABLE t1;
 
+--echo #
+--echo # BUG#21360 - mysqldump error on federated tables
+--echo #
+connection slave;
+--echo #Switch to Connection Slave
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
+INSERT INTO  t1 VALUES ('text1'),('text2'),('text3'),('text4');
+
+connection master;
+--echo #Switch to Connection Master
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED 
+  CONNECTION='mysql://root@stripped:$SLAVE_MYPORT/test/t1';
+--echo # Dump table t1 using mysqldump tool
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--exec $MYSQL_DUMP --compact test t1
+DROP TABLE t1;
+
+connection slave;
+--echo #Switch to Connection Slave
+DROP TABLE t1;
+
 connection default;
 
 --echo End of 5.0 tests

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_is.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result	2009-01-15 07:32:40 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result	2009-05-08 14:43:21 +0000
@@ -168,7 +168,7 @@ NULL	information_schema	PROCESSLIST	HOST
 NULL	information_schema	PROCESSLIST	ID	1	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(4)			select		Default	Default
 NULL	information_schema	PROCESSLIST	INFO	8	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select		Default	Default
 NULL	information_schema	PROCESSLIST	STATE	7	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select		Default	Default
-NULL	information_schema	PROCESSLIST	TIME	6	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(7)			select		Default	Default
+NULL	information_schema	PROCESSLIST	TIME	6	0	NO	int	NULL	NULL	10	0	NULL	NULL	int(7)			select		Default	Default
 NULL	information_schema	PROCESSLIST	USER	2		NO	varchar	16	48	NULL	NULL	utf8	utf8_general_ci	varchar(16)			select		Default	Default
 NULL	information_schema	REFERENTIAL_CONSTRAINTS	CONSTRAINT_CATALOG	1	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select		Default	Default
 NULL	information_schema	REFERENTIAL_CONSTRAINTS	CONSTRAINT_NAME	3		NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select		Default	Default
@@ -342,6 +342,7 @@ ORDER BY CHARACTER_SET_NAME, COLLATION_N
 COL_CML	DATA_TYPE	CHARACTER_SET_NAME	COLLATION_NAME
 NULL	bigint	NULL	NULL
 NULL	datetime	NULL	NULL
+NULL	int	NULL	NULL
 --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
 --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
 SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
@@ -523,7 +524,7 @@ NULL	information_schema	PROCESSLIST	ID	b
 3.0000	information_schema	PROCESSLIST	HOST	varchar	64	192	utf8	utf8_general_ci	varchar(64)
 3.0000	information_schema	PROCESSLIST	DB	varchar	64	192	utf8	utf8_general_ci	varchar(64)
 3.0000	information_schema	PROCESSLIST	COMMAND	varchar	16	48	utf8	utf8_general_ci	varchar(16)
-NULL	information_schema	PROCESSLIST	TIME	bigint	NULL	NULL	NULL	NULL	bigint(7)
+NULL	information_schema	PROCESSLIST	TIME	int	NULL	NULL	NULL	NULL	int(7)
 3.0000	information_schema	PROCESSLIST	STATE	varchar	64	192	utf8	utf8_general_ci	varchar(64)
 1.0000	information_schema	PROCESSLIST	INFO	longtext	4294967295	4294967295	utf8	utf8_general_ci	longtext
 3.0000	information_schema	REFERENTIAL_CONSTRAINTS	CONSTRAINT_CATALOG	varchar	512	1536	utf8	utf8_general_ci	varchar(512)

=== modified file 'mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result'
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result	2008-08-21 14:38:49 +0000
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result	2009-03-18 12:52:31 +0000
@@ -27,7 +27,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
@@ -97,7 +97,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8

=== modified file 'mysql-test/suite/funcs_1/r/processlist_priv_ps.result'
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result	2008-08-21 14:38:49 +0000
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result	2009-03-26 15:49:06 +0000
@@ -27,7 +27,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
@@ -97,7 +97,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8

=== modified file 'mysql-test/suite/funcs_1/r/processlist_val_no_prot.result'
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result	2008-08-13 19:44:54 +0000
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result	2009-03-18 12:52:31 +0000
@@ -17,7 +17,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8

=== modified file 'mysql-test/suite/funcs_1/r/processlist_val_ps.result'
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result	2008-08-13 19:44:54 +0000
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result	2009-03-26 15:49:06 +0000
@@ -17,7 +17,7 @@ PROCESSLIST	CREATE TEMPORARY TABLE `PROC
   `HOST` varchar(64) NOT NULL DEFAULT '',
   `DB` varchar(64) DEFAULT NULL,
   `COMMAND` varchar(16) NOT NULL DEFAULT '',
-  `TIME` bigint(7) NOT NULL DEFAULT '0',
+  `TIME` int(7) NOT NULL DEFAULT '0',
   `STATE` varchar(64) DEFAULT NULL,
   `INFO` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8

=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2009-02-16 08:00:56 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2009-05-08 14:43:21 +0000
@@ -607,9 +607,6 @@ a	b	c	d	e	f	g
 *********************************
 * Backup and restore tables w/ new column
 *********************************
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 DROP TABLE t1;
 ForceVarPart: 1
 DROP TABLE t1;

=== modified file 'mysql-test/suite/ndb/r/ndb_blob_restore.result'
--- a/mysql-test/suite/ndb/r/ndb_blob_restore.result	2009-02-01 21:05:19 +0000
+++ b/mysql-test/suite/ndb/r/ndb_blob_restore.result	2009-05-08 14:43:21 +0000
@@ -53,9 +53,6 @@ a33549d9844092289a58ac348dd59f09fc28406a
 1d42dd9090cf78314a06665d4ea938c35cc760f4	10d3c783026b310218d10b7188da96a2401648c6	xx3
 a33549d9844092289a58ac348dd59f09fc28406a	daa61c6de36a0526f0d47dc29d6b9de7e6d2630c	yy3
 70fc9a7d08beebc522258bfb02000a30c77a8f1d	090565c580809efed3d369481a4bbb168b20713e	zz3
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1, t2;
 select a, sha1(b) from t1 order by a;
 a	sha1(b)
@@ -124,9 +121,6 @@ a33549d9844092289a58ac348dd59f09fc28406a
 1d42dd9090cf78314a06665d4ea938c35cc760f4	10d3c783026b310218d10b7188da96a2401648c6	xx3
 a33549d9844092289a58ac348dd59f09fc28406a	daa61c6de36a0526f0d47dc29d6b9de7e6d2630c	yy3
 70fc9a7d08beebc522258bfb02000a30c77a8f1d	090565c580809efed3d369481a4bbb168b20713e	zz3
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1, t2;
 select a, sha1(b) from t1 order by a;
 a	sha1(b)

=== modified file 'mysql-test/suite/ndb/r/ndb_restore.result'
--- a/mysql-test/suite/ndb/r/ndb_restore.result	2009-02-01 21:05:19 +0000
+++ b/mysql-test/suite/ndb/r/ndb_restore.result	2009-05-08 14:43:21 +0000
@@ -131,9 +131,6 @@ create table t9 engine=myisam as select 
 create table t10 engine=myisam as select * from t10_c;
 ForceVarPart: 0
 ForceVarPart: 1
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
 ForceVarPart: 0
 ForceVarPart: 1
@@ -286,9 +283,6 @@ auto_increment
 10001
 ALTER TABLE t7_c
 PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
 select count(*) from t1;
 count(*)
@@ -490,9 +484,6 @@ select * from t9_c) a;
 count(*)
 3
 drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 CREATE TABLE t11_c (
 c1 int primary key, c2 char(10), c3 varchar(10)
 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
@@ -501,9 +492,6 @@ c1 int primary key, c2 char(10), c3 varc
 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
 INSERT INTO t11_c VALUES(1, "aaaaa", "bbbbb"), (2, "ccccc", "ddddd"), (3, "eeeee","fffff");
 INSERT INTO t12_c VALUES(4, "ggggg", "hhhhh"), (5, "iiiii", "jjjjj"), (6, "kkkkk","lllll");
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t2_c,t11_c,t12_c;
 SELECT * FROM t11_c ORDER BY c1;
 c1	c2	c3

=== modified file 'mysql-test/suite/ndb/r/ndb_restore_partition.result'
--- a/mysql-test/suite/ndb/r/ndb_restore_partition.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/ndb/r/ndb_restore_partition.result	2009-05-08 14:43:21 +0000
@@ -125,9 +125,6 @@ create table t6 engine=myisam as select 
 create table t7 engine=myisam as select * from t7_c;
 create table t8 engine=myisam as select * from t8_c;
 create table t9 engine=myisam as select * from t9_c;
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
 select count(*) from t1;
 count(*)
@@ -244,9 +241,6 @@ PARTITION BY LINEAR HASH (`relatta`)
 PARTITIONS 4;
 ALTER TABLE t7_c
 PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
 select count(*) from t1;
 count(*)
@@ -448,9 +442,6 @@ select * from t9_c) a;
 count(*)
 3
 drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 Create table test/def/t2_c failed: Translate frm error
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 drop table if exists t2_c;

=== modified file 'mysql-test/suite/ndb/r/ndb_restore_print.result'
--- a/mysql-test/suite/ndb/r/ndb_restore_print.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/ndb/r/ndb_restore_print.result	2009-05-08 14:43:21 +0000
@@ -227,9 +227,6 @@ hex(h3)	NULL
 hex(i1)	NULL
 hex(i2)	NULL
 hex(i3)	NULL
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 1;0x1;0x17;0x789A;0x789ABCDE;0xFEDC0001;127;255;32767;65535;2147483647;4294967295;9223372036854775807;18446744073709551615;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x12;0x123456789ABCDEF0;0x012345;0x12;0x123456789ABCDEF0;0x00123450
 2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0
 3;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N
@@ -257,9 +254,6 @@ create table t4 (pk int key, a int) engi
 insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
 insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
 insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 '1'	'1'	'12345678901234567890123456789012'	'123456789'	'1'	'12345678901234567890123456789012'	'123456789'	'0x20'	'0x123456789ABCDEF020'	'0x012345000020'	'0x1200000020'	'0x123456789ABCDEF000000020'	'0x00123450000020'
 
 t1
@@ -297,9 +291,6 @@ create table t1
 insert into t1 values(1, 8388607, 16777215);
 insert into t1 values(2, -8388608, 0);
 insert into t1 values(3, -1, 1);
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 1;8388607;16777215
 2;-8388608;0
 3;-1;1

=== modified file 'mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result'
--- a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result	2008-11-12 17:51:47 +0000
+++ b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result	2009-05-08 14:43:21 +0000
@@ -27,9 +27,6 @@ pk1	c2	c3	hex(c4)
 3	Sweden	498	1
 4	Sweden	497	1
 5	Sweden	496	1
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 ALTER TABLESPACE table_space1
 DROP DATAFILE './table_space1/datafile.dat'
@@ -91,9 +88,6 @@ LENGTH(data)
 SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
 LENGTH(data)
 16384
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 DROP TABLE test.t2;
 DROP TABLE test.t3;
@@ -317,9 +311,6 @@ pk1	c2	c3	hex(c4)
 248	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	4	1
 247	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	6	1
 246	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	8	1
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 DROP TABLE test.t2;
 DROP TABLE test.t3;

=== modified file 'mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result'
--- a/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result	2009-02-01 21:05:19 +0000
+++ b/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result	2009-05-08 14:43:21 +0000
@@ -265,9 +265,6 @@ COUNT(*)
 SELECT COUNT(*) FROM history;
 COUNT(*)
 200
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 ************ Restore the slave ************************
 CREATE DATABASE tpcb;
 ***** Check a few slave restore values ***************

=== modified file 'mysql-test/suite/parts/r/ndb_dd_backuprestore.result'
--- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result	2009-01-31 15:47:35 +0000
+++ b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result	2009-03-16 21:36:14 +0000
@@ -27,8 +27,9 @@ pk1	c2	c3	hex(c4)
 3	Sweden	498	1
 4	Sweden	497	1
 5	Sweden	496	1
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
+(id INT, backup_id INT) ENGINE = MEMORY;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
 DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 ALTER TABLESPACE table_space1
@@ -91,8 +92,9 @@ LENGTH(data)
 SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
 LENGTH(data)
 16384
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
+(id INT, backup_id INT) ENGINE = MEMORY;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
 DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 DROP TABLE test.t2;
@@ -317,8 +319,9 @@ pk1	c2	c3	hex(c4)
 248	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	4	1
 247	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	6	1
 246	TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU	8	1
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
+(id INT, backup_id INT) ENGINE = MEMORY;
+LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
 DROP TABLE test.backup_info;
 DROP TABLE test.t1;
 DROP TABLE test.t2;

=== modified file 'mysql-test/suite/rpl/r/rpl_do_grant.result'
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result	2009-03-18 13:48:23 +0000
@@ -89,3 +89,81 @@ show grants for rpl_do_grant2@localhost;
 ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
 show grants for rpl_do_grant2@localhost;
 ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
+DROP DATABASE IF EXISTS bug42217_db;
+CREATE DATABASE  bug42217_db;
+GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
+        IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
+USE bug42217_db;
+CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
+BEGIN
+RETURN "INSIDE upgrade_del_func()";
+END//
+USE bug42217_db;
+SELECT * FROM mysql.procs_priv;
+Host	Db	User	Routine_name	Routine_type	Grantor	Proc_priv	Timestamp
+localhost	bug42217_db	create_rout_db	upgrade_del_func	FUNCTION	create_rout_db@localhost	Execute,Alter Routine	#
+SELECT upgrade_del_func();
+upgrade_del_func()
+INSIDE upgrade_del_func()
+SELECT * FROM mysql.procs_priv;
+Host	Db	User	Routine_name	Routine_type	Grantor	Proc_priv	Timestamp
+localhost	bug42217_db	create_rout_db	upgrade_del_func	FUNCTION	create_rout_db@localhost	Execute,Alter Routine	#
+SHOW GRANTS FOR 'create_rout_db'@'localhost';
+Grants for create_rout_db@localhost
+GRANT USAGE ON *.* TO 'create_rout_db'@'localhost' IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
+GRANT CREATE ROUTINE ON `bug42217_db`.* TO 'create_rout_db'@'localhost' WITH GRANT OPTION
+GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'create_rout_db'@'localhost'
+USE bug42217_db;
+SHOW CREATE FUNCTION upgrade_del_func;
+Function	sql_mode	Create Function	character_set_client	collation_connection	Database Collation
+upgrade_del_func		CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
+BEGIN
+RETURN "INSIDE upgrade_del_func()";
+END	latin1	latin1_swedish_ci	latin1_swedish_ci
+SELECT upgrade_del_func();
+upgrade_del_func()
+INSIDE upgrade_del_func()
+"Check whether the definer user will be able to execute the replicated routine on slave"
+USE bug42217_db;
+SHOW CREATE FUNCTION upgrade_del_func;
+Function	sql_mode	Create Function	character_set_client	collation_connection	Database Collation
+upgrade_del_func		CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
+BEGIN
+RETURN "INSIDE upgrade_del_func()";
+END	latin1	latin1_swedish_ci	latin1_swedish_ci
+SELECT upgrade_del_func();
+upgrade_del_func()
+INSIDE upgrade_del_func()
+DELETE FROM mysql.procs_priv;
+FLUSH PRIVILEGES;
+USE bug42217_db;
+"Can't execute the replicated routine on slave like before after procs privilege is deleted "
+SELECT upgrade_del_func();
+ERROR 42000: execute command denied to user 'create_rout_db'@'localhost' for routine 'bug42217_db.upgrade_del_func'
+"Test the user who creates a function on master doesn't exist on slave."
+"Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
+DROP USER 'create_rout_db'@'localhost';
+CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
+BEGIN
+RETURN "INSIDE upgrade_alter_func()";
+END//
+SELECT upgrade_alter_func();
+upgrade_alter_func()
+INSIDE upgrade_alter_func()
+SHOW CREATE FUNCTION upgrade_alter_func;
+Function	sql_mode	Create Function	character_set_client	collation_connection	Database Collation
+upgrade_alter_func		CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
+BEGIN
+RETURN "INSIDE upgrade_alter_func()";
+END	latin1	latin1_swedish_ci	latin1_swedish_ci
+"Should no privilege record for upgrade_alter_func in mysql.procs_priv"
+SELECT * FROM mysql.procs_priv;
+Host	Db	User	Routine_name	Routine_type	Grantor	Proc_priv	Timestamp
+SELECT upgrade_alter_func();
+ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist
+USE bug42217_db;
+DROP FUNCTION upgrade_del_func;
+DROP FUNCTION upgrade_alter_func;
+DROP DATABASE bug42217_db;
+DROP USER 'create_rout_db'@'localhost';
+"End of test"

=== modified file 'mysql-test/suite/rpl/r/rpl_loaddatalocal.result'
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result	2009-03-16 08:21:29 +0000
@@ -29,3 +29,28 @@ a
 2
 3
 drop table t1;
+==== Bug22504 Initialize ====
+[on master]
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+insert into t1 values (1), (2), (3), (4);
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+[on slave]
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]

=== modified file 'mysql-test/suite/rpl/r/rpl_loadfile.result'
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result	2009-03-27 10:59:31 +0000
@@ -225,3 +225,21 @@ aberration
 
 DROP PROCEDURE IF EXISTS test.p1;
 DROP TABLE test.t1;
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (t text);
+CREATE PROCEDURE p(file varchar(4096)) 
+BEGIN
+INSERT INTO t1 VALUES (LOAD_FILE(file));
+END|
+include/stop_slave.inc
+CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
+include/start_slave.inc
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+DROP PROCEDURE p;

=== modified file 'mysql-test/suite/rpl/r/rpl_rotate_logs.result'
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-03-11 15:19:18 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-03-12 09:48:41 +0000
@@ -87,9 +87,7 @@ show binary logs;
 Log_name	File_size
 master-bin.000002	#
 master-bin.000003	#
-select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
-from information_schema.tables
-where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+SELECT @time_for_purge:=DATE_ADD('tmpval', INTERVAL 1 SECOND);
 purge master logs before (@time_for_purge);
 show binary logs;
 Log_name	File_size

=== added file 'mysql-test/suite/rpl/r/rpl_row_wide_table.result'
--- a/mysql-test/suite/rpl/r/rpl_row_wide_table.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_wide_table.result	2009-03-25 10:53:56 +0000
@@ -0,0 +1,318 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+DROP TABLE IF EXISTS t300;
+create table t300 (
+f1 int,
+f2 int,
+f3 int,
+f4 int,
+f5 int,
+f6 int,
+f7 int,
+f8 int,
+f9 int,
+f10 int,
+f11 int,
+f12 int,
+f13 int,
+f14 int,
+f15 int,
+f16 int,
+f17 int,
+f18 int,
+f19 int,
+f20 int,
+f21 int,
+f22 int,
+f23 int,
+f24 int,
+f25 int,
+f26 int,
+f27 int,
+f28 int,
+f29 int,
+f30 int,
+f31 int,
+f32 int,
+f33 int,
+f34 int,
+f35 int,
+f36 int,
+f37 int,
+f38 int,
+f39 int,
+f40 int,
+f41 int,
+f42 int,
+f43 int,
+f44 int,
+f45 int,
+f46 int,
+f47 int,
+f48 int,
+f49 int,
+f50 int,
+f51 int,
+f52 int,
+f53 int,
+f54 int,
+f55 int,
+f56 int,
+f57 int,
+f58 int,
+f59 int,
+f60 int,
+f61 int,
+f62 int,
+f63 int,
+f64 int,
+f65 int,
+f66 int,
+f67 int,
+f68 int,
+f69 int,
+f70 int,
+f71 int,
+f72 int,
+f73 int,
+f74 int,
+f75 int,
+f76 int,
+f77 int,
+f78 int,
+f79 int,
+f80 int,
+f81 int,
+f82 int,
+f83 int,
+f84 int,
+f85 int,
+f86 int,
+f87 int,
+f88 int,
+f89 int,
+f90 int,
+f91 int,
+f92 int,
+f93 int,
+f94 int,
+f95 int,
+f96 int,
+f97 int,
+f98 int,
+f99 int,
+f100 int,
+f101 int,
+f102 int,
+f103 int,
+f104 int,
+f105 int,
+f106 int,
+f107 int,
+f108 int,
+f109 int,
+f110 int,
+f111 int,
+f112 int,
+f113 int,
+f114 int,
+f115 int,
+f116 int,
+f117 int,
+f118 int,
+f119 int,
+f120 int,
+f121 int,
+f122 int,
+f123 int,
+f124 int,
+f125 int,
+f126 int,
+f127 int,
+f128 int,
+f129 int,
+f130 int,
+f131 int,
+f132 int,
+f133 int,
+f134 int,
+f135 int,
+f136 int,
+f137 int,
+f138 int,
+f139 int,
+f140 int,
+f141 int,
+f142 int,
+f143 int,
+f144 int,
+f145 int,
+f146 int,
+f147 int,
+f148 int,
+f149 int,
+f150 int,
+f151 int,
+f152 int,
+f153 int,
+f154 int,
+f155 int,
+f156 int,
+f157 int,
+f158 int,
+f159 int,
+f160 int,
+f161 int,
+f162 int,
+f163 int,
+f164 int,
+f165 int,
+f166 int,
+f167 int,
+f168 int,
+f169 int,
+f170 int,
+f171 int,
+f172 int,
+f173 int,
+f174 int,
+f175 int,
+f176 int,
+f177 int,
+f178 int,
+f179 int,
+f180 int,
+f181 int,
+f182 int,
+f183 int,
+f184 int,
+f185 int,
+f186 int,
+f187 int,
+f188 int,
+f189 int,
+f190 int,
+f191 int,
+f192 int,
+f193 int,
+f194 int,
+f195 int,
+f196 int,
+f197 int,
+f198 int,
+f199 int,
+f200 int,
+f201 int,
+f202 int,
+f203 int,
+f204 int,
+f205 int,
+f206 int,
+f207 int,
+f208 int,
+f209 int,
+f210 int,
+f211 int,
+f212 int,
+f213 int,
+f214 int,
+f215 int,
+f216 int,
+f217 int,
+f218 int,
+f219 int,
+f220 int,
+f221 int,
+f222 int,
+f223 int,
+f224 int,
+f225 int,
+f226 int,
+f227 int,
+f228 int,
+f229 int,
+f230 int,
+f231 int,
+f232 int,
+f233 int,
+f234 int,
+f235 int,
+f236 int,
+f237 int,
+f238 int,
+f239 int,
+f240 int,
+f241 int,
+f242 int,
+f243 int,
+f244 int,
+f245 int,
+f246 int,
+f247 int,
+f248 int,
+f249 int,
+f250 int,
+f251 int,
+f252 int,
+f253 int,
+f254 int,
+f255 int,
+f256 int,
+f257 int,
+f258 int,
+f259 int,
+f260 int,
+f261 int,
+f262 int,
+f263 int,
+f264 int,
+f265 int,
+f266 int,
+f267 int,
+f268 int,
+f269 int,
+f270 int,
+f271 int,
+f272 int,
+f273 int,
+f274 int,
+f275 int,
+f276 int,
+f277 int,
+f278 int,
+f279 int,
+f280 int,
+f281 int,
+f282 int,
+f283 int,
+f284 int,
+f285 int,
+f286 int,
+f287 int,
+f288 int,
+f289 int,
+f290 int,
+f291 int,
+f292 int,
+f293 int,
+f294 int,
+f295 int,
+f296 int,
+f297 int,
+f298 int,
+f299 int,
+f300 int,
+primary key (f1));
+insert into t300 set f1= 1;
+select f300 from t300;
+f300
+NULL
+select count(*) as one from t300;
+one
+1
+*** Cleanup  ***
+DROP TABLE t300;

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_load_in.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_load_in.result	2009-02-21 09:36:07 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_in.result	2009-03-18 10:31:17 +0000
@@ -5,6 +5,15 @@ reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
 create table t1(a int not null auto_increment, b int, primary key(a));
+create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
 load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+start transaction;
+insert into t2(b) values (1);
+insert into t2(b) values (2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t2;
+load data infile '../../std_data/rpl_loaddata.dat' into table t2;
+commit;
 Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
 drop table t1;
+drop table t2;

=== added file 'mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	2009-03-23 01:07:25 +0000
@@ -0,0 +1,53 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
+start transaction;
+insert into t1(b) values (1);
+insert into t1(b) values (2);
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+commit;
+show slave status;
+Slave_IO_State	#
+Master_Host	127.0.0.1
+Master_User	root
+Master_Port	MASTER_MYPORT
+Connect_Retry	1
+Master_Log_File	master-bin.000001
+Read_Master_Log_Pos	#
+Relay_Log_File	#
+Relay_Log_Pos	#
+Relay_Master_Log_File	master-bin.000001
+Slave_IO_Running	Yes
+Slave_SQL_Running	No
+Replicate_Do_DB	
+Replicate_Ignore_DB	
+Replicate_Do_Table	
+Replicate_Ignore_Table	
+Replicate_Wild_Do_Table	
+Replicate_Wild_Ignore_Table	
+Last_Errno	9
+Last_Error	Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
+Skip_Counter	0
+Exec_Master_Log_Pos	#
+Relay_Log_Space	#
+Until_Condition	None
+Until_Log_File	
+Until_Log_Pos	0
+Master_SSL_Allowed	No
+Master_SSL_CA_File	
+Master_SSL_CA_Path	
+Master_SSL_Cert	
+Master_SSL_Cipher	
+Master_SSL_Key	
+Seconds_Behind_Master	#
+Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	#
+Last_IO_Error	#
+Last_SQL_Errno	9
+Last_SQL_Error	Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
+drop table t1;
+drop table t1;

=== added file 'mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result	2009-03-23 01:07:25 +0000
@@ -0,0 +1,6 @@
+CHANGE MASTER TO MASTER_USER='root',
+MASTER_CONNECT_RETRY=1,
+MASTER_HOST='127.0.0.1',
+MASTER_PORT=MASTER_MYPORT;
+START SLAVE;
+Unable to use slave's temporary directory ../../../error - Can't read dir of '../../../error' (Errcode: 2)

=== added file 'mysql-test/suite/rpl/r/rpl_stm_loadfile.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result	2009-03-24 18:27:33 +0000
@@ -0,0 +1,231 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1  VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+Warnings:
+Warning	1592	Statement is not safe to log in statement format.
+create procedure test.p1()
+begin
+INSERT INTO test.t1  VALUES(2,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+CALL test.p1();
+Warnings:
+Warning	1592	Statement is not safe to log in statement format.
+SELECT * FROM test.t1 ORDER BY blob_column;
+a	blob_column
+1	abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2	abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+SELECT * FROM test.t1 ORDER BY blob_column;
+a	blob_column
+1	abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2	abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_log.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result	2009-02-03 06:46:01 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result	2009-05-08 14:43:21 +0000
@@ -218,7 +218,7 @@ slave-bin.000001	#	Query	1	#	use `test`;
 slave-bin.000001	#	Query	1	#	use `test`; drop table t1
 slave-bin.000001	#	Query	1	#	use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
 slave-bin.000001	#	Begin_load_query	1	#	;file_id=1;block_len=581
-slave-bin.000001	#	Execute_load_query	1	#	use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001	#	Execute_load_query	1	#	use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO  table t1 ignore 1 lines ;file_id=1
 slave-bin.000001	#	Query	1	#	use `test`; create table t3 (a int)ENGINE=MyISAM
 slave-bin.000001	#	Rotate	2	#	slave-bin.000002;pos=4
 show binlog events in 'slave-bin.000002' from 4;

=== modified file 'mysql-test/suite/rpl/r/rpl_temporary.result'
--- a/mysql-test/suite/rpl/r/rpl_temporary.result	2008-10-23 19:27:09 +0000
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result	2009-03-27 11:20:37 +0000
@@ -108,3 +108,16 @@ select * from t1;
 a
 1
 drop table t1;
+-- Bug#43748
+-- make a user on the slave that can list but not kill system threads.
+FLUSH PRIVILEGES;
+GRANT USAGE   ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
+GRANT PROCESS ON *.* TO user43748@stripped;
+-- try to KILL system-thread as that non-privileged user (on slave).
+SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
+KILL @id;
+Got one of the listed errors
+-- throw out test-user on slave.
+DROP USER user43748@stripped;
+-- done. back to master.
+End of 5.1 tests

=== modified file 'mysql-test/suite/rpl/r/rpl_timezone.result'
--- a/mysql-test/suite/rpl/r/rpl_timezone.result	2008-02-28 11:21:44 +0000
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result	2009-03-25 08:34:40 +0000
@@ -122,4 +122,23 @@ a	b
 SET @@session.time_zone = default;
 DROP TABLE t1;
 SET @@session.time_zone = default;
+reset master;
+CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
+SET @@session.time_zone='+01:00';
+insert into t1 values('2008-12-23 19:39:39',1);
+SET @@session.time_zone='+02:00';
+insert delayed into t1 values ('2008-12-23 19:39:39',2);
+flush table t1;
+flush logs;
+select * from t1;
+date	a
+2008-12-23 20:39:39	1
+2008-12-23 19:39:39	2
+DROP TABLE t1;
+select * from t1 order by a;
+date	a
+2008-12-23 20:39:39	1
+2008-12-23 19:39:39	2
+DROP TABLE t1;
+SET @@session.time_zone = default;
 End of 5.0 tests

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2009-01-23 12:22:05 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2009-03-27 12:12:33 +0000
@@ -11,3 +11,5 @@
 ##############################################################################
 
 rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
+rpl_temp_table_mix_row : BUG#43440 2009-03-23 joro rpl.rpl_temp_table_mix_row fails sporadicly
+rpl_cross_version      : BUG#42311 2009-03-27 joro rpl_cross_version fails on macosx

=== modified file 'mysql-test/suite/rpl/t/rpl_do_grant.test'
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test	2009-03-18 13:48:23 +0000
@@ -112,3 +112,100 @@ show grants for rpl_do_grant2@localhost;
 sync_slave_with_master;
 --error 1141
 show grants for rpl_do_grant2@localhost;
+
+#####################################################
+# Purpose
+# Test whether mysql.procs_priv get replicated 
+# Related bugs:
+# BUG42217  mysql.procs_priv does not get replicated
+#####################################################
+connection master; 
+
+--disable_warnings
+DROP DATABASE IF EXISTS bug42217_db;
+--enable_warnings
+CREATE DATABASE  bug42217_db;
+
+GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
+        IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
+
+connect (create_rout_db_master, localhost, create_rout_db, create_rout_db, bug42217_db,$MASTER_MYPORT,);
+connect (create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,);
+
+connection create_rout_db_master;
+
+
+USE bug42217_db;
+
+DELIMITER //;
+CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
+BEGIN
+   RETURN "INSIDE upgrade_del_func()";
+END//
+
+DELIMITER ;//
+
+connection master;
+
+USE bug42217_db;
+--replace_column 8 #
+SELECT * FROM mysql.procs_priv;
+SELECT upgrade_del_func();
+
+sync_slave_with_master;
+--replace_column 8 #
+SELECT * FROM mysql.procs_priv;
+SHOW GRANTS FOR 'create_rout_db'@'localhost';
+
+USE bug42217_db;
+SHOW CREATE FUNCTION upgrade_del_func;
+SELECT upgrade_del_func();
+
+--echo "Check whether the definer user will be able to execute the replicated routine on slave"
+connection create_rout_db_slave;
+USE bug42217_db;
+SHOW CREATE FUNCTION upgrade_del_func;
+SELECT upgrade_del_func();
+
+connection slave;
+DELETE FROM mysql.procs_priv;
+FLUSH PRIVILEGES;
+USE bug42217_db;
+--echo "Can't execute the replicated routine on slave like before after procs privilege is deleted "
+--error 1370
+SELECT upgrade_del_func();
+
+--echo "Test the user who creates a function on master doesn't exist on slave."
+--echo "Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
+DROP USER 'create_rout_db'@'localhost';
+
+connection create_rout_db_master;
+DELIMITER //;
+CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
+BEGIN
+   RETURN "INSIDE upgrade_alter_func()";
+END//
+DELIMITER ;//
+
+connection master;
+SELECT upgrade_alter_func();
+
+sync_slave_with_master;
+SHOW CREATE FUNCTION upgrade_alter_func;
+--echo "Should no privilege record for upgrade_alter_func in mysql.procs_priv"
+--replace_column 8 #
+SELECT * FROM mysql.procs_priv;
+--error 1449
+SELECT upgrade_alter_func();
+
+###### CLEAN UP SECTION ##############
+disconnect create_rout_db_master;
+disconnect create_rout_db_slave;
+connection master;
+USE bug42217_db;
+DROP FUNCTION upgrade_del_func;
+DROP FUNCTION upgrade_alter_func;
+DROP DATABASE bug42217_db;
+DROP USER 'create_rout_db'@'localhost';
+ 
+--echo "End of test"

=== modified file 'mysql-test/suite/rpl/t/rpl_loaddatalocal.test'
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test	2008-10-23 19:27:09 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test	2009-03-16 08:21:29 +0000
@@ -64,3 +64,37 @@ drop table t1;
 save_master_pos;
 connection slave;
 sync_with_master;
+
+
+#
+# Bug22504 load data infile sql statement in replication architecture get error
+#
+--echo ==== Bug22504 Initialize ====
+
+--echo [on master]
+--connection master
+
+SET sql_mode='ignore_space';
+CREATE TABLE t1(a int);
+insert into t1 values (1), (2), (3), (4);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
+SELECT * FROM t1 ORDER BY a;
+
+--echo [on slave]
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo ==== Clean up ====
+
+--echo [on master]
+connection master;
+DROP TABLE t1;
+
+--echo [on slave]
+sync_slave_with_master;
+

=== modified file 'mysql-test/suite/rpl/t/rpl_loadfile.test'
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test	2009-03-27 10:59:31 +0000
@@ -11,43 +11,105 @@
 
 # Includes
 -- source include/master-slave.inc
+-- source include/have_binlog_format_mixed_or_row.inc
 
+-- source extra/rpl_tests/rpl_loadfile.test
+
+#  BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
+#
+#  DESCRIPTION
+#
+#    Problem: when using load_file string function and mixed binlogging format
+#             there was no switch to row based binlogging format. This leads
+#             to scenarios on which the slave replicates the statement and it
+#             will try to load the file from local file system, which in most
+#             likely it will not exist.
+#
+#    Solution:
+#             Marking this function as unsafe for statement format, makes the
+#             statement using it to be logged in row based format. As such, data 
+#             replicated from the master, becomes the content of the loaded file.
+#             Consequently, the slave receives the necessary data to complete
+#             the load_file instruction correctly.
+#
+#  IMPLEMENTATION
+#
+#    The test is implemented as follows:
+#
+#      On Master,
+#       i) write to file the desired content.
+#      ii) create table and stored procedure with load_file
+#     iii) stop slave
+#     iii) execute load_file 
+#      iv) remove file
+#
+#      On Slave,
+#       v) start slave
+#      vi) sync it with master so that it gets the updates from binlog (which 
+#          should have bin logged in row format). 
+#
+#          If the the binlog format does not change to row, then the assertion
+#          done in the following step fails. This happens because tables differ 
+#          since the file does not exist anymore, meaning that when slave 
+#          attempts to execute LOAD_FILE statement it inserts NULL on table 
+#          instead of the same contents that the master loaded when it executed 
+#          the procedure (which was executed when file existed).
+#
+#     vii) assert that the contents of master and slave 
+#          table are the same
 
-# Begin clean up test section
---disable_warnings
 connection master;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
---enable_warnings
-
-# Section 1 test 
-
-CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
-INSERT INTO test.t1  VALUES(1,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
-delimiter |;
-create procedure test.p1()
-begin
-  INSERT INTO test.t1  VALUES(2,'test');
-  UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
-end|
-delimiter ;|
-
-CALL test.p1();
-SELECT * FROM test.t1 ORDER BY blob_column;
-save_master_pos;
-sync_slave_with_master;
+source include/reset_master_and_slave.inc;
+
+connection master;
+let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT repeat('x',20) INTO OUTFILE '$file'
+
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+
+CREATE TABLE t1 (t text);
+DELIMITER |;
+CREATE PROCEDURE p(file varchar(4096)) 
+  BEGIN
+    INSERT INTO t1 VALUES (LOAD_FILE(file));
+  END|
+DELIMITER ;|
+
+# stop slave before issuing the load_file on master
 connection slave;
-# Need to allow some time when NDB engine is used for
-# the injector thread to have time to populate binlog
-let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
---source include/wait_condition.inc
-SELECT * FROM test.t1 ORDER BY blob_column;
+source include/stop_slave.inc;
+
+connection master;
+
+# test: check that logging falls back to rbr.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval CALL p('$file')
+
+# test: remove the file from the filesystem and assert that slave still 
+#       gets the loaded file
+remove_file $file;
+
+# now that the file is removed it is safe (regarding what we want to test) 
+# to start slave
+connection slave;
+source include/start_slave.inc;
 
-# Cleanup
 connection master;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE test.t1;
 sync_slave_with_master;
 
-# End of 5.0 test case
+# assertion: assert that the slave got the updates even
+#            if the file was removed before the slave started,
+#            meaning that contents were indeed transfered
+#            through binlog (in row format)
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+# CLEAN UP
+DROP TABLE t1;
+DROP PROCEDURE p;
+sync_slave_with_master;

=== modified file 'mysql-test/suite/rpl/t/rpl_rotate_logs.test'
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test	2009-03-11 15:19:18 +0000
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test	2009-03-12 09:48:41 +0000
@@ -112,14 +112,24 @@ source include/show_master_logs.inc;
 purge binary logs to 'master-bin.000002';
 source include/show_binary_logs.inc;
 
-# Calculate time to use in "purge master logs before" by taking
-# last modification time of t2 and adding 1 second
-# This is donw in order to handle the case where file system
-# time differs from mysqld's time
+# Set the purge time 1 second after the last modify time of master-bin.000002.
+perl;
+open F, ">>".$ENV{'MYSQLTEST_VARDIR'}.'/tmp/rpl_rotate_logs.tmp' or die "Tmp file rpl_rotate_logs.tmp not found";
+my $binlogpath = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.1/data/master-bin.000002';
+my @array = stat($binlogpath);
+my $filemodifytime = $array[9];
+my @t = localtime $filemodifytime;
+my $modifytime = sprintf "%04u-%02u-%02u %02u:%02u:%02u",$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0];
+printf F ("let \$tmpval = %s;",$modifytime);
+close F;
+EOF
+
+--source $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp
+remove_file $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp;
+
 --disable_result_log
-select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
-  from information_schema.tables
-    where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+--replace_result $tmpval tmpval
+--eval SELECT @time_for_purge:=DATE_ADD('$tmpval', INTERVAL 1 SECOND)
 --enable_result_log
 
 purge master logs before (@time_for_purge);

=== added file 'mysql-test/suite/rpl/t/rpl_row_wide_table.test'
--- a/mysql-test/suite/rpl/t/rpl_row_wide_table.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_wide_table.test	2009-03-25 10:53:56 +0000
@@ -0,0 +1,339 @@
+##################################################################
+#  rpl_row_wide_table
+#                                                               
+# This test verifies that the table with number of attributes more
+# than 250  is replicated.
+# Related bugs:
+# Bug #42977 RBR logs for rows with more than 250 column results
+#            in corrupt binlog 
+##################################################################
+
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t300;
+--enable_warnings
+
+connection master;
+
+create table t300 (
+f1 int,
+f2 int,
+f3 int,
+f4 int,
+f5 int,
+f6 int,
+f7 int,
+f8 int,
+f9 int,
+f10 int,
+f11 int,
+f12 int,
+f13 int,
+f14 int,
+f15 int,
+f16 int,
+f17 int,
+f18 int,
+f19 int,
+f20 int,
+f21 int,
+f22 int,
+f23 int,
+f24 int,
+f25 int,
+f26 int,
+f27 int,
+f28 int,
+f29 int,
+f30 int,
+f31 int,
+f32 int,
+f33 int,
+f34 int,
+f35 int,
+f36 int,
+f37 int,
+f38 int,
+f39 int,
+f40 int,
+f41 int,
+f42 int,
+f43 int,
+f44 int,
+f45 int,
+f46 int,
+f47 int,
+f48 int,
+f49 int,
+f50 int,
+f51 int,
+f52 int,
+f53 int,
+f54 int,
+f55 int,
+f56 int,
+f57 int,
+f58 int,
+f59 int,
+f60 int,
+f61 int,
+f62 int,
+f63 int,
+f64 int,
+f65 int,
+f66 int,
+f67 int,
+f68 int,
+f69 int,
+f70 int,
+f71 int,
+f72 int,
+f73 int,
+f74 int,
+f75 int,
+f76 int,
+f77 int,
+f78 int,
+f79 int,
+f80 int,
+f81 int,
+f82 int,
+f83 int,
+f84 int,
+f85 int,
+f86 int,
+f87 int,
+f88 int,
+f89 int,
+f90 int,
+f91 int,
+f92 int,
+f93 int,
+f94 int,
+f95 int,
+f96 int,
+f97 int,
+f98 int,
+f99 int,
+f100 int,
+f101 int,
+f102 int,
+f103 int,
+f104 int,
+f105 int,
+f106 int,
+f107 int,
+f108 int,
+f109 int,
+f110 int,
+f111 int,
+f112 int,
+f113 int,
+f114 int,
+f115 int,
+f116 int,
+f117 int,
+f118 int,
+f119 int,
+f120 int,
+f121 int,
+f122 int,
+f123 int,
+f124 int,
+f125 int,
+f126 int,
+f127 int,
+f128 int,
+f129 int,
+f130 int,
+f131 int,
+f132 int,
+f133 int,
+f134 int,
+f135 int,
+f136 int,
+f137 int,
+f138 int,
+f139 int,
+f140 int,
+f141 int,
+f142 int,
+f143 int,
+f144 int,
+f145 int,
+f146 int,
+f147 int,
+f148 int,
+f149 int,
+f150 int,
+f151 int,
+f152 int,
+f153 int,
+f154 int,
+f155 int,
+f156 int,
+f157 int,
+f158 int,
+f159 int,
+f160 int,
+f161 int,
+f162 int,
+f163 int,
+f164 int,
+f165 int,
+f166 int,
+f167 int,
+f168 int,
+f169 int,
+f170 int,
+f171 int,
+f172 int,
+f173 int,
+f174 int,
+f175 int,
+f176 int,
+f177 int,
+f178 int,
+f179 int,
+f180 int,
+f181 int,
+f182 int,
+f183 int,
+f184 int,
+f185 int,
+f186 int,
+f187 int,
+f188 int,
+f189 int,
+f190 int,
+f191 int,
+f192 int,
+f193 int,
+f194 int,
+f195 int,
+f196 int,
+f197 int,
+f198 int,
+f199 int,
+f200 int,
+f201 int,
+f202 int,
+f203 int,
+f204 int,
+f205 int,
+f206 int,
+f207 int,
+f208 int,
+f209 int,
+f210 int,
+f211 int,
+f212 int,
+f213 int,
+f214 int,
+f215 int,
+f216 int,
+f217 int,
+f218 int,
+f219 int,
+f220 int,
+f221 int,
+f222 int,
+f223 int,
+f224 int,
+f225 int,
+f226 int,
+f227 int,
+f228 int,
+f229 int,
+f230 int,
+f231 int,
+f232 int,
+f233 int,
+f234 int,
+f235 int,
+f236 int,
+f237 int,
+f238 int,
+f239 int,
+f240 int,
+f241 int,
+f242 int,
+f243 int,
+f244 int,
+f245 int,
+f246 int,
+f247 int,
+f248 int,
+f249 int,
+f250 int,
+f251 int,
+f252 int,
+f253 int,
+f254 int,
+f255 int,
+f256 int,
+f257 int,
+f258 int,
+f259 int,
+f260 int,
+f261 int,
+f262 int,
+f263 int,
+f264 int,
+f265 int,
+f266 int,
+f267 int,
+f268 int,
+f269 int,
+f270 int,
+f271 int,
+f272 int,
+f273 int,
+f274 int,
+f275 int,
+f276 int,
+f277 int,
+f278 int,
+f279 int,
+f280 int,
+f281 int,
+f282 int,
+f283 int,
+f284 int,
+f285 int,
+f286 int,
+f287 int,
+f288 int,
+f289 int,
+f290 int,
+f291 int,
+f292 int,
+f293 int,
+f294 int,
+f295 int,
+f296 int,
+f297 int,
+f298 int,
+f299 int,
+f300 int,
+ primary key (f1));
+
+insert into t300 set f1= 1;
+
+sync_slave_with_master;
+
+#
+# prove that slave processed the create as well as the insert
+#
+eval select f300 from t300;
+select count(*) as one from t300;
+
+--echo *** Cleanup  ***
+connection master;
+DROP TABLE t300;
+sync_slave_with_master;
+
+# END of Test Case
+

=== modified file 'mysql-test/suite/rpl/t/rpl_slave_load_in.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_in.test	2009-02-21 09:36:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_in.test	2009-03-18 10:31:17 +0000
@@ -3,10 +3,11 @@
 # event while the "--secure-file-priv" option is set.
 # 
 # The test is divided in two steps:
-#    1 - Creates a table and populates it through "LOAD DATA INFILE".
+#    1 - Creates tables and populates them through "LOAD DATA INFILE".
 #    2 - Compares the master and slave.
 ##########################################################################
-source include/master-slave.inc;
+--source include/have_innodb.inc
+--source include/master-slave.inc
 
 ##########################################################################
 #                            Loading data
@@ -14,8 +15,17 @@ source include/master-slave.inc;
 connection master;
 
 create table t1(a int not null auto_increment, b int, primary key(a));
+create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
+
 load data infile '../../std_data/rpl_loaddata.dat' into table t1;
 
+start transaction;
+  insert into t2(b) values (1);
+  insert into t2(b) values (2);
+  load data infile '../../std_data/rpl_loaddata.dat' into table t2;
+  load data infile '../../std_data/rpl_loaddata.dat' into table t2;
+commit;
+
 ##########################################################################
 #                       Checking Consistency
 ##########################################################################
@@ -25,11 +35,16 @@ let $diff_table_1=master:test.t1;
 let $diff_table_2=slave:test.t1;
 source include/diff_tables.inc;
 
+let $diff_table_1=master:test.t2;
+let $diff_table_2=slave:test.t2;
+source include/diff_tables.inc;
+
 ##########################################################################
 #                             Clean up
 ##########################################################################
 connection master;
 
 drop table t1;
+drop table t2;
 
 sync_slave_with_master;

=== added file 'mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt	2009-03-18 10:31:17 +0000
@@ -0,0 +1 @@
+--loose-debug=d,remove_slave_load_file_before_write

=== added file 'mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	2009-03-23 01:07:25 +0000
@@ -0,0 +1,49 @@
+##########################################################################
+# This test verifies if the slave fails gracefully when the temporary 
+# file used to load data is removed while it is about to be used it. 
+# Similar errors are caught if the temporary directory is removed.
+#
+# Steps:
+#    1 - Creates a table and populates it through "LOAD DATA INFILE".
+#    2 - Catches error.
+##########################################################################
+--source include/have_binlog_format_mixed_or_statement.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/master-slave.inc
+--source include/not_embedded.inc
+
+##########################################################################
+#                            Loading data
+##########################################################################
+connection master;
+
+create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
+
+start transaction;
+  insert into t1(b) values (1);
+  insert into t1(b) values (2);
+  load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+commit;
+
+##########################################################################
+#                            Catch Error
+##########################################################################
+connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
+
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/
+query_vertical show slave status;
+
+##########################################################################
+#                             Clean up
+##########################################################################
+connection master;
+
+drop table t1;
+
+connection slave;
+
+drop table t1;

=== added file 'mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-slave.opt	2009-03-18 10:31:17 +0000
@@ -0,0 +1 @@
+--slave-load-tmpdir=../../../error

=== added file 'mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test	2009-03-23 01:07:25 +0000
@@ -0,0 +1,24 @@
+##########################################################################
+# This test verifies if the start slave fails gracefuly when an 
+# invalid directory is used to set --slave-load-tmpdir.
+##########################################################################
+--source include/have_log_bin.inc
+--source include/not_embedded.inc
+
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+
+connection slave;
+
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CHANGE MASTER TO MASTER_USER='root',
+                      MASTER_CONNECT_RETRY=1,
+                      MASTER_HOST='127.0.0.1',
+                      MASTER_PORT=$MASTER_MYPORT;
+START SLAVE;
+
+source include/wait_for_slave_sql_to_stop.inc;
+let $error=query_get_value("show slave status", Last_SQL_Error, 1);
+echo $error;

=== added file 'mysql-test/suite/rpl/t/rpl_stm_loadfile.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test	2009-03-24 18:27:33 +0000
@@ -0,0 +1,20 @@
+#############################################################################
+# Original Author: JBM                                                      #
+# Original Date: Aug/18/2005                                                #
+#############################################################################
+# TEST: To test the LOAD_FILE() in rbr                                      #
+#############################################################################
+# Change Author: JBM
+# Change Date: 2006-01-16
+# Change: Added Order by for NDB
+# Change: Split the original test file. This one forces STATEMENT only because
+#         when in STATEMENT mode, the load_file will issue a warning, whereas
+#         in RBR or MIXED mode it does not (by lsoares).
+##########
+
+# Includes
+-- source include/master-slave.inc
+-- source include/have_binlog_format_statement.inc
+
+-- source extra/rpl_tests/rpl_loadfile.test
+

=== modified file 'mysql-test/suite/rpl/t/rpl_temporary.test'
--- a/mysql-test/suite/rpl/t/rpl_temporary.test	2008-10-23 19:27:09 +0000
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test	2009-03-27 11:20:37 +0000
@@ -222,4 +222,40 @@ drop table t1;
 # Delete the anonymous users
 source include/delete_anonymous_users.inc;
 
-# End of tests
+
+
+#
+# Bug#43748: crash when non-super user tries to kill the replication threads
+#
+
+--echo -- Bug#43748
+
+--echo -- make a user on the slave that can list but not kill system threads.
+connection slave;
+
+FLUSH PRIVILEGES;
+GRANT USAGE   ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
+GRANT PROCESS ON *.* TO user43748@stripped;
+
+--echo -- try to KILL system-thread as that non-privileged user (on slave).
+connect (cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,);
+connection cont43748;
+
+SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
+
+--error ER_KILL_DENIED_ERROR,ER_NO_SUCH_THREAD
+KILL @id;
+
+disconnect cont43748;
+
+--echo -- throw out test-user on slave.
+connection slave;
+
+DROP USER user43748@stripped;
+
+--echo -- done. back to master.
+connection master;
+
+
+
+--echo End of 5.1 tests

=== modified file 'mysql-test/suite/rpl/t/rpl_timezone.test'
--- a/mysql-test/suite/rpl/t/rpl_timezone.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test	2009-03-25 08:34:40 +0000
@@ -165,5 +165,32 @@ connection master;
 DROP TABLE t1;
 SET @@session.time_zone = default;
 
+# Bug#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging
+# To test that time_zone is correctly binloging for 'insert delayed' statement
+# Insert 2 values into timestamp col with different time_zone. Check result.
+
+--connection master
+reset master;
+CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
+
+SET @@session.time_zone='+01:00';
+insert into t1 values('2008-12-23 19:39:39',1);
+
+--connection master1
+SET @@session.time_zone='+02:00';
+insert delayed into t1 values ('2008-12-23 19:39:39',2);
+# Forces table t1 to be closed and flushes the query cache.
+# This makes sure that 'delayed insert' is executed before next statement.
+flush table t1;
+flush logs;
+select * from t1;
+DROP TABLE t1;
+
+let $MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL
+--connection master1
+select * from t1 order by a;
+DROP TABLE t1;
+SET @@session.time_zone = default;
 
 --echo End of 5.0 tests

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2009-02-01 21:05:19 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2009-05-08 14:43:21 +0000
@@ -25,9 +25,6 @@ hex(c2)	hex(c3)	c1
 0	1	BCDEF
 1	0	CD
 0	0	DEFGHIJKL
-CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
 UPDATE t1 SET c2=0 WHERE c3="row2";
 SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
 hex(c1)	hex(c2)	c3

=== modified file 'mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc'
--- a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc	2009-03-20 17:11:22 +0000
@@ -23,6 +23,7 @@
 #                                                                             #
 ###############################################################################
 
+--source include/not_embedded.inc
 --source include/load_sysvars.inc
 
 ###################################################################

=== modified file 'mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc'
--- a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc	2009-03-20 17:11:22 +0000
@@ -23,6 +23,7 @@
 #                                                                             #
 ###############################################################################
 
+--source include/not_embedded.inc
 --source include/load_sysvars.inc
 
 ##################################################################

=== modified file 'mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -44,7 +44,7 @@ SET @@global.binlog_cache_size = 10000.0
 ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
 SET @@global.binlog_cache_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '0'
+Warning	1292	Truncated incorrect binlog_cache_size value: '-1024'
 SELECT @@global.binlog_cache_size;
 @@global.binlog_cache_size
 4096

=== modified file 'mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -68,6 +68,8 @@ SELECT @@global.bulk_insert_buffer_size;
 @@global.bulk_insert_buffer_size
 4294967295
 SET @@global.bulk_insert_buffer_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '-1024'
 SELECT @@global.bulk_insert_buffer_size;
 @@global.bulk_insert_buffer_size
 0
@@ -84,6 +86,8 @@ SELECT @@session.bulk_insert_buffer_size
 @@session.bulk_insert_buffer_size
 4294967295
 SET @@session.bulk_insert_buffer_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '-2'
 SELECT @@session.bulk_insert_buffer_size;
 @@session.bulk_insert_buffer_size
 0

=== modified file 'mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result	2009-03-20 17:11:22 +0000
@@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_limit;
 1
 SET @@global.delayed_insert_limit = -1024;
 Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+Warning	1292	Truncated incorrect delayed_insert_limit value: '-1024'
 SELECT @@global.delayed_insert_limit;
 @@global.delayed_insert_limit
 1

=== modified file 'mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result'
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result	2009-03-20 17:11:22 +0000
@@ -3,98 +3,75 @@
 Creating connection con0
 Creating connection con1
 SET @global_delayed_insert_limit = @@GLOBAL.delayed_insert_limit;
-CREATE TABLE t1 (a varchar(100));
+CREATE TABLE t1 (a VARCHAR(100),b VARCHAR(100),c VARCHAR(100));
 '#--------------------FN_DYNVARS_25_01-------------------------#'
-SET GLOBAL delayed_insert_limit = 9;
-** Connection con0 **
-SET GLOBAL delayed_insert_limit = 9;
-** Connection con1 **
-SET GLOBAL delayed_insert_limit = 9;
-** Connection default **
-SET GLOBAL delayed_insert_limit = 9;
-INSERT INTO t1 VALUES('1');
-INSERT INTO t1 VALUES('2');
-INSERT INTO t1 VALUES('3');
-INSERT INTO t1 VALUES('4');
-INSERT INTO t1 VALUES('5');
-INSERT INTO t1 VALUES('6');
+SET GLOBAL delayed_insert_limit = 14;
+INSERT INTO t1 VALUES('1','1','1');
+INSERT INTO t1 VALUES('2','1','1');
+INSERT INTO t1 VALUES('3','1','1');
+INSERT INTO t1 VALUES('4','1','1');
+INSERT INTO t1 VALUES('5','1','1');
+INSERT INTO t1 VALUES('6','1','1');
 LOCK TABLE t1 WRITE;
 ** Connection con1 **
-INSERT DELAYED INTO t1 VALUES('7');
-INSERT DELAYED INTO t1 VALUES('8');
-INSERT DELAYED INTO t1 VALUES('9');
-INSERT DELAYED INTO t1 VALUES('10');
-INSERT DELAYED INTO t1 VALUES('11');
-INSERT DELAYED INTO t1 VALUES('12');
-INSERT DELAYED INTO t1 VALUES('13');
-INSERT DELAYED INTO t1 VALUES('14');
-INSERT DELAYED INTO t1 VALUES('15');
-INSERT DELAYED INTO t1 VALUES('16');
-INSERT DELAYED INTO t1 VALUES('17');
-INSERT DELAYED INTO t1 VALUES('18');
-INSERT DELAYED INTO t1 VALUES('19');
-INSERT DELAYED INTO t1 VALUES('20');
-INSERT DELAYED INTO t1 VALUES('21');
-INSERT DELAYED INTO t1 VALUES('22');|
+INSERT DELAYED INTO t1 VALUES('7','1','1');
+INSERT DELAYED INTO t1 VALUES('8','1','1');
+INSERT DELAYED INTO t1 VALUES('9','1','1');
+INSERT DELAYED INTO t1 VALUES('10','1','1');
+INSERT DELAYED INTO t1 VALUES('11','1','1');
+INSERT DELAYED INTO t1 VALUES('12','1','1');
+INSERT DELAYED INTO t1 VALUES('13','1','1');
+INSERT DELAYED INTO t1 VALUES('14','1','1');
+INSERT DELAYED INTO t1 VALUES('15','1','1');
+INSERT DELAYED INTO t1 VALUES('16','1','1');
+INSERT DELAYED INTO t1 VALUES('17','1','1');
+INSERT DELAYED INTO t1 VALUES('18','1','1');
+INSERT DELAYED INTO t1 VALUES('19','1','1');
+INSERT DELAYED INTO t1 VALUES('20','1','1');
+INSERT DELAYED INTO t1 VALUES('21','1','1');
+INSERT DELAYED INTO t1 VALUES('22','1','1');
+INSERT DELAYED INTO t1 VALUES('23','1','1');
+INSERT DELAYED INTO t1 VALUES('24','1','1');
+INSERT DELAYED INTO t1 VALUES('25','1','1');
+INSERT DELAYED INTO t1 VALUES('26','1','1');
+INSERT DELAYED INTO t1 VALUES('27','1','1');
+INSERT DELAYED INTO t1 VALUES('28','1','1');
+INSERT DELAYED INTO t1 VALUES('29','1','1');
+INSERT DELAYED INTO t1 VALUES('30','1','1');
+INSERT DELAYED INTO t1 VALUES('31','1','1');
+INSERT DELAYED INTO t1 VALUES('32','1','1');
+INSERT DELAYED INTO t1 VALUES('33','1','1');
+INSERT DELAYED INTO t1 VALUES('34','1','1');
+INSERT DELAYED INTO t1 VALUES('35','1','1');
+INSERT DELAYED INTO t1 VALUES('36','1','1');
+INSERT DELAYED INTO t1 VALUES('37','1','1');
+INSERT DELAYED INTO t1 VALUES('38','1','1');
+INSERT DELAYED INTO t1 VALUES('39','1','1');
+INSERT DELAYED INTO t1 VALUES('40','1','1');
+INSERT DELAYED INTO t1 VALUES('41','1','1');
+INSERT DELAYED INTO t1 VALUES('42','1','1');
+INSERT DELAYED INTO t1 VALUES('43','1','1');|
 ** Connection con0 **
-SELECT * FROM t1;|
+SELECT COUNT(*) FROM t1;
 ** Connection default **
-Waiting for 1 sec
+** Wait till con0 is blocked **
 UNLOCK TABLES;
+** Connection con1 **
+Asynchronous "reap" result
 ** Connection con0 **
-a
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-'Bug#35386: insert delayed inserts 1 + limit rows instead of just limit rows'
+Asynchronous "reap" result
+The next result suffers from
+'# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
+COUNT(*)
+21
 ** Connection default **
-Waiting for 1 sec
 Checking if the delayed insert continued afterwards
-SELECT * FROM t1;
-a
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-DELETE FROM t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+43
+DROP TABLE t1;
 '#--------------------FN_DYNVARS_25_02-------------------------#'
-SET GLOBAL delayed_insert_limit = 20;
-** Connection con0 **
-SET GLOBAL delayed_insert_limit = 20;
-** Connection con1 **
-SET GLOBAL delayed_insert_limit = 20;
-** Connection default **
+CREATE TABLE t1 (a VARCHAR(100));
 SET GLOBAL delayed_insert_limit = 20;
 INSERT INTO t1 VALUES('1');
 INSERT INTO t1 VALUES('2');
@@ -123,64 +100,21 @@ INSERT DELAYED INTO t1 VALUES('21');
 INSERT DELAYED INTO t1 VALUES('22');|
 ** Connection con0 **
 Asynchronous execute
-SELECT * FROM t1;|
+SELECT COUNT(*) = 22 FROM t1;
 ** Connection default **
-Waiting for 1 sec
+** Wait till con0 is blocked **
 UNLOCK TABLES;
+** Connection con1 **
 ** Connection con0 **
-Asynchronous execute result
-a
+Asynchronous "reap" result
+COUNT(*) = 22
 1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
 ** Connection default**
-Waiting for 1 sec
 Checking if the delayed insert gives the same result afterwards
-SELECT * FROM t1;
-a
+SELECT COUNT(*) = 22 FROM t1;
+COUNT(*) = 22
 1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-DELETE FROM t1;
-Switching to default
-Disconnecting from con1, con0
+** Connection default**
 DROP TABLE t1;
 SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
+Disconnecting from con1, con0

=== modified file 'mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -35,7 +35,7 @@ SELECT @@global.delayed_queue_size;
 1
 SET @@global.delayed_queue_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+Warning	1292	Truncated incorrect delayed_queue_size value: '-1024'
 SELECT @@global.delayed_queue_size;
 @@global.delayed_queue_size
 1

=== removed file 'mysql-test/suite/sys_vars/r/event_scheduler_func.result'
--- a/mysql-test/suite/sys_vars/r/event_scheduler_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/event_scheduler_func.result	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-drop table if exists t1;
-## Creating new table ##
-CREATE TABLE t1
-(
-id INT NOT NULL auto_increment,
-PRIMARY KEY (id),
-name VARCHAR(30)
-);
-'#--------------------FN_DYNVARS_018_01-------------------------#'
-## Setting initial value of variable to ON ##
-SET @@global.event_scheduler = ON;
-SELECT @@event_scheduler;
-@@event_scheduler
-ON
-## Creating new event ##
-CREATE EVENT test_event_1
-ON SCHEDULE EVERY 3 SECOND
-DO 
-INSERT into t1(name) values('Record_1');
-SELECT * from t1;
-id	name
-1	Record_1
-2	Record_1
-DROP EVENT test_event_1;
-DELETE from t1;
-select * from t1;
-id	name
-'#--------------------FN_DYNVARS_018_02-------------------------#'
-## Setting value of variable to OFF ##
-SET @@global.event_scheduler = OFF;
-SELECT @@event_scheduler;
-@@event_scheduler
-OFF
-## Creating new event ##
-CREATE EVENT test_event_1
-ON SCHEDULE EVERY 3 SECOND
-DO 
-INSERT into t1(name) values('Record_2');
-## Table should be empty ##
-SELECT * from t1;
-id	name
-DROP EVENT test_event_1;
-## Dropping table ##
-DROP table t1;

=== modified file 'mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result'
--- a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result	2009-03-20 17:11:22 +0000
@@ -70,7 +70,7 @@ FROM articles WHERE MATCH (title,body) 
 AGAINST ('+security configuring' IN BOOLEAN MODE);
 id	title	body	relevance
 8	MySQL Security	When configured properly, MySQL ...	1
-9	Database Security	Configuring MySQL for ...	1.3333333730698
+9	Database Security	Configuring MySQL for ...	1.33333337306976
 SELECT * FROM articles WHERE MATCH (title,body)
 AGAINST ('"faster than"' IN BOOLEAN MODE);
 id	title	body
@@ -91,7 +91,7 @@ AGAINST ('+MySQL +(>show <dbms)' IN BOOL
 ORDER BY relevance DESC;
 id	title	body	relevance
 4	Optimizing MySQL	In this tutorial we will show .... Run command line ...	1.25
-1	MySQL Tutorial	DBMS stands for DataBase ...	0.83333337306976
+1	MySQL Tutorial	DBMS stands for DataBase ...	0.833333373069763
 '---try setting different operators. Default '+ -><()~*:""&|'--'
 SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-';
 SELECT * FROM articles WHERE MATCH (title,body)

=== modified file 'mysql-test/suite/sys_vars/r/interactive_timeout_func.result'
--- a/mysql-test/suite/sys_vars/r/interactive_timeout_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/interactive_timeout_func.result	2009-03-20 17:11:22 +0000
@@ -9,22 +9,27 @@ name VARCHAR(30)
 '#--------------------FN_DYNVARS_052_01-------------------------#'
 ## Setting initial value of variable to 1 ##
 SET @@global.interactive_timeout = 1;
-## Creating new interactive connection test_con1 ## 
+## Creating new connection test_con1 ##
 ## Inserting record in table ##
 INSERT into t1(name) values('Record_1');
-## Setting session value of interactive_timeout ## 
+## Setting session value of interactive_timeout ##
 SET @@session.interactive_timeout = 1;
-## Verifying values of variable ## 
+## Verifying values of variable ##
 SELECT @@session.interactive_timeout;
 @@session.interactive_timeout
 1
 SELECT @@global.interactive_timeout;
 @@global.interactive_timeout
 1
-## Using sleep to check timeout ## 
+connection default;
+## Using sleep to check timeout ##
+sleep 2;
+connection test_con1;
 SELECT * from t1;
 id	name
 1	Record_1
-'Bug#35377: Error should appear here because interactive_timeout value';
-'is 1 and connection remains idle for 5 secs';
 INSERT into t1(name) values('Record_2');
+connection default;
+disconnect test_con1;
+DROP TABLE t1;
+SET @@global.interactive_timeout= 28800;

=== modified file 'mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -75,7 +75,7 @@ SELECT @@global.join_buffer_size=8200 OR
 1
 SET @@global.join_buffer_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
+Warning	1292	Truncated incorrect join_buffer_size value: '-1024'
 SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
 1
@@ -109,7 +109,7 @@ SELECT @@session.join_buffer_size=8200 O
 1
 SET @@session.join_buffer_size = -2;
 Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
+Warning	1292	Truncated incorrect join_buffer_size value: '-2'
 SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
 @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
 1

=== modified file 'mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result	2009-01-26 15:34:41 +0000
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -17,8 +17,6 @@ SELECT @@global.key_buffer_size BETWEEN 
 @@global.key_buffer_size BETWEEN 8 AND 36
 1
 SET @@global.key_buffer_size = 1800;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '1800'
 SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
 @@global.key_buffer_size BETWEEN 8 AND 36
 1
@@ -55,13 +53,13 @@ SELECT @@global.key_buffer_size BETWEEN 
 @@global.key_buffer_size BETWEEN 8 AND 36
 1
 '#----------------------FN_DYNVARS_055_06------------------------#'
-SELECT @@global.key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+SELECT @@global.key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='key_buffer_size';
 @@global.key_buffer_size = VARIABLE_VALUE
 1
-SELECT @@key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+SELECT @@key_buffer_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='key_buffer_size';
 @@key_buffer_size = VARIABLE_VALUE
 1

=== modified file 'mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result	2009-03-20 17:11:22 +0000
@@ -37,10 +37,14 @@ SELECT @@global.key_cache_age_threshold;
 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
 '#--------------------FN_DYNVARS_056_04-------------------------#'
 SET @@global.key_cache_age_threshold = -1;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '18446744073709551615'
 SELECT @@global.key_cache_age_threshold;
 @@global.key_cache_age_threshold
 4294967200
 SET @@global.key_cache_age_threshold = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '42949672951'
 SELECT @@global.key_cache_age_threshold;
 @@global.key_cache_age_threshold
 4294967200
@@ -50,9 +54,11 @@ SELECT @@global.key_cache_age_threshold;
 @@global.key_cache_age_threshold
 4294967200
 SET @@global.key_cache_age_threshold = -1024;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '18446744073709550592'
 SELECT @@global.key_cache_age_threshold;
 @@global.key_cache_age_threshold
-4294966200
+4294967200
 SET @@global.key_cache_age_threshold = 99;
 Warnings:
 Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'

=== modified file 'mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -36,13 +36,13 @@ SELECT @@global.key_cache_block_size;
 '#--------------------FN_DYNVARS_057_04-------------------------#'
 SET @@global.key_cache_block_size = -1;
 Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294967295'
+Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709551615'
 SELECT @@global.key_cache_block_size;
 @@global.key_cache_block_size
 16384
 SET @@global.key_cache_block_size = 42949672951;
 Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294967287'
+Warning	1292	Truncated incorrect key_cache_block_size value: '42949672951'
 SELECT @@global.key_cache_block_size;
 @@global.key_cache_block_size
 16384
@@ -53,7 +53,7 @@ SELECT @@global.key_cache_block_size;
 16384
 SET @@global.key_cache_block_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294966272'
+Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709550592'
 SELECT @@global.key_cache_block_size;
 @@global.key_cache_block_size
 16384

=== modified file 'mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result	2009-03-20 17:11:22 +0000
@@ -35,7 +35,7 @@ SELECT @@global.key_cache_division_limit
 '#--------------------FN_DYNVARS_058_04-------------------------#'
 SET @@global.key_cache_division_limit = -1;
 Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '4294967295'
+Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709551615'
 SELECT @@global.key_cache_division_limit;
 @@global.key_cache_division_limit
 100
@@ -52,7 +52,7 @@ SELECT @@global.key_cache_division_limit
 100
 SET @@global.key_cache_division_limit = -1024;
 Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '4294966272'
+Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709550592'
 SELECT @@global.key_cache_division_limit;
 @@global.key_cache_division_limit
 100

=== modified file 'mysql-test/suite/sys_vars/r/log_warnings_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result	2009-03-20 17:11:22 +0000
@@ -76,6 +76,8 @@ SELECT @@global.log_warnings;
 @@global.log_warnings
 4294967295
 SET @@global.log_warnings = -1024;
+Warnings:
+Warning	1292	Truncated incorrect log_warnings value: '-1024'
 SELECT @@global.log_warnings;
 @@global.log_warnings
 0
@@ -96,6 +98,8 @@ SELECT @@session.log_warnings;
 @@session.log_warnings
 4294967295
 SET @@session.log_warnings = -2;
+Warnings:
+Warning	1292	Truncated incorrect log_warnings value: '-2'
 SELECT @@session.log_warnings;
 @@session.log_warnings
 0

=== modified file 'mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -39,7 +39,7 @@ SELECT @@global.max_binlog_cache_size;
 '#--------------------FN_DYNVARS_072_04-------------------------#'
 SET @@global.max_binlog_cache_size = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '-1'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 4096
@@ -56,7 +56,7 @@ SELECT @@global.max_binlog_cache_size;
 4294963200
 SET @@global.max_binlog_cache_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '-1024'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 4096

=== modified file 'mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result	2009-03-20 17:11:22 +0000
@@ -39,7 +39,7 @@ SELECT @@global.max_connect_errors;
 '#--------------------FN_DYNVARS_073_04-------------------------#'
 SET @@global.max_connect_errors = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
+Warning	1292	Truncated incorrect max_connect_errors value: '-1'
 SELECT @@global.max_connect_errors;
 @@global.max_connect_errors
 1
@@ -56,7 +56,7 @@ SELECT @@global.max_connect_errors;
 4294967295
 SET @@global.max_connect_errors = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
+Warning	1292	Truncated incorrect max_connect_errors value: '-1024'
 SELECT @@global.max_connect_errors;
 @@global.max_connect_errors
 1

=== modified file 'mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -40,10 +40,14 @@ SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 64512
 SET @@global.max_heap_table_size = 4294967294;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967294'
 SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 4294966272
 SET @@global.max_heap_table_size = 4294967295;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967295'
 SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 4294966272
@@ -62,10 +66,14 @@ SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 64512
 SET @@session.max_heap_table_size = 4294967294;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967294'
 SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 4294966272
 SET @@session.max_heap_table_size = 4294967295;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967295'
 SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 4294966272
@@ -73,13 +81,13 @@ SELECT @@session.max_heap_table_size;
 '#------------------FN_DYNVARS_077_05-----------------------#'
 SET @@global.max_heap_table_size = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+Warning	1292	Truncated incorrect max_heap_table_size value: '-1'
 SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 16384
 SET @@global.max_heap_table_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+Warning	1292	Truncated incorrect max_heap_table_size value: '-1024'
 SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 16384
@@ -96,6 +104,8 @@ SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 16384
 SET @@global.max_heap_table_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967296'
 SELECT @@global.max_heap_table_size;
 @@global.max_heap_table_size
 4294966272
@@ -111,7 +121,7 @@ SELECT @@global.max_heap_table_size;
 4294966272
 SET @@session.max_heap_table_size = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+Warning	1292	Truncated incorrect max_heap_table_size value: '-1'
 SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 16384
@@ -122,12 +132,16 @@ SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 16384
 SET @@session.max_heap_table_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '4294967296'
 SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 4294966272
 SET @@session.max_heap_table_size = 65530.34.;
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
 SET @@session.max_heap_table_size = 10737418241;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '10737418241'
 SELECT @@session.max_heap_table_size;
 @@session.max_heap_table_size
 4294966272

=== modified file 'mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result	2009-03-20 17:11:22 +0000
@@ -77,7 +77,7 @@ SELECT @@global.max_seeks_for_key;
 1
 SET @@global.max_seeks_for_key = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+Warning	1292	Truncated incorrect max_seeks_for_key value: '-1024'
 SELECT @@global.max_seeks_for_key;
 @@global.max_seeks_for_key
 1
@@ -105,7 +105,7 @@ SELECT @@session.max_seeks_for_key;
 1
 SET @@session.max_seeks_for_key = -2;
 Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+Warning	1292	Truncated incorrect max_seeks_for_key value: '-2'
 SELECT @@session.max_seeks_for_key;
 @@session.max_seeks_for_key
 1

=== modified file 'mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result	2009-03-20 17:11:22 +0000
@@ -71,7 +71,7 @@ SELECT @@session.max_tmp_tables;
 '#------------------FN_DYNVARS_086_05-----------------------#'
 SET @@global.max_tmp_tables = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+Warning	1292	Truncated incorrect max_tmp_tables value: '-1024'
 SELECT @@global.max_tmp_tables;
 @@global.max_tmp_tables
 1
@@ -83,7 +83,7 @@ SELECT @@global.max_tmp_tables;
 4294967295
 SET @@global.max_tmp_tables = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+Warning	1292	Truncated incorrect max_tmp_tables value: '-1'
 SELECT @@global.max_tmp_tables;
 @@global.max_tmp_tables
 1
@@ -111,7 +111,7 @@ SELECT @@session.max_tmp_tables;
 4294967295
 SET @@session.max_tmp_tables = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+Warning	1292	Truncated incorrect max_tmp_tables value: '-1'
 SELECT @@session.max_tmp_tables;
 @@session.max_tmp_tables
 1
@@ -123,7 +123,7 @@ SELECT @@session.max_tmp_tables;
 4294967295
 SET @@session.max_tmp_tables = -001;
 Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+Warning	1292	Truncated incorrect max_tmp_tables value: '-1'
 SELECT @@session.max_tmp_tables;
 @@session.max_tmp_tables
 1

=== modified file 'mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result	2009-03-20 17:11:22 +0000
@@ -37,7 +37,7 @@ SELECT @@global.max_write_lock_count;
 '#------------------FN_DYNVARS_088_04-----------------------#'
 SET @@global.max_write_lock_count = -1024;
 Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+Warning	1292	Truncated incorrect max_write_lock_count value: '-1024'
 SELECT @@global.max_write_lock_count;
 @@global.max_write_lock_count
 1
@@ -49,7 +49,7 @@ SELECT @@global.max_write_lock_count;
 4294967295
 SET @@global.max_write_lock_count = -1;
 Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+Warning	1292	Truncated incorrect max_write_lock_count value: '-1'
 SELECT @@global.max_write_lock_count;
 @@global.max_write_lock_count
 1

=== modified file 'mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result	2009-03-20 17:11:22 +0000
@@ -82,6 +82,8 @@ SELECT @@global.min_examined_row_limit;
 @@global.min_examined_row_limit
 429496726
 SET @@global.min_examined_row_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect min_examined_row_limit value: '-1024'
 SELECT @@global.min_examined_row_limit;
 @@global.min_examined_row_limit
 0
@@ -108,6 +110,8 @@ SELECT @@session.min_examined_row_limit;
 @@session.min_examined_row_limit
 4294967295
 SET @@session.min_examined_row_limit = -1;
+Warnings:
+Warning	1292	Truncated incorrect min_examined_row_limit value: '-1'
 SELECT @@session.min_examined_row_limit;
 @@session.min_examined_row_limit
 0

=== modified file 'mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result	2009-03-20 17:11:22 +0000
@@ -83,7 +83,7 @@ SELECT @@global.multi_range_count;
 4294967295
 SET @@global.multi_range_count = -1024;
 Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
+Warning	1292	Truncated incorrect multi_range_count value: '-1024'
 SELECT @@global.multi_range_count;
 @@global.multi_range_count
 1
@@ -117,7 +117,7 @@ SELECT @@session.multi_range_count;
 4294967295
 SET @@session.multi_range_count = -1;
 Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
+Warning	1292	Truncated incorrect multi_range_count value: '-1'
 SELECT @@session.multi_range_count;
 @@session.multi_range_count
 1

=== modified file 'mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -48,14 +48,20 @@ SET @@local.myisam_max_sort_file_size = 
 ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
 '#------------------FN_DYNVARS_094_05-----------------------#'
 SET @@global.myisam_max_sort_file_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect myisam_max_sort_file_size value: '-1'
 SELECT @@global.myisam_max_sort_file_size;
 @@global.myisam_max_sort_file_size
 0
 SET @@global.myisam_max_sort_file_size = -2147483648;
+Warnings:
+Warning	1292	Truncated incorrect myisam_max_sort_file_size value: '-2147483648'
 SELECT @@global.myisam_max_sort_file_size;
 @@global.myisam_max_sort_file_size
 0
 SET @@global.myisam_max_sort_file_size = -2147483649;
+Warnings:
+Warning	1292	Truncated incorrect myisam_max_sort_file_size value: '-2147483649'
 SELECT @@global.myisam_max_sort_file_size;
 @@global.myisam_max_sort_file_size
 0

=== modified file 'mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result	2009-03-20 17:11:22 +0000
@@ -61,7 +61,7 @@ SELECT @@global.myisam_repair_threads ;
 1
 SET @@global.myisam_repair_threads  = -1024;
 Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+Warning	1292	Truncated incorrect myisam_repair_threads value: '-1024'
 SELECT @@global.myisam_repair_threads ;
 @@global.myisam_repair_threads
 1
@@ -104,7 +104,7 @@ SELECT @@session.myisam_repair_threads ;
 1
 SET @@session.myisam_repair_threads  = -2;
 Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+Warning	1292	Truncated incorrect myisam_repair_threads value: '-2'
 SELECT @@session.myisam_repair_threads ;
 @@session.myisam_repair_threads
 1

=== modified file 'mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -61,7 +61,7 @@ SELECT @@global.myisam_sort_buffer_size 
 4
 SET @@global.myisam_sort_buffer_size   = -1024;
 Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '-1024'
 SELECT @@global.myisam_sort_buffer_size  ;
 @@global.myisam_sort_buffer_size
 4
@@ -104,7 +104,7 @@ SELECT @@session.myisam_sort_buffer_size
 4
 SET @@session.myisam_sort_buffer_size   = -2;
 Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '-2'
 SELECT @@session.myisam_sort_buffer_size  ;
 @@session.myisam_sort_buffer_size
 4

=== modified file 'mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result	2009-03-20 17:11:22 +0000
@@ -77,7 +77,7 @@ SELECT @@global.net_retry_count;
 1
 SET @@global.net_retry_count = -1024;
 Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
+Warning	1292	Truncated incorrect net_retry_count value: '-1024'
 SELECT @@global.net_retry_count;
 @@global.net_retry_count
 1
@@ -111,7 +111,7 @@ SELECT @@session.net_retry_count;
 1
 SET @@session.net_retry_count = -2;
 Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
+Warning	1292	Truncated incorrect net_retry_count value: '-2'
 SELECT @@session.net_retry_count;
 @@session.net_retry_count
 1

=== modified file 'mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -86,7 +86,7 @@ SELECT @@global.query_alloc_block_size;
 1024
 SET @@global.query_alloc_block_size = -1;
 Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+Warning	1292	Truncated incorrect query_alloc_block_size value: '-1'
 SELECT @@global.query_alloc_block_size;
 @@global.query_alloc_block_size
 1024
@@ -120,7 +120,7 @@ SELECT @@session.query_alloc_block_size;
 1024
 SET @@session.query_alloc_block_size = -2;
 Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+Warning	1292	Truncated incorrect query_alloc_block_size value: '-2'
 SELECT @@session.query_alloc_block_size;
 @@session.query_alloc_block_size
 1024

=== modified file 'mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result	2009-03-20 17:11:22 +0000
@@ -32,6 +32,8 @@ SELECT @@global.query_cache_limit;
 1048575
 '#--------------------FN_DYNVARS_131_04-------------------------#'
 SET @@global.query_cache_limit = -1;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_limit value: '-1'
 SELECT @@global.query_cache_limit;
 @@global.query_cache_limit
 0
@@ -53,6 +55,8 @@ SELECT @@global.query_cache_limit;
 @@global.query_cache_limit
 4294967295
 SET @@global.query_cache_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_limit value: '-1024'
 SELECT @@global.query_cache_limit;
 @@global.query_cache_limit
 0

=== modified file 'mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result	2009-03-20 17:11:22 +0000
@@ -42,6 +42,8 @@ SELECT @@global.query_cache_min_res_unit
 1048576
 '#--------------------FN_DYNVARS_132_04-------------------------#'
 SET @@global.query_cache_min_res_unit = -1;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_min_res_unit value: '-1'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
 512
@@ -61,6 +63,8 @@ SELECT @@global.query_cache_min_res_unit
 @@global.query_cache_min_res_unit
 512
 SET @@global.query_cache_min_res_unit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_min_res_unit value: '-1024'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
 512

=== modified file 'mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -41,6 +41,8 @@ SELECT @@global.query_cache_size;
 1047552
 '#--------------------FN_DYNVARS_133_04-------------------------#'
 SET @@global.query_cache_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_size value: '-1'
 SELECT @@global.query_cache_size;
 @@global.query_cache_size
 0
@@ -61,6 +63,8 @@ SELECT @@global.query_cache_size;
 @@global.query_cache_size
 0
 SET @@global.query_cache_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_size value: '-1024'
 SELECT @@global.query_cache_size;
 @@global.query_cache_size
 0

=== modified file 'mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result'
--- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result	2009-03-20 17:11:22 +0000
@@ -53,7 +53,7 @@ LOCK TABLE t1 WRITE;
 ** Asynchronous Execution **
 SELECT * FROM t1;
 ** Connection con0 **
-Sleeping 2 Seconds before unlock
+wait until table is locked
 UNLOCK TABLES;
 ** Connection con1 **
 ** Asynchronous Result **
@@ -108,8 +108,17 @@ id	value
 1	val1
 2	val2
 3	val3
+SELECT * FROM t1;
+id	value
+1	val1
+2	val2
+3	val3
+SELECT * FROM t1;
+id	value
+1	val1
+2	val2
+3	val3
 ** Connection con0 **
-Sleeping 2 Seconds before unlock
 UNLOCK TABLES;
 ** Connection con1 **
 '#----------------------------FN_DYNVARS_136_05------------------------#'

=== modified file 'mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -79,7 +79,7 @@ SELECT @@global.range_alloc_block_size;
 4096
 SET @@global.range_alloc_block_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+Warning	1292	Truncated incorrect range_alloc_block_size value: '-1024'
 SELECT @@global.range_alloc_block_size;
 @@global.range_alloc_block_size
 4096
@@ -107,7 +107,7 @@ SELECT @@session.range_alloc_block_size;
 4096
 SET @@session.range_alloc_block_size = -2;
 Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+Warning	1292	Truncated incorrect range_alloc_block_size value: '-2'
 SELECT @@session.range_alloc_block_size;
 @@session.range_alloc_block_size
 4096

=== modified file 'mysql-test/suite/sys_vars/r/read_buffer_size_basic.result'
--- a/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result	2009-02-27 20:43:43 +0000
+++ b/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result	2009-03-20 17:11:22 +0000
@@ -155,15 +155,11 @@ SELECT @@global.read_buffer_size= 8200 O
 'Bug: FN_DYNVARS_138_08- Errors are not coming on assigning TRUE/FALSE to variable'
 '#---------------------FN_DYNVARS_138_09----------------------#'
 SET @@global.read_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect read_buffer_size value: '9000'
 SELECT @@read_buffer_size = @@global.read_buffer_size;
 @@read_buffer_size = @@global.read_buffer_size
 0
 '#---------------------FN_DYNVARS_138_10----------------------#'
 SET @@read_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect read_buffer_size value: '9000'
 SELECT @@read_buffer_size = @@local.read_buffer_size;
 @@read_buffer_size = @@local.read_buffer_size
 1
@@ -172,8 +168,6 @@ SELECT @@local.read_buffer_size = @@sess
 1
 '#---------------------FN_DYNVARS_138_11----------------------#'
 SET read_buffer_size = 9100;
-Warnings:
-Warning	1292	Truncated incorrect read_buffer_size value: '9100'
 SELECT @@read_buffer_size= 8200 OR @@read_buffer_size= 8228 ;
 @@read_buffer_size= 8200 OR @@read_buffer_size= 8228
 1

=== modified file 'mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result'
--- a/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result	2009-02-27 20:43:43 +0000
+++ b/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result	2009-03-20 17:11:22 +0000
@@ -154,15 +154,11 @@ SELECT @@global.read_rnd_buffer_size= 82
 1
 '#---------------------FN_DYNVARS_140_09----------------------#'
 SET @@global.read_rnd_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect read_rnd_buffer_size value: '9000'
 SELECT @@read_rnd_buffer_size = @@global.read_rnd_buffer_size;
 @@read_rnd_buffer_size = @@global.read_rnd_buffer_size
 0
 '#---------------------FN_DYNVARS_140_10----------------------#'
 SET @@read_rnd_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect read_rnd_buffer_size value: '9000'
 SELECT @@read_rnd_buffer_size = @@local.read_rnd_buffer_size;
 @@read_rnd_buffer_size = @@local.read_rnd_buffer_size
 1
@@ -171,8 +167,6 @@ SELECT @@local.read_rnd_buffer_size = @@
 1
 '#---------------------FN_DYNVARS_140_11----------------------#'
 SET read_rnd_buffer_size = 9100;
-Warnings:
-Warning	1292	Truncated incorrect read_rnd_buffer_size value: '9100'
 SELECT @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228;
 @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228
 1

=== modified file 'mysql-test/suite/sys_vars/r/rpl_init_slave_func.result'
--- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result	2009-03-20 17:11:22 +0000
@@ -12,7 +12,7 @@ DROP TABLE IF EXISTS t1;
 CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
 DESCRIBE t1;
 Field	Type	Null	Key	Default	Extra
-my_column	longtext	NO		NULL	
+my_column	varchar(59)	NO			
 DROP TABLE t1;
 SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
 @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1'

=== modified file 'mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result'
--- a/mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/r/rpl_max_binlog_size_func.result	2009-03-20 17:11:22 +0000
@@ -1,8 +1,11 @@
 DROP TABLE IF EXISTS t1;
-'--- check if log file is rotated after 4096 bytes ----' 
+'--- check if log file is rotated after 4096 bytes ----'
 SET @saved_max_binlog_size= @@global.max_binlog_size;
 SET @@global.max_binlog_size = 4096;
 CREATE TABLE t1(a CHAR(5));
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+50
 'mylog.000002 exists'
 SET @@global.max_binlog_size= @saved_max_binlog_size;
 DROP TABLE t1;

=== modified file 'mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result	2009-03-12 16:55:10 +0000
+++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result	2009-03-20 17:11:22 +0000
@@ -51,14 +51,20 @@ SET @@local.rpl_recovery_rank = 4;
 ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
 '#------------------FN_DYNVARS_142_04-----------------------#'
 SET @@global.rpl_recovery_rank = -1;
+Warnings:
+Warning	1292	Truncated incorrect rpl_recovery_rank value: '-1'
 SELECT @@global.rpl_recovery_rank;
 @@global.rpl_recovery_rank
 0
 SET @@global.rpl_recovery_rank = -2147483648;
+Warnings:
+Warning	1292	Truncated incorrect rpl_recovery_rank value: '-2147483648'
 SELECT @@global.rpl_recovery_rank;
 @@global.rpl_recovery_rank
 0
 SET @@global.rpl_recovery_rank = -2147483649;
+Warnings:
+Warning	1292	Truncated incorrect rpl_recovery_rank value: '-2147483649'
 SELECT @@global.rpl_recovery_rank;
 @@global.rpl_recovery_rank
 0

=== modified file 'mysql-test/suite/sys_vars/r/server_id_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/server_id_basic_32.result	2009-03-12 16:55:10 +0000
+++ b/mysql-test/suite/sys_vars/r/server_id_basic_32.result	2009-03-20 17:11:22 +0000
@@ -52,10 +52,14 @@ SET @@local.server_id = 4;
 ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
 '#------------------FN_DYNVARS_144_05-----------------------#'
 SET @@global.server_id = -1;
+Warnings:
+Warning	1292	Truncated incorrect server_id value: '-1'
 SELECT @@global.server_id;
 @@global.server_id
 0
 SET @@global.server_id = -2147483648;
+Warnings:
+Warning	1292	Truncated incorrect server_id value: '-2147483648'
 SELECT @@global.server_id;
 @@global.server_id
 0

=== modified file 'mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result	2009-03-20 17:11:22 +0000
@@ -57,6 +57,8 @@ SET @@local.slave_transaction_retries = 
 ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
 '#------------------FN_DYNVARS_149_05-----------------------#'
 SET @@global.slave_transaction_retries = -1;
+Warnings:
+Warning	1292	Truncated incorrect slave_transaction_retries value: '-1'
 SELECT @@global.slave_transaction_retries;
 @@global.slave_transaction_retries
 0

=== modified file 'mysql-test/suite/sys_vars/r/slow_query_log_func.result'
--- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result	2009-03-20 17:11:22 +0000
@@ -17,8 +17,8 @@ TRUNCATE mysql.slow_log;
 SELECT sleep(2);
 sleep(2)
 0
-SELECT count(*) FROM mysql.slow_log;
-count(*)
+SELECT count(*) > 0 FROM mysql.slow_log;
+count(*) > 0
 1
 SET @@global.log_output = @global_log_output;
 SET @global.slow_query_log = @global_slow_query_log;

=== modified file 'mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result'
--- a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result	2009-03-20 17:11:22 +0000
@@ -29,7 +29,6 @@ LOCK TABLE t1 READ;
 SELECT * FROM t1;
 UNLOCK TABLES;|
 ** Connection default **
-Sleeping for 1 secs
 UNLOCK TABLES;
 ** Connection con0 **
 ** Asynchronous Result **
@@ -66,7 +65,6 @@ LOCK TABLE t1 READ;
 SELECT * FROM t1;
 UNLOCK TABLES;|
 ** Connection default **
-Sleeping for 1 secs
 UNLOCK TABLES;
 ** Connection con0 **
 ** Asynchronous Result **

=== modified file 'mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result	2009-03-20 17:11:22 +0000
@@ -36,47 +36,57 @@ SELECT @@global.sync_binlog;
 65536
 '#--------------------FN_DYNVARS_168_04-------------------------#'
 SET @@global.sync_binlog = -1;
+Warnings:
+Warning	1292	Truncated incorrect sync_binlog value: '-1'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
 0
 SET @@global.sync_binlog = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect sync_binlog value: '4294967296'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-0
+4294967295
 SET @@global.sync_binlog = 10240022115;
+Warnings:
+Warning	1292	Truncated incorrect sync_binlog value: '10240022115'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-1650087523
+4294967295
 SET @@global.sync_binlog = 10000.01;
 ERROR 42000: Incorrect argument type to variable 'sync_binlog'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-1650087523
+4294967295
 SET @@global.sync_binlog = -1024;
+Warnings:
+Warning	1292	Truncated incorrect sync_binlog value: '-1024'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
 0
 SET @@global.sync_binlog = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect sync_binlog value: '42949672950'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-4294967286
+4294967295
 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 SET @@global.sync_binlog = ON;
 ERROR 42000: Incorrect argument type to variable 'sync_binlog'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-4294967286
+4294967295
 SET @@global.sync_binlog = 'test';
 ERROR 42000: Incorrect argument type to variable 'sync_binlog'
 SELECT @@global.sync_binlog;
 @@global.sync_binlog
-4294967286
+4294967295
 '#-------------------FN_DYNVARS_168_05----------------------------#'
 SET @@session.sync_binlog = 0;
 ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
 SELECT @@sync_binlog;
 @@sync_binlog
-4294967286
+4294967295
 '#----------------------FN_DYNVARS_168_06------------------------#'
 SELECT @@global.sync_binlog = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -88,7 +98,7 @@ SET sync_binlog = 1;
 ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
 SELECT @@sync_binlog;
 @@sync_binlog
-4294967286
+4294967295
 SET local.sync_binlog = 1;
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
 SELECT local.sync_binlog;

=== modified file 'mysql-test/suite/sys_vars/r/tmp_table_size_basic.result'
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result	2008-12-05 15:43:13 +0000
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result	2009-03-20 17:11:22 +0000
@@ -51,7 +51,7 @@ SELECT @@global.tmp_table_size;
 1024
 SET @@global.tmp_table_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
+Warning	1292	Truncated incorrect tmp_table_size value: '-1024'
 SELECT @@global.tmp_table_size;
 @@global.tmp_table_size
 1024
@@ -100,6 +100,8 @@ SELECT @@session.tmp_table_size;
 SET @@session.tmp_table_size = "Test";
 ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
 SET @@session.tmp_table_size = 12345678901;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '12345678901'
 SELECT @@session.tmp_table_size IN (12345678901,4294967295);
 @@session.tmp_table_size IN (12345678901,4294967295)
 1

=== modified file 'mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result	2009-01-22 10:14:16 +0000
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -71,7 +71,7 @@ SELECT @@global.transaction_alloc_block_
 1024
 SET @@global.transaction_alloc_block_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '-1024'
 SELECT @@global.transaction_alloc_block_size;
 @@global.transaction_alloc_block_size
 1024

=== modified file 'mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result	2009-03-20 17:11:22 +0000
@@ -66,7 +66,7 @@ SELECT @@global.transaction_prealloc_siz
 1024
 SET @@global.transaction_prealloc_size = -1024;
 Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '-1024'
 SELECT @@global.transaction_prealloc_size;
 @@global.transaction_prealloc_size
 1024

=== modified file 'mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result'
--- a/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result	2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result	2009-03-20 17:11:22 +0000
@@ -44,7 +44,7 @@ Warnings:
 Warning	1292	Truncated incorrect wait_timeout value: '0'
 SET @@global.wait_timeout = -1024;
 Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
+Warning	1292	Truncated incorrect wait_timeout value: '-1024'
 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 SET @@global.wait_timeout = ON;
 ERROR 42000: Incorrect argument type to variable 'wait_timeout'

=== modified file 'mysql-test/suite/sys_vars/t/concurrent_insert_func.test'
--- a/mysql-test/suite/sys_vars/t/concurrent_insert_func.test	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test	2009-03-19 11:21:38 +0000
@@ -11,6 +11,11 @@
 # Creation Date: 2008-03-07                                                    #
 # Author:  Salman Rawala                                                       #
 #                                                                              #
+# Modified: HHunger 2009-02-23 Inserted a wait condition right after the       #
+#                              "INSERT ..record_6" to wait for the end of      #
+#                              the insert.                                     #
+#           mleich This test needs some inporovements                          #
+#                                                                              #
 # Description: Test Cases of Dynamic System Variable "concurrent_insert"       #
 #              that checks functionality of this variable                      #
 #                                                                              #
@@ -62,7 +67,6 @@ connection test_con1;
 INSERT INTO t1(name) VALUES('Record_4');
 SELECT * FROM t1;
 
-
 --echo ## unlocking tables ##
 --echo connection default;
 connection default;
@@ -106,6 +110,8 @@ UNLOCK TABLES;
 --echo ## table contens after UNLOCK ##
 SELECT * FROM t1;
 INSERT INTO t1(name) VALUES('Record_6');
+let $wait_condition= SELECT COUNT(*) = 5 FROM t1;
+--source include/wait_condition.inc
 
 --echo connection test_con1;
 connection test_con1;

=== modified file 'mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test'
--- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test	2009-03-20 17:11:22 +0000
@@ -1,23 +1,26 @@
-############# mysql-test\t\sql_low_priority_updates_func.test ###########################
-#                                                                                       #
-# Variable Name: sql_low_priority_updates                                               #
-# Scope: GLOBAL                                                                         #
-# Access Type: Dynamic                                                                  #
-# Data Type: BOOLEAN                                                                    #
-# Default Value: 1 TRUE                                                                 #
-# Values:       1 TRUE, 0 FALSE                                                         #
-#                                                                                       #
-#                                                                                       #
-# Creation Date: 2008-02-25                                                             #
-# Author:  Sharique Abdullah                                                            #
-#                                                                                       #
-# Description: Test Cases of Dynamic System Variable "sql_low_priority_updates"         #
-#              that checks behavior of this variable in the following ways              #
-#              * Functionality based on different values                                #
-#                                                                                       #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html                     #
-#                                                                                       #
-#########################################################################################
+################################################################################
+#                                                                              #
+# Variable Name: sql_low_priority_updates                                      #
+# Scope: GLOBAL                                                                #
+# Access Type: Dynamic                                                         #
+# Data Type: BOOLEAN                                                           #
+# Default Value: 1 TRUE                                                        #
+# Values:       1 TRUE, 0 FALSE                                                #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-25                                                    #
+# Author:  Sharique Abdullah                                                   #
+# Modified: HHunger 2009-02-26 Replaced 2 sleeps by wait conditions            #
+# Modified: mleich  2009-03-18 Partially reimplemented                         #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable "sql_low_priority_updates"#
+#              that checks behavior of this variable in the following ways     #
+#              * Functionality based on different values                       #
+#                                                                              #
+# Reference:                                                                   #
+#    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html       #
+#                                                                              #
+################################################################################
 
 --echo ** Setup **
 --echo
@@ -29,8 +32,10 @@
 
 --echo Creating connection con0
 connect (con0,localhost,root,,);
+let $con0_id=`SELECT CONNECTION_ID()`;
 --echo Creating connection con1
 connect (con1,localhost,root,,);
+let $con1_id=`SELECT CONNECTION_ID()`;
 
 connection default;
 
@@ -40,31 +45,20 @@ SET @global_delayed_insert_limit = @@GLO
 # Create Table
 #
 
-CREATE TABLE t1 (a varchar(100));
+CREATE TABLE t1 (a VARCHAR(100),b VARCHAR(100),c VARCHAR(100));
 
 --echo '#--------------------FN_DYNVARS_25_01-------------------------#'
-#
-# Value less than the provided INSERTS (9)
-#
 
-SET GLOBAL delayed_insert_limit = 9;
+# delayed_insert_limit is smaller than the number of inserted rows
 
---echo ** Connection con0 **
-connection con0;
-SET GLOBAL delayed_insert_limit = 9;
---echo ** Connection con1 **
-connection con1;
-SET GLOBAL delayed_insert_limit = 9;
---echo ** Connection default **
-connection default;
-SET GLOBAL delayed_insert_limit = 9;
+SET GLOBAL delayed_insert_limit = 14;
 
-INSERT INTO t1 VALUES('1');
-INSERT INTO t1 VALUES('2');
-INSERT INTO t1 VALUES('3');
-INSERT INTO t1 VALUES('4');
-INSERT INTO t1 VALUES('5');
-INSERT INTO t1 VALUES('6');
+INSERT INTO t1 VALUES('1','1','1');
+INSERT INTO t1 VALUES('2','1','1');
+INSERT INTO t1 VALUES('3','1','1');
+INSERT INTO t1 VALUES('4','1','1');
+INSERT INTO t1 VALUES('5','1','1');
+INSERT INTO t1 VALUES('6','1','1');
 
 LOCK TABLE t1 WRITE;
 
@@ -72,76 +66,94 @@ LOCK TABLE t1 WRITE;
 connection con1;
 
 delimiter |;
-
 send
-INSERT DELAYED INTO t1 VALUES('7');
-INSERT DELAYED INTO t1 VALUES('8');
-INSERT DELAYED INTO t1 VALUES('9');
-INSERT DELAYED INTO t1 VALUES('10');
-INSERT DELAYED INTO t1 VALUES('11');
-INSERT DELAYED INTO t1 VALUES('12');
-INSERT DELAYED INTO t1 VALUES('13');
-INSERT DELAYED INTO t1 VALUES('14');
-INSERT DELAYED INTO t1 VALUES('15');
-INSERT DELAYED INTO t1 VALUES('16');
-INSERT DELAYED INTO t1 VALUES('17');
-INSERT DELAYED INTO t1 VALUES('18');
-INSERT DELAYED INTO t1 VALUES('19');
-INSERT DELAYED INTO t1 VALUES('20');
-INSERT DELAYED INTO t1 VALUES('21');
-INSERT DELAYED INTO t1 VALUES('22');|
-
+INSERT DELAYED INTO t1 VALUES('7','1','1');
+INSERT DELAYED INTO t1 VALUES('8','1','1');
+INSERT DELAYED INTO t1 VALUES('9','1','1');
+INSERT DELAYED INTO t1 VALUES('10','1','1');
+INSERT DELAYED INTO t1 VALUES('11','1','1');
+INSERT DELAYED INTO t1 VALUES('12','1','1');
+INSERT DELAYED INTO t1 VALUES('13','1','1');
+INSERT DELAYED INTO t1 VALUES('14','1','1');
+INSERT DELAYED INTO t1 VALUES('15','1','1');
+INSERT DELAYED INTO t1 VALUES('16','1','1');
+INSERT DELAYED INTO t1 VALUES('17','1','1');
+INSERT DELAYED INTO t1 VALUES('18','1','1');
+INSERT DELAYED INTO t1 VALUES('19','1','1');
+INSERT DELAYED INTO t1 VALUES('20','1','1');
+INSERT DELAYED INTO t1 VALUES('21','1','1');
+INSERT DELAYED INTO t1 VALUES('22','1','1');
+INSERT DELAYED INTO t1 VALUES('23','1','1');
+INSERT DELAYED INTO t1 VALUES('24','1','1');
+INSERT DELAYED INTO t1 VALUES('25','1','1');
+INSERT DELAYED INTO t1 VALUES('26','1','1');
+INSERT DELAYED INTO t1 VALUES('27','1','1');
+INSERT DELAYED INTO t1 VALUES('28','1','1');
+INSERT DELAYED INTO t1 VALUES('29','1','1');
+INSERT DELAYED INTO t1 VALUES('30','1','1');
+INSERT DELAYED INTO t1 VALUES('31','1','1');
+INSERT DELAYED INTO t1 VALUES('32','1','1');
+INSERT DELAYED INTO t1 VALUES('33','1','1');
+INSERT DELAYED INTO t1 VALUES('34','1','1');
+INSERT DELAYED INTO t1 VALUES('35','1','1');
+INSERT DELAYED INTO t1 VALUES('36','1','1');
+INSERT DELAYED INTO t1 VALUES('37','1','1');
+INSERT DELAYED INTO t1 VALUES('38','1','1');
+INSERT DELAYED INTO t1 VALUES('39','1','1');
+INSERT DELAYED INTO t1 VALUES('40','1','1');
+INSERT DELAYED INTO t1 VALUES('41','1','1');
+INSERT DELAYED INTO t1 VALUES('42','1','1');
+INSERT DELAYED INTO t1 VALUES('43','1','1');|
 delimiter ;|
 
 --echo ** Connection con0 **
 connection con0;
-
-delimiter |;
-
-send
-SELECT * FROM t1;|
-
-delimiter ;|
+let $wait_condition=
+   SELECT variable_value > 0 FROM information_schema.global_status
+   WHERE variable_name like 'Not_flushed_delayed_rows';
+--source include/wait_condition.inc
+let $my_select= SELECT COUNT(*) BETWEEN 21 AND 43 FROM t1;
+let $my_select= SELECT COUNT(*) FROM t1;
+send;
+eval $my_select;
 
 --echo ** Connection default **
 connection default;
-
---echo Waiting for 1 sec
---sleep 1
-
+--echo ** Wait till con0 is blocked **
+let $wait_condition=
+   SELECT COUNT(*) = 1 FROM information_schema.processlist
+   WHERE state = 'Locked' AND info = '$my_select';
+--source include/wait_condition.inc
 UNLOCK TABLES;
 
+--echo ** Connection con1 **
+connection con1;
+--echo Asynchronous "reap" result
+reap;
+
 --echo ** Connection con0 **
 connection con0;
+--echo Asynchronous "reap" result
+--echo The next result suffers from
+--echo '# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
 reap;
---echo 'Bug#35386: insert delayed inserts 1 + limit rows instead of just limit rows'
 
 --echo ** Connection default **
 connection default;
-
---echo Waiting for 1 sec
---sleep 1
+let $wait_condition= SELECT count(*) = 43 FROM t1;
+--source include/wait_condition.inc
 --echo Checking if the delayed insert continued afterwards
-SELECT * FROM t1;
+SELECT COUNT(*) FROM t1;
 
-DELETE FROM t1;
+DROP TABLE t1;
 
 
 --echo '#--------------------FN_DYNVARS_25_02-------------------------#'
-#
-# Value 5
-#
 
-SET GLOBAL delayed_insert_limit = 20;
+# delayed_insert_limit is bigger than the number of inserted rows
+
+CREATE TABLE t1 (a VARCHAR(100));
 
---echo ** Connection con0 **
-connection con0;
-SET GLOBAL delayed_insert_limit = 20;
---echo ** Connection con1 **
-connection con1;
-SET GLOBAL delayed_insert_limit = 20;
---echo ** Connection default **
-connection default;
 SET GLOBAL delayed_insert_limit = 20;
 
 INSERT INTO t1 VALUES('1');
@@ -181,49 +193,52 @@ delimiter ;|
 
 --echo ** Connection con0 **
 connection con0;
-
+let $wait_condition=
+   SELECT variable_value > 0 FROM information_schema.global_status
+   WHERE variable_name like 'Not_flushed_delayed_rows';
+--source include/wait_condition.inc
 --echo Asynchronous execute
-delimiter |;
-
-send
-SELECT * FROM t1;|
-
-delimiter ;|
+let $my_select= SELECT COUNT(*) = 22 FROM t1;
+send;
+eval $my_select;
 
 --echo ** Connection default **
 connection default;
-
---echo Waiting for 1 sec
---sleep 1
-
+--echo ** Wait till con0 is blocked **
+let $wait_condition=
+   SELECT COUNT(*) = 1 FROM information_schema.processlist
+   WHERE state = 'Locked' AND info = '$my_select';
+--source include/wait_condition.inc
 UNLOCK TABLES;
 
+--echo ** Connection con1 **
+connection con1;
+reap;
+
 --echo ** Connection con0 **
 connection con0;
---echo Asynchronous execute result
+--echo Asynchronous "reap" result
 reap;
 
 --echo ** Connection default**
 connection default;
-
---echo Waiting for 1 sec
---sleep 1
 --echo Checking if the delayed insert gives the same result afterwards
-SELECT * FROM t1;
+eval $my_select;
 
-DELETE FROM t1;
 
 #
 # Cleanup
 #
 
---echo Switching to default
+--echo ** Connection default**
 connection default;
+DROP TABLE t1;
+SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
 
 --echo Disconnecting from con1, con0
 disconnect con0;
 disconnect con1;
-
-DROP TABLE t1;
-
-SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
+let $wait_condition=
+   SELECT COUNT(*) = 0 FROM information_schema.processlist
+   WHERE id IN ($con0_id,$con1_id);
+--source include/wait_condition.inc

=== removed file 'mysql-test/suite/sys_vars/t/event_scheduler_func.test'
--- a/mysql-test/suite/sys_vars/t/event_scheduler_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/event_scheduler_func.test	1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
-############## mysql-test\t\event_scheduler_func.test ##########################
-#                                                                              #
-# Variable Name: event_scheduler                                               #
-# Scope: GLOBAL                                                                #
-# Access Type: Dynamic                                                         #
-# Data Type: Boolean                                                           #
-# Default Value: OFF                                                           #
-# Valid Values: ON, OFF & DISABLED                                             #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-03-17                                                    #
-# Author:  Salman Rawala                                                       #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable "event_scheduler"         #
-#              that checks functionality of this variable                      #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#    server-system-variables.html#option_mysqld_event_scheduler                #
-#                                                                              #
-################################################################################
-
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#########################
-#   Creating new table  #
-#########################
-
---echo ## Creating new table ##
-CREATE TABLE t1
-(
-id INT NOT NULL auto_increment,
-PRIMARY KEY (id),
-name VARCHAR(30)
-);
-
---echo '#--------------------FN_DYNVARS_018_01-------------------------#'
-####################################################################
-#    Setting initial value of event_scheduler to ON and verifying
-#    its behavior
-####################################################################
-
---echo ## Setting initial value of variable to ON ##
-SET @@global.event_scheduler = ON;
-SELECT @@event_scheduler;
-
---echo ## Creating new event ##
-CREATE EVENT test_event_1
-ON SCHEDULE EVERY 3 SECOND
-DO 
-  INSERT into t1(name) values('Record_1');
-
---sleep 4
-
-SELECT * from t1;
-
-DROP EVENT test_event_1;
-
---sleep 1
-DELETE from t1;
-select * from t1;
-
-
---echo '#--------------------FN_DYNVARS_018_02-------------------------#'
-####################################################################
-#    Setting initial value of event_scheduler to OFF and verifying
-#    its behavior
-####################################################################
-
---echo ## Setting value of variable to OFF ##
-SET @@global.event_scheduler = OFF;
-SELECT @@event_scheduler;
-
---echo ## Creating new event ##
-CREATE EVENT test_event_1
-ON SCHEDULE EVERY 3 SECOND
-DO 
-  INSERT into t1(name) values('Record_2');
-
---sleep 4
-
---echo ## Table should be empty ##
-SELECT * from t1;
-
-DROP EVENT test_event_1;
---echo ## Dropping table ##
-DROP table t1;
-

=== modified file 'mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test'
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test	2009-01-30 16:59:10 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,4 @@
-################# mysql-test\t\innodb_max_dirty_pages_pct_func.test  ##########
+###############################################################################
 #                                                                             #
 # Variable Name: innodb_max_dirty_pages_pct                                   #
 # Scope: GLOBAL                                                               #

=== modified file 'mysql-test/suite/sys_vars/t/interactive_timeout_func.test'
--- a/mysql-test/suite/sys_vars/t/interactive_timeout_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/interactive_timeout_func.test	2009-03-20 17:11:22 +0000
@@ -1,23 +1,26 @@
-############## mysql-test\t\interactive_timeout_func.test #####################
-#                                                                             #
-# Variable Name: interactive_timeout                                          #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:28800                                                         #
-# Minvalue: 1                                                                 #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-03-07                                                   #
-# Author:  Salman Rawala                                                      #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable interactive_timeout      #
-#              that checks the functionality of this variable                 #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
+################################################################################
+#                                                                              #
+# Variable Name: interactive_timeout                                           #
+# Scope: GLOBAL | SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: numeric                                                           #
+# Default Value:28800                                                          #
+# Minvalue: 1                                                                  #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-03-07                                                    #
+# Author:  Salman Rawala                                                       #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable interactive_timeout       #
+#              that checks the functionality of this variable                  #
+# Modified: HHunger 2009-02-26 Inserted clean up, beautifications.             #
+#                              It is not yet possible to set CLIENT_INTERACIVE #
+#                              When connecting, so the test has not the        #
+#                              desired effect. See 'wait_timeout_func'.        #
+# Reference:                                                                   #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html          #
+#                                                                              #
+################################################################################
 
 
 --disable_warnings
@@ -42,29 +45,44 @@ name VARCHAR(30)
 #   Setting initial value of interactive_timeout to 1 and verifying its
 #   behavior
 #######################################################################
+let $start_value= `SELECT @@global.interactive_timeout`;
 
 --echo ## Setting initial value of variable to 1 ##
 SET @@global.interactive_timeout = 1;
 
---echo ## Creating new interactive connection test_con1 ## 
-connect (test_con1, localhost, root,);
+--echo ## Creating new connection test_con1 ##
+# Not yet possible to set CLEAN_INTERACTIVE flag
+connect (test_con1, localhost, root,,,,,);
 connection test_con1;
 
 --echo ## Inserting record in table ##
 INSERT into t1(name) values('Record_1');
 
---echo ## Setting session value of interactive_timeout ## 
+--echo ## Setting session value of interactive_timeout ##
 SET @@session.interactive_timeout = 1;
 
---echo ## Verifying values of variable ## 
+--echo ## Verifying values of variable ##
 SELECT @@session.interactive_timeout;
 SELECT @@global.interactive_timeout;
 
---echo ## Using sleep to check timeout ## 
-sleep 5;
-SELECT * from t1;
+--echo connection default;
+connection default;
+--echo ## Using sleep to check timeout ##
+--echo sleep 2;
+sleep 2;
 
---echo 'Bug#35377: Error should appear here because interactive_timeout value';
---echo 'is 1 and connection remains idle for 5 secs';
+--echo connection test_con1;
+connection test_con1;
+SELECT * from t1;
 
 INSERT into t1(name) values('Record_2');
+
+--echo connection default;
+connection default;
+
+--echo disconnect test_con1;
+disconnect test_con1;
+DROP TABLE t1;
+
+eval SET @@global.interactive_timeout= $start_value;
+

=== modified file 'mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test'
--- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,4 @@
-############# mysql-test\t\query_cache_wlock_invalidate_func.test ####################
+######################################################################################
 #                                                                                    #
 # Variable Name: query_cache_wlock_invalidate                                        #
 # Scope: GLOBAL & SESSION                                                            #
@@ -10,6 +10,7 @@
 #                                                                                    #
 # Creation Date: 2008-02-21                                                          #
 # Author:  Sharique Abdullah                                                         #
+# Modified: HHunger 2009-02-27 Replaced sleeps, beautifications                      #
 #                                                                                    #
 # Description: Test Cases of Dynamic System Variable "query_cache_wlock_invalidate"  #
 #              that checks behavior of this variable in the following ways           #
@@ -18,8 +19,8 @@
 #              * Scope & Access method                                               #
 #              * Cache behaviors                                                     #
 #                                                                                    #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                                 #
-#            server-system-variables.html#option_mysqld_query_cache_wlock_invalidate #
+# Reference:                                                                         #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html                #
 #                                                                                    #
 ######################################################################################
 
@@ -29,6 +30,8 @@
 # Setup
 #
 
+--source include/not_embedded.inc
+
 # disabled due to differences in the result
 --disable_ps_protocol
 #
@@ -135,8 +138,9 @@ send SELECT * FROM t1;
 --echo ** Connection con0 **
 connection con0;
 
---echo Sleeping 2 Seconds before unlock
---sleep 2
+--echo wait until table is locked
+let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state= 'Locked';
+--source include/wait_condition.inc
 UNLOCK TABLES;
 
 --echo ** Connection con1 **
@@ -195,20 +199,17 @@ SELECT * FROM t1;
 
 --echo ** Connection con0 **
 connection con0;
-
 LOCK TABLE t1 WRITE;
 
 --echo ** Connection con1 **
 connection con1;
-
 --echo ** Should not be blocked **
 SELECT * FROM t1;
+SELECT * FROM t1;
+SELECT * FROM t1;
 
 --echo ** Connection con0 **
 connection con0;
-
---echo Sleeping 2 Seconds before unlock
---sleep 2
 UNLOCK TABLES;
 
 --echo ** Connection con1 **

=== modified file 'mysql-test/suite/sys_vars/t/rpl_init_slave_func.test'
--- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,4 @@
-###################### mysql-test\t\init_slave_func.test  #####################
+###############################################################################
 #                                                                             #
 # Variable Name: init_slave                                                   #
 # Scope: GLOBAL                                                               #

=== modified file 'mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test'
--- a/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func.test	2009-03-20 17:11:22 +0000
@@ -7,9 +7,8 @@ source include/have_log_bin.inc;
 DROP TABLE IF EXISTS t1;
 --enable_warnings
 
-
 #==============================================================
---echo '--- check if log file is rotated after 4096 bytes ----' 
+--echo '--- check if log file is rotated after 4096 bytes ----'
 #==============================================================
 
 SET @saved_max_binlog_size= @@global.max_binlog_size;
@@ -24,8 +23,7 @@ INSERT INTO t1 VALUES ('mysql');
 dec $a;
 }
 --enable_query_log
-
---sleep 2
+SELECT COUNT(*) FROM t1;
 
 # if log file is not created then this will fail
 let $MYSQLD_DATADIR=`select @@datadir`;

=== modified file 'mysql-test/suite/sys_vars/t/slow_query_log_func.test'
--- a/mysql-test/suite/sys_vars/t/slow_query_log_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,3 @@
-
 # save
 SET @global_slow_query_log = @@global.slow_query_log;
 SET @global_log_output = @@global.log_output;
@@ -16,6 +15,7 @@ SET @@global.log_output = 'TABLE';
 
 SET @@global.slow_query_log = OFF;
 TRUNCATE mysql.slow_log;
+# The sleep is the slow query
 SELECT sleep(2);
 
 SELECT count(*) FROM mysql.slow_log;
@@ -26,9 +26,10 @@ SELECT count(*) FROM mysql.slow_log;
 
 SET @@global.slow_query_log = ON;
 TRUNCATE mysql.slow_log;
+# The sleep is the slow query
 SELECT sleep(2);
 
-SELECT count(*) FROM mysql.slow_log;
+SELECT count(*) > 0 FROM mysql.slow_log;
 
 #restore
 SET @@global.log_output = @global_log_output;
@@ -37,3 +38,4 @@ SET @global.slow_query_log = @global_slo
 ###############################################################################
 # End of the functionality test for slow_query_log                            #
 ###############################################################################
+

=== modified file 'mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test'
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test	2009-03-20 17:11:22 +0000
@@ -1,23 +1,23 @@
-############# mysql-test\t\sql_low_priority_updates_func.test #################
-#                                                                             #
-# Variable Name: sql_low_priority_updates                                     #
-# Scope: GLOBAL & SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: BOOLEAN                                                          #
-# Default Value: 1 TRUE                                                       #
-# Values:       1 TRUE, 0 FALSE                                               #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-25                                                   #
-# Author:  Sharique Abdullah                                                  #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable  sql_low_priority_updates#
-#              that checks behavior of this variable in the following ways    #
-#              * Functionality based on different values                      #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html           #
-#                                                                             #
-###############################################################################
+################################################################################
+#                                                                              #
+# Variable Name: sql_low_priority_updates                                      #
+# Scope: GLOBAL & SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: BOOLEAN                                                           #
+# Default Value: 1 TRUE                                                        #
+# Values:       1 TRUE, 0 FALSE                                                #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-25                                                    #
+# Author:  Sharique Abdullah                                                   #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable  sql_low_priority_updates #
+#              that checks behavior of this variable in the following ways     #
+#              * Functionality based on different values                       #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html            #
+#                                                                              #
+################################################################################
 
 --source include/not_embedded.inc
 
@@ -85,6 +85,9 @@ delimiter ;|
 --echo ** Connection con0 **
 connection con0;
 
+let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state='Locked' AND info LIKE  'UPDATE t1 SET a = CONCAT(a,"-updated")';
+--source include/wait_condition.inc
+
 --echo ** Asynchronous Execution **
 delimiter |;
 
@@ -98,9 +101,8 @@ delimiter ;|
 --echo ** Connection default **
 connection default;
 
---echo Sleeping for 1 secs
---sleep 1
-
+let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist WHERE state LIKE 'Locked';
+--source include/wait_condition.inc
 UNLOCK TABLES;
 
 --echo ** Connection con0 **
@@ -153,6 +155,9 @@ delimiter ;|
 --echo ** Connection con0 **
 connection con0;
 
+let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state='Locked' AND info LIKE  'UPDATE t1 SET a = CONCAT(a,"-updated")';
+--source include/wait_condition.inc
+
 --echo ** Asynchronous Execution **
 delimiter |;
 
@@ -166,9 +171,8 @@ delimiter ;|
 --echo ** Connection default **
 connection default;
 
---echo Sleeping for 1 secs
---sleep 1
-
+let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist WHERE state LIKE 'Locked';
+--source include/wait_condition.inc
 UNLOCK TABLES;
 
 --echo ** Connection con0 **

=== modified file 'mysql-test/suite/sys_vars/t/timestamp_func.test'
--- a/mysql-test/suite/sys_vars/t/timestamp_func.test	2008-12-19 15:12:15 +0000
+++ b/mysql-test/suite/sys_vars/t/timestamp_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,4 @@
-############# mysql-test\t\timestamp_func.test #############################
+############################################################################
 #                                                                          #
 # Variable Name: timestamp                                                 #
 # Scope: GLOBAL                                                            #

=== modified file 'mysql-test/suite/sys_vars/t/wait_timeout_func.test'
--- a/mysql-test/suite/sys_vars/t/wait_timeout_func.test	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_func.test	2009-03-20 17:11:22 +0000
@@ -1,4 +1,4 @@
-############## mysql-test\t\wait_timeout_func.test ############################
+###############################################################################
 #                                                                             #
 # Variable Name: wait_timeout                                                 #
 # Scope: GLOBAL | SESSION                                                     #

=== modified file 'mysql-test/t/ctype_collate.test'
--- a/mysql-test/t/ctype_collate.test	2007-07-08 21:23:33 +0000
+++ b/mysql-test/t/ctype_collate.test	2009-03-19 08:20:28 +0000
@@ -229,3 +229,17 @@ insert into t1 set a=0x6c;
 insert into t1 set a=0x4c98;
 check table t1 extended;
 drop table t1;
+
+#
+# Bug#41627 Illegal mix of collations in LEAST / GREATEST / CASE
+#
+select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
+create table t1
+select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1;
+show create table t1;
+drop table t1;
+
+select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
+latin5_turkish_ci then 2 else 3 end;
+
+select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-05-08 09:57:18 +0000
+++ b/mysql-test/t/disabled.def	2009-05-08 14:43:21 +0000
@@ -11,4 +11,5 @@
 ##############################################################################
 kill                     : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
 innodb_bug39438          : BUG#42383 2009-01-28 lsoares "This fails in embedded and on windows.  Note that this test is not run on windows and on embedded in PB for main trees currently"
-innodb			 : Bug #37995  	Error message truncation in test "innodb" in embedded mode
+#concurrent_innodb_safelog: disabled for embedded server due to bug#43733 Select on processlist let the embedded server crash (concurrent_innodb_safelog).
+#concurrent_innodb_unsafelog: disabled for embedded server due to bug#43733.

=== modified file 'mysql-test/t/index_merge_myisam.test'
--- a/mysql-test/t/index_merge_myisam.test	2006-08-16 12:58:49 +0000
+++ b/mysql-test/t/index_merge_myisam.test	2009-03-14 18:58:23 +0000
@@ -19,3 +19,170 @@ let $merge_table_support= 1;
 --source include/index_merge2.inc
 --source include/index_merge_2sweeps.inc
 --source include/index_merge_ror_cpk.inc
+
+--echo #
+--echo # Generic @@optimizer_switch tests (move those into a separate file if
+--echo #  we get another @@optimizer_switch user)
+--echo #
+
+select @@optimizer_switch;
+
+set optimizer_switch='index_merge=off,index_merge_union=off';
+select @@optimizer_switch;
+
+set optimizer_switch='index_merge_union=on';
+select @@optimizer_switch;
+
+set optimizer_switch='default,index_merge_sort_union=off';
+select @@optimizer_switch;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch=4;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch=NULL;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='default,index_merge';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge=index_merge';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge=on,but...';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge=';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='on';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge=on,index_merge=off';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='index_merge_union=on,index_merge_union=default';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set optimizer_switch='default,index_merge=on,index_merge=off,default';
+
+set optimizer_switch=default;
+set optimizer_switch='index_merge=off,index_merge_union=off,default';
+select @@optimizer_switch;
+set optimizer_switch=default;
+
+# Check setting defaults for global vars
+select @@global.optimizer_switch;
+set @@global.optimizer_switch=default;
+select @@global.optimizer_switch;
+
+--echo #
+--echo # Check index_merge's @@optimizer_switch flags
+--echo #
+select @@optimizer_switch;
+
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int, filler char(100), 
+                 key(a), key(b), key(c));
+insert into t1 select 
+  A.a * B.a*10 + C.a*100, 
+  A.a * B.a*10 + C.a*100,
+  A.a, 
+  'filler'
+from t0 A, t0 B, t0 C; 
+
+--echo This should use union:
+explain select * from t1 where a=1 or b=1;
+
+--echo This should use ALL:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a=1 or b=1;
+
+--echo This should use sort-union:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=1 or b=1;
+
+--echo This will use sort-union:
+set optimizer_switch=default;
+explain select * from t1 where a<1 or b <1;
+
+--echo This should use ALL:
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where a<1 or b <1;
+
+
+--echo This should use ALL:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a<1 or b <1;
+
+--echo This will use sort-union:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a<1 or b <1;
+
+alter table t1 add d int, add key(d);
+update t1 set d=a;
+
+--echo This will use sort_union:
+set optimizer_switch=default;
+explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
+
+--echo And if we disable sort_union, union:
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where (a=3 or b in (1,2)) and (c=3 or d=4);
+
+drop table t1;
+
+# Now test that intersection can be disabled
+create table t1 (
+  a int, b int, c int,
+  filler1 char(200), filler2 char(200), 
+  key(a),key(b),key(c)
+); 
+
+insert into t1 
+select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a, 'foo', 'bar' 
+from t0 A, t0 B, t0 C, t0 D where D.a<5;
+
+--echo This should be intersect:
+set optimizer_switch=default;
+explain select * from t1 where a=10 and b=10;
+
+--echo No intersect when index_merge is disabled:
+set optimizer_switch='default,index_merge=off';
+explain select * from t1 where a=10 and b=10;
+
+--echo No intersect if it is disabled:
+set optimizer_switch='default,index_merge_intersection=off';
+explain select * from t1 where a=10 and b=10;
+
+--echo Do intersect when union was disabled
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=10 and b=10;
+
+--echo Do intersect when sort_union was disabled
+set optimizer_switch='default,index_merge_sort_union=off';
+explain select * from t1 where a=10 and b=10;
+
+# Now take union-of-intersection and see how we can disable parts of it
+--echo This will use intersection inside a union:
+set optimizer_switch=default;
+explain select * from t1 where a=10 and b=10 or c=10;
+
+--echo Should be only union left:
+set optimizer_switch='default,index_merge_intersection=off';
+explain select * from t1 where a=10 and b=10 or c=10;
+
+--echo This will switch to sort-union (intersection will be gone, too,
+--echo   thats a known limitation:
+set optimizer_switch='default,index_merge_union=off';
+explain select * from t1 where a=10 and b=10 or c=10;
+
+set optimizer_switch=default;
+show variables like 'optimizer_switch';
+
+drop table t0, t1;
+

=== modified file 'mysql-test/t/information_schema.test'
--- a/mysql-test/t/information_schema.test	2009-02-10 10:23:47 +0000
+++ b/mysql-test/t/information_schema.test	2009-03-17 14:29:16 +0000
@@ -1410,6 +1410,15 @@ CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
 SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
 DROP TABLE t1;
 
+#
+# Bug #22047: Time in SHOW PROCESSLIST for SQL thread in replication seems
+# to become negative
+#
+
+SET TIMESTAMP=@@TIMESTAMP + 10000000;
+SELECT 'OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
+SET TIMESTAMP=DEFAULT;
+
 --echo End of 5.1 tests.
 
 # Wait till all disconnects are completed

=== modified file 'mysql-test/t/lock_multi.test'
--- a/mysql-test/t/lock_multi.test	2009-03-06 14:56:17 +0000
+++ b/mysql-test/t/lock_multi.test	2009-03-24 13:58:52 +0000
@@ -262,6 +262,7 @@ DROP DATABASE mysqltest_1;
 # With bug in place: try to acquire LOCK_mysql_create_table...
 # When fixed: Reject dropping db because of the read lock.
 connection con1;
+# Wait a bit so that the session con2 is in state "Waiting for release of readlock"
 let $wait_condition=
   select count(*) = 1 from information_schema.processlist
   where state = "Waiting for release of readlock"
@@ -316,327 +317,6 @@ reap;
 connection locker;
 drop table t1;
 
-#
-# Bug#38691 segfault/abort in ``UPDATE ...JOIN'' while
-#           ``FLUSH TABLES WITH READ LOCK''
-#
-
---connection default
-CREATE TABLE t1 (
-  a int(11) unsigned default NULL,
-  b varchar(255) default NULL,
-  UNIQUE KEY a (a),
-  KEY b (b)
-);
-
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
-CREATE TABLE t2 SELECT * FROM t1;
-CREATE TABLE t3 SELECT * FROM t1;
-
---echo # test altering of columns that multiupdate doesn't use
-
---echo # normal mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
-  send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
-         SET a = NULL WHERE t1.b <> t2.b;
-
---connection locker
-  ALTER TABLE t2 ADD COLUMN (c INT);
-  ALTER TABLE t2 DROP COLUMN c;
-
---connection writer
---reap
-}
-
---echo # PS mode
-
---connection writer
-PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
-                     SET a = NULL WHERE t1.b <> t2.b';
-
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
---send EXECUTE stmt
-
---connection locker
-  ALTER TABLE t2 ADD COLUMN (c INT);
-  ALTER TABLE t2 DROP COLUMN c;
-
---connection writer
---reap
-}
---enable_query_log
-
-
---echo # test altering of columns that multiupdate uses
-
---echo # normal mode
-
---connection default
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
-  UPDATE t2 SET a=b;
-
---connection writer
---send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t2 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR
---reap
-}
---enable_query_log
-
---echo # PS mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
-  UPDATE t2 SET a=b;
-
---connection writer
-  PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b';
---send EXECUTE stmt
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t2 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR
---reap
-
-}
---enable_query_log
---connection default
-DROP TABLE t1, t2, t3;
-
-
-#
-# Bug#38499 flush tables and multitable table update with derived table cause
-#           crash
-#
-
-CREATE TABLE t1( a INT, b INT );
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
-
---echo # 1. test regular tables
---echo # 1.1. test altering of columns that multiupdate doesn't use
---echo # 1.1.1. normal mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
-  send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
-
---connection locker
-  ALTER TABLE t1 ADD COLUMN (c INT);
-  ALTER TABLE t1 DROP COLUMN c;
-
---connection writer
---reap
-}
-
---echo # 1.1.2. PS mode
-
---connection writer
-PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
-
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
---send EXECUTE stmt
-
---connection locker
-  ALTER TABLE t1 ADD COLUMN (c INT);
-  ALTER TABLE t1 DROP COLUMN c;
-
---connection writer
---reap
-}
---enable_query_log
-
---echo # 1.2. test altering of columns that multiupdate uses
---echo # 1.2.1. normal mode
-
---connection default
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
-  UPDATE t1 SET a=b;
-
---connection writer
---send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t1 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR # unknown column error
---reap
-}
---enable_query_log
-
---echo # 1.2.2. PS mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t1 ADD COLUMN a INT;
-  UPDATE t1 SET a=b;
-
---connection writer
-  PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
---send EXECUTE stmt
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t1 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
---reap
-}
---enable_query_log
---connection default
-ALTER TABLE t1 ADD COLUMN a INT;
-
---echo # 2. test UNIONs
---echo # 2.1. test altering of columns that multiupdate doesn't use
---echo # 2.1.1. normal mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
-  send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
-
---connection locker
-  ALTER TABLE t1 ADD COLUMN (c INT);
-  ALTER TABLE t1 DROP COLUMN c;
-
---connection writer
---reap
-}
-
---echo # 2.1.2. PS mode
-
---connection writer
-PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
-
-let $i = 100;
-while ($i) {
---dec $i
-
---connection writer
---send EXECUTE stmt
-
---connection locker
-  ALTER TABLE t1 ADD COLUMN (c INT);
-  ALTER TABLE t1 DROP COLUMN c;
-
---connection writer
---reap
-}
---enable_query_log
-
---echo # 2.2. test altering of columns that multiupdate uses
---echo # 2.2.1. normal mode
-
---connection default
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
-  UPDATE t1 SET a=b;
-
---connection writer
---send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t1 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
---reap
-}
---enable_query_log
-
---echo # 2.2.2. PS mode
-
---disable_query_log
-let $i = 100;
-while ($i) {
-  dec $i;
-
---connection locker
---error 0,ER_DUP_FIELDNAME
-  ALTER TABLE t1 ADD COLUMN a INT;
-  UPDATE t1 SET a=b;
-
---connection writer
-  PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
---send EXECUTE stmt
-
---connection locker
---error 0,ER_CANT_DROP_FIELD_OR_KEY
-  ALTER TABLE t1 DROP COLUMN a;
-
---connection writer
---error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
---reap
-}
---enable_query_log
---connection default
-DROP TABLE t1;
 
 --echo End of 5.0 tests
 

=== added file 'mysql-test/t/lock_multi_bug38499.test'
--- a/mysql-test/t/lock_multi_bug38499.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/lock_multi_bug38499.test	2009-03-23 14:22:31 +0000
@@ -0,0 +1,221 @@
+# Bug38499 flush tables and multitable table update with derived table cause crash
+# MySQL >= 5.0
+#
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+connect (locker,localhost,root,,);
+connect (writer,localhost,root,,);
+
+--connection default
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1( a INT, b INT );
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
+
+--echo # 1. test regular tables
+--echo # 1.1. test altering of columns that multiupdate doesn't use
+--echo # 1.1.1. normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+  send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
+
+--connection locker
+  ALTER TABLE t1 ADD COLUMN (c INT);
+  ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # 1.1.2. PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+  ALTER TABLE t1 ADD COLUMN (c INT);
+  ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+--echo # 1.2. test altering of columns that multiupdate uses
+--echo # 1.2.1. normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+  UPDATE t1 SET a=b;
+
+--connection writer
+--send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR # unknown column error
+--reap
+}
+--enable_query_log
+
+--echo # 1.2.2. PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t1 ADD COLUMN a INT;
+  UPDATE t1 SET a=b;
+
+--connection writer
+  PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+--connection default
+ALTER TABLE t1 ADD COLUMN a INT;
+
+--echo # 2. test UNIONs
+--echo # 2.1. test altering of columns that multiupdate doesn't use
+--echo # 2.1.1. normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+  send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
+
+--connection locker
+  ALTER TABLE t1 ADD COLUMN (c INT);
+  ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # 2.1.2. PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+  ALTER TABLE t1 ADD COLUMN (c INT);
+  ALTER TABLE t1 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+--echo # 2.2. test altering of columns that multiupdate uses
+--echo # 2.2.1. normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+  UPDATE t1 SET a=b;
+
+--connection writer
+--send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+
+--echo # 2.2.2. PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t1 ADD COLUMN a INT;
+  UPDATE t1 SET a=b;
+
+--connection writer
+  PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t1 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
+--reap
+}
+--enable_query_log
+--connection default
+DROP TABLE t1;
+
+
+# Close connections
+--disconnect locker
+--disconnect writer
+
+# End of 5.0 tests
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+

=== added file 'mysql-test/t/lock_multi_bug38691.test'
--- a/mysql-test/t/lock_multi_bug38691.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/lock_multi_bug38691.test	2009-03-23 14:22:31 +0000
@@ -0,0 +1,141 @@
+#
+# Bug#38691 segfault/abort in ``UPDATE ...JOIN'' while
+#           ``FLUSH TABLES WITH READ LOCK''
+# MySQL >= 5.0
+#
+
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+# Test to see if select will get the lock ahead of low priority update
+
+connect (locker,localhost,root,,);
+connect (writer,localhost,root,,);
+
+--connection default
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+  a int(11) unsigned default NULL,
+  b varchar(255) default NULL,
+  UNIQUE KEY a (a),
+  KEY b (b)
+);
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
+CREATE TABLE t2 SELECT * FROM t1;
+CREATE TABLE t3 SELECT * FROM t1;
+
+--echo # test altering of columns that multiupdate doesn't use
+
+--echo # normal mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+  send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
+         SET a = NULL WHERE t1.b <> t2.b;
+
+--connection locker
+  ALTER TABLE t2 ADD COLUMN (c INT);
+  ALTER TABLE t2 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+
+--echo # PS mode
+
+--connection writer
+PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a)
+                     SET a = NULL WHERE t1.b <> t2.b';
+
+let $i = 100;
+while ($i) {
+--dec $i
+
+--connection writer
+--send EXECUTE stmt
+
+--connection locker
+  ALTER TABLE t2 ADD COLUMN (c INT);
+  ALTER TABLE t2 DROP COLUMN c;
+
+--connection writer
+--reap
+}
+--enable_query_log
+
+
+--echo # test altering of columns that multiupdate uses
+
+--echo # normal mode
+
+--connection default
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+  UPDATE t2 SET a=b;
+
+--connection writer
+--send UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t2 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR
+--reap
+}
+--enable_query_log
+
+--echo # PS mode
+
+--disable_query_log
+let $i = 100;
+while ($i) {
+  dec $i;
+
+--connection locker
+--error 0,ER_DUP_FIELDNAME
+  ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+  UPDATE t2 SET a=b;
+
+--connection writer
+  PREPARE stmt FROM 'UPDATE t2 INNER JOIN (t1 JOIN t3 USING(a)) USING(a) SET a = NULL WHERE t1.b <> t2.b';
+--send EXECUTE stmt
+
+--connection locker
+--error 0,ER_CANT_DROP_FIELD_OR_KEY
+  ALTER TABLE t2 DROP COLUMN a;
+
+--connection writer
+--error 0,ER_BAD_FIELD_ERROR
+--reap
+
+}
+--enable_query_log
+--connection default
+DROP TABLE t1, t2, t3;
+
+
+# Close connections
+--disconnect locker
+--disconnect writer
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+

=== added file 'mysql-test/t/mysql-bug41486.test'
--- a/mysql-test/t/mysql-bug41486.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/mysql-bug41486.test	2009-03-25 08:47:41 +0000
@@ -0,0 +1,50 @@
+#
+# Bug#41486 extra character appears in BLOB for every ~40Mb after
+#           mysqldump/import
+#
+# This test consumes a significant amount of resources.
+# Therefore it should be kept separated from other tests.
+# Otherwise we might suffer from problems like
+# Bug#43801 mysql.test takes too long, fails due to expired timeout
+#           on debx86-b in PB
+#
+
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Have to change the global variable as the session variable is
+# read-only.
+SET @old_max_allowed_packet= @@global.max_allowed_packet;
+# 2 MB blob length + some space for the rest of INSERT query
+SET @@global.max_allowed_packet = 2 * 1024 * 1024 + 1024;
+
+# Create a new connection since the global max_allowed_packet
+# has no effect for the current connection
+connect (con1, localhost, root,,);
+
+CREATE TABLE t1(data LONGBLOB);
+INSERT INTO t1 SELECT REPEAT('1', 2*1024*1024);
+
+let $outfile= $MYSQLTEST_VARDIR/tmp/bug41486.sql;
+--error 0,1
+remove_file $outfile;
+--exec $MYSQL_DUMP test t1 > $outfile
+SET @old_general_log = @@global.general_log;
+SET @@global.general_log = 0;
+# Check that the mysql client does not insert extra newlines when loading
+# strings longer than client's max_allowed_packet
+--exec $MYSQL --max_allowed_packet=1M test < $outfile 2>&1
+SET @@global.general_log = @old_general_log;
+SELECT LENGTH(data) FROM t1;
+
+DROP TABLE t1;
+
+# Cleanup
+disconnect con1;
+--source include/wait_until_disconnected.inc
+remove_file $outfile;
+connection default;
+SET @@global.max_allowed_packet = @old_max_allowed_packet;

=== modified file 'mysql-test/t/select.test'
--- a/mysql-test/t/select.test	2008-12-24 15:26:48 +0000
+++ b/mysql-test/t/select.test	2009-03-16 05:02:10 +0000
@@ -3769,4 +3769,20 @@ SELECT date_nokey FROM C 
 
 DROP TABLE A,C;
 
+#
+# Bug #42957: no results from 
+# select where .. (col=col and col=col) or ... (false expression)
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT);
+INSERT INTO t1 VALUES (1, 1);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
+SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'mysql-test/t/union.test'
--- a/mysql-test/t/union.test	2008-11-20 07:51:48 +0000
+++ b/mysql-test/t/union.test	2009-03-19 10:18:52 +0000
@@ -105,17 +105,25 @@ SELECT a INTO @v FROM (
   SELECT a FROM t1
 ) alias;
 
-SELECT a INTO OUTFILE 'union.out.file' FROM (
+--let $outfile = $MYSQLTEST_VARDIR/tmp/union.out.file
+--error 0,1
+--remove_file $outfile
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a INTO OUTFILE '$outfile' FROM (
   SELECT a FROM t1
   UNION
   SELECT a FROM t1 WHERE 0
 ) alias;
+--remove_file $outfile
 
-SELECT a INTO DUMPFILE 'union.out.file2' FROM (
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a INTO DUMPFILE '$outfile' FROM (
   SELECT a FROM t1
   UNION
   SELECT a FROM t1 WHERE 0
 ) alias;
+--remove_file $outfile
 
 #
 # INTO will not be allowed in subqueries in version 5.1 and above.
@@ -126,27 +134,42 @@ SELECT a FROM (
   SELECT a INTO @v FROM t1
 ) alias;
 
-SELECT a FROM (
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a FROM (
   SELECT a FROM t1
   UNION
-  SELECT a INTO OUTFILE 'union.out.file3' FROM t1
+  SELECT a INTO OUTFILE '$outfile' FROM t1
 ) alias;
+--remove_file $outfile
 
-SELECT a FROM (
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a FROM (
   SELECT a FROM t1
   UNION
-  SELECT a INTO DUMPFILE 'union.out.file4' FROM t1
+  SELECT a INTO DUMPFILE '$outfile' FROM t1
 ) alias;
+--remove_file $outfile
 
 SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a FROM t1 UNION SELECT a INTO OUTFILE '$outfile' FROM t1;
+--remove_file $outfile
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '$outfile' FROM t1;
+--remove_file $outfile
+
 --error ER_WRONG_USAGE
 SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
 --error ER_WRONG_USAGE
-SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
+eval SELECT a INTO OUTFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
 --error ER_WRONG_USAGE
-SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
+eval SELECT a INTO DUMPFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
 
 DROP TABLE t1;
 

=== modified file 'mysql-test/t/upgrade.test'
--- a/mysql-test/t/upgrade.test	2008-02-28 11:21:44 +0000
+++ b/mysql-test/t/upgrade.test	2009-03-26 14:47:58 +0000
@@ -53,7 +53,9 @@ drop table `txu#p#p1`;
 #
 
 let $MYSQLD_DATADIR= `select @@datadir`;
-system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLD_DATADIR/test/t1.frm;
+--error 0,1
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/old_table-323.frm $MYSQLD_DATADIR/test/t1.frm
 truncate t1;
 drop table t1;
 

=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test	2009-03-12 16:55:10 +0000
+++ b/mysql-test/t/variables.test	2009-03-16 15:11:45 +0000
@@ -36,6 +36,7 @@ set @my_slow_launch_time          =@@glo
 set @my_storage_engine            =@@global.storage_engine;
 set @my_thread_cache_size         =@@global.thread_cache_size;
 set @my_max_allowed_packet        =@@global.max_allowed_packet;
+set @my_join_buffer_size          =@@global.join_buffer_size;
 # case insensitivity tests (new in 5.0)
 set @`test`=1;
 select @test, @`test`, @TEST, @`TEST`, @"teSt";
@@ -780,6 +781,18 @@ show variables like 'hostname';
 
 --echo End of 5.0 tests
 
+#
+# Bug#36446: Attempt to set @@join_buffer_size to its minimum value
+#            produces spurious warning
+#
+
+# set to 1 so mysqld will correct to minimum (+ warn)
+set join_buffer_size=1;
+# save minimum
+set @save_join_buffer_size=@@join_buffer_size;
+# set minimum
+set join_buffer_size=@save_join_buffer_size;
+
 # This is at the very after the versioned tests, since it involves doing
 # cleanup
 #
@@ -816,6 +829,8 @@ set global slow_launch_time          =@m
 set global storage_engine            =@my_storage_engine;
 set global thread_cache_size         =@my_thread_cache_size;
 set global max_allowed_packet        =@my_max_allowed_packet;
+set global join_buffer_size          =@my_join_buffer_size;
+
 #
 # Bug#28580 Repeatation of status variables
 #

=== modified file 'mysys/array.c'
--- a/mysys/array.c	2007-10-11 15:07:40 +0000
+++ b/mysys/array.c	2009-02-13 16:41:47 +0000
@@ -371,7 +371,7 @@ void freeze_size(DYNAMIC_ARRAY *array)
 
 int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element)
 {
-  uint ret;
+  size_t ret;
   if (array->buffer > element)
     return -1;
 

=== modified file 'mysys/base64.c'
--- a/mysys/base64.c	2008-01-15 12:23:14 +0000
+++ b/mysys/base64.c	2009-03-20 14:27:53 +0000
@@ -223,7 +223,7 @@ base64_decode(const char *src_base, size
     The variable 'i' is set to 'len' when padding has been read, so it
     does not actually reflect the number of bytes read from 'src'.
    */
-  return i != len ? -1 : d - dst_base;
+  return i != len ? -1 : (int) (d - dst_base);
 }
 
 

=== modified file 'mysys/charset.c'
--- a/mysys/charset.c	2009-02-02 13:25:42 +0000
+++ b/mysys/charset.c	2009-02-13 16:41:47 +0000
@@ -328,7 +328,7 @@ static my_bool my_read_charset_file(cons
 {
   uchar *buf;
   int  fd;
-  uint len, tmp_len;
+  size_t len, tmp_len;
   MY_STAT stat_info;
   
   if (!my_stat(filename, &stat_info, MYF(myflags)) ||

=== modified file 'mysys/checksum.c'
--- a/mysys/checksum.c	2007-05-10 09:59:39 +0000
+++ b/mysys/checksum.c	2009-02-13 16:41:47 +0000
@@ -36,7 +36,7 @@ ha_checksum my_checksum(ha_checksum crc,
     crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
   return crc;
 #else
-  return (ha_checksum)crc32((uint)crc, pos, length);
+  return (ha_checksum)crc32((uint)crc, pos, (uint)length);
 #endif
 }
 

=== modified file 'mysys/default.c'
--- a/mysys/default.c	2008-10-27 09:57:59 +0000
+++ b/mysys/default.c	2009-03-24 13:58:52 +0000
@@ -152,7 +152,7 @@ static char *remove_end_comment(char *pt
 
 int my_search_option_files(const char *conf_file, int *argc, char ***argv,
                            uint *args_used, Process_option_func func,
-                           void *func_ctx)
+                           void *func_ctx, const char **default_directories)
 {
   const char **dirs, *forced_default_file, *forced_extra_defaults;
   int error= 0;
@@ -183,7 +183,7 @@ int my_search_option_files(const char *c
     /* Handle --defaults-group-suffix= */
     uint i;
     const char **extra_groups;
-    const uint instance_len= strlen(my_defaults_group_suffix); 
+    const size_t instance_len= strlen(my_defaults_group_suffix); 
     struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx;
     char *ptr;
     TYPELIB *group= ctx->group;
@@ -195,12 +195,12 @@ int my_search_option_files(const char *c
     
     for (i= 0; i < group->count; i++)
     {
-      uint len;
+      size_t len;
       extra_groups[i]= group->type_names[i]; /** copy group */
       
       len= strlen(extra_groups[i]);
-      if (!(ptr= alloc_root(ctx->alloc, len+instance_len+1)))
-        DBUG_RETURN(2);
+      if (!(ptr= alloc_root(ctx->alloc, (uint) (len+instance_len+1))))
+       DBUG_RETURN(2);
       
       extra_groups[i+group->count]= ptr;
       
@@ -359,18 +359,46 @@ int get_defaults_options(int argc, char 
   return org_argc - argc;
 }
 
+/*
+  Wrapper around my_load_defaults() for interface compatibility.
+
+  SYNOPSIS
+    load_defaults()
+    conf_file			Basename for configuration file to search for.
+    				If this is a path, then only this file is read.
+    groups			Which [group] entrys to read.
+				Points to an null terminated array of pointers
+    argc			Pointer to argc of original program
+    argv			Pointer to argv of original program
+
+  NOTES
+
+    This function is NOT thread-safe as it uses a global pointer internally.
+    See also notes for my_load_defaults().
+
+  RETURN
+    0 ok
+    1 The given conf_file didn't exists
+*/
+int load_defaults(const char *conf_file, const char **groups,
+                  int *argc, char ***argv)
+{
+  return my_load_defaults(conf_file, groups, argc, argv, &default_directories);
+}
 
 /*
   Read options from configurations files
 
   SYNOPSIS
-    load_defaults()
+    my_load_defaults()
     conf_file			Basename for configuration file to search for.
     				If this is a path, then only this file is read.
     groups			Which [group] entrys to read.
 				Points to an null terminated array of pointers
     argc			Pointer to argc of original program
     argv			Pointer to argv of original program
+    default_directories         Pointer to a location where a pointer to the list
+                                of default directories will be stored
 
   IMPLEMENTATION
 
@@ -386,13 +414,18 @@ int get_defaults_options(int argc, char 
     that was put in *argv
 
    RETURN
-     0	ok
-     1	The given conf_file didn't exists
+     - If successful, 0 is returned. If 'default_directories' is not NULL,
+     a pointer to the array of default directory paths is stored to a location
+     it points to. That stored value must be passed to my_search_option_files()
+     later.
+     
+     - 1 is returned if the given conf_file didn't exist. In this case, the
+     value pointed to by default_directories is undefined.
 */
 
 
-int load_defaults(const char *conf_file, const char **groups,
-                  int *argc, char ***argv)
+int my_load_defaults(const char *conf_file, const char **groups,
+                  int *argc, char ***argv, const char ***default_directories)
 {
   DYNAMIC_ARRAY args;
   TYPELIB group;
@@ -402,10 +435,11 @@ int load_defaults(const char *conf_file,
   MEM_ROOT alloc;
   char *ptr,**res;
   struct handle_option_ctx ctx;
+  const char **dirs;
   DBUG_ENTER("load_defaults");
 
   init_alloc_root(&alloc,512,0);
-  if ((default_directories= init_default_directories(&alloc)) == NULL)
+  if ((dirs= init_default_directories(&alloc)) == NULL)
     goto err;
   /*
     Check if the user doesn't want any default option processing
@@ -426,6 +460,8 @@ int load_defaults(const char *conf_file,
     (*argc)--;
     *argv=res;
     *(MEM_ROOT*) ptr= alloc;			/* Save alloc root for free */
+    if (default_directories)
+      *default_directories= dirs;
     DBUG_RETURN(0);
   }
 
@@ -444,7 +480,8 @@ int load_defaults(const char *conf_file,
   ctx.group= &group;
 
   error= my_search_option_files(conf_file, argc, argv, &args_used,
-                                handle_default_option, (void *) &ctx);
+                                handle_default_option, (void *) &ctx,
+                                dirs);
   /*
     Here error contains <> 0 only if we have a fully specified conf_file
     or a forced default file
@@ -490,6 +527,10 @@ int load_defaults(const char *conf_file,
     puts("");
     exit(0);
   }
+
+  if (error == 0 && default_directories)
+    *default_directories= dirs;
+
   DBUG_RETURN(error);
 
  err:
@@ -895,15 +936,11 @@ void my_print_default_files(const char *
     fputs(conf_file,stdout);
   else
   {
-    /*
-      If default_directories is already initialized, use it.  Otherwise,
-      use a private MEM_ROOT.
-    */
-    const char **dirs = default_directories;
+    const char **dirs;
     MEM_ROOT alloc;
     init_alloc_root(&alloc,512,0);
 
-    if (!dirs && (dirs= init_default_directories(&alloc)) == NULL)
+    if ((dirs= init_default_directories(&alloc)) == NULL)
     {
       fputs("Internal error initializing default directories list", stdout);
     }
@@ -970,7 +1007,7 @@ void print_defaults(const char *conf_fil
 static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs)
 {
   char buf[FN_REFLEN];
-  uint len;
+  size_t len;
   char *p;
   my_bool err __attribute__((unused));
 
@@ -1004,14 +1041,14 @@ static size_t my_get_system_windows_dire
                                              "GetSystemWindowsDirectoryA");
 
   if (func_ptr)
-    return func_ptr(buffer, size);
+    return func_ptr(buffer, (uint) size);
 
   /*
     Windows NT 4.0 Terminal Server Edition:  
     To retrieve the shared Windows directory, call GetSystemDirectory and
     trim the "System32" element from the end of the returned path.
   */
-  count= GetSystemDirectory(buffer, size);
+  count= GetSystemDirectory(buffer, (uint) size);
   if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0)
   {
     count-= 8;
@@ -1090,7 +1127,7 @@ static const char **init_default_directo
   errors += add_directory(alloc, "/etc/mysql/", dirs);
 
 #if defined(DEFAULT_SYSCONFDIR)
-  if (DEFAULT_SYSCONFDIR != "")
+  if (DEFAULT_SYSCONFDIR[0])
     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
 #endif /* DEFAULT_SYSCONFDIR */
 

=== modified file 'mysys/default_modify.c'
--- a/mysys/default_modify.c	2007-07-30 08:33:50 +0000
+++ b/mysys/default_modify.c	2009-02-13 16:41:47 +0000
@@ -68,11 +68,9 @@ int modify_defaults_file(const char *fil
   FILE *cnf_file;
   MY_STAT file_stat;
   char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer;
-  size_t opt_len= 0, optval_len= 0, sect_len;
+  size_t opt_len= 0, optval_len= 0, sect_len, new_opt_len, reserve_extended;
   uint nr_newlines= 0, buffer_size;
   my_bool in_section= FALSE, opt_applied= 0;
-  uint reserve_extended;
-  uint new_opt_len;
   int reserve_occupied= 0;
   DBUG_ENTER("modify_defaults_file");
 

=== modified file 'mysys/hash.c'
--- a/mysys/hash.c	2008-11-10 20:21:49 +0000
+++ b/mysys/hash.c	2009-03-20 11:35:00 +0000
@@ -33,7 +33,7 @@ typedef struct st_hash_info {
   uchar *data;					/* data for current entry */
 } HASH_LINK;
 
-static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength);
+static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength);
 static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
 static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
                    size_t length);
@@ -157,14 +157,14 @@ my_hash_key(const HASH *hash, const ucha
 
 	/* Calculate pos according to keys */
 
-static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength)
+static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength)
 {
   if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1));
   return (hashnr & ((buffmax >> 1) -1));
 }
 
 static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos,
-                             uint buffmax, uint maxlength)
+                             size_t buffmax, size_t maxlength)
 {
   size_t length;
   uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0);
@@ -309,8 +309,7 @@ static int hashcmp(const HASH *hash, HAS
 my_bool my_hash_insert(HASH *info, const uchar *record)
 {
   int flag;
-  size_t idx;
-  uint halfbuff,hash_nr,first_index;
+  size_t idx,halfbuff,hash_nr,first_index;
   uchar *ptr_to_rec,*ptr_to_rec2;
   HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
 
@@ -539,8 +538,8 @@ exit:
 my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
                        size_t old_key_length)
 {
-  uint new_index,new_pos_index,blength,records,empty;
-  size_t idx;
+  uint new_index,new_pos_index,blength,records;
+  size_t idx,empty;
   HASH_LINK org_link,*data,*previous,*pos;
   DBUG_ENTER("my_hash_update");
   

=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c	2008-08-11 22:44:13 +0000
+++ b/mysys/mf_keycache.c	2009-02-13 16:41:47 +0000
@@ -2404,7 +2404,7 @@ static void read_block(KEY_CACHE *keycac
                        BLOCK_LINK *block, uint read_length,
                        uint min_length, my_bool primary)
 {
-  uint got_length;
+  size_t got_length;
 
   /* On entry cache_lock is locked */
 

=== modified file 'mysys/mf_tempdir.c'
--- a/mysys/mf_tempdir.c	2009-02-24 11:29:49 +0000
+++ b/mysys/mf_tempdir.c	2009-03-17 20:29:24 +0000
@@ -47,7 +47,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, c
   }
   do
   {
-    uint length;
+    size_t length;
     end=strcend(pathlist, DELIM);
     strmake(buff, pathlist, (uint) (end-pathlist));
     length= cleanup_dirname(buff, buff);

=== modified file 'mysys/my_append.c'
--- a/mysys/my_append.c	2007-07-30 08:33:50 +0000
+++ b/mysys/my_append.c	2009-02-13 16:41:47 +0000
@@ -36,7 +36,7 @@ struct utimbuf {
 
 int my_append(const char *from, const char *to, myf MyFlags)
 {
-  uint Count;
+  size_t Count;
   File from_file,to_file;
   uchar buff[IO_SIZE];
   DBUG_ENTER("my_append");

=== modified file 'mysys/my_compress.c'
--- a/mysys/my_compress.c	2007-10-11 15:07:40 +0000
+++ b/mysys/my_compress.c	2009-02-13 16:41:47 +0000
@@ -67,7 +67,7 @@ uchar *my_compress_alloc(const uchar *pa
   if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME))))
     return 0;					/* Not enough memory */
 
-  tmp_complen= *complen;
+  tmp_complen= (uint) *complen;
   res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len);
   *complen=    tmp_complen;
 
@@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, siz
     if (!compbuf)
       DBUG_RETURN(1);				/* Not enough memory */
 
-    tmp_complen= *complen;
+    tmp_complen= (uint) *complen;
     error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet,
                       (uLong) len);
     *complen= tmp_complen;

=== modified file 'mysys/my_conio.c'
--- a/mysys/my_conio.c	2007-07-23 17:39:53 +0000
+++ b/mysys/my_conio.c	2009-02-13 16:41:47 +0000
@@ -172,7 +172,7 @@ char* my_cgets(char *buffer, size_t clen
   do
   {
     clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y);
-    if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, &plen_res,
+    if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, (DWORD) clen - 1, &plen_res,
                      NULL))
     {
       result= NULL;

=== modified file 'mysys/my_copy.c'
--- a/mysys/my_copy.c	2007-07-30 08:33:50 +0000
+++ b/mysys/my_copy.c	2009-02-13 16:41:47 +0000
@@ -50,7 +50,7 @@ struct utimbuf {
 
 int my_copy(const char *from, const char *to, myf MyFlags)
 {
-  uint Count;
+  size_t Count;
   my_bool new_file_stat= 0; /* 1 if we could stat "to" */
   int create_flag;
   File from_file,to_file;

=== modified file 'mysys/my_error.c'
--- a/mysys/my_error.c	2009-02-05 06:16:00 +0000
+++ b/mysys/my_error.c	2009-03-17 19:43:00 +0000
@@ -252,11 +252,16 @@ const char **my_error_unregister(int fir
 
 void my_error_unregister_all(void)
 {
-  struct my_err_head    *list, *next;
-  for (list= my_errmsgs_globerrs.meh_next; list; list= next)
+  struct my_err_head *cursor, *saved_next;
+
+  for (cursor= my_errmsgs_globerrs.meh_next; cursor != NULL; cursor= saved_next)
   {
-    next= list->meh_next;
-    my_free((uchar*) list, MYF(0));
+    /* We need this ptr, but we're about to free its container, so save it. */
+    saved_next= cursor->meh_next;
+
+    my_free((uchar*) cursor, MYF(0));
   }
+  my_errmsgs_globerrs.meh_next= NULL;  /* Freed in first iteration above. */
+
   my_errmsgs_list= &my_errmsgs_globerrs;
 }

=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c	2009-02-24 11:29:49 +0000
+++ b/mysys/my_getopt.c	2009-03-17 17:24:35 +0000
@@ -846,7 +846,8 @@ longlong getopt_ll_limit_value(longlong 
   if (num < optp->min_value)
   {
     num= optp->min_value;
-    adjusted= TRUE;
+    if (old < optp->min_value)
+      adjusted= TRUE;
   }
 
   if (fix)
@@ -917,7 +918,8 @@ ulonglong getopt_ull_limit_value(ulonglo
   if (num < (ulonglong) optp->min_value)
   {
     num= (ulonglong) optp->min_value;
-    adjusted= TRUE;
+    if (old < (ulonglong) optp->min_value)
+      adjusted= TRUE;
   }
 
   if (fix)

=== modified file 'mysys/my_getwd.c'
--- a/mysys/my_getwd.c	2007-05-10 09:59:39 +0000
+++ b/mysys/my_getwd.c	2009-02-13 16:41:47 +0000
@@ -55,7 +55,7 @@ int my_getwd(char * buf, size_t size, my
   else
   {
 #if defined(HAVE_GETCWD)
-    if (!getcwd(buf,size-2) && MyFlags & MY_WME)
+    if (!getcwd(buf,(uint) (size-2)) && MyFlags & MY_WME)
     {
       my_errno=errno;
       my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno);

=== modified file 'mysys/my_new.cc'
--- a/mysys/my_new.cc	2006-12-23 19:17:15 +0000
+++ b/mysys/my_new.cc	2009-03-19 20:20:15 +0000
@@ -46,8 +46,9 @@ void operator delete[] (void *ptr) throw
 
 C_MODE_START
 
-int __cxa_pure_virtual() {
-  assert("Pure virtual method called." == "Aborted");
+int __cxa_pure_virtual()
+{
+  assert(! "Aborted: pure virtual method called.");
   return 0;
 }
 

=== modified file 'mysys/my_pread.c'
--- a/mysys/my_pread.c	2009-03-06 09:38:14 +0000
+++ b/mysys/my_pread.c	2009-03-17 20:29:24 +0000
@@ -59,7 +59,7 @@ size_t my_pread(File Filedes, uchar *Buf
     pthread_mutex_lock(&my_file_info[Filedes].mutex);
     readbytes= (uint) -1;
     error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 ||
-	    (readbytes= read(Filedes, Buffer, Count)) != Count);
+	    (readbytes= read(Filedes, Buffer, (uint) Count)) != Count);
     pthread_mutex_unlock(&my_file_info[Filedes].mutex);
 #else
     if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
@@ -136,7 +136,7 @@ size_t my_pwrite(int Filedes, const ucha
     writenbytes= (size_t) -1;
     pthread_mutex_lock(&my_file_info[Filedes].mutex);
     error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 &&
-            (writenbytes = write(Filedes, Buffer, Count)) == Count);
+            (writenbytes = write(Filedes, Buffer, (uint) Count)) == Count);
     pthread_mutex_unlock(&my_file_info[Filedes].mutex);
     if (error)
       break;

=== modified file 'mysys/my_quick.c'
--- a/mysys/my_quick.c	2007-06-21 08:13:10 +0000
+++ b/mysys/my_quick.c	2009-02-13 16:41:47 +0000
@@ -23,7 +23,7 @@ size_t my_quick_read(File Filedes,uchar 
 {
   size_t readbytes;
 
-  if ((readbytes = read(Filedes, Buffer, Count)) != Count)
+  if ((readbytes = read(Filedes, Buffer, (uint) Count)) != Count)
   {
 #ifndef DBUG_OFF
     if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
@@ -50,7 +50,7 @@ size_t my_quick_write(File Filedes,const
 #ifndef DBUG_OFF
        writtenbytes =
 #endif
-       (size_t) write(Filedes,Buffer,Count)) != Count)
+       (size_t) write(Filedes,Buffer, (uint) Count)) != Count)
   {
 #ifndef DBUG_OFF
     if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)

=== modified file 'mysys/my_read.c'
--- a/mysys/my_read.c	2007-05-10 09:59:39 +0000
+++ b/mysys/my_read.c	2009-02-13 16:41:47 +0000
@@ -44,7 +44,7 @@ size_t my_read(File Filedes, uchar *Buff
   for (;;)
   {
     errno= 0;					/* Linux doesn't reset this */
-    if ((readbytes= read(Filedes, Buffer, Count)) != Count)
+    if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count)
     {
       my_errno= errno ? errno : -1;
       DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",

=== modified file 'mysys/string.c'
--- a/mysys/string.c	2007-05-10 09:59:39 +0000
+++ b/mysys/string.c	2009-02-13 16:41:47 +0000
@@ -25,7 +25,7 @@
 my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
 			    size_t init_alloc, size_t alloc_increment)
 {
-  uint length;
+  size_t length;
   DBUG_ENTER("init_dynamic_string");
 
   if (!alloc_increment)
@@ -100,7 +100,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING
   char *new_ptr;
   if (str->length+length >= str->max_length)
   {
-    uint new_length=(str->length+length+str->alloc_increment)/
+    size_t new_length=(str->length+length+str->alloc_increment)/
       str->alloc_increment;
     new_length*=str->alloc_increment;
     if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME))))
@@ -160,12 +160,12 @@ my_bool dynstr_append_os_quoted(DYNAMIC_
     /* Search for quote in each string and replace with escaped quote */
     while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0')
     {
-      ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos);
+      ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
       ret&= dynstr_append_mem(str ,"\\", 1);
       ret&= dynstr_append_mem(str, quote_str, quote_len);
       cur_pos= next_pos + 1;
     }
-    ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos);
+    ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
     append= va_arg(dirty_text, char *);
   }
   va_end(dirty_text);

=== modified file 'scripts/mysqld_safe.sh'
--- a/scripts/mysqld_safe.sh	2007-12-04 01:19:35 +0000
+++ b/scripts/mysqld_safe.sh	2009-03-16 19:28:06 +0000
@@ -18,7 +18,7 @@ niceness=0
 logging=init
 want_syslog=0
 syslog_tag=
-user=@MYSQLD_USER@
+user='@MYSQLD_USER@'
 pid_file=
 err_log=
 
@@ -64,9 +64,10 @@ my_which ()
 {
   save_ifs="${IFS-UNSET}"
   IFS=:
+  ret=0
   for file
   do
-    for dir in $PATH
+    for dir in "$PATH"
     do
       if [ -f "$dir/$file" ]
       then
@@ -74,15 +75,18 @@ my_which ()
         continue 2
       fi
     done
-    return 1  # Failure, didn't find file in path
+
+	ret=1  #signal an error
+	break
   done
+
   if [ "$save_ifs" = UNSET ]
   then
     unset IFS
   else
     IFS="$save_ifs"
   fi
-  return 0  # Success
+  return $ret  # Success
 }
 
 log_generic () {
@@ -212,19 +216,30 @@ fi
 
 MY_PWD=`pwd`
 # Check for the directories we would expect from a binary release install
-if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/mysqld
+if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION"
+then
+  # BASEDIR is already overridden on command line.  Do not re-set.
+
+  # Use BASEDIR to discover le.
+  if test -x "$MY_BASEDIR_VERSION/libexec/mysqld"
+  then
+    ledir="$MY_BASEDIR_VERSION/libexec"
+  else
+    ledir="$MY_BASEDIR_VERSION/bin"
+  fi
+elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/bin/mysqld"
 then
-  MY_BASEDIR_VERSION=$MY_PWD		# Where bin, share and data are
-  ledir=$MY_BASEDIR_VERSION/bin		# Where mysqld is
+  MY_BASEDIR_VERSION="$MY_PWD"		# Where bin, share and data are
+  ledir="$MY_PWD/bin"			# Where mysqld is
 # Check for the directories we would expect from a source install
-elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/mysqld
+elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld"
 then
-  MY_BASEDIR_VERSION=$MY_PWD		# Where libexec, share and var are
-  ledir=$MY_BASEDIR_VERSION/libexec	# Where mysqld is
+  MY_BASEDIR_VERSION="$MY_PWD"		# Where libexec, share and var are
+  ledir="$MY_PWD/libexec"		# Where mysqld is
 # Since we didn't find anything, used the compiled-in defaults
 else
-  MY_BASEDIR_VERSION=@prefix@
-  ledir=@libexecdir@
+  MY_BASEDIR_VERSION='@prefix@'
+  ledir='@libexecdir@'
 fi
 
 
@@ -274,7 +289,10 @@ export MYSQL_HOME
 
 # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
 # and then merge with the command line arguments
-if test -x ./bin/my_print_defaults
+if test -x "$MY_BASEDIR_VERSION/bin/my_print_defaults"
+then
+  print_defaults="$MY_BASEDIR_VERSION/bin/my_print_defaults"
+elif test -x ./bin/my_print_defaults
 then
   print_defaults="./bin/my_print_defaults"
 elif test -x @bindir@/my_print_defaults
@@ -399,7 +417,7 @@ then
   MYSQLD=mysqld
 fi
 
-if test ! -x $ledir/$MYSQLD
+if test ! -x "$ledir/$MYSQLD"
 then
   log_error "The file $ledir/$MYSQLD
 does not exist or is not executable. Please cd to the mysql installation
@@ -411,7 +429,7 @@ fi
 
 if test -z "$pid_file"
 then
-  pid_file=$DATADIR/`@HOSTNAME@`.pid
+  pid_file="$DATADIR/`@HOSTNAME@`.pid"
 else
   case "$pid_file" in
     /* ) ;;

=== modified file 'server-tools/instance-manager/buffer.cc'
--- a/server-tools/instance-manager/buffer.cc	2007-05-10 09:59:39 +0000
+++ b/server-tools/instance-manager/buffer.cc	2009-02-13 16:41:47 +0000
@@ -100,7 +100,7 @@ err:
 
 int Buffer::get_size()
 {
-  return buffer_size;
+  return (uint) buffer_size;
 }
 
 

=== modified file 'server-tools/instance-manager/instance.cc'
--- a/server-tools/instance-manager/instance.cc	2007-07-27 13:39:01 +0000
+++ b/server-tools/instance-manager/instance.cc	2009-02-13 16:41:47 +0000
@@ -163,7 +163,7 @@ static bool start_process(Instance_optio
 
   int cmdlen= 0;
   for (int i= 0; instance_options->argv[i] != 0; i++)
-    cmdlen+= strlen(instance_options->argv[i]) + 3;
+    cmdlen+= (uint) strlen(instance_options->argv[i]) + 3;
   cmdlen++;   /* make room for the null */
 
   char *cmdline= new char[cmdlen];

=== modified file 'server-tools/instance-manager/instance_map.cc'
--- a/server-tools/instance-manager/instance_map.cc	2007-05-10 09:59:39 +0000
+++ b/server-tools/instance-manager/instance_map.cc	2009-03-19 13:42:36 +0000
@@ -536,7 +536,8 @@ int Instance_map::load()
   */
   if (my_search_option_files(Options::Main::config_file, &argc,
                              (char ***) &argv, &args_used,
-                             process_option, (void*) this))
+                             process_option, (void*) this,
+                             Options::default_directories))
     log_info("Falling back to compiled-in defaults.");
 
   return complete_initialization();

=== modified file 'server-tools/instance-manager/options.cc'
--- a/server-tools/instance-manager/options.cc	2007-05-10 09:59:39 +0000
+++ b/server-tools/instance-manager/options.cc	2009-03-19 13:42:36 +0000
@@ -86,6 +86,7 @@ const char *Options::Main::bind_address=
 uint Options::Main::monitoring_interval= DEFAULT_MONITORING_INTERVAL;
 uint Options::Main::port_number= DEFAULT_PORT;
 my_bool Options::Main::mysqld_safe_compatible= FALSE;
+const char **Options::default_directories= NULL;
 
 /* Options::User_management */
 
@@ -103,7 +104,7 @@ const char *Options::Debug::config_str= 
 #endif
 
 static const char * const ANGEL_PID_FILE_SUFFIX= ".angel.pid";
-static const int ANGEL_PID_FILE_SUFFIX_LEN= strlen(ANGEL_PID_FILE_SUFFIX);
+static const int ANGEL_PID_FILE_SUFFIX_LEN= (uint) strlen(ANGEL_PID_FILE_SUFFIX);
 
 /*
   List of options, accepted by the instance manager.
@@ -439,7 +440,8 @@ int Options::load(int argc, char **argv)
   log_info("Loading config file '%s'...",
            (const char *) Main::config_file);
 
-  load_defaults(Main::config_file, default_groups, &argc, &saved_argv);
+  my_load_defaults(Main::config_file, default_groups, &argc,
+                   &saved_argv, &default_directories);
 
   if ((handle_options(&argc, &saved_argv, my_long_options, get_one_option)))
     return ERR_INVALID_USAGE;

=== modified file 'server-tools/instance-manager/options.h'
--- a/server-tools/instance-manager/options.h	2007-01-27 01:46:45 +0000
+++ b/server-tools/instance-manager/options.h	2009-02-27 09:26:06 +0000
@@ -91,6 +91,9 @@ struct Options
 #endif
 
 public:
+  /* Array of paths to be passed to my_search_option_files() later */
+  static const char **default_directories;
+
   static int load(int argc, char **argv);
   static void cleanup();
 

=== modified file 'server-tools/instance-manager/parse.h'
--- a/server-tools/instance-manager/parse.h	2007-05-10 09:59:39 +0000
+++ b/server-tools/instance-manager/parse.h	2009-02-13 16:41:47 +0000
@@ -206,7 +206,7 @@ inline void get_word(const char **text, 
     break;
   }
 
-  *word_len= word_end - *text;
+  *word_len= (uint) (word_end - *text);
 }
 
 #endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H */

=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2008-03-29 08:02:54 +0000
+++ b/sql-common/client.c	2009-03-19 13:42:36 +0000
@@ -1021,7 +1021,7 @@ void mysql_read_default_options(struct s
   argc=1; argv=argv_buff; argv_buff[0]= (char*) "client";
   groups[0]= (char*) "client"; groups[1]= (char*) group; groups[2]=0;
 
-  load_defaults(filename, groups, &argc, &argv);
+  my_load_defaults(filename, groups, &argc, &argv, NULL);
   if (argc != 1)				/* If some default option */
   {
     char **option=argv;
@@ -3183,7 +3183,7 @@ int STDCALL mysql_set_character_set(MYSQ
     if (mysql_get_server_version(mysql) < 40100)
       return 0;
     sprintf(buff, "SET NAMES %s", cs_name);
-    if (!mysql_real_query(mysql, buff, strlen(buff)))
+    if (!mysql_real_query(mysql, buff, (uint) strlen(buff)))
     {
       mysql->charset= cs;
     }

=== modified file 'sql-common/my_user.c'
--- a/sql-common/my_user.c	2008-02-07 10:47:39 +0000
+++ b/sql-common/my_user.c	2009-02-13 16:41:47 +0000
@@ -44,8 +44,8 @@ void parse_user(const char *user_id_str,
   }
   else
   {
-    *user_name_len= p - user_id_str;
-    *host_name_len= user_id_len - *user_name_len - 1;
+    *user_name_len= (uint) (p - user_id_str);
+    *host_name_len= (uint) (user_id_len - *user_name_len - 1);
 
     if (*user_name_len > USERNAME_LENGTH)
       *user_name_len= USERNAME_LENGTH;

=== modified file 'sql/event_data_objects.cc'
--- a/sql/event_data_objects.cc	2008-07-15 01:43:12 +0000
+++ b/sql/event_data_objects.cc	2009-02-13 16:41:47 +0000
@@ -380,7 +380,7 @@ bool
 Event_job_data::load_from_row(THD *thd, TABLE *table)
 {
   char *ptr;
-  uint len;
+  size_t len;
   LEX_STRING tz_name;
 
   DBUG_ENTER("Event_job_data::load_from_row");
@@ -580,7 +580,7 @@ bool
 Event_timed::load_from_row(THD *thd, TABLE *table)
 {
   char *ptr;
-  uint len;
+  size_t len;
 
   DBUG_ENTER("Event_timed::load_from_row");
 

=== modified file 'sql/event_parse_data.cc'
--- a/sql/event_parse_data.cc	2008-11-10 20:21:49 +0000
+++ b/sql/event_parse_data.cc	2009-02-13 16:41:47 +0000
@@ -527,8 +527,8 @@ Event_parse_data::init_definer(THD *thd)
 
   const char *definer_user= thd->lex->definer->user.str;
   const char *definer_host= thd->lex->definer->host.str;
-  int definer_user_len= thd->lex->definer->user.length;
-  int definer_host_len= thd->lex->definer->host.length;
+  size_t  definer_user_len= thd->lex->definer->user.length;
+  size_t  definer_host_len= thd->lex->definer->host.length;
 
   DBUG_PRINT("info",("init definer_user thd->mem_root: 0x%lx  "
                      "definer_user: 0x%lx", (long) thd->mem_root,

=== modified file 'sql/events.cc'
--- a/sql/events.cc	2008-07-15 17:46:02 +0000
+++ b/sql/events.cc	2009-02-13 16:41:47 +0000
@@ -694,7 +694,7 @@ send_show_create_event(THD *thd, Event_t
                                                          &sql_mode))
     DBUG_RETURN(TRUE);
 
-  field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length));
+  field_list.push_back(new Item_empty_string("sql_mode", (uint) sql_mode.length));
 
   tz_name= et->time_zone->get_name();
 

=== modified file 'sql/gen_lex_hash.cc'
--- a/sql/gen_lex_hash.cc	2008-11-14 16:29:38 +0000
+++ b/sql/gen_lex_hash.cc	2009-02-13 16:41:47 +0000
@@ -204,7 +204,7 @@ void insert_symbols()
   for (cur= symbols; i<array_elements(symbols); cur++, i++){
     hash_lex_struct *root= 
       get_hash_struct_by_len(&root_by_len,cur->length,&max_len);
-    insert_into_hash(root,cur->name,0,i,0);
+    insert_into_hash(root,cur->name,0,(uint) i,0);
   }
 }
 
@@ -516,7 +516,7 @@ static SYMBOL *get_hash_symbol(const cha
           res= symbols+ires;\n\
         else\n\
           res= sql_functions-ires-1;\n\
-        register uint count= cur_str-s;\n\
+		  register uint count= (uint) (cur_str - s);\n\
         return lex_casecmp(cur_str,res->name+count,len-count) ? 0 : res;\n\
       }\n\
 \n\
@@ -545,7 +545,7 @@ static SYMBOL *get_hash_symbol(const cha
         register int16 ires= (int16)(cur_struct>>16);\n\
         if (ires==array_elements(symbols)) return 0;\n\
         register SYMBOL *res= symbols+ires;\n\
-        register uint count= cur_str-s;\n\
+		register uint count= (uint) (cur_str - s);\n\
         return lex_casecmp(cur_str,res->name+count,len-count)!=0 ? 0 : res;\n\
       }\n\
 \n\

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2009-02-20 09:50:50 +0000
+++ b/sql/item.cc	2009-03-24 13:58:52 +0000
@@ -1531,7 +1531,8 @@ bool DTCollation::aggregate(DTCollation 
     else
     {
       // Cannot apply conversion
-      set(0, DERIVATION_NONE, 0);
+      set(&my_charset_bin, DERIVATION_NONE,
+          (dt.repertoire|repertoire));
       return 1;
     }
   }
@@ -1614,15 +1615,31 @@ bool agg_item_collations(DTCollation &c,
 {
   uint i;
   Item **arg;
+  bool unknown_cs= 0;
+
   c.set(av[0]->collation);
   for (i= 1, arg= &av[item_sep]; i < count; i++, arg++)
   {
     if (c.aggregate((*arg)->collation, flags))
     {
+      if (c.derivation == DERIVATION_NONE &&
+          c.collation == &my_charset_bin)
+      {
+        unknown_cs= 1;
+        continue;
+      }
       my_coll_agg_error(av, count, fname, item_sep);
       return TRUE;
     }
   }
+
+  if (unknown_cs &&
+      c.derivation != DERIVATION_EXPLICIT)
+  {
+    my_coll_agg_error(av, count, fname, item_sep);
+    return TRUE;
+  }
+
   if ((flags & MY_COLL_DISALLOW_NONE) &&
       c.derivation == DERIVATION_NONE)
   {

=== modified file 'sql/item.h'
--- a/sql/item.h	2009-05-08 09:57:18 +0000
+++ b/sql/item.h	2009-05-08 14:43:21 +0000
@@ -1095,7 +1095,7 @@ inline void Item_sp_variable::make_field
   if (name)
     it->set_name(name, (uint) strlen(name), system_charset_info);
   else
-    it->set_name(m_name.str, m_name.length, system_charset_info);
+    it->set_name(m_name.str, (uint) m_name.length, system_charset_info);
   it->make_field(field);
 }
 

=== modified file 'sql/item_create.cc'
--- a/sql/item_create.cc	2008-04-11 03:27:24 +0000
+++ b/sql/item_create.cc	2009-03-24 18:27:33 +0000
@@ -3791,6 +3791,7 @@ Create_func_load_file Create_func_load_f
 Item*
 Create_func_load_file::create(THD *thd, Item *arg1)
 {
+  thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
   return new (thd->mem_root) Item_load_file(arg1);
 }

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-05-08 09:57:18 +0000
+++ b/sql/item_func.cc	2009-05-08 14:43:21 +0000
@@ -2739,7 +2739,7 @@ longlong Item_func_find_in_set::val_int(
           if (is_last_item && !is_separator)
             str_end= substr_end;
           if (!my_strnncoll(cs, (const uchar *) str_begin,
-                            str_end - str_begin,
+                            (uint) (str_end - str_begin),
                             find_str, find_str_len))
             return (longlong) position;
           else
@@ -4833,7 +4833,7 @@ Item_func_get_system_var(sys_var *var_ar
   component(*component_arg), cache_present(0)
 {
   /* set_name() will allocate the name */
-  set_name(name_arg, name_len_arg, system_charset_info);
+  set_name(name_arg, (uint) name_len_arg, system_charset_info);
 }
 
 

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2009-03-11 16:13:42 +0000
+++ b/sql/item_strfunc.cc	2009-03-24 13:58:52 +0000
@@ -1827,17 +1827,17 @@ bool Item_func_user::init(const char *us
   if (user)
   {
     CHARSET_INFO *cs= str_value.charset();
-    uint res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen;
+    size_t res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen;
 
-    if (str_value.alloc(res_length))
+    if (str_value.alloc((uint) res_length))
     {
       null_value=1;
       return TRUE;
     }
 
-    res_length=cs->cset->snprintf(cs, (char*)str_value.ptr(), res_length,
+    res_length=cs->cset->snprintf(cs, (char*)str_value.ptr(), (uint) res_length,
                                   "%s@%s", user, host);
-    str_value.length(res_length);
+    str_value.length((uint) res_length);
     str_value.mark_as_const();
   }
   return FALSE;
@@ -2541,7 +2541,7 @@ String *Item_func_rpad::val_str(String *
     memcpy(to,ptr_pad,(size_t) pad_byte_length);
     to+= pad_byte_length;
   }
-  res->length(to- (char*) res->ptr());
+  res->length((uint) (to- (char*) res->ptr()));
   return (res);
 
  err:
@@ -2809,7 +2809,7 @@ String *Item_func_charset::val_str(Strin
 
   CHARSET_INFO *cs= args[0]->collation.collation; 
   null_value= 0;
-  str->copy(cs->csname, strlen(cs->csname),
+  str->copy(cs->csname, (uint) strlen(cs->csname),
 	    &my_charset_latin1, collation.collation, &dummy_errors);
   return str;
 }
@@ -2821,7 +2821,7 @@ String *Item_func_collation::val_str(Str
   CHARSET_INFO *cs= args[0]->collation.collation; 
 
   null_value= 0;
-  str->copy(cs->name, strlen(cs->name),
+  str->copy(cs->name, (uint) strlen(cs->name),
 	    &my_charset_latin1, collation.collation, &dummy_errors);
   return str;
 }

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2008-12-23 14:21:01 +0000
+++ b/sql/item_timefunc.cc	2009-02-13 16:41:47 +0000
@@ -391,7 +391,7 @@ static bool extract_date_time(DATE_TIME_
 	if (tmp - val > 6)
 	  tmp= (char*) val + 6;
 	l_time->second_part= (int) my_strtoll10(val, &tmp, &error);
-	frac_part= 6 - (tmp - val);
+	frac_part= 6 - (uint) (tmp - val);
 	if (frac_part > 0)
 	  l_time->second_part*= (ulong) log_10_int[frac_part];
 	val= tmp;
@@ -642,14 +642,14 @@ bool make_date_time(DATE_TIME_FORMAT *fo
         if (!l_time->month)
           return 1;
         str->append(locale->month_names->type_names[l_time->month-1],
-                    strlen(locale->month_names->type_names[l_time->month-1]),
+                    (uint) strlen(locale->month_names->type_names[l_time->month-1]),
                     system_charset_info);
         break;
       case 'b':
         if (!l_time->month)
           return 1;
         str->append(locale->ab_month_names->type_names[l_time->month-1],
-                    strlen(locale->ab_month_names->type_names[l_time->month-1]),
+                    (uint) strlen(locale->ab_month_names->type_names[l_time->month-1]),
                     system_charset_info);
         break;
       case 'W':
@@ -658,7 +658,7 @@ bool make_date_time(DATE_TIME_FORMAT *fo
         weekday= calc_weekday(calc_daynr(l_time->year,l_time->month,
                               l_time->day),0);
         str->append(locale->day_names->type_names[weekday],
-                    strlen(locale->day_names->type_names[weekday]),
+                    (uint) strlen(locale->day_names->type_names[weekday]),
                     system_charset_info);
         break;
       case 'a':
@@ -667,13 +667,13 @@ bool make_date_time(DATE_TIME_FORMAT *fo
         weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
                              l_time->day),0);
         str->append(locale->ab_day_names->type_names[weekday],
-                    strlen(locale->ab_day_names->type_names[weekday]),
+                    (uint) strlen(locale->ab_day_names->type_names[weekday]),
                     system_charset_info);
         break;
       case 'D':
 	if (type == MYSQL_TIMESTAMP_TIME)
 	  return 1;
-	length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	if (l_time->day >= 10 &&  l_time->day <= 19)
 	  str->append(STRING_WITH_LEN("th"));
@@ -696,62 +696,62 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	}
 	break;
       case 'Y':
-	length= int10_to_str(l_time->year, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->year, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 4, '0');
 	break;
       case 'y':
-	length= int10_to_str(l_time->year%100, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->year%100, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'm':
-	length= int10_to_str(l_time->month, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->month, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'c':
-	length= int10_to_str(l_time->month, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->month, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	break;
       case 'd':
-	length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'e':
-	length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	break;
       case 'f':
-	length= int10_to_str(l_time->second_part, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->second_part, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 6, '0');
 	break;
       case 'H':
-	length= int10_to_str(l_time->hour, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->hour, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'h':
       case 'I':
 	hours_i= (l_time->hour%24 + 11)%12+1;
-	length= int10_to_str(hours_i, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(hours_i, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'i':					/* minutes */
-	length= int10_to_str(l_time->minute, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->minute, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'j':
 	if (type == MYSQL_TIMESTAMP_TIME)
 	  return 1;
-	length= int10_to_str(calc_daynr(l_time->year,l_time->month,
+	length= (uint) (int10_to_str(calc_daynr(l_time->year,l_time->month,
 					l_time->day) - 
-		     calc_daynr(l_time->year,1,1) + 1, intbuff, 10) - intbuff;
+		     calc_daynr(l_time->year,1,1) + 1, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 3, '0');
 	break;
       case 'k':
-	length= int10_to_str(l_time->hour, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->hour, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	break;
       case 'l':
 	hours_i= (l_time->hour%24 + 11)%12+1;
-	length= int10_to_str(hours_i, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(hours_i, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	break;
       case 'p':
@@ -770,7 +770,7 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	break;
       case 'S':
       case 's':
-	length= int10_to_str(l_time->second, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(l_time->second, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'T':
@@ -788,11 +788,11 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	uint year;
 	if (type == MYSQL_TIMESTAMP_TIME)
 	  return 1;
-	length= int10_to_str(calc_week(l_time,
+	length= (uint) (int10_to_str(calc_week(l_time,
 				       (*ptr) == 'U' ?
 				       WEEK_FIRST_WEEKDAY : WEEK_MONDAY_FIRST,
 				       &year),
-			     intbuff, 10) - intbuff;
+			     intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
       }
       break;
@@ -802,12 +802,12 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	uint year;
 	if (type == MYSQL_TIMESTAMP_TIME)
 	  return 1;
-	length= int10_to_str(calc_week(l_time,
+	length= (uint) (int10_to_str(calc_week(l_time,
 				       ((*ptr) == 'V' ?
 					(WEEK_YEAR | WEEK_FIRST_WEEKDAY) :
 					(WEEK_YEAR | WEEK_MONDAY_FIRST)),
 				       &year),
-			     intbuff, 10) - intbuff;
+			     intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 2, '0');
       }
       break;
@@ -822,7 +822,7 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 			  WEEK_YEAR | WEEK_FIRST_WEEKDAY :
 			  WEEK_YEAR | WEEK_MONDAY_FIRST),
 			 &year);
-	length= int10_to_str(year, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(year, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 4, '0');
       }
       break;
@@ -831,7 +831,7 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	  return 1;
 	weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
 					l_time->day),1);
-	length= int10_to_str(weekday, intbuff, 10) - intbuff;
+	length= (uint) (int10_to_str(weekday, intbuff, 10) - intbuff);
 	str->append_with_prefill(intbuff, length, 1, '0');
 	break;
 
@@ -881,7 +881,7 @@ static bool get_interval_info(const char
       value= value*LL(10) + (longlong) (*str - '0');
     if (transform_msec && i == count - 1) // microseconds always last
     {
-      long msec_length= 6 - (str - start);
+      long msec_length= 6 - (uint) (str - start);
       if (msec_length > 0)
 	value*= (long) log_10_int[msec_length];
     }
@@ -1060,7 +1060,7 @@ String* Item_func_monthname::val_str(Str
   }
   null_value=0;
   month_name= locale->month_names->type_names[month-1];
-  str->copy(month_name, strlen(month_name), &my_charset_utf8_bin,
+  str->copy(month_name, (uint) strlen(month_name), &my_charset_utf8_bin,
 	    collation.collation, &err);
   return str;
 }
@@ -1210,7 +1210,7 @@ String* Item_func_dayname::val_str(Strin
     return (String*) 0;
   
   day_name= locale->day_names->type_names[weekday];
-  str->copy(day_name, strlen(day_name), &my_charset_utf8_bin,
+  str->copy(day_name, (uint) strlen(day_name), &my_charset_utf8_bin,
 	    collation.collation, &err);
   return str;
 }
@@ -3176,14 +3176,14 @@ String *Item_func_get_format::val_str(St
        format++)
   {
     uint format_name_len;
-    format_name_len= strlen(format_name);
+    format_name_len= (uint) strlen(format_name);
     if (val_len == format_name_len &&
 	!my_strnncoll(&my_charset_latin1, 
 		      (const uchar *) val->ptr(), val_len, 
 		      (const uchar *) format_name, val_len))
     {
       const char *format_str= get_date_time_format_str(format, type);
-      str->set(format_str, strlen(format_str), &my_charset_bin);
+      str->set(format_str, (uint) strlen(format_str), &my_charset_bin);
       return str;
     }
   }

=== modified file 'sql/lock.cc'
--- a/sql/lock.cc	2008-11-10 20:21:49 +0000
+++ b/sql/lock.cc	2009-02-13 16:41:47 +0000
@@ -461,7 +461,7 @@ void mysql_unlock_read_tables(THD *thd, 
   for (i= 0; i < sql_lock->table_count; i++)
   {
     TABLE *tbl= *table;
-    tbl->lock_position= table - sql_lock->table;
+    tbl->lock_position= (uint) (table - sql_lock->table);
     tbl->lock_data_start= found;
     found+= tbl->lock_count;
     table++;
@@ -862,7 +862,7 @@ static MYSQL_LOCK *get_lock_data(THD *th
       {
 	my_error(ER_OPEN_AS_READONLY,MYF(0),table->alias);
         /* Clear the lock type of the lock data that are stored already. */
-        sql_lock->lock_count= locks - sql_lock->locks;
+        sql_lock->lock_count= (uint) (locks - sql_lock->locks);
         reset_lock_data(sql_lock);
 	my_free((uchar*) sql_lock,MYF(0));
 	DBUG_RETURN(0);

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2009-05-08 09:57:18 +0000
+++ b/sql/log_event.cc	2009-05-08 14:43:21 +0000
@@ -382,7 +382,7 @@ static void cleanup_load_tmpdir()
   uint i;
   char fname[FN_REFLEN], prefbuf[31], *p;
 
-  if (!(dirp=my_dir(slave_load_tmpdir,MYF(MY_WME))))
+  if (!(dirp=my_dir(slave_load_tmpdir,MYF(0))))
     return;
 
   /* 
@@ -1280,7 +1280,7 @@ void Log_event::print_header(IO_CACHE* f
       char emit_buf[256];               // Enough for storing one line
       my_b_printf(file, "# Position  Timestamp   Type   Master ID        "
                   "Size      Master Pos    Flags \n");
-      int const bytes_written=
+      size_t const bytes_written=
         my_snprintf(emit_buf, sizeof(emit_buf),
                     "# %8.8lx %02x %02x %02x %02x   %02x   "
                     "%02x %02x %02x %02x   %02x %02x %02x %02x   "
@@ -1289,7 +1289,6 @@ void Log_event::print_header(IO_CACHE* f
                     ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6],
                     ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13],
                     ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
-      DBUG_ASSERT(bytes_written >= 0);
       DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
       my_b_write(file, (uchar*) emit_buf, bytes_written);
       ptr += LOG_EVENT_MINIMAL_HEADER_LEN;
@@ -1315,12 +1314,11 @@ void Log_event::print_header(IO_CACHE* f
           TODO: Rewrite my_b_printf() to support full printf() syntax.
          */
         char emit_buf[256];
-        int const bytes_written=
+        size_t const bytes_written=
           my_snprintf(emit_buf, sizeof(emit_buf),
                       "# %8.8lx %-48.48s |%16s|\n",
                       (unsigned long) (hexdump_from + (i & 0xfffffff0)),
                       hex_string, char_string);
-        DBUG_ASSERT(bytes_written >= 0);
         DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
 	my_b_write(file, (uchar*) emit_buf, bytes_written);
 	hex_string[0]= 0;
@@ -1335,12 +1333,11 @@ void Log_event::print_header(IO_CACHE* f
     if (hex_string[0])
     {
       char emit_buf[256];
-      int const bytes_written=
+      size_t const bytes_written=
         my_snprintf(emit_buf, sizeof(emit_buf),
                     "# %8.8lx %-48.48s |%s|\n",
                     (unsigned long) (hexdump_from + (i & 0xfffffff0)),
                     hex_string, char_string);
-      DBUG_ASSERT(bytes_written >= 0);
       DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
       my_b_write(file, (uchar*) emit_buf, bytes_written);
     }
@@ -1628,7 +1625,7 @@ beg:
 
   case MYSQL_TYPE_DATETIME:
     {
-      uint d, t;
+      size_t d, t;
       uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
       d= i64 / 1000000;
       t= i64 % 1000000;
@@ -4198,7 +4195,7 @@ int Load_log_event::copy_log_event(const
   table_name  = fields + field_block_len;
   db = table_name + table_name_len + 1;
   fname = db + db_len + 1;
-  fname_len = strlen(fname);
+  fname_len = (uint) strlen(fname);
   // null termination is accomplished by the caller doing buf[event_len]=0
 
   DBUG_RETURN(0);
@@ -5697,7 +5694,7 @@ void Slave_log_event::init_from_mem_pool
   master_pos = uint8korr(mem_pool + SL_MASTER_POS_OFFSET);
   master_port = uint2korr(mem_pool + SL_MASTER_PORT_OFFSET);
   master_host = mem_pool + SL_MASTER_HOST_OFFSET;
-  master_host_len = strlen(master_host);
+  master_host_len = (uint) strlen(master_host);
   // safety
   master_log = master_host + master_host_len + 1;
   if (master_log > mem_pool + data_size)
@@ -5705,7 +5702,7 @@ void Slave_log_event::init_from_mem_pool
     master_host = 0;
     return;
   }
-  master_log_len = strlen(master_log);
+  master_log_len = (uint) strlen(master_log);
 }
 
 
@@ -6178,6 +6175,12 @@ int Append_block_log_event::do_apply_eve
   thd_proc_info(thd, proc_info);
   if (get_create_or_append())
   {
+    /*
+      Usually lex_start() is called by mysql_parse(), but we need it here
+      as the present method does not call mysql_parse().
+    */
+    lex_start(thd);
+    mysql_reset_thd_for_next_command(thd);
     my_delete(fname, MYF(0)); // old copy may exist already
     if ((fd= my_create(fname, CREATE_MODE,
 		       O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
@@ -6197,6 +6200,10 @@ int Append_block_log_event::do_apply_eve
                 get_type_str(), fname);
     goto err;
   }
+
+  DBUG_EXECUTE_IF("remove_slave_load_file_before_write", 
+                  my_close(fd,MYF(0)); fd= -1; my_delete(fname, MYF(0)););
+
   if (my_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP)))
   {
     rli->report(ERROR_LEVEL, my_errno,
@@ -6618,7 +6625,7 @@ void Execute_load_query_log_event::print
     my_b_printf(&cache, "\'");
     if (dup_handling == LOAD_DUP_REPLACE)
       my_b_printf(&cache, " REPLACE");
-    my_b_printf(&cache, " INTO");
+    my_b_printf(&cache, " INTO ");
     my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
     my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
   }
@@ -6699,7 +6706,7 @@ Execute_load_query_log_event::do_apply_e
     /* Ordinary load data */
     break;
   }
-  p= strmake(p, STRING_WITH_LEN(" INTO"));
+  p= strmake(p, STRING_WITH_LEN(" INTO "));
   p= strmake(p, query+fn_pos_end, q_len-fn_pos_end);
 
   error= Query_log_event::do_apply_event(rli, buf, p-buf);
@@ -6986,8 +6993,8 @@ int Rows_log_event::get_data_size()
 {
   int const type_code= get_type_code();
 
-  uchar buf[sizeof(m_width)+1];
-  uchar *end= net_store_length(buf, (m_width + 7) / 8);
+  uchar buf[sizeof(m_width) + 1];
+  uchar *end= net_store_length(buf, m_width);
 
   DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
                   return 6 + no_bytes_in_map(&m_cols) + (end - buf) +
@@ -6995,12 +7002,12 @@ int Rows_log_event::get_data_size()
                   (m_rows_cur - m_rows_buf););
   int data_size= ROWS_HEADER_LEN;
   data_size+= no_bytes_in_map(&m_cols);
-  data_size+= end - buf;
+  data_size+= (uint) (end - buf);
 
   if (type_code == UPDATE_ROWS_EVENT)
     data_size+= no_bytes_in_map(&m_cols_ai);
 
-  data_size+= (m_rows_cur - m_rows_buf);
+  data_size+= (uint) (m_rows_cur - m_rows_buf);
   return data_size; 
 }
 
@@ -7600,7 +7607,7 @@ bool Rows_log_event::write_data_body(IO_
      Note that this should be the number of *bits*, not the number of
      bytes.
   */
-  uchar sbuf[sizeof(m_width)];
+  uchar sbuf[sizeof(m_width) + 1];
   my_ptrdiff_t const data_size= m_rows_cur - m_rows_buf;
   bool res= false;
   uchar *const sbuf_end= net_store_length(sbuf, (size_t) m_width);
@@ -7762,6 +7769,8 @@ Table_map_log_event::Table_map_log_event
     m_null_bits(0),
     m_meta_memory(NULL)
 {
+  uchar cbuf[sizeof(m_colcnt) + 1];
+  uchar *cbuf_end;
   DBUG_ASSERT(m_table_id != ~0UL);
   /*
     In TABLE_SHARE, "db" and "table_name" are 0-terminated (see this comment in
@@ -7778,7 +7787,9 @@ Table_map_log_event::Table_map_log_event
   DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", m_data_size= 6;);
   m_data_size+= m_dblen + 2;	// Include length and terminating \0
   m_data_size+= m_tbllen + 2;	// Include length and terminating \0
-  m_data_size+= 1 + m_colcnt;	// COLCNT and column types
+  cbuf_end= net_store_length(cbuf, (size_t) m_colcnt);
+  DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
+  m_data_size+= (cbuf_end - cbuf) + m_colcnt;	// COLCNT and column types
 
   /* If malloc fails, caught in is_valid() */
   if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME))))
@@ -7917,7 +7928,7 @@ Table_map_log_event::Table_map_log_event
     memcpy(m_coltype, ptr_after_colcnt, m_colcnt);
 
     ptr_after_colcnt= ptr_after_colcnt + m_colcnt;
-    bytes_read= ptr_after_colcnt - (uchar *)buf;
+    bytes_read= (uint) (ptr_after_colcnt - (uchar *)buf);
     DBUG_PRINT("info", ("Bytes read: %d.\n", bytes_read));
     if (bytes_read < event_len)
     {
@@ -8070,7 +8081,7 @@ bool Table_map_log_event::write_data_bod
   uchar const dbuf[]= { (uchar) m_dblen };
   uchar const tbuf[]= { (uchar) m_tbllen };
 
-  uchar cbuf[sizeof(m_colcnt)];
+  uchar cbuf[sizeof(m_colcnt) + 1];
   uchar *const cbuf_end= net_store_length(cbuf, (size_t) m_colcnt);
   DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
 
@@ -9308,7 +9319,7 @@ bool
 Incident_log_event::write_data_body(IO_CACHE *file)
 {
   DBUG_ENTER("Incident_log_event::write_data_body");
-  DBUG_RETURN(write_str(file, m_message.str, m_message.length));
+  DBUG_RETURN(write_str(file, m_message.str, (uint) m_message.length));
 }
 
 

=== modified file 'sql/log_event.h'
--- a/sql/log_event.h	2009-05-08 09:57:18 +0000
+++ b/sql/log_event.h	2009-05-08 14:43:21 +0000
@@ -3316,7 +3316,7 @@ public:
   virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; }
   virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ }
 
-  virtual int get_data_size() { return m_data_size; } 
+  virtual int get_data_size() { return (uint) m_data_size; } 
 #ifndef MYSQL_CLIENT
   virtual int save_field_metadata();
   virtual bool write_data_header(IO_CACHE *file);
@@ -3899,7 +3899,7 @@ public:
     return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
   }
   virtual int get_data_size() {
-    return INCIDENT_HEADER_LEN + 1 + m_message.length;
+    return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length;
   }
 
 private:

=== modified file 'sql/log_event_old.cc'
--- a/sql/log_event_old.cc	2008-10-20 18:50:08 +0000
+++ b/sql/log_event_old.cc	2009-02-13 16:41:47 +0000
@@ -1382,9 +1382,9 @@ int Old_rows_log_event::get_data_size()
                   (m_rows_cur - m_rows_buf););
   int data_size= ROWS_HEADER_LEN;
   data_size+= no_bytes_in_map(&m_cols);
-  data_size+= end - buf;
+  data_size+= (uint) (end - buf);
 
-  data_size+= (m_rows_cur - m_rows_buf);
+  data_size+= (uint) (m_rows_cur - m_rows_buf);
   return data_size;
 }
 

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2009-05-08 09:57:18 +0000
+++ b/sql/mysql_priv.h	2009-05-08 14:43:21 +0000
@@ -539,6 +539,20 @@ enum open_table_mode
 #define MODE_NO_ENGINE_SUBSTITUTION     (MODE_HIGH_NOT_PRECEDENCE*2)
 #define MODE_PAD_CHAR_TO_FULL_LENGTH    (ULL(1) << 31)
 
+/* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */
+#define OPTIMIZER_SWITCH_INDEX_MERGE 1
+#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION 2
+#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION 4
+#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT 8
+#define OPTIMIZER_SWITCH_LAST 16
+
+/* The following must be kept in sync with optimizer_switch_str in mysqld.cc */
+#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
+                                  OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
+                                  OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
+                                  OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT)
+
+
 /*
   Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
   use strictly more than 64 bits by adding one more define above, you should
@@ -1844,6 +1858,10 @@ extern enum_field_types agg_field_type(I
 /* strfunc.cc */
 ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
 		   char **err_pos, uint *err_len, bool *set_warning);
+ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
+                              ulonglong cur_set, ulonglong default_set,
+                              const char *str, uint length, CHARSET_INFO *cs,
+                              char **err_pos, uint *err_len, bool *set_warning);
 uint find_type(const TYPELIB *lib, const char *find, uint length,
                bool part_match);
 uint find_type2(const TYPELIB *lib, const char *find, uint length,

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-05-08 09:57:18 +0000
+++ b/sql/mysqld.cc	2009-05-08 14:43:21 +0000
@@ -299,6 +299,25 @@ static const unsigned int sql_mode_names
 TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
 			    sql_mode_names,
                             (unsigned int *)sql_mode_names_len };
+
+static const char *optimizer_switch_names[]=
+{
+  "index_merge","index_merge_union","index_merge_sort_union", 
+  "index_merge_intersection", "default", NullS
+};
+/* Corresponding defines are named OPTIMIZER_SWITCH_XXX */
+static const unsigned int optimizer_switch_names_len[]=
+{
+  sizeof("index_merge") - 1,
+  sizeof("index_merge_union") - 1,
+  sizeof("index_merge_sort_union") - 1,
+  sizeof("index_merge_intersection") - 1,
+  sizeof("default") - 1
+};
+TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"",
+                                    optimizer_switch_names,
+                                    (unsigned int *)optimizer_switch_names_len };
+
 static const char *tc_heuristic_recover_names[]=
 {
   "COMMIT", "ROLLBACK", NullS
@@ -364,6 +383,10 @@ static ulong max_used_connections;
 static ulong my_bind_addr;			/**< the address we bind to */
 static volatile ulong cached_thread_count= 0;
 static const char *sql_mode_str= "OFF";
+/* Text representation for OPTIMIZER_SWITCH_DEFAULT */
+static const char *optimizer_switch_str="index_merge=on,index_merge_union=on,"
+                                        "index_merge_sort_union=on,"
+                                        "index_merge_intersection=on";
 static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
 static char *opt_init_slave, *language_ptr, *opt_init_connect;
 static char *default_character_set_name;
@@ -5588,6 +5611,7 @@ enum options_mysqld
   OPT_SYSDATE_IS_NOW,
   OPT_OPTIMIZER_SEARCH_DEPTH,
   OPT_OPTIMIZER_PRUNE_LEVEL,
+  OPT_OPTIMIZER_SWITCH,
   OPT_UPDATABLE_VIEWS_WITH_LIMIT,
   OPT_SP_AUTOMATIC_PRIVILEGES,
   OPT_MAX_SP_RECURSION_DEPTH,
@@ -6780,6 +6804,13 @@ The minimum value for this variable is 4
    (uchar**) &global_system_variables.optimizer_search_depth,
    (uchar**) &max_system_variables.optimizer_search_depth,
    0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
+  {"optimizer_switch", OPT_OPTIMIZER_SWITCH,
+   "optimizer_switch=option=val[,option=val...], where option={index_merge, "
+   "index_merge_union, index_merge_sort_union, index_merge_intersection} and "
+   "val={on, off, default}.",
+   (uchar**) &optimizer_switch_str, (uchar**) &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, 
+   /*OPTIMIZER_SWITCH_DEFAULT*/0,
+   0, 0, 0, 0, 0},
   {"plugin_dir", OPT_PLUGIN_DIR,
    "Directory for plugins.",
    (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
@@ -7691,7 +7722,8 @@ static int mysql_init_variables(void)
     when collecting index statistics for MyISAM tables.
   */
   global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
-
+  
+  global_system_variables.optimizer_switch= OPTIMIZER_SWITCH_DEFAULT;
   /* Variables that depends on compile options */
 #ifndef DBUG_OFF
   default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
@@ -8286,6 +8318,29 @@ mysqld_get_one_option(int optid,
 						   sql_mode);
     break;
   }
+  case OPT_OPTIMIZER_SWITCH:
+  {
+    bool not_used;
+    char *error= 0;
+    uint error_len= 0;
+    optimizer_switch_str= argument;
+    global_system_variables.optimizer_switch=
+      (ulong)find_set_from_flags(&optimizer_switch_typelib, 
+                                 optimizer_switch_typelib.count, 
+                                 global_system_variables.optimizer_switch,
+                                 global_system_variables.optimizer_switch,
+                                 argument, strlen(argument), NULL,
+                                 &error, &error_len, &not_used);
+     if (error)
+     {
+       char buf[512];
+       char *cbuf= buf;
+       cbuf += my_snprintf(buf, 512, "Error in parsing optimizer_switch setting near %*s\n", error_len, error);
+       sql_perror(buf);
+       return 1;
+     }
+    break;
+  }
   case OPT_ONE_THREAD:
     global_system_variables.thread_handling=
       SCHEDULER_ONE_THREAD_PER_CONNECTION;

=== modified file 'sql/net_serv.cc'
--- a/sql/net_serv.cc	2008-03-28 18:20:21 +0000
+++ b/sql/net_serv.cc	2009-02-13 16:41:47 +0000
@@ -249,7 +249,7 @@ static int net_data_is_ready(my_socket s
 
   tv.tv_sec= tv.tv_usec= 0;
 
-  if ((res= select(sd+1, &sfds, NULL, NULL, &tv)) < 0)
+  if ((res= select((int) (sd + 1), &sfds, NULL, NULL, &tv)) < 0)
     return 0;
   else
     return test(res ? FD_ISSET(sd, &sfds) : 0);
@@ -429,7 +429,7 @@ net_write_command(NET *net,uchar command
 		  const uchar *header, size_t head_len,
 		  const uchar *packet, size_t len)
 {
-  ulong length=len+1+head_len;			/* 1 extra byte for command */
+  size_t length=len+1+head_len;			/* 1 extra byte for command */
   uchar buff[NET_HEADER_SIZE+1];
   uint header_size=NET_HEADER_SIZE+1;
   DBUG_ENTER("net_write_command");
@@ -495,7 +495,7 @@ net_write_buff(NET *net, const uchar *pa
 {
   ulong left_length;
   if (net->compress && net->max_packet > MAX_PACKET_LENGTH)
-    left_length= MAX_PACKET_LENGTH - (net->write_pos - net->buff);
+    left_length= (ulong) (MAX_PACKET_LENGTH - (net->write_pos - net->buff));
   else
     left_length= (ulong) (net->buff_end - net->write_pos);
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2009-02-27 15:07:27 +0000
+++ b/sql/opt_range.cc	2009-03-24 13:58:52 +0000
@@ -2386,7 +2386,8 @@ int SQL_SELECT::test_quick_select(THD *t
           objects are not allowed so don't use ROR-intersection for
           table deletes.
         */
-        if ((thd->lex->sql_command != SQLCOM_DELETE))
+        if ((thd->lex->sql_command != SQLCOM_DELETE) && 
+             optimizer_flag(thd, OPTIMIZER_SWITCH_INDEX_MERGE))
         {
           /*
             Get best non-covering ROR-intersection plan and prepare data for
@@ -2410,25 +2411,28 @@ int SQL_SELECT::test_quick_select(THD *t
       }
       else
       {
-        /* Try creating index_merge/ROR-union scan. */
-        SEL_IMERGE *imerge;
-        TABLE_READ_PLAN *best_conj_trp= NULL, *new_conj_trp;
-        LINT_INIT(new_conj_trp); /* no empty index_merge lists possible */
-        DBUG_PRINT("info",("No range reads possible,"
-                           " trying to construct index_merge"));
-        List_iterator_fast<SEL_IMERGE> it(tree->merges);
-        while ((imerge= it++))
+        if (optimizer_flag(thd, OPTIMIZER_SWITCH_INDEX_MERGE))
         {
-          new_conj_trp= get_best_disjunct_quick(&param, imerge, best_read_time);
-          if (new_conj_trp)
-            set_if_smaller(param.table->quick_condition_rows, 
-                           new_conj_trp->records);
-          if (!best_conj_trp || (new_conj_trp && new_conj_trp->read_cost <
-                                 best_conj_trp->read_cost))
-            best_conj_trp= new_conj_trp;
+          /* Try creating index_merge/ROR-union scan. */
+          SEL_IMERGE *imerge;
+          TABLE_READ_PLAN *best_conj_trp= NULL, *new_conj_trp;
+          LINT_INIT(new_conj_trp); /* no empty index_merge lists possible */
+          DBUG_PRINT("info",("No range reads possible,"
+                             " trying to construct index_merge"));
+          List_iterator_fast<SEL_IMERGE> it(tree->merges);
+          while ((imerge= it++))
+          {
+            new_conj_trp= get_best_disjunct_quick(&param, imerge, best_read_time);
+            if (new_conj_trp)
+              set_if_smaller(param.table->quick_condition_rows, 
+                             new_conj_trp->records);
+            if (!best_conj_trp || (new_conj_trp && new_conj_trp->read_cost <
+                                   best_conj_trp->read_cost))
+              best_conj_trp= new_conj_trp;
+          }
+          if (best_conj_trp)
+            best_trp= best_conj_trp;
         }
-        if (best_conj_trp)
-          best_trp= best_conj_trp;
       }
     }
 
@@ -3767,11 +3771,19 @@ TABLE_READ_PLAN *get_best_disjunct_quick
                         "full table scan, bailing out"));
     DBUG_RETURN(NULL);
   }
-  if (all_scans_rors)
+
+  /* 
+    If all scans happen to be ROR, proceed to generate a ROR-union plan (it's 
+    guaranteed to be cheaper than non-ROR union), unless ROR-unions are
+    disabled in @@optimizer_switch
+  */
+  if (all_scans_rors && 
+      optimizer_flag(param->thd, OPTIMIZER_SWITCH_INDEX_MERGE_UNION))
   {
     roru_read_plans= (TABLE_READ_PLAN**)range_scans;
     goto skip_to_ror_scan;
   }
+
   if (cpk_scan)
   {
     /*
@@ -3785,8 +3797,11 @@ TABLE_READ_PLAN *get_best_disjunct_quick
   imerge_cost += get_sweep_read_cost(param, non_cpk_scan_records);
   DBUG_PRINT("info",("index_merge cost with rowid-to-row scan: %g",
                      imerge_cost));
-  if (imerge_cost > read_time)
+  if (imerge_cost > read_time || 
+      !optimizer_flag(param->thd, OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION))
+  {
     goto build_ror_index_merge;
+  }
 
   /* Add Unique operations cost */
   unique_calc_buff_size=
@@ -3822,7 +3837,9 @@ TABLE_READ_PLAN *get_best_disjunct_quick
   }
 
 build_ror_index_merge:
-  if (!all_scans_ror_able || param->thd->lex->sql_command == SQLCOM_DELETE)
+  if (!all_scans_ror_able || 
+      param->thd->lex->sql_command == SQLCOM_DELETE ||
+      !optimizer_flag(param->thd, OPTIMIZER_SWITCH_INDEX_MERGE_UNION))
     DBUG_RETURN(imerge_trp);
 
   /* Ok, it is possible to build a ROR-union, try it. */
@@ -4495,7 +4512,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersec
   double min_cost= DBL_MAX;
   DBUG_ENTER("get_best_ror_intersect");
 
-  if ((tree->n_ror_scans < 2) || !param->table->file->stats.records)
+  if ((tree->n_ror_scans < 2) || !param->table->file->stats.records ||
+      !optimizer_flag(param->thd, OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT))
     DBUG_RETURN(NULL);
 
   /*
@@ -4685,6 +4703,9 @@ TRP_ROR_INTERSECT *get_best_covering_ror
   ROR_SCAN_INFO **ror_scans_end= tree->ror_scans_end;
   DBUG_ENTER("get_best_covering_ror_intersect");
 
+  if (!optimizer_flag(param->thd, OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT))
+    DBUG_RETURN(NULL);
+
   for (ROR_SCAN_INFO **scan= tree->ror_scans; scan != ror_scans_end; ++scan)
     (*scan)->key_components=
       param->table->key_info[(*scan)->keynr].key_parts;
@@ -9473,7 +9494,7 @@ get_best_group_min_max(PARAM *param, SEL
     }
 
     /* If we got to this point, cur_index_info passes the test. */
-    key_infix_parts= cur_key_infix_len ?
+    key_infix_parts= cur_key_infix_len ? (uint) 
                      (first_non_infix_part - first_non_group_part) : 0;
     cur_used_key_parts= cur_group_key_parts + key_infix_parts;
 

=== modified file 'sql/rpl_utility.h'
--- a/sql/rpl_utility.h	2008-09-01 12:28:57 +0000
+++ b/sql/rpl_utility.h	2009-05-08 14:43:21 +0000
@@ -294,12 +294,14 @@ namespace {
 }
 #endif
 
+// NB. number of printed bit values is limited to sizeof(buf) - 1
 #define DBUG_PRINT_BITSET(N,FRM,BS)                \
   do {                                             \
     char buf[256];                                 \
-    for (uint i = 0 ; i < (BS)->n_bits ; ++i)      \
+    uint i;                                        \
+    for (i = 0 ; i < min(sizeof(buf) - 1, (BS)->n_bits) ; i++) \
       buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
-    buf[(BS)->n_bits] = '\0';                      \
+    buf[i] = '\0';                                 \
     DBUG_PRINT((N), ((FRM), buf));                 \
   } while (0)
 

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2009-05-08 09:57:18 +0000
+++ b/sql/set_var.cc	2009-05-08 14:43:21 +0000
@@ -468,6 +468,8 @@ static sys_var_thd_ulong        sys_opti
                                                   &SV::optimizer_prune_level);
 static sys_var_thd_ulong        sys_optimizer_search_depth(&vars, "optimizer_search_depth",
                                                    &SV::optimizer_search_depth);
+static sys_var_thd_optimizer_switch   sys_optimizer_switch(&vars, "optimizer_switch",
+                                     &SV::optimizer_switch);
 static sys_var_const            sys_pid_file(&vars, "pid_file",
                                              OPT_GLOBAL, SHOW_CHAR,
                                              (uchar*) pidfile_name);
@@ -3926,6 +3928,97 @@ ulong fix_sql_mode(ulong sql_mode)
 }
 
 
+bool
+sys_var_thd_optimizer_switch::
+symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
+{
+  char buff[STRING_BUFFER_USUAL_SIZE*8];
+  String tmp(buff, sizeof(buff), &my_charset_latin1);
+  int i;
+  ulonglong bit;
+  tmp.length(0);
+ 
+  for (i= 0, bit=1; bit != OPTIMIZER_SWITCH_LAST; i++, bit= bit << 1)
+  {
+    tmp.append(optimizer_switch_typelib.type_names[i],
+               optimizer_switch_typelib.type_lengths[i]);
+    tmp.append('=');
+    tmp.append((val & bit)? "on":"off");
+    tmp.append(',');
+  }
+
+  if (tmp.length())
+    tmp.length(tmp.length() - 1); /* trim the trailing comma */
+
+  rep->str= thd->strmake(tmp.ptr(), tmp.length());
+
+  rep->length= rep->str ? tmp.length() : 0;
+
+  return rep->length != tmp.length();
+}
+
+
+uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
+				               LEX_STRING *base)
+{
+  LEX_STRING opts;
+  ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
+                  thd->variables.*offset);
+  (void) symbolic_mode_representation(thd, val, &opts);
+  return (uchar *) opts.str;
+}
+
+
+/*
+  Check (and actually parse) string representation of @@optimizer_switch.
+*/
+
+bool sys_var_thd_optimizer_switch::check(THD *thd, set_var *var)
+{
+  bool not_used;
+  char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
+  uint error_len= 0;
+  String str(buff, sizeof(buff), system_charset_info), *res;
+
+  if (!(res= var->value->val_str(&str)))
+  {
+    strmov(buff, "NULL");
+    goto err;
+  }
+  
+  if (res->length() == 0)
+  {
+    buff[0]= 0;
+    goto err;
+  }
+
+  var->save_result.ulong_value= 
+    (ulong)find_set_from_flags(&optimizer_switch_typelib, 
+                               optimizer_switch_typelib.count, 
+                               thd->variables.optimizer_switch,
+                               global_system_variables.optimizer_switch,
+                               res->c_ptr_safe(), res->length(), NULL,
+                               &error, &error_len, &not_used);
+  if (error_len)
+  {
+    strmake(buff, error, min(sizeof(buff) - 1, error_len));
+    goto err;
+  }
+  return FALSE;
+err:
+  my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff);
+  return TRUE;
+}
+
+
+void sys_var_thd_optimizer_switch::set_default(THD *thd, enum_var_type type)
+{
+  if (type == OPT_GLOBAL)
+    global_system_variables.*offset= OPTIMIZER_SWITCH_DEFAULT;
+  else
+    thd->variables.*offset= global_system_variables.*offset;
+}
+
 /****************************************************************************
   Named list handling
 ****************************************************************************/

=== modified file 'sql/set_var.h'
--- a/sql/set_var.h	2008-12-02 11:21:05 +0000
+++ b/sql/set_var.h	2009-03-14 18:58:23 +0000
@@ -31,7 +31,7 @@ typedef struct system_variables SV;
 typedef struct my_locale_st MY_LOCALE;
 
 extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib,
-  slave_exec_mode_typelib;
+  optimizer_switch_typelib, slave_exec_mode_typelib;
 
 typedef int (*sys_check_func)(THD *,  set_var *);
 typedef bool (*sys_update_func)(THD *, set_var *);
@@ -532,6 +532,20 @@ public:
 };
 
 
+class sys_var_thd_optimizer_switch :public sys_var_thd_enum
+{
+public:
+  sys_var_thd_optimizer_switch(sys_var_chain *chain, const char *name_arg, 
+                               ulong SV::*offset_arg)
+    :sys_var_thd_enum(chain, name_arg, offset_arg, &optimizer_switch_typelib)
+  {}
+  bool check(THD *thd, set_var *var);
+  void set_default(THD *thd, enum_var_type type);
+  uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+  static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode,
+                                           LEX_STRING *rep);
+};
+
 extern void fix_sql_mode_var(THD *thd, enum_var_type type);
 
 class sys_var_thd_sql_mode :public sys_var_thd_enum

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-02-17 09:46:09 +0000
+++ b/sql/slave.cc	2009-05-08 14:43:21 +0000
@@ -2632,6 +2632,41 @@ err:
   DBUG_RETURN(0);                               // Can't return anything here
 }
 
+/*
+  Check the temporary directory used by commands like
+  LOAD DATA INFILE.
+ */
+static 
+int check_temp_dir(char* tmp_dir, char *tmp_file)
+{
+  int fd;
+  MY_DIR *dirp;
+
+  DBUG_ENTER("check_temp_dir");
+
+  /*
+    Check if the directory exists.
+   */
+  if (!(dirp=my_dir(tmp_dir,MYF(MY_WME))))
+    DBUG_RETURN(1);
+  my_dirend(dirp);
+
+  /*
+    Check permissions to create a file.
+   */
+  if ((fd= my_create(tmp_file, CREATE_MODE,
+                     O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
+                     MYF(MY_WME))) < 0)
+  DBUG_RETURN(1);
+
+  /*
+    Clean up.
+   */
+  my_close(fd, MYF(0));
+  my_delete(tmp_file, MYF(0));
+
+  DBUG_RETURN(0);
+}
 
 /**
   Slave SQL thread entry point.
@@ -2763,6 +2798,14 @@ log '%s' at position %s, relay log '%s' 
                     llstr(rli->group_master_log_pos,llbuff),rli->group_relay_log_name,
                     llstr(rli->group_relay_log_pos,llbuff1));
 
+  if (check_temp_dir(slave_load_tmpdir, rli->slave_patternload_file))
+  {
+    rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), 
+                "Unable to use slave's temporary directory %s - %s", 
+                slave_load_tmpdir, thd->main_da.message());
+    goto err;
+  }
+
   /* execute init_slave variable */
   if (sys_init_slave.value_length)
   {

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2009-02-01 21:05:19 +0000
+++ b/sql/sp_head.cc	2009-05-08 14:43:21 +0000
@@ -956,6 +956,8 @@ subst_spvars(THD *thd, sp_instr *instr, 
   qbuf.length(0);
   cur= query_str->str;
   prev_pos= res= 0;
+  thd->query_name_consts= 0;
+  
   for (Item_splocal **splocal= sp_vars_uses.front(); 
        splocal < sp_vars_uses.back(); splocal++)
   {
@@ -989,6 +991,8 @@ subst_spvars(THD *thd, sp_instr *instr, 
     res|= qbuf.append(')');
     if (res)
       break;
+      
+    thd->query_name_consts++;
   }
   res|= qbuf.append(cur + prev_pos, query_str->length - prev_pos);
   if (res)
@@ -2855,6 +2859,7 @@ sp_instr_stmt::execute(THD *thd, uint *n
       *nextp= m_ip+1;
     thd->query= query;
     thd->query_length= query_length;
+    thd->query_name_consts= 0;
 
     if (!thd->is_error())
       thd->main_da.reset_diagnostics_area();

=== modified file 'sql/sp_head.h'
--- a/sql/sp_head.h	2008-07-07 21:53:20 +0000
+++ b/sql/sp_head.h	2009-02-13 16:41:47 +0000
@@ -367,7 +367,7 @@ public:
   char *name(uint *lenp = 0) const
   {
     if (lenp)
-      *lenp= m_name.length;
+      *lenp= (uint) m_name.length;
     return m_name.str;
   }
 

=== modified file 'sql/spatial.h'
--- a/sql/spatial.h	2008-12-16 12:12:22 +0000
+++ b/sql/spatial.h	2009-02-13 16:41:47 +0000
@@ -281,7 +281,7 @@ public:
                                    uint32 len, String *res);
   int as_wkt(String *wkt, const char **end)
   {
-    uint32 len= get_class_info()->m_name.length;
+    uint32 len= (uint) get_class_info()->m_name.length;
     if (wkt->reserve(len + 2, 512))
       return 1;
     wkt->qs_append(get_class_info()->m_name.str, len);

=== modified file 'sql/sql_cache.cc'
--- a/sql/sql_cache.cc	2009-03-09 11:15:46 +0000
+++ b/sql/sql_cache.cc	2009-03-24 13:58:52 +0000
@@ -1114,7 +1114,7 @@ def_week_frmt: %lu, in_trans: %d, autoco
     {
       memcpy(thd->query+thd->query_length+1, thd->db, thd->db_length);
       DBUG_PRINT("qcache", ("database: %s  length: %u",
-			    thd->db, thd->db_length)); 
+			    thd->db, (unsigned) thd->db_length)); 
     }
     else
     {
@@ -1307,7 +1307,7 @@ Query_cache::send_result_to_client(THD *
   {
     memcpy(sql+query_length+1, thd->db, thd->db_length);
     DBUG_PRINT("qcache", ("database: '%s'  length: %u",
-			  thd->db, thd->db_length));
+			  thd->db, (unsigned)thd->db_length));
   }
   else
   {

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_class.cc	2009-05-08 14:43:21 +0000
@@ -599,6 +599,7 @@ THD::THD()
   one_shot_set= 0;
   file_id = 0;
   query_id= 0;
+  query_name_consts= 0;
   warn_id= 0;
   db_charset= global_system_variables.collation_database;
   bzero(ha_data, sizeof(ha_data));
@@ -2305,7 +2306,7 @@ void Query_arena::set_query_arena(Query_
 
 void Query_arena::cleanup_stmt()
 {
-  DBUG_ASSERT("Query_arena::cleanup_stmt()" == "not implemented");
+  DBUG_ASSERT(! "Query_arena::cleanup_stmt() not implemented");
 }
 
 /*
@@ -2807,6 +2808,14 @@ Security_context::restore_security_conte
 }
 #endif
 
+
+bool Security_context::user_matches(Security_context *them)
+{
+  return ((user != NULL) && (them->user != NULL) &&
+          !strcmp(user, them->user));
+}
+
+
 /****************************************************************************
   Handling of open and locked tables states.
 

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2009-03-05 19:01:46 +0000
+++ b/sql/sql_class.h	2009-03-25 19:41:16 +0000
@@ -321,6 +321,8 @@ struct system_variables
   ulong net_write_timeout;
   ulong optimizer_prune_level;
   ulong optimizer_search_depth;
+  /* A bitmap for switching optimizations on/off */
+  ulong optimizer_switch;
   ulong preload_buff_size;
   ulong profiling_history_size;
   ulong query_cache_type;
@@ -664,7 +666,7 @@ public:
   */
 
   char *db;
-  uint db_length;
+  size_t db_length;
 
 public:
 
@@ -811,6 +813,7 @@ public:
   void
   restore_security_context(THD *thd, Security_context *backup);
 #endif
+  bool user_matches(Security_context *);
 };
 
 
@@ -1772,6 +1775,9 @@ public:
   sp_cache   *sp_proc_cache;
   sp_cache   *sp_func_cache;
 
+  /** number of name_const() substitutions, see sp_head.cc:subst_spvars() */
+  uint       query_name_consts;
+
   /*
     If we do a purge of binary logs, log index info of the threads
     that are currently reading it needs to be adjusted. To do that

=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc	2008-03-28 08:41:52 +0000
+++ b/sql/sql_connect.cc	2009-02-13 16:41:47 +0000
@@ -54,7 +54,7 @@ static int get_or_create_user_conn(THD *
 				   USER_RESOURCES *mqh)
 {
   int return_val= 0;
-  uint temp_len, user_len;
+  size_t temp_len, user_len;
   char temp_user[USER_HOST_BUFF_SIZE];
   struct  user_conn *uc;
 

=== modified file 'sql/sql_crypt.cc'
--- a/sql/sql_crypt.cc	2006-12-31 00:32:21 +0000
+++ b/sql/sql_crypt.cc	2009-02-13 16:41:47 +0000
@@ -31,7 +31,7 @@
 SQL_CRYPT::SQL_CRYPT(const char *password)
 {
   ulong rand_nr[2];
-  hash_password(rand_nr,password, strlen(password));
+  hash_password(rand_nr,password, (uint) strlen(password));
   crypt_init(rand_nr);
 }
 

=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc	2009-02-05 06:16:00 +0000
+++ b/sql/sql_error.cc	2009-02-13 16:41:47 +0000
@@ -251,7 +251,7 @@ bool mysqld_show_warnings(THD *thd, ulon
     protocol->store(warning_level_names[err->level].str,
 		    warning_level_names[err->level].length, system_charset_info);
     protocol->store((uint32) err->code);
-    protocol->store(err->msg, strlen(err->msg), system_charset_info);
+    protocol->store(err->msg, (uint) strlen(err->msg), system_charset_info);
     if (protocol->write())
       DBUG_RETURN(TRUE);
   }

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2009-02-19 21:09:35 +0000
+++ b/sql/sql_insert.cc	2009-03-27 14:27:35 +0000
@@ -1654,11 +1654,12 @@ public:
   ulong auto_increment_offset;
   timestamp_auto_set_type timestamp_field_type;
   LEX_STRING query;
+  Time_zone *time_zone;
 
   delayed_row(LEX_STRING const query_arg, enum_duplicates dup_arg,
               bool ignore_arg, bool log_query_arg)
     : record(0), dup(dup_arg), ignore(ignore_arg), log_query(log_query_arg),
-      forced_insert_id(0), query(query_arg)
+      forced_insert_id(0), query(query_arg), time_zone(0)
     {}
   ~delayed_row()
   {
@@ -1879,7 +1880,7 @@ bool delayed_get_table(THD *thd, TABLE_L
       pthread_mutex_lock(&LOCK_thread_count);
       thread_count++;
       pthread_mutex_unlock(&LOCK_thread_count);
-      di->thd.set_db(table_list->db, strlen(table_list->db));
+      di->thd.set_db(table_list->db, (uint) strlen(table_list->db));
       di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME));
       if (di->thd.db == NULL || di->thd.query == NULL)
       {
@@ -2147,6 +2148,19 @@ int write_delayed(THD *thd, TABLE *table
     thd->first_successful_insert_id_in_prev_stmt;
   row->timestamp_field_type=    table->timestamp_field_type;
 
+  /* Add session variable timezone
+     Time_zone object will not be freed even the thread is ended.
+     So we can get time_zone object from thread which handling delayed statement.
+     See the comment of my_tz_find() for detail.
+  */
+  if (thd->time_zone_used)
+  {
+    row->time_zone = thd->variables.time_zone;
+  }
+  else
+  {
+    row->time_zone = NULL;
+  }
   /* Copy session variables. */
   row->auto_increment_increment= thd->variables.auto_increment_increment;
   row->auto_increment_offset=    thd->variables.auto_increment_offset;
@@ -2645,6 +2659,14 @@ bool Delayed_insert::handle_inserts(void
 
     if (log_query && mysql_bin_log.is_open())
     {
+      bool backup_time_zone_used = thd.time_zone_used;
+      Time_zone *backup_time_zone = thd.variables.time_zone;
+      if (row->time_zone != NULL)
+      {
+        thd.time_zone_used = true;
+        thd.variables.time_zone = row->time_zone;
+      }
+
       /*
         If the query has several rows to insert, only the first row will come
         here. In row-based binlogging, this means that the first row will be
@@ -2656,6 +2678,9 @@ bool Delayed_insert::handle_inserts(void
       thd.binlog_query(THD::ROW_QUERY_TYPE,
                        row->query.str, row->query.length,
                        FALSE, FALSE);
+
+      thd.time_zone_used = backup_time_zone_used;
+      thd.variables.time_zone = backup_time_zone;
     }
 
     if (table->s->blob_fields)

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_lex.cc	2009-05-08 14:43:21 +0000
@@ -253,7 +253,7 @@ void Lex_input_stream::body_utf8_append_
   {
     thd->convert_string(&utf_txt,
                         &my_charset_utf8_general_ci,
-                        txt->str, txt->length,
+                        txt->str, (uint) txt->length,
                         txt_cs);
   }
   else
@@ -435,7 +435,7 @@ bool is_keyword(const char *name, uint l
 bool is_lex_native_function(const LEX_STRING *name)
 {
   DBUG_ASSERT(name != NULL);
-  return (get_hash_symbol(name->str, name->length, 1) != 0);
+  return (get_hash_symbol(name->str, (uint) name->length, 1) != 0);
 }
 
 /* make a copy of token before ptr and set yytoklen */
@@ -1074,7 +1074,7 @@ int MYSQLlex(void *arg, void *yythd)
       if (c != '.')
       {					// Found complete integer number.
         yylval->lex_str=get_token(lip, 0, lip->yyLength());
-	return int_token(yylval->lex_str.str,yylval->lex_str.length);
+	return int_token(yylval->lex_str.str, (uint) yylval->lex_str.length);
       }
       // fall through
     case MY_LEX_REAL:			// Incomplete real number
@@ -1978,8 +1978,8 @@ void st_select_lex::print_order(String *
     if (order->counter_used)
     {
       char buffer[20];
-      uint length= my_snprintf(buffer, 20, "%d", order->counter);
-      str->append(buffer, length);
+      size_t length= my_snprintf(buffer, 20, "%d", order->counter);
+      str->append(buffer, (uint) length);
     }
     else
       (*order->item)->print(str, query_type);

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2009-05-08 09:57:18 +0000
+++ b/sql/sql_lex.h	2009-05-08 14:43:21 +0000
@@ -1368,7 +1368,7 @@ public:
   /** Get the utf8-body length. */
   uint get_body_utf8_length()
   {
-    return m_body_utf8_ptr - m_body_utf8;
+    return (uint) (m_body_utf8_ptr - m_body_utf8);
   }
 
   void body_utf8_start(THD *thd, const char *begin_ptr);

=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc	2009-02-21 09:36:07 +0000
+++ b/sql/sql_load.cc	2009-03-17 20:29:24 +0000
@@ -557,8 +557,8 @@ static bool write_execute_load_query_log
 {
   Execute_load_query_log_event
     e(thd, thd->query, thd->query_length,
-      (char*)thd->lex->fname_start - (char*)thd->query,
-      (char*)thd->lex->fname_end - (char*)thd->query,
+      (uint) ((char*)thd->lex->fname_start - (char*)thd->query),
+      (uint) ((char*)thd->lex->fname_end - (char*)thd->query),
       (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
       (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
       transactional_table, FALSE, killed_err_arg);

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_parse.cc	2009-05-08 14:43:21 +0000
@@ -2559,6 +2559,43 @@ mysql_execute_command(THD *thd)
       select_result *result;
       Ha_global_schema_lock_guard global_schema_lock_guard(thd);
 
+      /*
+        If:
+        a) we inside an SP and there was NAME_CONST substitution,
+        b) binlogging is on (STMT mode),
+        c) we log the SP as separate statements
+        raise a warning, as it may cause problems
+        (see 'NAME_CONST issues' in 'Binary Logging of Stored Programs')
+       */
+      if (thd->query_name_consts && 
+          mysql_bin_log.is_open() &&
+          thd->variables.binlog_format == BINLOG_FORMAT_STMT &&
+          !mysql_bin_log.is_query_in_union(thd, thd->query_id))
+      {
+        List_iterator_fast<Item> it(select_lex->item_list);
+        Item *item;
+        uint splocal_refs= 0;
+        /* Count SP local vars in the top-level SELECT list */
+        while ((item= it++))
+        {
+          if (item->is_splocal())
+            splocal_refs++;
+        }
+        /*
+          If it differs from number of NAME_CONST substitution applied,
+          we may have a SOME_FUNC(NAME_CONST()) in the SELECT list,
+          that may cause a problem with binary log (see BUG#35383),
+          raise a warning. 
+        */
+        if (splocal_refs != thd->query_name_consts)
+          push_warning(thd, 
+                       MYSQL_ERROR::WARN_LEVEL_WARN,
+                       ER_UNKNOWN_ERROR,
+"Invoked routine ran a statement that may cause problems with "
+"binary log, see 'NAME_CONST issues' in 'Binary Logging of Stored Programs' "
+"section of the manual.");
+      }
+      
       select_lex->options|= SELECT_NO_UNLOCK;
       unit->set_limit(select_lex);
 
@@ -4132,9 +4169,32 @@ end_with_restore_list:
 
     res= (sp_result= lex->sphead->create(thd));
     switch (sp_result) {
-    case SP_OK:
+    case SP_OK: {
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
       /* only add privileges if really neccessary */
+
+      Security_context security_context;
+      bool restore_backup_context= false;
+      Security_context *backup= NULL;
+      LEX_USER *definer= thd->lex->definer;
+      /*
+        Check if the definer exists on slave, 
+        then use definer privilege to insert routine privileges to mysql.procs_priv.
+
+        For current user of SQL thread has GLOBAL_ACL privilege, 
+        which doesn't any check routine privileges, 
+        so no routine privilege record  will insert into mysql.procs_priv.
+      */
+      if (thd->slave_thread && is_acl_user(definer->host.str, definer->user.str))
+      {
+        security_context.change_security_context(thd, 
+                                                 &thd->lex->definer->user,
+                                                 &thd->lex->definer->host,
+                                                 &thd->lex->sphead->m_db,
+                                                 &backup);
+        restore_backup_context= true;
+      }
+
       if (sp_automatic_privileges && !opt_noacl &&
           check_routine_access(thd, DEFAULT_CREATE_PROC_ACLS,
                                lex->sphead->m_db.str, name,
@@ -4146,8 +4206,19 @@ end_with_restore_list:
                        ER_PROC_AUTO_GRANT_FAIL,
                        ER(ER_PROC_AUTO_GRANT_FAIL));
       }
+
+      /*
+        Restore current user with GLOBAL_ACL privilege of SQL thread
+      */ 
+      if (restore_backup_context)
+      {
+        DBUG_ASSERT(thd->slave_thread == 1);
+        thd->security_ctx->restore_security_context(thd, backup);
+      }
+
 #endif
     break;
+    }
     case SP_WRITE_ROW_FAILED:
       my_error(ER_SP_ALREADY_EXISTS, MYF(0), SP_TYPE_STRING(lex), name);
     break;
@@ -6862,8 +6933,26 @@ uint kill_one_thread(THD *thd, ulong id,
   VOID(pthread_mutex_unlock(&LOCK_thread_count));
   if (tmp)
   {
+
+    /*
+      If we're SUPER, we can KILL anything, including system-threads.
+      No further checks.
+
+      KILLer: thd->security_ctx->user could in theory be NULL while
+      we're still in "unauthenticated" state. This is a theoretical
+      case (the code suggests this could happen, so we play it safe).
+
+      KILLee: tmp->security_ctx->user will be NULL for system threads.
+      We need to check so Jane Random User doesn't crash the server
+      when trying to kill a) system threads or b) unauthenticated users'
+      threads (Bug#43748).
+
+      If user of both killer and killee are non-NULL, proceed with
+      slayage if both are string-equal.
+    */
+
     if ((thd->security_ctx->master_access & SUPER_ACL) ||
-	!strcmp(thd->security_ctx->user, tmp->security_ctx->user))
+        thd->security_ctx->user_matches(tmp->security_ctx))
     {
       tmp->awake(only_kill_query ? THD::KILL_QUERY : THD::KILL_CONNECTION);
       error=0;

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-03-13 08:51:25 +0000
+++ b/sql/sql_plugin.cc	2009-03-16 10:37:13 +0000
@@ -1652,7 +1652,7 @@ bool mysql_install_plugin(THD *thd, cons
   pthread_mutex_lock(&LOCK_plugin);
   rw_wrlock(&LOCK_system_variables_hash);
 
-  load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv);
+  my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL);
   error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
   if (argv)
     free_defaults(argv);

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	2008-07-15 01:43:12 +0000
+++ b/sql/sql_prepare.cc	2009-02-13 16:41:47 +0000
@@ -759,13 +759,13 @@ static bool insert_params_with_log(Prepa
     Item_param *param= *it;
     if (param->state != Item_param::LONG_DATA_VALUE)
     {
-      if (is_param_null(null_array, it - begin))
+      if (is_param_null(null_array, (uint) (it - begin)))
         param->set_null();
       else
       {
         if (read_pos >= data_end)
           DBUG_RETURN(1);
-        param->set_param_func(param, &read_pos, data_end - read_pos);
+        param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
         if (param->state == Item_param::NO_VALUE)
           DBUG_RETURN(1);
       }
@@ -797,13 +797,13 @@ static bool insert_params(Prepared_state
     Item_param *param= *it;
     if (param->state != Item_param::LONG_DATA_VALUE)
     {
-      if (is_param_null(null_array, it - begin))
+      if (is_param_null(null_array, (uint) (it - begin)))
         param->set_null();
       else
       {
         if (read_pos >= data_end)
           DBUG_RETURN(1);
-        param->set_param_func(param, &read_pos, data_end - read_pos);
+        param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
         if (param->state == Item_param::NO_VALUE)
           DBUG_RETURN(1);
       }

=== modified file 'sql/sql_profile.cc'
--- a/sql/sql_profile.cc	2009-01-12 16:17:15 +0000
+++ b/sql/sql_profile.cc	2009-02-13 16:41:47 +0000
@@ -119,7 +119,7 @@ int make_profile_table_for_show(THD *thd
     if (field)
     {
       field->set_name(field_info->old_name,
-                      strlen(field_info->old_name),
+                      (uint) strlen(field_info->old_name),
                       system_charset_info);
       if (add_item_to_list(thd, field))
         return 1;

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2009-02-01 21:05:19 +0000
+++ b/sql/sql_repl.cc	2009-05-08 14:43:21 +0000
@@ -205,7 +205,7 @@ void adjust_linfo_offsets(my_off_t purge
 
 bool log_in_use(const char* log_name)
 {
-  int log_name_len = strlen(log_name) + 1;
+  size_t log_name_len = strlen(log_name) + 1;
   THD *tmp;
   bool result = 0;
 
@@ -1367,8 +1367,8 @@ int cmp_master_pos(const char* log_file_
 		   const char* log_file_name2, ulonglong log_pos2)
 {
   int res;
-  uint log_file_name1_len=  strlen(log_file_name1);
-  uint log_file_name2_len=  strlen(log_file_name2);
+  size_t log_file_name1_len=  strlen(log_file_name1);
+  size_t log_file_name2_len=  strlen(log_file_name2);
 
   //  We assume that both log names match up to '.'
   if (log_file_name1_len == log_file_name2_len)
@@ -1688,7 +1688,7 @@ int log_loaded_block(IO_CACHE* file)
       lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
     DBUG_RETURN(0);
   
-  for (block_len= my_b_get_bytes_in_buffer(file); block_len > 0;
+  for (block_len= (uint) (my_b_get_bytes_in_buffer(file)); block_len > 0;
        buffer += min(block_len, max_event_size),
        block_len -= min(block_len, max_event_size))
   {

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_select.cc	2009-05-08 14:43:21 +0000
@@ -7625,7 +7625,7 @@ static COND *build_equal_items_for_cond(
     if (and_level)
     {
       /*
-         Retrieve all conjucts of this level detecting the equality
+         Retrieve all conjuncts of this level detecting the equality
          that are subject to substitution by multiple equality items and
          removing each such predicate from the conjunction after having 
          found/created a multiple equality whose inference the predicate is.
@@ -7641,6 +7641,15 @@ static COND *build_equal_items_for_cond(
           li.remove();
       }
 
+      /*
+        Check if we eliminated all the predicates of the level, e.g.
+        (a=a AND b=b AND a=a).
+      */
+      if (!args->elements && 
+          !cond_equal.current_level.elements && 
+          !eq_list.elements)
+        return new Item_int((longlong) 1, 1);
+
       List_iterator_fast<Item_equal> it(cond_equal.current_level);
       while ((item_equal= it++))
       {
@@ -9788,6 +9797,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
   table->in_use= thd;
   table->quick_keys.init();
   table->covering_keys.init();
+  table->merge_keys.init();
   table->keys_in_use_for_query.init();
 
   table->s= share;

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2009-02-05 09:37:06 +0000
+++ b/sql/sql_select.h	2009-02-23 16:16:48 +0000
@@ -729,3 +729,9 @@ bool error_if_full_join(JOIN *join);
 int report_error(TABLE *table, int error);
 int safe_index_read(JOIN_TAB *tab);
 COND *remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value);
+
+inline bool optimizer_flag(THD *thd, uint flag)
+{ 
+  return (thd->variables.optimizer_switch & flag);
+}
+

=== modified file 'sql/sql_servers.cc'
--- a/sql/sql_servers.cc	2008-07-15 17:46:02 +0000
+++ b/sql/sql_servers.cc	2009-03-20 14:27:53 +0000
@@ -60,7 +60,7 @@ prepare_server_struct_for_insert(LEX_SER
 /* drop functions */ 
 static int delete_server_record(TABLE *table,
                                 char *server_name,
-                                int server_name_length);
+                                size_t server_name_length);
 static int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options);
 
 /* update functions */
@@ -301,7 +301,7 @@ get_server_from_table_to_cache(TABLE *ta
 
   /* get each field into the server struct ptr */
   server->server_name= get_field(&mem, table->field[0]);
-  server->server_name_length= strlen(server->server_name);
+  server->server_name_length= (uint) strlen(server->server_name);
   ptr= get_field(&mem, table->field[1]);
   server->host= ptr ? ptr : blank;
   ptr= get_field(&mem, table->field[2]);
@@ -911,7 +911,7 @@ end:
 
 static int 
 delete_server_record(TABLE *table,
-                     char *server_name, int server_name_length)
+                     char *server_name, size_t server_name_length)
 {
   int error;
   DBUG_ENTER("delete_server_record");
@@ -1271,7 +1271,7 @@ static FOREIGN_SERVER *clone_server(MEM_
 FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
                                    FOREIGN_SERVER *buff)
 {
-  uint server_name_length;
+  size_t server_name_length;
   FOREIGN_SERVER *server;
   DBUG_ENTER("get_server_by_name");
   DBUG_PRINT("info", ("server_name %s", server_name));
@@ -1290,8 +1290,8 @@ FOREIGN_SERVER *get_server_by_name(MEM_R
                                                (uchar*) server_name,
                                                server_name_length)))
   {
-    DBUG_PRINT("info", ("server_name %s length %d not found!",
-                        server_name, server_name_length));
+    DBUG_PRINT("info", ("server_name %s length %u not found!",
+                        server_name, (unsigned) server_name_length));
     server= (FOREIGN_SERVER *) NULL;
   }
   /* otherwise, make copy of server */

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_show.cc	2009-05-08 14:43:21 +0000
@@ -1760,7 +1760,8 @@ void mysqld_list_processes(THD *thd,cons
   field_list.push_back(field=new Item_empty_string("db",NAME_CHAR_LEN));
   field->maybe_null=1;
   field_list.push_back(new Item_empty_string("Command",16));
-  field_list.push_back(new Item_return_int("Time",7, MYSQL_TYPE_LONG));
+  field_list.push_back(field= new Item_return_int("Time",7, MYSQL_TYPE_LONG));
+  field->unsigned_flag= 0;
   field_list.push_back(field=new Item_empty_string("State",30));
   field->maybe_null=1;
   field_list.push_back(field=new Item_empty_string("Info",max_query_length));
@@ -1853,7 +1854,7 @@ void mysqld_list_processes(THD *thd,cons
     else
       protocol->store(command_name[thd_info->command].str, system_charset_info);
     if (thd_info->start_time)
-      protocol->store((uint32) (now - thd_info->start_time));
+      protocol->store_long ((longlong) (now - thd_info->start_time));
     else
       protocol->store_null();
     protocol->store(thd_info->state_info, system_charset_info);
@@ -1928,8 +1929,8 @@ int fill_schema_processlist(THD* thd, TA
         table->field[4]->store(command_name[tmp->command].str,
                                command_name[tmp->command].length, cs);
       /* MYSQL_TIME */
-      table->field[5]->store((uint32)(tmp->start_time ?
-                                      now - tmp->start_time : 0), TRUE);
+      table->field[5]->store((longlong)(tmp->start_time ?
+                                      now - tmp->start_time : 0), FALSE);
       /* STATE */
 #ifndef EMBEDDED_LIBRARY
       val= (char*) (tmp->locked ? "Locked" :
@@ -6630,7 +6631,7 @@ ST_FIELD_INFO processlist_fields_info[]=
    SKIP_OPEN_TABLE},
   {"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", SKIP_OPEN_TABLE},
   {"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command", SKIP_OPEN_TABLE},
-  {"TIME", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Time", SKIP_OPEN_TABLE},
+  {"TIME", 7, MYSQL_TYPE_LONG, 0, 0, "Time", SKIP_OPEN_TABLE},
   {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
   {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
    SKIP_OPEN_TABLE},

=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc	2009-02-14 09:14:05 +0000
+++ b/sql/sql_string.cc	2009-03-24 13:58:52 +0000
@@ -455,7 +455,7 @@ bool String::append(const char *s,uint32
 
 bool String::append(const char *s)
 {
-  return append(s, strlen(s));
+  return append(s, (uint) strlen(s));
 }
 
 
@@ -1048,7 +1048,7 @@ outp:
       }
     }
     *from_end_pos= from;
-    res= to - to_start;
+    res= (uint) (to - to_start);
   }
   return (uint32) res;
 }

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-05-08 09:57:18 +0000
+++ b/sql/sql_table.cc	2009-05-08 14:43:21 +0000
@@ -84,7 +84,7 @@ static void wait_for_kill_signal(THD *th
 uint filename_to_tablename(const char *from, char *to, uint to_length)
 {
   uint errors;
-  uint res;
+  size_t res;
   DBUG_ENTER("filename_to_tablename");
   DBUG_PRINT("enter", ("from '%s'", from));
 
@@ -224,7 +224,7 @@ uint build_table_filename(char *buff, si
   char *end = buff + bufflen;
   /* Don't add FN_ROOTDIR if mysql_data_home already includes it */
   char *pos = strnmov(buff, mysql_data_home, bufflen);
-  int rootdir_len= strlen(FN_ROOTDIR);
+  size_t rootdir_len= strlen(FN_ROOTDIR);
   if (pos - rootdir_len >= buff &&
       memcmp(pos - rootdir_len, FN_ROOTDIR, rootdir_len) != 0)
     pos= strnmov(pos, FN_ROOTDIR, end - pos);
@@ -273,7 +273,7 @@ uint build_tmptable_filename(THD* thd, c
     my_casedn_str(files_charset_info, p);
   }
 
-  uint length= unpack_filename(buff, buff);
+  size_t length= unpack_filename(buff, buff);
   DBUG_PRINT("exit", ("buff: '%s'", buff));
   DBUG_RETURN(length);
 }
@@ -1999,7 +1999,7 @@ void calculate_interval_lengths(CHARSET_
   for (pos= interval->type_names, len= interval->type_lengths;
        *pos ; pos++, len++)
   {
-    uint length= cs->cset->numchars(cs, *pos, *pos + *len);
+    size_t length= cs->cset->numchars(cs, *pos, *pos + *len);
     *tot_length+= length;
     set_if_bigger(*max_length, (uint32)length);
   }
@@ -2328,7 +2328,7 @@ mysql_prepare_create_table(THD *thd, HA_
         DBUG_ASSERT(comma_length > 0);
         for (uint i= 0; (tmp= int_it++); i++)
         {
-          uint lengthsp;
+          size_t lengthsp;
           if (String::needs_conversion(tmp->length(), tmp->charset(),
                                        cs, &dummy))
           {
@@ -4248,7 +4248,7 @@ static bool mysql_admin_table(THD* thd, 
               (!(alter_info->flags & ALTER_ALL_PARTITION)))
           {
             char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
-            uint length;
+            size_t length;
             DBUG_PRINT("admin", ("sending non existent partition error"));
             protocol->prepare_for_resend();
             protocol->store(table_name, system_charset_info);
@@ -4337,7 +4337,7 @@ static bool mysql_admin_table(THD* thd, 
     {
       /* purecov: begin inspected */
       char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
-      uint length;
+      size_t length;
       DBUG_PRINT("admin", ("sending error message"));
       protocol->prepare_for_resend();
       protocol->store(table_name, system_charset_info);
@@ -4455,7 +4455,7 @@ send_result_message:
     case HA_ADMIN_NOT_IMPLEMENTED:
       {
        char buf[MYSQL_ERRMSG_SIZE];
-       uint length=my_snprintf(buf, sizeof(buf),
+       size_t length=my_snprintf(buf, sizeof(buf),
 				ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
 	protocol->store(STRING_WITH_LEN("note"), system_charset_info);
 	protocol->store(buf, length, system_charset_info);
@@ -4465,7 +4465,7 @@ send_result_message:
     case HA_ADMIN_NOT_BASE_TABLE:
       {
         char buf[MYSQL_ERRMSG_SIZE];
-        uint length= my_snprintf(buf, sizeof(buf),
+        size_t length= my_snprintf(buf, sizeof(buf),
                                  ER(ER_BAD_TABLE_ERROR), table_name);
         protocol->store(STRING_WITH_LEN("note"), system_charset_info);
         protocol->store(buf, length, system_charset_info);
@@ -4593,7 +4593,7 @@ send_result_message:
     case HA_ADMIN_NEEDS_ALTER:
     {
       char buf[MYSQL_ERRMSG_SIZE];
-      uint length;
+      size_t length;
 
       protocol->store(STRING_WITH_LEN("error"), system_charset_info);
       length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
@@ -4606,7 +4606,7 @@ send_result_message:
     default:				// Probably HA_ADMIN_INTERNAL_ERROR
       {
         char buf[MYSQL_ERRMSG_SIZE];
-        uint length=my_snprintf(buf, sizeof(buf),
+        size_t length=my_snprintf(buf, sizeof(buf),
                                 "Unknown - internal error %d during operation",
                                 result_code);
         protocol->store(STRING_WITH_LEN("error"), system_charset_info);

=== modified file 'sql/sql_trigger.cc'
--- a/sql/sql_trigger.cc	2009-01-15 18:11:25 +0000
+++ b/sql/sql_trigger.cc	2009-02-13 16:41:47 +0000
@@ -1728,7 +1728,7 @@ Table_triggers_list::change_table_name_i
   List_iterator_fast<LEX_STRING> it_def(definitions_list);
   List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list);
   List_iterator_fast<ulonglong> it_mode(definition_modes_list);
-  uint on_q_table_name_len, before_on_len;
+  size_t on_q_table_name_len, before_on_len;
   String buff;
 
   DBUG_ASSERT(definitions_list.elements == on_table_names_list.elements &&

=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc	2009-01-15 18:11:25 +0000
+++ b/sql/sql_udf.cc	2009-02-13 16:41:47 +0000
@@ -159,7 +159,7 @@ void udf_init()
     DBUG_PRINT("info",("init udf record"));
     LEX_STRING name;
     name.str=get_field(&mem, table->field[0]);
-    name.length = strlen(name.str);
+    name.length = (uint) strlen(name.str);
     char *dl_name= get_field(&mem, table->field[2]);
     bool new_dl=0;
     Item_udftype udftype=UDFTYPE_FUNCTION;

=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc	2009-02-25 10:19:29 +0000
+++ b/sql/sql_view.cc	2009-03-20 14:27:53 +0000
@@ -61,7 +61,8 @@ static void make_unique_view_field_name(
   char *name= (target->orig_name ?
                target->orig_name :
                target->name);
-  uint name_len, attempt;
+  size_t name_len;
+  uint attempt;
   char buff[NAME_LEN+1];
   List_iterator_fast<Item> itc(item_list);
 
@@ -545,7 +546,7 @@ bool mysql_create_view(THD *thd, TABLE_L
     }
     while ((item= it++, name= nm++))
     {
-      item->set_name(name->str, name->length, system_charset_info);
+      item->set_name(name->str, (uint) name->length, system_charset_info);
       item->is_autogenerated_name= FALSE;
     }
   }
@@ -1682,7 +1683,7 @@ frm_type_enum mysql_frm_type(THD *thd, c
 {
   File file;
   uchar header[10];	//"TYPE=VIEW\n" it is 10 characters
-  int error;
+  size_t error;
   DBUG_ENTER("mysql_frm_type");
 
   *dbt= DB_TYPE_UNKNOWN;

=== modified file 'sql/strfunc.cc'
--- a/sql/strfunc.cc	2007-08-13 13:11:25 +0000
+++ b/sql/strfunc.cc	2009-03-14 18:58:23 +0000
@@ -88,6 +88,208 @@ ulonglong find_set(TYPELIB *lib, const c
 }
 
 
+static const char *on_off_default_names[]=
+{
+  "off","on","default", NullS
+};
+
+static const unsigned int on_off_default_names_len[]=
+{
+  sizeof("off") - 1,
+  sizeof("on") - 1,
+  sizeof("default") - 1
+};
+
+static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
+                                        "", on_off_default_names,
+                                        (unsigned int *)on_off_default_names_len};
+
+
+/*
+  Parse a TYPELIB name from the buffer
+
+  SYNOPSIS
+    parse_name()
+      lib          Set of names to scan for.
+      strpos INOUT Start of the buffer (updated to point to the next
+                   character after the name)
+      end          End of the buffer
+      cs           Charset used in the buffer
+
+  DESCRIPTION
+    Parse a TYPELIB name from the buffer. The buffer is assumed to contain
+    one of the names specified in the TYPELIB, followed by comma, '=', or
+    end of the buffer.
+
+  RETURN
+    0	No matching name
+    >0  Offset+1 in typelib for matched name
+*/
+
+static uint parse_name(TYPELIB *lib, const char **strpos, const char *end, 
+                       CHARSET_INFO *cs)
+{
+  const char *pos= *strpos;
+  const char *start= pos;
+
+  /* Find the length */
+  if (cs && cs->mbminlen > 1)
+  {
+    int mblen= 0;
+    for ( ; pos < end; pos+= mblen)
+    {
+      my_wc_t wc;
+      if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos,
+                                           (const uchar *) end)) < 1)
+        mblen= 1; // Not to hang on a wrong multibyte sequence
+      if (wc == (my_wc_t) '=' || wc == (my_wc_t) ',')
+        break;
+    }
+  }
+  else
+    for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
+
+  uint var_len= (uint) (pos - start);
+  /* Determine which flag it is */
+  uint find= cs ? find_type2(lib, start, var_len, cs) :
+                  find_type(lib, start, var_len, (bool) 0);
+  *strpos= pos;
+  return find;
+}
+
+
+/* Read next character from the buffer in a charset-aware way */
+
+static my_wc_t get_next_char(const char **pos, const char *end, CHARSET_INFO *cs)
+{
+  my_wc_t wc;
+  if (*pos == end)
+      return (my_wc_t)-1;
+
+  if (cs && cs->mbminlen > 1)
+  {
+    int mblen;
+    if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) *pos,
+                                         (const uchar *) end)) < 1)
+      mblen= 1; // Not to hang on a wrong multibyte sequence
+    *pos += mblen;
+    return wc;
+  }
+  else
+    return *((*pos)++);
+}
+
+
+/*
+  Parse and apply a set of flag assingments
+
+  SYNOPSIS
+    find_set_from_flags()
+      lib               Flag names
+      default_name      Number of "default" in the typelib
+      cur_set           Current set of flags (start from this state)
+      default_set       Default set of flags (use this for assign-default
+                        keyword and flag=default assignments)
+      str               String to be parsed
+      length            Length of the string
+      cs                String charset
+      err_pos      OUT  If error, set to point to start of wrong set string
+                        NULL on success
+      err_len      OUT  If error, set to the length of wrong set string
+      set_warning  OUT  TRUE <=> Some string in set couldn't be used
+
+  DESCRIPTION
+    Parse a set of flag assignments, that is, parse a string in form:
+
+      param_name1=value1,param_name2=value2,... 
+    
+    where the names are specified in the TYPELIB, and each value can be
+    either 'on','off', or 'default'. Setting the same name twice is not 
+    allowed.
+    
+    Besides param=val assignments, we support the "default" keyword (keyword 
+    #default_name in the typelib). It can be used one time, if specified it 
+    causes us to build the new set over the default_set rather than cur_set
+    value.
+    
+  RETURN
+    Parsed set value if (*errpos == NULL)
+    Otherwise undefined
+*/
+
+ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
+                              ulonglong cur_set, ulonglong default_set,
+                              const char *str, uint length, CHARSET_INFO *cs,
+                              char **err_pos, uint *err_len, bool *set_warning)
+{
+  CHARSET_INFO *strip= cs ? cs : &my_charset_latin1;
+  const char *end= str + strip->cset->lengthsp(strip, str, length);
+  ulonglong flags_to_set= 0, flags_to_clear= 0;
+  bool set_defaults= 0;
+  *err_pos= 0;                  // No error yet
+  if (str != end)
+  {
+    const char *start= str;    
+    for (;;)
+    {
+      const char *pos= start;
+      uint flag_no, value;
+
+      if (!(flag_no= parse_name(lib, &pos, end, cs)))
+        goto err;
+
+      if (flag_no == default_name)
+      {
+        /* Using 'default' twice isn't allowed. */
+        if (set_defaults)
+          goto err;
+        set_defaults= TRUE;
+      }
+      else
+      {
+        ulonglong bit=  ((longlong) 1 << (flag_no - 1));
+        /* parse the '=on|off|default' */
+        if ((flags_to_clear | flags_to_set) & bit ||
+            get_next_char(&pos, end, cs) != '=' ||
+            !(value= parse_name(&on_off_default_typelib, &pos, end, cs)))
+        {
+          goto err;
+        }
+        
+        if (value == 1) // this is '=off'
+          flags_to_clear|= bit;
+        else if (value == 2) // this is '=on'
+          flags_to_set|= bit;
+        else // this is '=default' 
+        {
+          if (default_set & bit)
+            flags_to_set|= bit;
+          else
+            flags_to_clear|= bit;
+        }
+      }
+      if (pos >= end)
+        break;
+
+      if (get_next_char(&pos, end, cs) != ',')
+        goto err;
+
+      start=pos;
+      continue;
+   err:
+      *err_pos= (char*)start;
+      *err_len= end - start;
+      *set_warning= TRUE;
+      break;
+    }
+  }
+  ulonglong res= set_defaults? default_set : cur_set;
+  res|= flags_to_set;
+  res&= ~flags_to_clear;
+  return res;
+}
+
+
 /*
   Function to find a string in a TYPELIB
   (Same format as mysys/typelib.c)

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2009-05-08 09:57:18 +0000
+++ b/sql/table.cc	2009-05-08 14:43:21 +0000
@@ -1708,6 +1708,7 @@ int open_table_from_share(THD *thd, TABL
     goto err;
   outparam->quick_keys.init();
   outparam->covering_keys.init();
+  outparam->merge_keys.init();
   outparam->keys_in_use_for_query.init();
 
   /* Allocate handler */

=== modified file 'sql/tztime.cc'
--- a/sql/tztime.cc	2009-01-15 18:11:25 +0000
+++ b/sql/tztime.cc	2009-03-19 10:44:57 +0000
@@ -1825,6 +1825,13 @@ tz_load_from_open_tables(const String *t
 #ifdef ABBR_ARE_USED
   char chars[max(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1)))];
 #endif
+  /* 
+    Used as a temporary tz_info until we decide that we actually want to
+    allocate and keep the tz info and tz name in tz_storage.
+  */
+  TIME_ZONE_INFO tmp_tz_info;
+  memset(&tmp_tz_info, 0, sizeof(TIME_ZONE_INFO));
+
   DBUG_ENTER("tz_load_from_open_tables");
 
   /* Prepare tz_info for loading also let us make copy of time zone name */
@@ -1866,7 +1873,8 @@ tz_load_from_open_tables(const String *t
       Most probably user has mistyped time zone name, so no need to bark here
       unless we need it for debugging.
     */
-    sql_print_error("Can't find description of time zone '%s'", tz_name_buff);
+     sql_print_error("Can't find description of time zone '%.*s'", 
+                     tz_name->length(), tz_name->ptr());
 #endif
     goto end;
   }
@@ -1895,8 +1903,8 @@ tz_load_from_open_tables(const String *t
   /* If Uses_leap_seconds == 'Y' */
   if (table->field[1]->val_int() == 1)
   {
-    tz_info->leapcnt= tz_leapcnt;
-    tz_info->lsis= tz_lsis;
+    tmp_tz_info.leapcnt= tz_leapcnt;
+    tmp_tz_info.lsis= tz_lsis;
   }
 
   (void)table->file->ha_index_end();
@@ -1932,18 +1940,18 @@ tz_load_from_open_tables(const String *t
 #ifdef ABBR_ARE_USED
     // FIXME should we do something with duplicates here ?
     table->field[4]->val_str(&abbr, &abbr);
-    if (tz_info->charcnt + abbr.length() + 1 > sizeof(chars))
+    if (tmp_tz_info.charcnt + abbr.length() + 1 > sizeof(chars))
     {
       sql_print_error("Error while loading time zone description from "
                       "mysql.time_zone_transition_type table: not enough "
                       "room for abbreviations");
       goto end;
     }
-    ttis[ttid].tt_abbrind= tz_info->charcnt;
-    memcpy(chars + tz_info->charcnt, abbr.ptr(), abbr.length());
-    tz_info->charcnt+= abbr.length();
-    chars[tz_info->charcnt]= 0;
-    tz_info->charcnt++;
+    ttis[ttid].tt_abbrind= tmp_tz_info.charcnt;
+    memcpy(chars + tmp_tz_info.charcnt, abbr.ptr(), abbr.length());
+    tmp_tz_info.charcnt+= abbr.length();
+    chars[tmp_tz_info.charcnt]= 0;
+    tmp_tz_info.charcnt++;
 
     DBUG_PRINT("info",
       ("time_zone_transition_type table: tz_id=%u tt_id=%u tt_gmtoff=%ld "
@@ -1956,9 +1964,9 @@ tz_load_from_open_tables(const String *t
 #endif
 
     /* ttid is increasing because we are reading using index */
-    DBUG_ASSERT(ttid >= tz_info->typecnt);
+    DBUG_ASSERT(ttid >= tmp_tz_info.typecnt);
 
-    tz_info->typecnt= ttid + 1;
+    tmp_tz_info.typecnt= ttid + 1;
 
     res= table->file->index_next_same(table->record[0],
                                       table->field[0]->ptr, 4);
@@ -1990,14 +1998,14 @@ tz_load_from_open_tables(const String *t
     ttime= (my_time_t)table->field[1]->val_int();
     ttid= (uint)table->field[2]->val_int();
 
-    if (tz_info->timecnt + 1 > TZ_MAX_TIMES)
+    if (tmp_tz_info.timecnt + 1 > TZ_MAX_TIMES)
     {
       sql_print_error("Error while loading time zone description from "
                       "mysql.time_zone_transition table: "
                       "too much transitions");
       goto end;
     }
-    if (ttid + 1 > tz_info->typecnt)
+    if (ttid + 1 > tmp_tz_info.typecnt)
     {
       sql_print_error("Error while loading time zone description from "
                       "mysql.time_zone_transition table: "
@@ -2005,9 +2013,9 @@ tz_load_from_open_tables(const String *t
       goto end;
     }
 
-    ats[tz_info->timecnt]= ttime;
-    types[tz_info->timecnt]= ttid;
-    tz_info->timecnt++;
+    ats[tmp_tz_info.timecnt]= ttime;
+    types[tmp_tz_info.timecnt]= ttid;
+    tmp_tz_info.timecnt++;
 
     DBUG_PRINT("info",
       ("time_zone_transition table: tz_id: %u  tt_time: %lu  tt_id: %u",
@@ -2032,6 +2040,34 @@ tz_load_from_open_tables(const String *t
   table= 0;
 
   /*
+    Let us check how correct our time zone description is. We don't check for
+    tz->timecnt < 1 since it is ok for GMT.
+  */
+  if (tmp_tz_info.typecnt < 1)
+  {
+    sql_print_error("loading time zone without transition types");
+    goto end;
+  }
+
+  /* Allocate memory for the timezone info and timezone name in tz_storage. */
+  if (!(alloc_buff= (char*) alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) +
+                                       tz_name->length() + 1)))
+  {
+    sql_print_error("Out of memory while loading time zone description");
+    return 0;
+  }
+
+  /* Move the temporary tz_info into the allocated area */
+  tz_info= (TIME_ZONE_INFO *)alloc_buff;
+  memcpy(tz_info, &tmp_tz_info, sizeof(TIME_ZONE_INFO));
+  tz_name_buff= alloc_buff + sizeof(TIME_ZONE_INFO);
+  /*
+    By writing zero to the end we guarantee that we can call ptr()
+    instead of c_ptr() for time zone name.
+  */
+  strmake(tz_name_buff, tz_name->ptr(), tz_name->length());
+
+  /*
     Now we will allocate memory and init TIME_ZONE_INFO structure.
   */
   if (!(alloc_buff= (char*) alloc_root(&tz_storage,
@@ -2062,15 +2098,7 @@ tz_load_from_open_tables(const String *t
   tz_info->ttis= (TRAN_TYPE_INFO *)alloc_buff;
   memcpy(tz_info->ttis, ttis, tz_info->typecnt * sizeof(TRAN_TYPE_INFO));
 
-  /*
-    Let us check how correct our time zone description and build
-    reversed map. We don't check for tz->timecnt < 1 since it ok for GMT.
-  */
-  if (tz_info->typecnt < 1)
-  {
-    sql_print_error("loading time zone without transition types");
-    goto end;
-  }
+  /* Build reversed map. */
   if (prepare_tz_info(tz_info, &tz_storage))
   {
     sql_print_error("Unable to build mktime map for time zone");

=== modified file 'sql/udf_example.c'
--- a/sql/udf_example.c	2007-11-27 15:19:51 +0000
+++ b/sql/udf_example.c	2009-02-13 16:41:47 +0000
@@ -1099,7 +1099,7 @@ char * is_const(UDF_INIT *initid, UDF_AR
     sprintf(result, "not const");
   }
   *is_null= 0;
-  *length= strlen(result);
+  *length= (uint) strlen(result);
   return result;
 }
 
@@ -1133,7 +1133,7 @@ char * check_const_len(UDF_INIT *initid,
                 char *is_null, char *error __attribute__((unused)))
 {
   strmov(result, initid->ptr);
-  *length= strlen(result);
+  *length= (uint) strlen(result);
   *is_null= 0;
   return result;
 }

=== modified file 'sql/uniques.cc'
--- a/sql/uniques.cc	2007-07-04 08:46:45 +0000
+++ b/sql/uniques.cc	2009-02-13 16:41:47 +0000
@@ -130,7 +130,7 @@ static double get_merge_buffers_cost(uin
     total_buf_elems+= *pbuf;
   *last= total_buf_elems;
 
-  int n_buffers= last - first + 1;
+  size_t n_buffers= last - first + 1;
 
   /* Using log2(n)=log(n)/log(2) formula */
   return 2*((double)total_buf_elems*elem_size) / IO_SIZE +

=== modified file 'storage/archive/azio.c'
--- a/storage/archive/azio.c	2007-12-12 13:16:59 +0000
+++ b/storage/archive/azio.c	2009-02-13 16:41:47 +0000
@@ -390,7 +390,7 @@ int destroy (s)
   Reads the given number of uncompressed bytes from the compressed file.
   azread returns the number of bytes actually read (0 for end of file).
 */
-unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *error)
+unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
 {
   Bytef *start = (Bytef*)buf; /* starting point for crc computation */
   Byte  *next_out; /* == stream.next_out but not forced far (for MSDOS) */

=== modified file 'storage/archive/azlib.h'
--- a/storage/archive/azlib.h	2007-09-07 11:27:52 +0000
+++ b/storage/archive/azlib.h	2009-02-13 16:41:47 +0000
@@ -265,7 +265,7 @@ int azdopen(azio_stream *s,File fd, int 
 */
 
 
-extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *error);
+extern unsigned int azread ( azio_stream *s, voidp buf, size_t len, int *error);
 /*
      Reads the given number of uncompressed bytes from the compressed file.
    If the input file was not in gzip format, gzread copies the given number

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2008-10-03 18:08:40 +0000
+++ b/storage/archive/ha_archive.cc	2009-03-26 14:27:34 +0000
@@ -1071,16 +1071,18 @@ int ha_archive::unpack_row(azio_stream *
   row_len=  uint4korr(size_buffer);
   DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len, 
                            (unsigned int)table->s->reclength));
-  fix_rec_buff(row_len);
+
+  if (fix_rec_buff(row_len))
+  {
+    DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+  }
   DBUG_ASSERT(row_len <= record_buffer->length);
 
   read= azread(file_to_read, record_buffer->buffer, row_len, &error);
 
-  DBUG_ASSERT(row_len == read);
-
   if (read != row_len || error)
   {
-    DBUG_RETURN(-1);
+    DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
   }
 
   /* Copy null bits */
@@ -1257,7 +1259,7 @@ int ha_archive::repair(THD* thd, HA_CHEC
   int rc= optimize(thd, check_opt);
 
   if (rc)
-    DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
+    DBUG_RETURN(HA_ADMIN_CORRUPT);
 
   share->crashed= FALSE;
   DBUG_RETURN(0);

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2009-01-15 07:32:40 +0000
+++ b/storage/csv/ha_tina.cc	2009-05-08 14:43:21 +0000
@@ -397,12 +397,12 @@ static int free_share(TINA_SHARE *share)
   '\r''\n' --  DOS\Windows line ending
 */
 
-off_t find_eoln_buff(Transparent_file *data_buff, off_t begin,
-                     off_t end, int *eoln_len)
+my_off_t find_eoln_buff(Transparent_file *data_buff, my_off_t begin,
+                     my_off_t end, int *eoln_len)
 {
   *eoln_len= 0;
 
-  for (off_t x= begin; x < end; x++)
+  for (my_off_t x= begin; x < end; x++)
   {
     /* Unix (includes Mac OS X) */
     if (data_buff->get_value(x) == '\n')
@@ -553,7 +553,7 @@ int ha_tina::chain_append()
     /* We set up for the next position */
     if ((off_t)(chain_ptr - chain) == (chain_size -1))
     {
-      off_t location= chain_ptr - chain;
+      my_off_t location= chain_ptr - chain;
       chain_size += DEFAULT_CHAIN_LENGTH;
       if (chain_alloced)
       {
@@ -586,7 +586,7 @@ int ha_tina::chain_append()
 */
 int ha_tina::find_current_row(uchar *buf)
 {
-  off_t end_offset, curr_offset= current_position;
+  my_off_t end_offset, curr_offset= current_position;
   int eoln_len;
   my_bitmap_map *org_bitmap;
   int error;
@@ -836,7 +836,7 @@ int ha_tina::open(const char *name, int 
     during locking. This is needed to enable concurrent inserts.
   */
   thr_lock_data_init(&share->lock, &lock, (void*) this);
-  ref_length=sizeof(off_t);
+  ref_length= sizeof(my_off_t);
 
   share->lock.get_status= tina_get_status;
   share->lock.update_status= tina_update_status;
@@ -1140,7 +1140,7 @@ int ha_tina::rnd_pos(uchar * buf, uchar 
 {
   DBUG_ENTER("ha_tina::rnd_pos");
   ha_statistic_increment(&SSV::ha_read_rnd_count);
-  current_position= (off_t)my_get_ptr(pos,ref_length);
+  current_position= my_get_ptr(pos,ref_length);
   DBUG_RETURN(find_current_row(buf));
 }
 
@@ -1180,7 +1180,7 @@ int ha_tina::extra(enum ha_extra_functio
   to the given "hole", stored in the buffer. "Valid" here means,
   not listed in the chain of deleted records ("holes").
 */
-bool ha_tina::get_write_pos(off_t *end_pos, tina_set *closest_hole)
+bool ha_tina::get_write_pos(my_off_t *end_pos, tina_set *closest_hole)
 {
   if (closest_hole == chain_ptr) /* no more chains */
     *end_pos= file_buff->end();
@@ -1200,7 +1200,7 @@ bool ha_tina::get_write_pos(off_t *end_p
 int ha_tina::rnd_end()
 {
   char updated_fname[FN_REFLEN];
-  off_t file_buffer_start= 0;
+  my_off_t file_buffer_start= 0;
   DBUG_ENTER("ha_tina::rnd_end");
 
   free_root(&blobroot, MYF(0));
@@ -1223,17 +1223,17 @@ int ha_tina::rnd_end()
     my_qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set),
              (qsort_cmp)sort_set);
 
-    off_t write_begin= 0, write_end;
+    my_off_t write_begin= 0, write_end;
 
     /* create the file to write updated table if it wasn't yet created */
     if (open_update_temp_file_if_needed())
       DBUG_RETURN(-1);
 
     /* write the file with updated info */
-    while ((file_buffer_start != -1))     // while not end of file
+    while ((file_buffer_start != (my_off_t)-1))     // while not end of file
     {
       bool in_hole= get_write_pos(&write_end, ptr);
-      off_t write_length= write_end - write_begin;
+      my_off_t write_length= write_end - write_begin;
 
       /* if there is something to write, write it */
       if (write_length)
@@ -1241,14 +1241,15 @@ int ha_tina::rnd_end()
         if (my_write(update_temp_file, 
                      (uchar*) (file_buff->ptr() +
                                (write_begin - file_buff->start())),
-                     write_length, MYF_RW))
+                     (size_t)write_length, MYF_RW))
           goto error;
         temp_file_length+= write_length;
       }
       if (in_hole)
       {
         /* skip hole */
-        while (file_buff->end() <= ptr->end && file_buffer_start != -1)
+        while (file_buff->end() <= ptr->end &&
+               file_buffer_start != (my_off_t)-1)
           file_buffer_start= file_buff->read_next();
         write_begin= ptr->end;
         ptr++;
@@ -1348,7 +1349,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_O
   File repair_file;
   int rc;
   ha_rows rows_repaired= 0;
-  off_t write_begin= 0, write_end;
+  my_off_t write_begin= 0, write_end;
   DBUG_ENTER("ha_tina::repair");
 
   /* empty file */
@@ -1423,7 +1424,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_O
     write_end= min(file_buff->end(), current_position);
     if ((write_end - write_begin) &&
         (my_write(repair_file, (uchar*)file_buff->ptr(),
-                  write_end - write_begin, MYF_RW)))
+                  (size_t) (write_end - write_begin), MYF_RW)))
       DBUG_RETURN(-1);
 
     write_begin= write_end;

=== modified file 'storage/csv/ha_tina.h'
--- a/storage/csv/ha_tina.h	2008-01-17 23:37:18 +0000
+++ b/storage/csv/ha_tina.h	2009-03-24 09:02:01 +0000
@@ -40,7 +40,7 @@ typedef struct st_tina_share {
     inserts, updates and deletes. The var is initialized along with the
     share initialization.
   */
-  off_t saved_data_file_length;
+  my_off_t saved_data_file_length;
   pthread_mutex_t mutex;
   THR_LOCK lock;
   bool update_file_opened;
@@ -53,18 +53,18 @@ typedef struct st_tina_share {
 } TINA_SHARE;
 
 struct tina_set {
-  off_t begin;
-  off_t end;
+  my_off_t begin;
+  my_off_t end;
 };
 
 class ha_tina: public handler
 {
   THR_LOCK_DATA lock;      /* MySQL lock */
   TINA_SHARE *share;       /* Shared lock info */
-  off_t current_position;  /* Current position in the file during a file scan */
-  off_t next_position;     /* Next position in the file scan */
-  off_t local_saved_data_file_length; /* save position for reads */
-  off_t temp_file_length;
+  my_off_t current_position;  /* Current position in the file during a file scan */
+  my_off_t next_position;     /* Next position in the file scan */
+  my_off_t local_saved_data_file_length; /* save position for reads */
+  my_off_t temp_file_length;
   uchar byte_buffer[IO_SIZE];
   Transparent_file *file_buff;
   File data_file;                   /* File handler for readers */
@@ -85,7 +85,7 @@ class ha_tina: public handler
   MEM_ROOT blobroot;
 
 private:
-  bool get_write_pos(off_t *end_pos, tina_set *closest_hole);
+  bool get_write_pos(my_off_t *end_pos, tina_set *closest_hole);
   int open_update_temp_file_if_needed();
   int init_tina_writer();
   int init_data_file();

=== modified file 'storage/csv/transparent_file.cc'
--- a/storage/csv/transparent_file.cc	2007-05-10 09:59:39 +0000
+++ b/storage/csv/transparent_file.cc	2009-03-24 09:02:01 +0000
@@ -45,17 +45,17 @@ uchar *Transparent_file::ptr()
   return buff; 
 }
 
-off_t Transparent_file::start()
+my_off_t Transparent_file::start()
 { 
   return lower_bound; 
 }
 
-off_t Transparent_file::end()
+my_off_t Transparent_file::end()
 { 
   return upper_bound; 
 }
 
-off_t Transparent_file::read_next()
+my_off_t Transparent_file::read_next()
 {
   size_t bytes_read;
 
@@ -64,11 +64,11 @@ off_t Transparent_file::read_next()
      always points to upper_bound byte
   */
   if ((bytes_read= my_read(filedes, buff, buff_size, MYF(0))) == MY_FILE_ERROR)
-    return (off_t) -1;
+    return (my_off_t) -1;
 
   /* end of file */
   if (!bytes_read)
-    return (off_t) -1;
+    return (my_off_t) -1;
 
   lower_bound= upper_bound;
   upper_bound+= bytes_read;
@@ -77,12 +77,12 @@ off_t Transparent_file::read_next()
 }
 
 
-char Transparent_file::get_value(off_t offset)
+char Transparent_file::get_value(my_off_t offset)
 {
   size_t bytes_read;
 
   /* check boundaries */
-  if ((lower_bound <= offset) && (offset < upper_bound))
+  if ((lower_bound <= offset) && (((my_off_t) offset) < upper_bound))
     return buff[offset - lower_bound];
 
   VOID(my_seek(filedes, offset, MY_SEEK_SET, MYF(0)));
@@ -95,7 +95,7 @@ char Transparent_file::get_value(off_t o
   upper_bound= lower_bound + bytes_read;
 
   /* end of file */
-  if (upper_bound == offset)
+  if (upper_bound == (my_off_t) offset)
     return 0;
 
   return buff[0];

=== modified file 'storage/csv/transparent_file.h'
--- a/storage/csv/transparent_file.h	2007-05-10 09:59:39 +0000
+++ b/storage/csv/transparent_file.h	2009-03-24 09:02:01 +0000
@@ -23,8 +23,8 @@ class Transparent_file
   File filedes;
   uchar *buff;  /* in-memory window to the file or mmaped area */
   /* current window sizes */
-  off_t lower_bound;
-  off_t upper_bound;
+  my_off_t lower_bound;
+  my_off_t upper_bound;
   uint buff_size;
 
 public:
@@ -34,8 +34,8 @@ public:
 
   void init_buff(File filedes_arg);
   uchar *ptr();
-  off_t start();
-  off_t end();
-  char get_value (off_t offset);
-  off_t read_next();
+  my_off_t start();
+  my_off_t end();
+  char get_value (my_off_t offset);
+  my_off_t read_next();
 };

=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc	2008-12-16 12:12:22 +0000
+++ b/storage/federated/ha_federated.cc	2009-02-13 16:41:47 +0000
@@ -505,7 +505,7 @@ int federated_done(void *p)
         in sql_show.cc except that quoting always occurs.
 */
 
-static bool append_ident(String *string, const char *name, uint length,
+static bool append_ident(String *string, const char *name, size_t length,
                          const char quote_char)
 {
   bool result;
@@ -515,7 +515,7 @@ static bool append_ident(String *string,
 
   if (quote_char)
   {
-    string->reserve(length * 2 + 2);
+    string->reserve((uint) length * 2 + 2);
     if ((result= string->append(&quote_char, 1, system_charset_info)))
       goto err;
 
@@ -533,7 +533,7 @@ static bool append_ident(String *string,
     result= string->append(&quote_char, 1, system_charset_info);
   }
   else
-    result= string->append(name, length, system_charset_info);
+    result= string->append(name, (uint) length, system_charset_info);
 
 err:
   DBUG_RETURN(result);
@@ -543,7 +543,7 @@ err:
 static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
 {
   char buf[FEDERATED_QUERY_BUFFER_SIZE];
-  int buf_len;
+  size_t buf_len;
   DBUG_ENTER("ha_federated parse_url_error");
 
   buf_len= min(table->s->connect_string.length,
@@ -721,7 +721,7 @@ static int parse_url(MEM_ROOT *mem_root,
     {
       share->connection_string[share->table_name - share->connection_string]= '\0';
       share->table_name++;
-      share->table_name_length= strlen(share->table_name);
+      share->table_name_length= (uint) strlen(share->table_name);
 
       DBUG_PRINT("info", 
                  ("internal format, parsed table_name share->connection_string \
@@ -1489,7 +1489,7 @@ static FEDERATED_SHARE *get_share(const 
   pthread_mutex_lock(&federated_mutex);
 
   tmp_share.share_key= table_name;
-  tmp_share.share_key_length= strlen(table_name);
+  tmp_share.share_key_length= (uint) strlen(table_name);
   if (parse_url(&mem_root, &tmp_share, table, 0))
     goto error;
 
@@ -2161,7 +2161,7 @@ int ha_federated::update_row(const uchar
   {
     if (bitmap_is_set(table->write_set, (*field)->field_index))
     {
-      uint field_name_length= strlen((*field)->field_name);
+      size_t field_name_length= strlen((*field)->field_name);
       append_ident(&update_string, (*field)->field_name, field_name_length,
                    ident_quote_char);
       update_string.append(STRING_WITH_LEN(" = "));
@@ -2187,7 +2187,7 @@ int ha_federated::update_row(const uchar
 
     if (bitmap_is_set(table->read_set, (*field)->field_index))
     {
-      uint field_name_length= strlen((*field)->field_name);
+      size_t field_name_length= strlen((*field)->field_name);
       append_ident(&where_string, (*field)->field_name, field_name_length,
                    ident_quote_char);
       if (field_in_record_is_null(table, *field, (char*) old_data))
@@ -3158,7 +3158,7 @@ int ha_federated::real_connect()
 }
 
 
-int ha_federated::real_query(const char *query, uint length)
+int ha_federated::real_query(const char *query, size_t length)
 {
   int rc= 0;
   DBUG_ENTER("ha_federated::real_query");
@@ -3169,7 +3169,7 @@ int ha_federated::real_query(const char 
   if (!query || !length)
     goto end;
 
-  rc= mysql_real_query(mysql, query, length);
+  rc= mysql_real_query(mysql, query, (uint) length);
   
 end:
   DBUG_RETURN(rc);

=== modified file 'storage/federated/ha_federated.h'
--- a/storage/federated/ha_federated.h	2007-11-30 20:46:44 +0000
+++ b/storage/federated/ha_federated.h	2009-02-13 16:41:47 +0000
@@ -70,7 +70,7 @@ typedef struct st_federated_share {
   int share_key_length;
   ushort port;
 
-  uint table_name_length, server_name_length, connect_string_length, use_count;
+  size_t table_name_length, server_name_length, connect_string_length, use_count;
   pthread_mutex_t mutex;
   THR_LOCK lock;
 } FEDERATED_SHARE;
@@ -113,7 +113,7 @@ private:
                                      uint key_len,
                                      ha_rkey_function find_flag,
                                      MYSQL_RES **result);
-  int real_query(const char *query, uint length);
+  int real_query(const char *query, size_t length);
   int real_connect();
 public:
   ha_federated(handlerton *hton, TABLE_SHARE *table_arg);

=== modified file 'storage/heap/hp_write.c'
--- a/storage/heap/hp_write.c	2007-05-10 09:59:39 +0000
+++ b/storage/heap/hp_write.c	2009-02-13 16:41:47 +0000
@@ -69,7 +69,7 @@ int heap_write(HP_INFO *info, const ucha
 err:
   if (my_errno == HA_ERR_FOUND_DUPP_KEY)
     DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
-  info->errkey= keydef - share->keydef;
+  info->errkey= (int) (keydef - share->keydef);
   /*
     We don't need to delete non-inserted key from rb-tree.  Also, if
     we got ENOMEM, the key wasn't inserted, so don't try to delete it

=== modified file 'storage/ibmdb2i/Makefile.am'
--- a/storage/ibmdb2i/Makefile.am	2009-02-15 02:18:30 +0000
+++ b/storage/ibmdb2i/Makefile.am	2009-04-01 20:18:49 +0000
@@ -27,6 +27,7 @@ DEFS =                  @DEFS@
 noinst_HEADERS =	ha_ibmdb2i.h db2i_collationSupport.h db2i_file.h \
 			db2i_ioBuffers.h db2i_blobCollection.h \
 			db2i_global.h db2i_misc.h db2i_charsetSupport.h db2i_errors.h \
+			db2i_iconv.h db2i_myconv.h db2i_safeString.h db2i_sqlStatementStream.h \
 			db2i_ileBridge.h db2i_validatedPointer.h
 
 EXTRA_LTLIBRARIES =	ha_ibmdb2i.la

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2009-05-08 09:57:18 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2009-05-08 14:43:21 +0000
@@ -6519,7 +6519,7 @@ ha_innobase::get_foreign_key_list(THD *t
 	    f_key_info.referenced_key_name = thd_make_lex_string(
 		    thd, f_key_info.referenced_key_name,
 		    foreign->referenced_index->name,
-		    strlen(foreign->referenced_index->name), 1);
+		    (uint) strlen(foreign->referenced_index->name), 1);
           }
           else
             f_key_info.referenced_key_name= 0;
@@ -7132,7 +7132,7 @@ innodb_show_status(
 
 	bool result = FALSE;
 
-	if (stat_print(thd, innobase_hton_name, strlen(innobase_hton_name),
+	if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
 			STRING_WITH_LEN(""), str, flen)) {
 		result= TRUE;
 	}
@@ -7162,7 +7162,7 @@ innodb_mutex_show_status(
 	ulint	  rw_lock_count_os_yield= 0;
 	ulonglong rw_lock_wait_time= 0;
 #endif /* UNIV_DEBUG */
-	uint	  hton_name_len= strlen(innobase_hton_name), buf1len, buf2len;
+	uint	  hton_name_len= (uint) strlen(innobase_hton_name), buf1len, buf2len;
 	DBUG_ENTER("innodb_mutex_show_status");
 
 	mutex_enter_noninline(&mutex_list_mutex);
@@ -7206,9 +7206,9 @@ innodb_mutex_show_status(
 			rw_lock_wait_time += mutex->lspent_time;
 		}
 #else /* UNIV_DEBUG */
-		buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%lu",
+		buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
 				     mutex->cfile_name, (ulong) mutex->cline);
-		buf2len= my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
+		buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
 				     mutex->count_os_wait);
 
 		if (stat_print(thd, innobase_hton_name,
@@ -7723,7 +7723,7 @@ ha_innobase::get_error_message(int error
 {
 	trx_t*	trx = check_trx_exists(ha_thd());
 
-	buf->copy(trx->detailed_error, strlen(trx->detailed_error),
+	buf->copy(trx->detailed_error, (uint) strlen(trx->detailed_error),
 		system_charset_info);
 
 	return FALSE;

=== modified file 'storage/innobase/include/pars0pars.h'
--- a/storage/innobase/include/pars0pars.h	2006-07-26 09:28:51 +0000
+++ b/storage/innobase/include/pars0pars.h	2009-02-13 16:41:47 +0000
@@ -684,7 +684,7 @@ struct for_node_struct{
 					definition */
 	que_node_t*	loop_start_limit;/* initial value of loop variable */
 	que_node_t*	loop_end_limit;	/* end value of loop variable */
-	int		loop_end_value;	/* evaluated value for the end value:
+	lint		loop_end_value;	/* evaluated value for the end value:
 					it is calculated only when the loop
 					is entered, and will not change within
 					the loop */

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2009-02-24 11:17:50 +0000
+++ b/storage/myisam/ha_myisam.cc	2009-03-17 20:29:24 +0000
@@ -62,7 +62,7 @@ static void mi_check_print_msg(MI_CHECK 
 {
   THD* thd = (THD*)param->thd;
   Protocol *protocol= thd->protocol;
-  uint length, msg_length;
+  size_t length, msg_length;
   char msgbuf[MI_MAX_MSG_BUF];
   char name[NAME_LEN*2+2];
 
@@ -1557,7 +1557,7 @@ bool ha_myisam::check_and_repair(THD *th
   old_query_length= thd->query_length;
   pthread_mutex_lock(&LOCK_thread_count);
   thd->query=        table->s->table_name.str;
-  thd->query_length= table->s->table_name.length;
+  thd->query_length= (uint) table->s->table_name.length;
   pthread_mutex_unlock(&LOCK_thread_count);
 
   if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))

=== modified file 'storage/myisam/mi_check.c'
--- a/storage/myisam/mi_check.c	2009-01-26 06:35:15 +0000
+++ b/storage/myisam/mi_check.c	2009-02-13 16:41:47 +0000
@@ -660,7 +660,7 @@ void mi_collect_stats_nonulls_first(HA_K
                                     uchar *key)
 {
   uint first_null, kp;
-  first_null= ha_find_null(keyseg, key) - keyseg;
+  first_null= (uint) (ha_find_null(keyseg, key) - keyseg);
   /*
     All prefix tuples that don't include keypart_{first_null} are not-null
     tuples (and all others aren't), increment counters for them.
@@ -716,7 +716,7 @@ int mi_collect_stats_nonulls_next(HA_KEY
   seg= keyseg + diffs[0] - 1;
 
   /* Find first NULL in last_key */
-  first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg;
+  first_null_seg= (uint) (ha_find_null(seg, last_key + diffs[1]) - keyseg);
   for (kp= 0; kp < first_null_seg; kp++)
     notnull[kp]++;
 
@@ -3952,7 +3952,7 @@ static int sort_ft_key_write(MI_SORT_PAR
       key_block++;
     sort_info->key_block=key_block;
     sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo;
-    ft_buf->count=(ft_buf->buf - p)/val_len;
+    ft_buf->count=(uint) (ft_buf->buf - p)/val_len;
 
     /* flushing buffer to second-level tree */
     for (error=0; !error && p < ft_buf->buf; p+= val_len)

=== modified file 'storage/myisam/mi_packrec.c'
--- a/storage/myisam/mi_packrec.c	2008-03-31 07:40:39 +0000
+++ b/storage/myisam/mi_packrec.c	2009-02-13 16:41:47 +0000
@@ -255,7 +255,7 @@ my_bool _mi_read_pack_info(MI_INFO *info
 	       MYF(MY_HOLD_ON_ERROR));
   /* Fix the table addresses in the tree heads. */
   {
-    long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
+    my_ptrdiff_t diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
     share->decode_tables=decode_table;
     for (i=0 ; i < trees ; i++)
       share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,

=== modified file 'storage/myisam/mi_search.c'
--- a/storage/myisam/mi_search.c	2008-03-29 08:02:54 +0000
+++ b/storage/myisam/mi_search.c	2009-02-13 16:41:47 +0000
@@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, reg
       }
       from+=keyseg->length;
       page=from+nod_flag;
-      length=from-vseg;
+      length= (uint) (from - vseg);
     }
 
     if (page > end)

=== modified file 'storage/myisam/rt_index.c'
--- a/storage/myisam/rt_index.c	2008-08-26 13:53:22 +0000
+++ b/storage/myisam/rt_index.c	2009-02-13 16:41:47 +0000
@@ -95,7 +95,7 @@ static int rtree_find_req(MI_INFO *info,
                                       _mi_kpos(nod_flag, k), level + 1)))
         {
           case 0: /* found - exit from recursion */
-            *saved_key = k - page_buf;
+            *saved_key = (uint) (k - page_buf);
             goto ok;
           case 1: /* not found - continue searching */
             info->rtree_recursion_depth = level;
@@ -117,7 +117,7 @@ static int rtree_find_req(MI_INFO *info,
         info->lastkey_length = k_len + info->s->base.rec_reflength;
         memcpy(info->lastkey, k, info->lastkey_length);
         info->rtree_recursion_depth = level;
-        *saved_key = last - page_buf;
+        *saved_key = (uint) (last - page_buf);
 
         if (after_key < last)
         {
@@ -314,7 +314,7 @@ static int rtree_get_req(MI_INFO *info, 
                                   _mi_kpos(nod_flag, k), level + 1)))
       {
         case 0: /* found - exit from recursion */
-          *saved_key = k - page_buf;
+          *saved_key = (uint) (k - page_buf);
           goto ok;
         case 1: /* not found - continue searching */
           info->rtree_recursion_depth = level;
@@ -333,7 +333,7 @@ static int rtree_get_req(MI_INFO *info, 
       memcpy(info->lastkey, k, info->lastkey_length);
 
       info->rtree_recursion_depth = level;
-      *saved_key = k - page_buf;
+      *saved_key = (uint) (k - page_buf);
 
       if (after_key < last)
       {
@@ -420,7 +420,7 @@ int rtree_get_next(MI_INFO *info, uint k
     info->lastkey_length = k_len + info->s->base.rec_reflength;
     memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength);
 
-    *(int*)info->int_keypos = key - info->buff;
+    *(uint*)info->int_keypos = (uint) (key - info->buff);
     if (after_key >= info->int_maxpos)
     {
       info->buff_used = 1;

=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc	2009-03-09 09:33:02 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc	2009-03-17 20:29:24 +0000
@@ -218,7 +218,7 @@ static int myisammrg_parent_open_callbac
   TABLE_LIST    *child_l;
   const char    *db;
   const char    *table_name;
-  uint          dirlen;
+  size_t        dirlen;
   char          dir_path[FN_REFLEN];
   DBUG_ENTER("myisammrg_parent_open_callback");
 
@@ -1042,7 +1042,7 @@ THR_LOCK_DATA **ha_myisammrg::store_lock
 static void split_file_name(const char *file_name,
 			    LEX_STRING *db, LEX_STRING *name)
 {
-  uint dir_length, prefix_length;
+  size_t dir_length, prefix_length;
   char buff[FN_REFLEN];
 
   db->length= 0;
@@ -1115,7 +1115,7 @@ int ha_myisammrg::create(const char *nam
   const char **table_names, **pos;
   TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first;
   THD *thd= current_thd;
-  uint dirlgt= dirname_length(name);
+  size_t dirlgt= dirname_length(name);
   DBUG_ENTER("ha_myisammrg::create");
 
   /* Allocate a table_names array in thread mem_root. */
@@ -1174,7 +1174,7 @@ int ha_myisammrg::create(const char *nam
 void ha_myisammrg::append_create_info(String *packet)
 {
   const char *current_db;
-  uint db_length;
+  size_t db_length;
   THD *thd= current_thd;
   MYRG_TABLE *open_table, *first;
 

=== modified file 'strings/Makefile.am'
--- a/strings/Makefile.am	2008-04-28 00:34:01 +0000
+++ b/strings/Makefile.am	2009-05-08 14:43:21 +0000
@@ -65,7 +65,8 @@ EXTRA_DIST 	= ctype-big5.c ctype-cp932.c
 			bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \
 			strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
 			strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
-			t_ctype.h my_strchr.c CMakeLists.txt
+			t_ctype.h my_strchr.c CMakeLists.txt \
+			CHARSET_INFO.txt
 
 conf_to_src_SOURCES = conf_to_src.c 
 conf_to_src_LDADD= libmystringslt.la

=== modified file 'strings/ctype.c'
--- a/strings/ctype.c	2008-12-23 14:21:01 +0000
+++ b/strings/ctype.c	2009-02-13 16:41:47 +0000
@@ -39,7 +39,7 @@
   
 */
 
-static char *mstr(char *str,const char *src,uint l1,uint l2)
+static char *mstr(char *str,const char *src,size_t l1,size_t l2)
 {
   l1= l1<l2 ? l1 : l2;
   memcpy(str,src,l1);
@@ -143,7 +143,7 @@ typedef struct my_cs_file_info
 
 
 
-static int fill_uchar(uchar *a,uint size,const char *str, uint len)
+static int fill_uchar(uchar *a,uint size,const char *str, size_t len)
 {
   uint i= 0;
   const char *s, *b, *e=str+len;

=== modified file 'strings/my_vsnprintf.c'
--- a/strings/my_vsnprintf.c	2007-06-01 08:12:06 +0000
+++ b/strings/my_vsnprintf.c	2009-02-13 16:41:47 +0000
@@ -108,7 +108,7 @@ size_t my_vsnprintf(char *to, size_t n, 
       char *par = va_arg(ap, char *);
       DBUG_ASSERT(to <= end);
       if (to + abs(width) + 1 > end)
-        width= end - to - 1;  /* sign doesn't matter */
+        width= (uint) (end - to - 1);  /* sign doesn't matter */
       memmove(to, par, abs(width));
       to+= width;
       continue;
@@ -176,7 +176,7 @@ size_t my_vsnprintf(char *to, size_t n, 
 
 size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
 {
-  int result;
+  size_t result;
   va_list args;
   va_start(args,fmt);
   result= my_vsnprintf(to, n, fmt, args);

=== modified file 'tests/bug25714.c'
--- a/tests/bug25714.c	2007-11-22 11:39:07 +0000
+++ b/tests/bug25714.c	2009-02-13 16:41:47 +0000
@@ -54,14 +54,14 @@ int main (int argc, char **argv)
     printf("%s\n", mysql_error(&conn));
   }
 
-  OK = mysql_real_query (&conn, query4, strlen(query4));
+  OK = mysql_real_query (&conn, query4, (uint) strlen(query4));
 
   assert(0 == OK);
 
   printf("%ld inserted\n",
          (long) mysql_insert_id(&conn));
 
-  OK = mysql_real_query (&conn, query5, strlen(query5));
+  OK = mysql_real_query (&conn, query5, (uint) strlen(query5));
 
   assert(0 == OK);
 

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2009-03-09 11:15:46 +0000
+++ b/tests/mysql_client_test.c	2009-03-24 13:58:52 +0000
@@ -262,7 +262,7 @@ static MYSQL_STMT *STDCALL
 mysql_simple_prepare(MYSQL *mysql_arg, const char *query)
 {
   MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg);
-  if (stmt && mysql_stmt_prepare(stmt, query, strlen(query)))
+  if (stmt && mysql_stmt_prepare(stmt, query, (uint) strlen(query)))
   {
     mysql_stmt_close(stmt);
     return 0;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090508144321-a1ekoyab42fqhab8.bundle
Thread
bzr commit into mysql-5.1-telco-6.2-merge branch (jonas:2838)Jonas Oreland10 May