1. 02 Aug, 2007 4 commits
    • unknown's avatar
      Simplify logging code a bit (to make code smaller and faster) · 68a7f757
      unknown authored
      Moved duplicated code to inline function store_timestamp()
      Save thd->time_zone_used when logging to table as CSV internally cases it to be changed
      Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
      Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
      Set TABLE->no_replicate on open
      
      
      
      client/mysqlbinlog.cc:
        Fixed several memory leaks (most in case of error situations)
      mysql-test/r/events_logs_tests.result:
        Made long_query_timeout smaller to ensure next query comes into log
      mysql-test/r/variables.result:
        Make it safe to run test with --log
      mysql-test/t/events_logs_tests.test:
        Made long_query_timeout smaller to ensure next query comes into log
      mysql-test/t/variables.test:
        Make it safe to run test with --log
      sql/field.cc:
        Moved duplicated code to inline function store_timestamp()
      sql/field.h:
        Moved duplicated code to inline function store_timestamp()
      sql/handler.cc:
        Reorder checks in likely order
        Simplify checks if we should do binary logging
        (no_replicate is set once and for all when table is opened)
      sql/log.cc:
        Save thd->time_zone_used as CVS internally cases it to be changed
        Use Field_timestamp->store_timestamp instead of automatic timestamps.
        This gives us correct timestamp even if thd->set_time() is not called (in case
        of connect) and we don't have to store thd->query_start_used anymore.
      sql/sql_base.cc:
        Removed not needed comment
        Moved LINT_INIT() to after declaration
        Renamed temporary variable to avoid compiler warning
        Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
        Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
      sql/table.cc:
        Set TABLE->no_replicate on open
      68a7f757
    • unknown's avatar
      Don't save & restore time fields from thd when it's not needed. · a640d340
      unknown authored
      Added back setting of 'some_tables_deleted' to not cause deadlocks in mysql_lock_table()
      
      
      BitKeeper/etc/ignore:
        added tests/bug25714
      sql/lock.cc:
        Added comment
      sql/log.cc:
        Don't save & restore time fields from thd when it's not needed.
        Fix that we properly detect if open table failed
      sql/sql_base.cc:
        Added back setting of 'some_tables_deleted' to not cause deadlocks in
        mysql_lock_table()
      a640d340
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1 · 8433e968
      unknown authored
      into  mysql.com:/home/my/mysql-5.1
      
      
      client/client_priv.h:
        Auto merged
      client/mysqldump.c:
        Auto merged
      client/mysqlslap.c:
        Auto merged
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/lib/mtr_report.pl:
        Auto merged
      mysql-test/t/disabled.def:
        Auto merged
      sql/event_data_objects.cc:
        Auto merged
      sql/event_queue.cc:
        Auto merged
      sql/ha_partition.cc:
        Auto merged
      sql/lock.cc:
        Auto merged
      sql/log.cc:
        Auto merged
      sql/log.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_plugin.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql-common/client.c:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_cache.cc:
        Manual merge
        Removed comment about bug in old code (not relevant)
      8433e968
    • unknown's avatar
      Set --debug-check if one uses DBUG_PUSH in all clients · 0c4768f3
      unknown authored
      Fixed bug in query cache that made it impossible to run mysqld with --debug
      Fixed memory leaks in mysqldump and mysqltest
      Memory leaks associated with wrong usage of mysqltest is not fixed. To find these, run
      mysql-test-run --debug mysqltest
      
      
      client/mysql_upgrade.c:
        Set --debug-check if one uses DBUG_PUSH
      client/mysqlcheck.c:
        Set --debug-check if one uses DBUG_PUSH
      client/mysqldump.c:
        Set --debug-check if one uses DBUG_PUSH
        Fixed several memory leaks
      client/mysqlimport.c:
        Set --debug-check if one uses DBUG_PUSH
      client/mysqlshow.c:
        Set --debug-check if one uses DBUG_PUSH
      client/mysqlslap.c:
        Set --debug-check if one uses DBUG_PUSH
      client/mysqltest.c:
        Set --debug-check if one uses DBUG_PUSH
        Fixed some memory leaks
        Removed MY_CHECK_ERROR argument to my_end() as mysqltest.test otherwise shows MANY memory leaks
      dbug/dbug.c:
        Fixed compiler warning
        Force flush of out_file on end
        Removed some wrong dbug_flush(0) commands that could cause crashes
      mysys/my_init.c:
        Don't write memory usage if MY_GIVE_INFO is not given
      sql/sql_cache.cc:
        Fixed bug in query cache that made it impossible to run mysqld with --debug
      0c4768f3
  2. 01 Aug, 2007 5 commits
    • unknown's avatar
      Fixes Bug#30127: --debug-info no longer prints memory usage in mysql · b6abe0d2
      unknown authored
      Fixed compiler warnings, errors and link errors
      Fixed new bug on Solaris with gethrtime()
      Added --debug-check option to all mysql clients to print errors and memory leaks
      Added --debug-info to all clients. This now works as --debug-check but also prints memory and cpu usage
      
      
      BUILD/compile-solaris-sparc-debug:
        Remove old cpu options
      client/client_priv.h:
        Added OPT_DBUG_CHECK
      client/mysql.cc:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysql_upgrade.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqladmin.cc:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqlbinlog.cc:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqlcheck.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqldump.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqlimport.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqlshow.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqlslap.c:
        --debug-info now prints memory usage 
        Added --debug-check
      client/mysqltest.c:
        --debug-info now prints memory usage 
        Added --debug-check
      include/my_sys.h:
        Added extra option to TERMINATE to not print statistics
      libmysql/libmysql.c:
        Fixed compiler warning
      mysql-test/mysql-test-run.pl:
        --debug-info -> --debug-check to not print memory usage
      mysys/my_getsystime.c:
        Moved fast time calculation to my_micro_time_and_time()
        Fixed bug in previous push related to HAVE_GETHRTIME
      mysys/my_init.c:
        Print not freed memory in my_end() if MY_CHECK_ERROR is given
      mysys/my_static.c:
        Cleanup
      mysys/safemalloc.c:
        Added extra option to TERMINATE to not print statistics
      sql/item_xmlfunc.cc:
        Fixed compiler warning
      sql/sql_test.cc:
        Fixed TERMINATE() call
      unittest/mysys/base64-t.c:
        Fixed link error
      unittest/mysys/bitmap-t.c:
        Fixed link error
      unittest/mysys/my_atomic-t.c:
        Fixed link error
      b6abe0d2
    • unknown's avatar
      Fix a valgrind warning. For some reason it never popped up before. · 80584169
      unknown authored
      
      sql/sql_class.cc:
        Fix a valgrind warning (row_count_func is used before it was initialized
        in SQLCOM_CALL)
      80584169
    • unknown's avatar
      Fix an unstable test. · 5c682a56
      unknown authored
      
      mysql-test/r/log_tables.result:
        Update results.
      mysql-test/t/log_tables.test:
        Silence a race condition: TRUNCATE code issues mysql_frm_type without
        a metadata lock, and finds no table if hits the moment when
        ALTER is swapping two tables.
      5c682a56
    • unknown's avatar
      Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime · ea978293
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/r/func_time.result:
        Auto merged
      mysql-test/r/mysqldump.result:
        Auto merged
      mysql-test/t/func_time.test:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/include/mix1.inc:
        Manual merge.
      mysql-test/r/innodb_mysql.result:
        Manual merge.
      ea978293
    • unknown's avatar
      Fix an unstable test. It was reliant on the current time. · ce7cbe73
      unknown authored
      
      mysql-test/r/func_time.result:
        Update results (use fixed datetime values instead of NOW()).
      mysql-test/t/func_time.test:
        Use fixed datetime values instead of NOW(): the test would have a sporadic
        failure when current day changed between two consequtive calls to
        NOW(). The test actually tests FROM_DAYS/TO_DAYS functions, 
        so use of NOW() is not necessary.
      ce7cbe73
  3. 31 Jul, 2007 6 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1 · 3f0bf2e8
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/r/mysqldump.result:
        Auto merged
      mysql-test/t/disabled.def:
        Auto merged
      mysql-test/t/mysqldump.test:
        Auto merged
      sql/handler.cc:
        Auto merged
      sql/lock.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_lex.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      sql/table.h:
        Auto merged
      mysql-test/include/mix1.inc:
        Manual merge.
      mysql-test/r/innodb_mysql.result:
        Manual merge.
      3f0bf2e8
    • unknown's avatar
      Post-merge fixes. · f9c94f97
      unknown authored
      
      sql/sql_base.cc:
        Fix an incorrect manual merge.
      f9c94f97
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · c8c5323b
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/r/mysqldump.result:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/innodb_mysql.result:
        Manual merge.
      mysql-test/t/innodb_mysql.test:
        Manual merge.
      sql/sql_table.cc:
        Manual merge.
      c8c5323b
    • unknown's avatar
      Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime · cbcb6988
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      sql/mysql_priv.h:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_lex.cc:
        Auto merged
      mysql-test/include/mix1.inc:
        Manual merge.
      mysql-test/r/innodb_mysql.result:
        Manual merge.
      sql/handler.h:
        Manual merge.
      sql/lock.cc:
        Manual merge.
      sql/opt_range.cc:
        Manual merge.
      sql/sql_base.cc:
        Manual merge.
      sql/sql_table.cc:
        Manual merge.
      cbcb6988
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 29372b5d
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.1-cleanup
      
      
      sql/log.cc:
        Auto merged
      29372b5d
    • unknown's avatar
      11a492b7
  4. 30 Jul, 2007 7 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 95df5baa
      unknown authored
      into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
      
      95df5baa
    • unknown's avatar
      handler::ha_write_row_no_binlog() hack removed, · 80df2b55
      unknown authored
      existing table->no_replicate code is used instead
      
      80df2b55
    • unknown's avatar
      Disable IM tests. · 5d16675d
      unknown authored
      5d16675d
    • unknown's avatar
      Fix a compilation warning. · 074cc0ff
      unknown authored
      
      sql/handler.h:
        Fix a warning.
      074cc0ff
    • unknown's avatar
      Fix merge: update result files. · 9b2d18ba
      unknown authored
      
      mysql-test/r/ddl_i18n_koi8r.result:
        Update result file.
      mysql-test/r/ddl_i18n_utf8.result:
        Update result file.
      9b2d18ba
    • unknown's avatar
      Slow query log to file now displays queries with microsecond precission · 21e25f8b
      unknown authored
      --long-query-time is now given in seconds with microseconds as decimals
      --min_examined_row_limit added for slow query log
      long_query_time user variable is now double with 6 decimals
      Added functions to get time in microseconds
      Added faster time() functions for system that has gethrtime()  (Solaris)
      We now do less time() calls.
      Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
      set_var.cc and my_getopt() can now handle DOUBLE variables.
      All time() calls changed to my_time()
      my_time() now does retry's if time() call fails.
      Added debug function for stopping in mysql_admin_table() when tables are locked
      Some trivial function and struct variable renames to avoid merge errors.
      Fixed compiler warnings
      Initialization of some time variables on windows moved to my_init() 
      
      
      include/my_getopt.h:
        Added support for double arguments
      include/my_sys.h:
        Fixed wrong type to packfrm()
        Added new my_time functions
      include/mysql/plugin.h:
        Added support for DOUBLE
      libmysql/CMakeLists.txt:
        Added new time functions
      libmysql/Makefile.shared:
        Added new time functions
      mysql-test/r/variables.result:
        Testing of long_query_time
      mysql-test/t/variables.test:
        Testing of long_query_time
      mysys/charset.c:
        Fixed compiler warnings
      mysys/default_modify.c:
        Fixed compiler warnings
      mysys/hash.c:
        Fixed compiler warnings
      mysys/mf_getdate.c:
        Use my_time()
      mysys/mf_iocache2.c:
        Fixed compiler warnings
      mysys/mf_pack.c:
        Fixed compiler warnings
      mysys/mf_path.c:
        Fixed compiler warnings
      mysys/my_append.c:
        Fixed compiler warnings
      mysys/my_compress.c:
        Fixed compiler warnings
      mysys/my_copy.c:
        Fixed compiler warnings
      mysys/my_gethwaddr.c:
        Fixed compiler warnings
      mysys/my_getopt.c:
        Added support for double arguments
      mysys/my_getsystime.c:
        Added functions to get time in microseconds.
        Added faster time() functions for system that has gethrtime()  (Solaris)
        Moved windows initialization code to my_init()
      mysys/my_init.c:
        Added initializing of variables needed for windows time functions
      mysys/my_static.c:
        Added variables needed for windows time functions
      mysys/my_static.h:
        Added variables needed for windows time functions
      mysys/my_thr_init.c:
        Added THR_LOCK_time, used for faster my_time()
      mysys/mysys_priv.h:
        Added THR_LOCK_time, used for faster my_time()
      mysys/thr_alarm.c:
        time() -> my_time()
      sql/event_data_objects.cc:
        end_time() -> set_current_time()
      sql/event_queue.cc:
        end_time() -> set_current_time()
      sql/event_scheduler.cc:
        Fixed compiler warnings
      sql/field.h:
        Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
      sql/item.h:
        Added decimal to Item_float(double)
      sql/item_cmpfunc.h:
        Added decimal to Item_float(double)
      sql/item_timefunc.cc:
        time() -> my_time()
      sql/item_xmlfunc.cc:
        Fixed compiler warning
      sql/lock.cc:
        lock_time() -> set_time_after_lock()
      sql/log.cc:
        Timing in slow query log to file is now done in microseconds
        Changed some while() loops to for() loops.
        Fixed indentation
        time() -> my_time()
      sql/log.h:
        Slow query logging is now done based on microseconds
      sql/log_event.cc:
        time() -> my_time()
        Fixed arguments to new Item_float()
      sql/mysql_priv.h:
        Fixed compiler warnings
        Added opt_log_slow_slave_statements
      sql/mysqld.cc:
        Added --log_slow_slave_statements and --min_examined_row_limit
        --long-query-time now takes a double argument with microsecond resolution
        Don't write shutdown message when using --help
        Removed not needed \n
        Thread create time and connect time is now done in microseconds
        time() -> my_time()
        Avoid some time() calls
      sql/net_serv.cc:
        Fixed compiler warnings
      sql/parse_file.cc:
        time() -> my_time()
      sql/set_var.cc:
        Added support for DOUBLE variables
        Added support for variables that are given in seconds with microsecond resolution
      sql/set_var.h:
        Added support for variables that are given in seconds with microsecond resolution
      sql/slave.cc:
        Allow logging of slave queries to slow query log if 'opt_log_slow_slave_statements' is given
        time() -> my_time()
      sql/sql_cache.h:
        Fixed compiler warning()
      sql/sql_class.cc:
        Initialize new THD variables
      sql/sql_class.h:
        long_query_time is now in microseconds
        Added min_examined_row_limit
        Reordered some THD elements for higher efficency
        Added timers in microseconds (connect_utime, thr_create_utime, start_utime and utime_after_lock)
        Start of query is now recorded both in seconds and in microseconds.
        Following renames was made for more clarity and avoid merge problems from earlier versions:
        connect_time -> connect_utime
        thr_create_time -> thr_create_utime
        end_time()  -> set_current_time()
        lock_time() -> set_time_after_lock()
        
        Added THD::start_utime, which is start of query in microseconds from some arbitary time
        Added function THD::current_utime()
        
        Removed safe_time() as retry's are handled in my_time()
      sql/sql_connect.cc:
        User resources are now using microsecond resolution
      sql/sql_insert.cc:
        end_time() -> set_current_time()
      sql-common/client.c:
        time() -> my_time()
      sql/sql_parse.cc:
        Testing if we should print to slow_query_log() is now done with microsecond precission.
        If min_examined_row_limit is given, only log queries to slow query log that has examined more rows than this.
      sql/sql_select.cc:
        Simplify code now that Item_float() takes decimals as argument
      sql/sql_show.cc:
        time() -> my_time()
        Added support for SYS_DOUBLE
      sql/sql_table.cc:
        Added debug function for stopping in mysql_admin_table() when tables are locked
      sql/structs.h:
        intime -> reset_utime
      21e25f8b
    • unknown's avatar
      Add 'extension' field to all client library structures to make them extensible · c5d66dc6
      unknown authored
      Reorder structure elements to make structures smaller and faster on 64 bit systems
      This is a first step in cleaning up the client include files (but should be enough to allow us to do future fixes without breaking the library)
      This change is part of WL#2872,  Make client library extensible.
      
      
      configure.in:
        Increased shared library version of client library
        Detect gethrtime (for future)
      include/mysql.h:
        Add 'extension' field to all structures to make them extensible
        Reorder structure elements to make structures smaller and faster on 64 bit systems
        Removed an old define that is not needed for MySQL 5.1
      include/mysql_com.h:
        Add 'extension' field to all structures to make them extensible
        Reorder structure elements to make structures smaller and faster on 64 bit systems
      c5d66dc6
  5. 29 Jul, 2007 3 commits
  6. 28 Jul, 2007 1 commit
  7. 27 Jul, 2007 14 commits
    • unknown's avatar
      manual merge · 9c3c4817
      unknown authored
      9c3c4817
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 52d3ed38
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.1-25422-d
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/r/log_state.result:
        Auto merged
      mysql-test/r/show_check.result:
        Auto merged
      mysql-test/t/show_check.test:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/share/errmsg.txt:
        Auto merged
      sql/sp.cc:
        Auto merged
      52d3ed38
    • unknown's avatar
      Code review changes · 94620433
      unknown authored
      94620433
    • unknown's avatar
      Fix merge. · 2d612630
      unknown authored
      2d612630
    • unknown's avatar
      Merge ibm.:/home/alik/Documents/MySQL/devel/5.0-rt · ed9bfeb3
      unknown authored
      into  ibm.:/home/alik/Documents/MySQL/devel/5.1-rt-merge
      
      
      mysql-test/r/mysqldump-max.result:
        Auto merged
      mysql-test/r/openssl_1.result:
        Auto merged
      mysql-test/t/show_check.test:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      client/mysqldump.c:
        Manual merge.
      mysql-test/r/mysqldump.result:
        Manual merge + use local.
      ed9bfeb3
    • unknown's avatar
      Fix test so that it will be environment-independent. · da0986d1
      unknown authored
      
      mysql-test/r/mysqldump.result:
        Update result file.
      da0986d1
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 1b1715ab
      unknown authored
      into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
      
      1b1715ab
    • unknown's avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929 · c1fd3178
      unknown authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
      
      c1fd3178
    • unknown's avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929 · 02f3a750
      unknown authored
      into  adventure.(none):/home/thek/Development/cpp/bug29929/my51-bug29929
      
      
      mysql-test/r/sp-prelocking.result:
        Auto merged
      mysql-test/t/sp-prelocking.test:
        Auto merged
      sql/sql_lex.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      sql/table.h:
        SCCS merged
      02f3a750
    • unknown's avatar
      Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables · 34695c01
      unknown authored
      When a table was explicitly locked with LOCK TABLES no associated
      tables from any related trigger on the subject table were locked.
      As a result of this the user could experience unexpected locking
      behavior and statement failures similar to "failed: 1100: Table'xx'
      was not locked with LOCK TABLES".
      
      This patch fixes this problem by making sure triggers are
      pre-loaded on any statement if the subject table was explicitly
      locked with LOCK TABLES.
      
      
      mysql-test/r/sp-prelocking.result:
        Added test case
      mysql-test/t/sp-prelocking.test:
        Added test case
      sql/sql_lex.cc:
        - Moved some conditional logic out of the table iteration.
        - Added event map values for LOCK TABLE command.
      sql/table.cc:
        - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
          and set_trg_event_map as methods for manipulating the table event map.
          The original function was only called from st_lex::set_trg_event_type_for_tables
          so it was possible to move the event map creation logic to this function as
          a loop optimization.
      sql/table.h:
        - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
          and set_trg_event_map as methods for manipulating the table event map.
          The original function was only called from st_lex::set_trg_event_type_for_tables
          so it was possible to move the event map creation logic to this function as
          a loop optimization.
      34695c01
    • unknown's avatar
      Fix for BUG#30027: mysqldump does not dump views properly. · 2a846fa2
      unknown authored
      mysqldump generates view defitions in two stages:
      
        - dump CREATE TABLE statements for the temporary tables.  For each view a
          temporary table, that has the same structure as the view is created.
      
        - dump DROP TABLE statements for the temporary tables and CREATE VIEW
          statements for the view.
      
      This approach is required because views can have dependencies on each other
      (a view can use other views). So, they should be created in the particular
      order. mysqldump however is not smart enough, so in order to resolve
      dependencies it creates temporary tables first of all.
      
      The problem was that mysqldump might have generated incorrect dump for the
      temporary table when a view has non-ASCII column name. That happened when
      default-character-set is not utf8.
      
      The fix is to:
      
        1. Switch character_set_client for the mysqldump's connection to binary
           before issuing SHOW FIELDS statement in order to avoid conversion.
          
        2. Dump switch character_set_client statements to UTF8 and back for
           CREATE TABLE statement that is issued to create temporary table.
      
      
      client/mysqldump.c:
        1. Switch character_set_results for mysqldump's connection to
        binary before SHOW FIELDS in order to avoid conversion to client
        character set.
        
        2. Dump switch character_set_client statements to UTF8 and back
        for CREATE TABLE statement.
      mysql-test/r/mysqldump.result:
        Update result file.
      mysql-test/t/mysqldump.test:
        Test case for BUG#30027.
      2a846fa2
    • unknown's avatar
      Fix for BUG#28030: test im_instance_conf fails with an assert. · b70262d6
      unknown authored
      The problem was a race condition on shutdown -- when IM got shutdown
      request while a guarded mysqld is starting. In this case the Guardian
      thread tried to stop the mysqld, but might fail if the mysqld hadn't
      created pid-file so far. When this happened, the mysqld-monitor thread
      didn't stop, so the assert in Thread_registry happened.
      
      The fix is to make several attempts to stop mysqld if it is active.
      
      
      server-tools/instance-manager/guardian.cc:
        Try to stop mysqld several times if it is still active.
      server-tools/instance-manager/instance.cc:
        Make Instance::kill_mysqld() to return operation status.
      server-tools/instance-manager/instance.h:
        Make Instance::kill_mysqld() to return operation status.
      server-tools/instance-manager/thread_registry.cc:
        Log unregistered thread ids.
      b70262d6
    • unknown's avatar
      Bug #30094 mi_test_all: assertion failure · 9ea7329f
      unknown authored
      updated to keypart_map api
      
      
      storage/myisam/mi_test2.c:
        Bug #30094 mi_test_all: assertion failure
        updated to keypart_map api
        prefix char keys are not supported anymore
      9ea7329f
    • unknown's avatar
      A fix and a test case for Bug#24918 drop table and lock / inconsistent · 0c371edd
      unknown authored
      between perm and temp tables. Review fixes.
      
      The original bug report complains that if we locked a temporary table
      with LOCK TABLES statement, we would not leave LOCK TABLES mode
      when this temporary table is dropped.
      
      Additionally, the bug was escalated when it was discovered than
      when a temporary transactional table that was previously
      locked with LOCK TABLES statement was dropped, futher actions with
      this table, such as UNLOCK TABLES, would lead to a crash.
      
      The problem originates from incomplete support of transactional temporary
      tables. When we added calls to handler::store_lock()/handler::external_lock()
      to operations that work with such tables, we only covered the normal
      server code flow and did not cover LOCK TABLES mode. 
      In LOCK TABLES mode, ::external_lock(LOCK) would sometimes be called without
      matching ::external_lock(UNLOCK), e.g. when a transactional temporary table
      was dropped. Additionally, this table would be left in the list of LOCKed 
      TABLES.
      
      The patch aims to address this inadequacy. Now, whenever an instance
      of 'handler' is destroyed, we assert that it was priorly
      external_lock(UNLOCK)-ed. All the places that violate this assert
      were fixed.
      
      This patch introduces no changes in behavior -- the discrepancy in
      behavior will be fixed when we start calling ::store_lock()/::external_lock()
      for all tables, regardless whether they are transactional or not, 
      temporary or not.
      
      
      mysql-test/r/innodb_mysql.result:
        Update test results (Bug#24918)
      mysql-test/t/innodb_mysql.test:
        Add a test case for Bug#24918
      sql/handler.h:
        Make handler::external_lock() a protected method. Backport from 5.1 its
        public wrapper handler::ha_external_lock().
        Assert that the handler is not closed if it is still locked.
      sql/lock.cc:
        In mysql_lock_tables only call lock_external() for the list of tables that
        we called store_lock() for. 
        E.g. get_lock_data() does not add non-transactional temporary tables to the
        lock list, so lock_external() should not be called for them.
        
        Use handler::ha_external_lock() instead of handler::external_lock().
        
        Add comments for mysql_lock_remove(), parameterize one strange
        side effect that it has. At least in one place where mysql_lock_remove
        is used, this side effect is not desired (DROP TABLE). The parameter
        will be dropped in 5.1, along with the side effect.
      sql/mysql_priv.h:
        Update declaration of mysql_lock_remove().
      sql/opt_range.cc:
        Deploy handler::ha_external_lock() instead of handler::external_lock()
      sql/sql_base.cc:
        When closing a temporary table, remove the table from the list of LOCKed 
        TABLES of this thread, in case it's there. 
        It's there if it is a transactional temporary table.
        Use a new declaration of mysql_lock_remove().
      sql/sql_class.h:
        Extend the comment for THD::temporary_tables.
      sql/sql_table.cc:
        Deploy handler::ha_external_lock() instead of handler::external_lock()
      0c371edd