1. 14 Dec, 2007 1 commit
    • unknown's avatar
      Merge station.:/mnt/raid/alik/MySQL/devel/5.1 · 541ac204
      unknown authored
      into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt
      
      
      client/mysqltest.c:
        Auto merged
      include/mysql_com.h:
        Auto merged
      libmysqld/emb_qcache.cc:
        Auto merged
      libmysqld/emb_qcache.h:
        Auto merged
      libmysqld/lib_sql.cc:
        Auto merged
      mysql-test/lib/mtr_report.pl:
        Auto merged
      sql/ha_partition.cc:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/set_var.h:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_db.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_partition.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      storage/myisam/ha_myisam.cc:
        Auto merged
      sql/protocol.cc:
        SCCS merged
      541ac204
  2. 13 Dec, 2007 24 commits
    • unknown's avatar
      Remove an unused argument of sql_update::do_updates(). · a6eec72e
      unknown authored
      
      sql/sql_class.h:
        Remove an unused argument.
      sql/sql_update.cc:
        Remove an unused argument.
      a6eec72e
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 68c6ff09
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      68c6ff09
    • unknown's avatar
      Fix broken embedded build (broken by the patch for Bug#12713, first part). · 37a2c459
      unknown authored
      
      client/mysqltest.c:
        Remove a call to my_message() (server call) in case of a client error.
        It asserts in the embedded build now, since is called after send_ok().
      libmysqld/emb_qcache.cc:
        Use net_send_eof (embedded implementation) in embedded query cache/
        send result to client, since send_eof currently does not
        send anything.
      libmysqld/emb_qcache.h:
        Declare net_send_eof.
      libmysqld/lib_sql.cc:
        Fix the main loop of the embedded server to use the new Diagnostics_area
        API.
      sql/log.cc:
        Silence errors of open_performance_schema_table. This function
        is called for general logging, and it happens after the error
        has been sent to the client, and thus triggers an assert.
      storage/myisam/ha_myisam.cc:
        Remove an old hack that broke repair.test in embedded build:
        unless we clear an error here, the server attempts to send OK after
        ERROR. This currently asserts.
      37a2c459
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · 35742460
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
      
      
      storage/blackhole/ha_blackhole.cc:
        use local
      35742460
    • unknown's avatar
      additional fix · 12504d90
      unknown authored
      12504d90
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 5cd3e1bf
      unknown authored
      into  damien-katzs-computer.local:/Users/dkatz/51runtime
      
      
      sql/set_var.cc:
        Auto merged
      sql/set_var.h:
        Auto merged
      5cd3e1bf
    • unknown's avatar
      Merge mysql.com:/Users/davi/mysql/bugs/32395-5.1 · 2c19aa1a
      unknown authored
      into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
      
      
      sql/ha_ndbcluster_binlog.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      2c19aa1a
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · ab088404
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
      
      
      storage/blackhole/ha_blackhole.cc:
        use local
      ab088404
    • unknown's avatar
      additional after merge fix · f61f5f72
      unknown authored
      
      mysql-test/r/partition_range.result:
        removed fix for bug#30573
      mysql-test/suite/parts/r/rpl_partition.result:
        updated result file
      mysql-test/t/partition_range.test:
        removed test case for bug#30573
      sql/ha_partition.cc:
        removed fix for bug#30573
      f61f5f72
    • unknown's avatar
      valgrind error fix · e51e6097
      unknown authored
      e51e6097
    • unknown's avatar
      after merge fix · 0cc269da
      unknown authored
      0cc269da
    • unknown's avatar
      after merge fix · f7f96cd2
      unknown authored
      f7f96cd2
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt · 214ea206
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
      
      
      client/mysql.cc:
        Auto merged
      client/mysqltest.c:
        Auto merged
      include/mysql_com.h:
        Auto merged
      libmysql/CMakeLists.txt:
        Auto merged
      mysql-test/r/delayed.result:
        Auto merged
      mysql-test/r/func_misc.result:
        Auto merged
      mysql-test/r/innodb.result:
        Auto merged
      mysql-test/r/myisam.result:
        Auto merged
      mysql-test/r/ps.result:
        Auto merged
      mysql-test/t/func_misc.test:
        Auto merged
      mysql-test/t/merge.test:
        Auto merged
      mysql-test/t/myisam.test:
        Auto merged
      mysql-test/t/range.test:
        Auto merged
      mysql-test/t/subselect.test:
        Auto merged
      mysql-test/t/type_datetime.test:
        Auto merged
      mysql-test/t/variables.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/set_var.h:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      storage/myisam/ha_myisam.cc:
        Auto merged
      storage/myisam/mi_check.c:
        Auto merged
      mysql-test/include/mix1.inc:
        manual merge
      mysql-test/r/innodb_mysql.result:
        manual merge
      mysql-test/r/range.result:
        manual merge
      sql/item_cmpfunc.cc:
        manual merge
      214ea206
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.1 · 9a10c20b
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
      
      
      BitKeeper/etc/ignore:
        auto-union
      client/mysql.cc:
        Auto merged
      client/mysqltest.c:
        Auto merged
      include/mysql_com.h:
        Auto merged
      libmysql/CMakeLists.txt:
        Auto merged
      libmysqld/lib_sql.cc:
        Auto merged
      mysql-test/r/archive.result:
        Auto merged
      mysql-test/r/create.result:
        Auto merged
      mysql-test/r/delayed.result:
        Auto merged
      mysql-test/r/func_misc.result:
        Auto merged
      mysql-test/r/innodb.result:
        Auto merged
      mysql-test/r/innodb_mysql.result:
        Auto merged
      mysql-test/r/merge.result:
        Auto merged
      mysql-test/r/ps.result:
        Auto merged
      mysql-test/r/type_date.result:
        Auto merged
      mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
        Auto merged
      mysql-test/t/create.test:
        Auto merged
      mysql-test/t/func_misc.test:
        Auto merged
      mysql-test/t/information_schema.test:
        Auto merged
      mysql-test/t/merge.test:
        Auto merged
      mysql-test/t/subselect.test:
        Auto merged
      mysql-test/t/type_date.test:
        Auto merged
      mysql-test/t/type_datetime.test:
        Auto merged
      mysql-test/t/variables.test:
        Auto merged
      mysys/queues.c:
        Auto merged
      sql/events.cc:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/ha_partition.cc:
        Auto merged
      sql/handler.cc:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/protocol.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/set_var.h:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_db.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_partition.cc:
        Auto merged
      sql/sql_plugin.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_string.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      sql/table.cc:
        Auto merged
      sql/table.h:
        Auto merged
      storage/myisam/ha_myisam.cc:
        Auto merged
      storage/myisam/mi_check.c:
        Auto merged
      storage/myisam/mi_open.c:
        Auto merged
      tests/mysql_client_test.c:
        Auto merged
      mysql-test/lib/mtr_report.pl:
        manual merge
      mysql-test/r/myisam.result:
        manual merge
      mysql-test/r/partition.result:
        manual merge
      mysql-test/r/user_var.result:
        manual merge
      mysql-test/t/myisam.test:
        manual merge
      mysql-test/t/partition.test:
        manual merge
      mysql-test/t/user_var.test:
        manual merge
      sql/item.h:
        manual merge
      sql/item_func.cc:
        manual merge
      storage/myisammrg/ha_myisammrg.cc:
        manual merge
      9a10c20b
    • unknown's avatar
      after merge fix · f1d98054
      unknown authored
      f1d98054
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt · 4618000b
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
      
      
      include/mysql_com.h:
        Auto merged
      myisam/mi_check.c:
        Auto merged
      4618000b
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/5.0 · 33f82b17
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
      
      
      client/mysql.cc:
        Auto merged
      client/mysqltest.c:
        Auto merged
      include/mysql_com.h:
        Auto merged
      libmysql/CMakeLists.txt:
        Auto merged
      myisam/mi_check.c:
        Auto merged
      mysql-test/r/delayed.result:
        Auto merged
      mysql-test/r/innodb.result:
        Auto merged
      mysql-test/r/myisam.result:
        Auto merged
      mysql-test/r/ps.result:
        Auto merged
      mysql-test/t/merge.test:
        Auto merged
      mysql-test/t/myisam.test:
        Auto merged
      mysql-test/t/subselect.test:
        Auto merged
      mysql-test/t/type_datetime.test:
        Auto merged
      mysql-test/t/variables.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/ha_myisam.cc:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/set_var.h:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/func_misc.result:
        manual merge
      mysql-test/r/innodb_mysql.result:
        manual merge
      mysql-test/t/func_misc.test:
        manual merge
      mysql-test/t/innodb_mysql.test:
        manual merge
      sql/sql_insert.cc:
        manual merge
      33f82b17
    • unknown's avatar
      Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 196f0c75
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug32198
      
      
      196f0c75
    • unknown's avatar
      BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly · c6675cd1
      unknown authored
      - Make conditions like "date_col $CMP$ 'datetime-const'" range-sargable
      
      
      mysql-test/r/range.result:
        BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
        - Testcase
      mysql-test/t/range.test:
        BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
        - Testcase
      sql/field.cc:
        BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
        - Added comments
      c6675cd1
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/4.1 · 618cb7a8
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/4.1-opt
      
      
      include/mysql_com.h:
        Auto merged
      myisam/mi_check.c:
        Auto merged
      618cb7a8
    • unknown's avatar
      Merge station.:/mnt/raid/alik/MySQL/devel/5.1 · f2b8de23
      unknown authored
      into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt
      
      
      sql/ha_partition.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_partition.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      f2b8de23
    • unknown's avatar
      Fix a compilation warning and a subtle bug with truncation of the · a3a0d435
      unknown authored
      last_insert_id introduced by the patch for Bug#12713 (part 1)
      
      
      a3a0d435
    • unknown's avatar
    • unknown's avatar
      Fix a compilation error. · 9e7abc2c
      unknown authored
      9e7abc2c
  3. 12 Dec, 2007 10 commits
    • unknown's avatar
      Bug#32395 Alter table under a impending global read lock causes a server crash · e5a397e2
      unknown authored
      The problem is that some DDL statements (ALTER TABLE, CREATE
      TRIGGER, FLUSH TABLES, ...) when under LOCK TABLES need to
      momentarily drop the lock, reopen the table and grab the write
      lock again (using reopen_tables). When grabbing the lock again,
      reopen_tables doesn't pass a flag to mysql_lock_tables in
      order to ignore the impending global read lock, which causes a
      assertion because LOCK_open is being hold. Also dropping the
      lock must not signal to any threads that the table has been
      relinquished (related to the locking/flushing protocol).
      
      The solution is to correct the way the table is reopenned
      and the locks grabbed. When reopening the table and under
      LOCK TABLES, the table version should be set to 0 so other
      threads have to wait for the table. When grabbing the lock,
      any other flush should be ignored because it's theoretically
      a atomic operation. The chosen solution also fixes a potential
      discrepancy between binlog and GRL (global read lock) because
      table placeholders were being ignored, now a FLUSH TABLES WITH
      READ LOCK will properly for table with open placeholders.
      
      It's also important to mention that this patch doesn't fix
      a potential deadlock if one uses two GRLs under LOCK TABLES
      concurrently.
      
      
      mysql-test/r/lock_multi.result:
        Add test case result for Bug#32395
      mysql-test/r/trigger_notembedded.result:
        Add test case result for Bug#32395
      mysql-test/t/lock_multi.test:
        Add test case for Bug#32395
      mysql-test/t/trigger_notembedded.test:
        Enable test case for Bug#32395
      sql/ha_ndbcluster.cc:
        Update close_cached_tables usage.
      sql/ha_ndbcluster_binlog.cc:
        Update close_cached_tables usage.
      sql/mysql_priv.h:
        Update close_cache_tables prototype.
      sql/set_var.cc:
        Update close_cached_tables usage and set flag to wait for
        tables with placeholders. This is one of the places where
        a GRL can be obtained.
      sql/sql_base.cc:
        Preserve old version for write locked tables and ignore
        pending flushes and update close_cache_tables to take
        into account name locked tables.
      sql/sql_parse.cc:
        Update close_cached_tables usage and pass flag so that
        name locked tables are waited for.
      sql/sql_table.cc:
        Protect the table against a impending GRL if under LOCK TABLES.
      e5a397e2
    • unknown's avatar
      Merge stella.local:/home2/mydev/mysql-5.0-axmrg · 0d5caaa4
      unknown authored
      into  stella.local:/home2/mydev/mysql-5.1-axmrg
      
      
      mysql-test/t/merge.test:
        Auto merged
      0d5caaa4
    • unknown's avatar
      Dummy push to help pushbuild running again. · 0ced2a4d
      unknown authored
      Fixed case of comment.
      
      
      mysql-test/t/merge.test:
        Fixed case of comment.
      0ced2a4d
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · b9b38501
      unknown authored
      into  damien-katzs-computer.local:/Users/dkatz/mysql-5.1-runtime
      
      
      sql/mysqld.cc:
        Auto merged
      b9b38501
    • unknown's avatar
      Bug #29993 Default value of log_output should be 'FILE', not 'TABLE' · 4fbdff0f
      unknown authored
      Ensure default logging is "file" logging, for additional ways the option can be turned on. Verified on OS X, but not tested automatically.
      
      
      4fbdff0f
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 2be5708a
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-12713-1
      
      
      mysql-test/r/grant.result:
        Auto merged
      mysql-test/t/grant.test:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      2be5708a
    • unknown's avatar
      Bug#12713 "Error in a stored function called from a SELECT doesn't · 2a0d2fef
      unknown authored
      cause ROLLBACK of statement", part 1. Review fixes.
      
      Do not send OK/EOF packets to the client until we reached the end of 
      the current statement.
      This is a consolidation, to keep the functionality that is shared by all 
      SQL statements in one place in the server.
      Currently this functionality includes:
      - close_thread_tables()
      - log_slow_statement().
      
      After this patch and the subsequent patch for Bug#12713, it shall also include:
      - ha_autocommit_or_rollback()
      - net_end_statement()
      - query_cache_end_of_result().
      
      In future it may also include:
      - mysql_reset_thd_for_next_command().
      
      
      include/mysql_com.h:
        Rename now unused members of NET: no_send_ok, no_send_error, report_error.
        These were server-specific variables related to the client/server
        protocol. They have been made obsolete by this patch.
        
        Previously the same members of NET were used to store the error message
        both on the client and on the server. 
        The error message was stored in net.last_error (client: mysql->net.last_error,
        server: thd->net.last_error).
        The error code was stored in net.last_errno (client: mysql->net.last_errno,
        server: thd->net.last_errno).
        The server error code and message are now stored elsewhere 
        (in the Diagnostics_area), thus NET members are no longer used by the
        server.
        Rename last_error to client_last_error, last_errno to client_last_errno
        to avoid potential bugs introduced by merges.
      include/mysql_h.ic:
        Update the ABI file to reflect a rename. 
        Renames do not break the binary compatibility.
      libmysql/libmysql.c:
        Rename last_error to client_last_error, last_errno to client_last_errno.
        This is necessary to ensure no unnoticed bugs introduced by merged
        changesets.
        
        Remove net.report_error, net.no_send_ok, net.no_send_error.
      libmysql/manager.c:
        Rename net.last_errno to net.client_last_errno.
      libmysqld/lib_sql.cc:
        Rename net.last_errno to net.client_last_errno.
        
        Update the embedded implementation of the client-server protocol to
        reflect the refactoring of protocol.cc.
      libmysqld/libmysqld.c:
        Rename net.last_errno to net.client_last_errno.
      mysql-test/r/events.result:
        Update to reflect the change in mysql_rm_db(). Now we drop stored
        routines and events for a given database name only if there
        is a directory for this database name. ha_drop_database() and
        query_cache_invalidate() are called likewise. 
        Previously we would attempt to drop routines/events even if database
        directory was not found (it worked, since routines and events are stored
        in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
        does not exist".
        The change was done because the previous code used to call send_ok()
        twice, which led to an assertion failure when asserts against it were
        added by this patch.
      mysql-test/r/grant.result:
        Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error 
        if mysql.procs_priv is missing.
        This fixes the assert that send_ok() must not called after send_error()
        (the original patch for Bug 16470 was prone to this).
      mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
        Produce a more detailed error message.
      mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
        Produce a more detailed error message.
      mysql-test/t/grant.test:
        Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
        is missing.
      server-tools/instance-manager/mysql_connection.cc:
        Rename net.last_errno to net.client_last_errno.
      sql/ha_ndbcluster_binlog.cc:
        Add asserts. 
        
        Use getters to access statement status information.
        
        Add a comment why run_query() is broken. Reset the diagnostics area
        in the end of run_query() to fulfill the invariant that the diagnostics_area
        is never assigned twice per statement (see the comment in the code
        when this can happen). We still do not clear thd->is_fatal_error and
        thd->is_slave_error, which may lead to bugs, I consider the whole affair
        as something to be dealt with separately.
      sql/ha_partition.cc:
        fatal_error() doesn't set an error by itself. Perhaps we should
        remove this method altogether and instead add a flag to my_error 
        to set thd->is_fatal_error property.
        
        Meanwhile, this change is a part of inspection made to the entire source
        code with the goal to ensure that fatal_error()
        is always accompanied by my_error().
      sql/item_func.cc:
        There is no net.last_error anymore. Remove the obsolete assignment.
      sql/log_event.cc:
        Use getters to access statement error status information.
      sql/log_event_old.cc:
        Use getters to access statement error status information.
      sql/mysqld.cc:
        Previously, if a continue handler for an error was found, my_message_sql() 
        would not set an error in THD. Since the current statement
        must be aborted in any case, find_handler() had a hack to assign 
        thd->net.report_error to 1.
        
        Remove this hack. Set an error in my_message_sql() even if the continue
        handler is found. The error will be cleared anyway when the handler
        is executed. This is one action among many in this patch to ensure the 
        invariant that whenever thd->is_error() is TRUE, we have a message in 
        thd->main_da.message().
      sql/net_serv.cc:
        Use a full-blown my_error() in net_serv.cc to report an error,
        instead of just setting net->last_errno. This ensures the invariant that
        whenever thd->is_error() returns TRUE, we have a message in 
        thd->main_da.message().
        
        Remove initialization of removed NET members.
      sql/opt_range.cc:
        Use my_error() instead of just raising thd->net.report_error. 
        This ensures the invariant that whenever thd->is_error() returns TRUE, 
        there is a message in thd->main_da.message().
      sql/opt_sum.cc:
        Move invocation of fatal_error() right next to the place where
        we set the error message. That makes it easier to track that whenever
        fatal_error() is called, there is a message in THD.
      sql/protocol.cc:
        Rename send_ok() and send_eof() to net_send_ok() and net_send_eof() 
        respectively. These functions write directly to the network and are not 
        for use anywhere outside the client/server protocol code. 
        
        Remove the code that was responsible for cases when either there is 
        no error code, or no error message, or both.
        Instead the calling code ensures that they are always present. Asserts
        are added to enforce the invariant.
        
        Instead of a direct access to thd->server_status and thd->total_warn_count
        use function parameters, since these from now on don't always come directly
        from THD.
        
        Introduce net_end_statement(), the single-entry-point replacement API for 
        send_ok(), send_eof() and net_send_error().
        
        Implement Protocol::end_partial_result_set to use in select_send::abort()
        when there is a continue handler.
      sql/protocol.h:
        Update declarations.
      sql/repl_failsafe.cc:
        Use getters to access statement status information in THD.
        Rename net.last_error to net.client_last_error.
      sql/rpl_record.cc:
        Set an error message in prepare_record() if there is no default
        value for the field -- later we do print this message to the client.
      sql/rpl_rli.cc:
        Use getters to access statement status information in THD.
      sql/slave.cc:
        In create_table_from_dump() (a common function that is used in 
        LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
        with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
        
        Update has_temporary_error() to work correctly when no error is set.
        This is the case when Incident_log_event is executed: it always returns
        an error but does not set an error message.
        
        Use getters to access error status information.
      sql/sp_head.cc:
        Instead of hacks with no_send_error, work through the diagnostics area 
        interface to suppress sending of OK/ERROR packets to the client.
        
        Move query_cache_end_of_result before log_slow_statement(), similarly
        to how it's done in dispatch_command().
      sql/sp_rcontext.cc:
        Remove hacks with assignment of thd->net.report_error, they are not
        necessary any more (see the changes in mysqld.cc).
      sql/sql_acl.cc:
        Use getters to access error status information in THD.
      sql/sql_base.cc:
        Access thd->main_da.sql_errno() only if there is an error. This fixes
        a bug when auto-discovery, that was effectively disabled under pre-locking.
      sql/sql_binlog.cc:
        Remove hacks with no_send_ok/no_send_error, they are not necessary 
        anymore: the caller is responsible for network communication.
      sql/sql_cache.cc:
        Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
        if the response has been served from the query cache. This raises the 
        question whether we should store EOF packet in the query cache at all,
        or generate it anew for each statement (we should generate it anew), but
        this is to be addressed separately.
      sql/sql_class.cc:
        Implement class Diagnostics_area. Please see comments in sql_class.h
        for details.
        
        Fix a subtle coding mistake in select_send::send_data: when on slave, 
        an error in Item::send() was ignored.
        The problem became visible due to asserts that the diagnostics area is
        never double assigned.
        
        Remove initialization of removed NET members.
        
        In select_send::abort() do not call select_send::send_eof(). This is
        not inheritance-safe. Even if a stored procedure continue handler is
        found, the current statement is aborted, not succeeded.
        Instead introduce a Protocol API to send the required response, 
        Protocol::end_partial_result_set().
        
        This simplifies implementation of select_send::send_eof(). No need
        to add more asserts that there is no error, there is an assert inside
        Diagnostics_area::set_ok_status() already.
        
        Leave no trace of no_send_* in the code.
      sql/sql_class.h:
        Declare class Diagnostics_area. 
        
        Remove the hack with no_send_ok from
        Substatement_state.
        
        Provide inline implementations of send_ok/send_eof.
        
        Add commetns.
      sql/sql_connect.cc:
        Remove hacks with no_send_error. 
        
        Since now an error in THD is always set if net->error, it's not necessary
        to check both net->error and thd->is_error() in the do_command loop.
        
        Use thd->main_da.message() instead of net->last_errno.
        
        Remove the hack with is_slave_error in sys_init_connect. Since now we do not
        reset the diagnostics area in net_send_error (it's reset at the beginning
        of the next statement), we can access it safely even after 
        execute_init_command.
      sql/sql_db.cc:
        Update the code to satisfy the invariant that the diagnostics area is never
        assigned twice.
        Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if 
        mysql.proc does not exist".
      sql/sql_delete.cc:
        Change multi-delete to abort in abort(), as per select_send protocol.
        Fixes the merge error with the test for Bug 29136
      sql/sql_derived.cc:
        Use getters to access error information.
      sql/sql_insert.cc:
        Use getters to access error information.
      sql-common/client.c:
        Rename last_error to client_last_error, last_errno to client_last_errno.
      sql/sql_parse.cc:
        Remove hacks with no_send_error. Deploy net_end_statement().
        
        The story of COM_SHUTDOWN is interesting. Long story short, the server 
        would become on its death's door, and only no_send_ok/no_send_error assigned
        by send_ok()/net_send_error() would hide its babbling from the client.
        
        First of all, COM_QUIT does not require a response. So, the comment saying
        "Let's send a response to possible COM_QUIT" is not only groundless 
        (even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after 
        COM_SHUTDOWN), it's plainly incorrect.
        
        Secondly, besides this additional 'OK' packet to respond to a hypothetical
        COM_QUIT, there was the following code in dispatch_command():
        
        if (thd->killed)
          thd->send_kill_message();
        if (thd->is_error()
          net_send_error(thd);
        
        This worked out really funny for the thread through which COM_SHUTDOWN
        was delivered: we would get COM_SHUTDOWN, say okay, say okay again, 
        kill everybody, get the kill signal ourselves, and then attempt to say 
        "Server shutdown in progress" to the client that is very likely long gone.
        
        This all became visible when asserts were added that the Diagnostics_area
        is not assigned twice.
        
        Move query_cache_end_of_result() to the end of dispatch_command(), since
        net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
        is a no-op if there is no started query in the cache.
        
        Consistently use select_send interface to call abort() or send_eof()
        depending on the operation result.
        
        Remove thd->fatal_error() from reset_master(), it was a no-op. 
        in hacks with no_send_error woudl save us
        from complete breakage of the client/server protocol.
        
        Consistently use select_send::abort() whenever there is an error, 
        and select_send::send_eof() in case of success.
        The issue became visible due to added asserts.
      sql/sql_partition.cc:
        Always set an error in THD whenever there is a call to fatal_error().
      sql/sql_prepare.cc:
        Deploy class Diagnostics_area.
        Remove the unnecessary juggling with the protocol in 
        Select_fetch_protocol_binary::send_eof(). EOF packet format is 
        protocol-independent.
      sql/sql_select.cc:
        Call fatal_error() directly in opt_sum_query.
        Call my_error() whenever we call thd->fatal_error().
      sql/sql_servers.cc:
        Use getters to access error information in THD.
      sql/sql_show.cc:
        Use getters to access error information in THD.
        
        Add comments.
        
        Call my_error() whenever we call fatal_error().
      sql/sql_table.cc:
        Replace hacks with no_send_ok with the interface of the diagnostics area.
        
        Clear the error if ENOENT error in ha_delete_table().
      sql/sql_update.cc:
        Introduce multi_update::abort(), which is the proper way to abort a
        multi-update. This fixes the merge conflict between this patch and
        the patch for Bug 29136.
      sql/table.cc:
        Use a getter to access error information in THD.
      sql/tztime.cc:
        Use a getter to access error information in THD.
      2a0d2fef
    • unknown's avatar
      Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime · 8f967bf6
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      8f967bf6
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1 · 10848bd5
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
      
      
      sql/sql_parse.cc:
        Auto merged
      10848bd5
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 1c0207d1
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      
      1c0207d1
  4. 11 Dec, 2007 5 commits