1. 22 Oct, 2009 4 commits
    • Alexander Nozdrin's avatar
      Automerge from mysql-next-mr-runtime. · d18d2dc8
      Alexander Nozdrin authored
      d18d2dc8
    • Alexander Nozdrin's avatar
      Backporting a patch for Bug#43138. That patch had been already backported · 9434e604
      Alexander Nozdrin authored
      to 5.1 partially. This patch brings what was left to mysql-next-mr.
      
      Original revisions in 6.0:
      ------------------------------------------------------------
      revno: 2617.31.26
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: 6.0-rt-bug43138.3
      timestamp: Thu 2009-04-30 19:31:30 +0400
      message:
        Fix for Bug#43138: DROP DATABASE failure does not clean up message list.
        
        The problem was that the high-level function mysql_rm_db() invoked
        low-level mysql_rm_table_part2(), which reported low-level error
        (Unknown table) if SE refused to delete a table. Also when
        mysql_rm_table_part2() reported an error, it didn't add corresponding
        warning into the list (because it is used from other places where such
        behaviour is required).
        
        The fix is to
          1. Remove no_warnings_for_error usage from sql_table.cc
          2. Improve internal error handler support in THD, so that
             a stack of error handlers is allowed.
          3. Create an internal error handler (Drop_table_error_handler)
             to silence useless warnings.
          4. Use the handler in DROP DATABASE and DROP TABLE statements.
      ------------------------------------------------------------
      revno: 2617.69.38
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: mysql-next-bugfixing-bug37431
      timestamp: Mon 2009-08-24 21:52:09 +0400
      message:
        A test case for Bug#37431 (DROP TABLE does not report errors correctly).
      ------------------------------------------------------------
      revno: 2617.31.29
      committer: Dmitry Lenev <dlenev@mysql.com>
      branch nick: mysql-6.0-runtime
      timestamp: Fri 2009-05-01 17:37:34 +0400
      message:
        Follow-up for fix for bug "Bug#43138: DROP DATABASE failure
        does not clean up message list".
        
        Fixed drop.test failure under non-debug server by moving part
        of test dependent on debug-only feature to separate .test file,
        which won't be run for non-debug versions of server.
      ------------------------------------------------------------
      revno: 2617.45.17
      committer: Sergei Golubchik <serg@mysql.com>
      branch nick: 6.0-maria
      timestamp: Wed 2009-05-13 20:08:58 +0200
      message:
        followup for bug#43138
        if delete fails with a permission denied error, we want to show it
      ------------------------------------------------------------
      
      The patch was backported to 5.1 in scope of Bug#42364 by
      the following revision:
      ------------------------------------------------------------
      revno: 2497.975.3
      committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
      branch nick: mysql-5.1-bugteam
      timestamp: Fri 2009-07-03 13:22:06 +0500
      message:
        Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
        enabled message storing into error message list
        for 'drop table' command
      ------------------------------------------------------------
      9434e604
    • Alexander Nozdrin's avatar
      Backporting patches for Bug#38347 (ALTER ROUTINE privilege · 72025253
      Alexander Nozdrin authored
      allows SHOW CREATE TABLE) from 6.0. Original revisions:
      ------------------------------------------------------------
      revno: 2617.31.8
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: 6.0-rt-bug38347
      timestamp: Thu 2009-03-26 09:08:24 +0300
      message:
        Patch for Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
        
        If a user has any of the following privileges for a table (or the database
        if the table), he should be able to issue SHOW CREATE TABLE for the table:
          - CREATE
          - DROP
          - ALTER
          - DELETE
          - INDEX
          - INSERT
          - SELECT
          - UPDATE
          - TRIGGER
          - REFERENCES
          - GRANT OPTION
          - CREATE VIEW
          - SHOW VIEW
        
        Any other privilege (even SUPER) should not allow SHOW CREATE TABLE.
      ------------------------------------------------------------
      revno: 2617.31.11
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: 6.0-rt
      timestamp: Fri 2009-03-27 21:36:34 +0300
      message:
        Additional patch for Bug#38347 (ALTER ROUTINE privilege
        allows SHOW CREATE TABLE).
        
        The problem was that information_schema.test,
        information_schema_parameters.test and information_schema_routines.test
        failed with the first patch. That happened due to limitation in check_access():
        it allows only SELECT_ACL privilege for INFORMATION_SCHEMA tables.
        
        The patch is to request only SELECT_ACL privilege for INFORMATION_SCHEMA tables.
      ------------------------------------------------------------
      72025253
    • Konstantin Osipov's avatar
      Merge with next-mr-runtime. · bd83ad89
      Konstantin Osipov authored
      bd83ad89
  2. 21 Oct, 2009 1 commit
    • Konstantin Osipov's avatar
      Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1, · 8ec23470
      Konstantin Osipov authored
      2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
      2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
      some other minor revisions.
      
      This patch implements: 
      
      WL#4264 "Backup: Stabilize Service Interface" -- all the
      server prerequisites except si_objects.{h,cc} themselves (they can
      be just copied over, when needed).
      
      WL#4435: Support OUT-parameters in prepared statements.
      
      (and all issues in the initial patches for these two
      tasks, that were discovered in pushbuild and during testing).
      
      Bug#39519: mysql_stmt_close() should flush all data
      associated with the statement.
      
      After execution of a prepared statement, send OUT parameters of the invoked
      stored procedure, if any, to the client.
      
      When using the binary protocol, send the parameters in an additional result
      set over the wire.  When using the text protocol, assign out parameters to
      the user variables from the CALL(@var1, @var2, ...) specification.
      
      The following refactoring has been made:
        - Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
        - A new Protocol::send_result_set_row() was introduced to incapsulate
          common functionality for sending row data.
        - Signature of Protocol::prepare_for_send() was changed: this operation
          does not need a list of items, the number of items is fully sufficient.
      
      The following backward incompatible changes have been made:
        - CLIENT_MULTI_RESULTS is now enabled by default in the client;
        - CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
      
      include/mysql.h:
        Add a new flag to MYSQL_METHODS::flush_use_result
        function pointer. This flag determines if all results
        should be flushed or only the first one:
            
        - if flush_all_results is TRUE, then cli_flush_use_result()
          will read/flush all pending results. I.e. it will read
          all packets while server status attribute indicates that
          there are more results. This is a new semantic, required
          to fix the bug.
                    
        - if flush_all_results is FALSE, the old sematic
          is preserved -- i.e. cli_flush_use_result() reads data
          until first EOF-packet.
      include/mysql.h.pp:
        Update the ABI with new calls (compatible changes).
      include/mysql_com.h:
        Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
      libmysql/libmysql.c:
        Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
        Fix a minor bug in alloc_fields() -- not all members were copied over,
        and some only shallow-copied (catalog).
        Flush all results in mysql_stmt_close() (Bug#39519).
      libmysqld/lib_sql.cc:
        Rename send_fields() -> send_result_set_metadata().
        Refactoring: change prepare_for_send() so that it accepts only 
        what it really needs -- a number of elements in the list.
      mysql-test/r/ps.result:
        Update results: WL#4435.
      mysql-test/t/ps.test:
        WL#4435: A test case for an SQL-part of the problem.
      sql-common/client.c:
        Bug#39519.
        Implement new functionality in cli_flush_use_result():
        if flush_all_delete is TRUE, then it should read/flush
        all pending results.
      sql/Makefile.am:
        Add a new header sql_prepare.h to the list
        of build headers.
      sql/events.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/handler.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/mysql_priv.h:
        Move sql_prepare.cc-specific declarations to a new
        header - sql_prepare.h.
      sql/procedure.h:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/protocol.cc:
        Move the logic responsible for sending of one result
        set row to the Protocol class. Define a template
        for end-of-statement action. 
        Refactoring: change prepare_for_send() so that it accepts 
        only what it really needs -- a number of elements in the list.
        Rename send_fields() to send_result_set_metadata().
      sql/protocol.h:
        Update with new declarations (WL#4435).
        Rename send_fields() -> send_result_set_metadata().
        prepare_for_send() only needs the number of columns to send,
        and doesn't use the item list - update signature to require
        only what's needed.
        Add a new protocol type -- Protocol_local.
      sql/repl_failsafe.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/slave.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_acl.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_base.cc:
        Include sql_prepare.h (for Reprepare_observer).
      sql/sql_cache.cc:
        Extend the query cache flags block to be able
        to store a numeric id for the result format,
        not just a flag binary/non-binary.
      sql/sql_class.cc:
        Update to use the rename of Protocol::send_fields()
        to Protocol::send_result_set_metadata().
        Use Protocol::send_one_result_set_row().
      sql/sql_class.h:
        Move the declaration of Reprepare_observer to the 
        new header - sql_prepare.h.
        Update to the new signature of class Protocol::send_fields().
      sql/sql_connect.cc:
        Use a protocol template method instead of
        raw NET layer API at the end of a statement.
      sql/sql_cursor.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_error.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_handler.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
        Use new method Protocol::send_one_result_set_row().
      sql/sql_help.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_lex.cc:
        Initialize multi_statements variable.
        Add a handy constant for empty lex
        string.
      sql/sql_lex.h:
        Add a separate member for a standalone
        parsing option - multi-statements support.
      sql/sql_list.cc:
        sql_list.h is a standalone header now, 
        no need to include mysql_priv.h.
      sql/sql_list.h:
        Make sql_list.h a stand-alone header.
      sql/sql_parse.cc:
        Include sql_prepare.h for prepared
        statements- related declarations.
        Use a new Protocol template method to end
        each statement (send OK, EOF or ERROR to
        the client).
      sql/sql_prepare.cc:
        Implement Execute Direct API (WL#4264), 
        currently unused. It will be used by the service
        interface (Backup).
        Use a new header - sql_prepare.h.
        Add support for OUT parameters in the 
        binary and text protocol (prepared statements 
        only).
      sql/sql_prepare.h:
        Add a new header to contain (for now)
        all prepared statement- external
        related declarations.
      sql/sql_profile.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_repl.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_select.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_show.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_string.h:
        Add a way to convert a String to LEX_STRING.
      sql/sql_table.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_update.cc:
        Remove an extraneous my_error(). The error
        is already reported in update_non_unique_table_error().
      sql/sql_yacc.yy:
        Support for multi-statements is an independent
        property of parsing, not derived from 
        the protocol type.
      tests/mysql_client_test.c:
        Add tests for WL#4435 (binary protocol).
      8ec23470
  3. 20 Oct, 2009 1 commit
  4. 19 Oct, 2009 2 commits
    • Kristofer Pettersson's avatar
      Automerge · d1b03b43
      Kristofer Pettersson authored
      d1b03b43
    • Kristofer Pettersson's avatar
      Bug#27145 EXTRA_ACL troubles · 0659b857
      Kristofer Pettersson authored
      The flag EXTRA_ACL is used in conjugation with our access checks, yet it is
      not clear what impact this flag has.
      This is a code clean up which replaces use of EXTRA_ACL with an explicit
      function parameter.
      The patch also fixes privilege checks for:
      - SHOW CREATE TABLE: The new privilege requirement is any privilege on
        the table-level.
      - CHECKSUM TABLE: Requires SELECT on the table level.
      - SHOW CREATE VIEW: Requires SHOW_VIEW and SELECT on the table level
        (just as the manual claims)
      - SHOW INDEX: Requires any privilege on any column combination.
      
      
      mysql-test/r/grant.result:
        * Error message now shows correct command (SHOW instead of SELECT)
      mysql-test/r/grant2.result:
        * Error message now shows correct command (SHOW instead of SELECT)
      mysql-test/r/grant4.result:
        * This test file tests privilege requirements for
          SHOW COLUMNS
          CREATE TABLE .. LIKE
          SHOW CREATE TABLE
          SHOW INDEX
          CHECKSUM TABLE
          SHOW CREATE VIEW
      mysql-test/r/information_schema_db.result:
        * Added SELECT privilege to testdb_2 as
          SHOW CREATE VIEW now demands this privilege
          as well as SHOW VIEW.
      mysql-test/r/outfile.result:
        * Changed error code
      mysql-test/r/view_grant.result:
        * Additional SELECT privilege is now needed
          for SHOW CREATE VIEW
      mysql-test/t/grant4.test:
        * This test file tests privilege requirements for
          SHOW COLUMNS
          CREATE TABLE .. LIKE
          SHOW CREATE TABLE
          SHOW INDEX
          CHECKSUM TABLE
          SHOW CREATE VIEW
      mysql-test/t/information_schema_db.test:
        * Added SELECT privilege to testdb_2 as
          SHOW CREATE VIEW now demands this privilege
          as well as SHOW VIEW.
      mysql-test/t/outfile.test:
        * Changed error code
      mysql-test/t/view_grant.test:
        * Additional SELECT privilege is now needed
          for SHOW CREATE VIEW
      sql/mysql_priv.h:
        * Replaced EXTRA_ACL with a parameter
      sql/sp_head.cc:
        * Replaced EXTRA_ACL with a parameter
      sql/sql_acl.cc:
        * Converted function documentation to doxygen and clarified some behaviors.
        * Changed value from uint to bool to better reflect its meaning.
        * Removed pointless variable orig_want_access
        * Added function has_any_table_level_privileges to help with requirements
          checks during SHOW CREATE TABLE.
      sql/sql_acl.h:
        * changed signature of check_grant()
        * introduced access control function has_any_table_leevl_privileges()
      sql/sql_base.cc:
        * Check_table_access has new signature
      sql/sql_cache.cc:
        * Check_table_access has new signature
      sql/sql_parse.cc:
        * Rewrote function documentation in doxygen comments for: check_access,
          check_table_acces, check_grant.
        * Removed EXTRA_ACL flag where it doesn't hold any meaningful purpose anymore
          and replaced it with a function parameter where any privileges on any column
          combination would satisfy the requirement.
        * Fixed privilege check for SHOW COLUMNS and SHOW INDEX
        * Modified check_table_access to gain clarity in what EXTRA_ACL actually does.
        * Modified check_access to gain clarity in what EXTRA_ACL actually does.
        * Fixed privilege check for CREATE TABLE .. LIKE .. ; It now requires SELECT
          privileges on the table.
        * Fixed privilege check for SHOW CREATE TABLE ..; It now requires any privilege
          on the table level.
      sql/sql_plugin.cc:
        * check_table_access has new signature
      sql/sql_prepare.cc:
        * check_table_access has new signature
      sql/sql_show.cc:
        * check_table_access has new signature
      sql/sql_trigger.cc:
        * check_table_access has new signature
      sql/sql_update.cc:
        * check grant has new signature
      sql/sql_view.cc:
        * check_table_access has new signature
      0659b857
  5. 16 Oct, 2009 9 commits
    • Alexander Nozdrin's avatar
      Pull from mysql-next-mr-runtime. · b7c3a76c
      Alexander Nozdrin authored
      b7c3a76c
    • Alexander Nozdrin's avatar
      Backporting a patch for Bug#47421 from 6.0: · bafa0fdf
      Alexander Nozdrin authored
      revno: 2617.68.41
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: mysql-6.0-codebase-bugfixing-bug47421
      timestamp: Wed 2009-09-23 17:48:11 +0400
      message:
        A patch for Bug#47421 (Server crash from -
        SELECT SUM ( DISTINCT <char_column>) in azalea).
        
        The problem was that DBUG_RETURN() macro should have been
        used instead the 'return' operator.
      bafa0fdf
    • Konstantin Osipov's avatar
      Backport of: · f0ccd917
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.22.11
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-records
      timestamp: Mon 2008-08-11 16:40:09 +0400
      message:
        Move read_record related functions to a new header - records.h
      
      sql/Makefile.am:
        Introduce records.h
      sql/handler.h:
        Forward-declare class handler (an unnecessary forward declaration
        was removed from mysql_priv.h).
      sql/item_subselect.cc:
        Make read_record function naming more consistent.
        Assign read_record function at once, no need to defer till
        read_first_record invocation.
      sql/mysql_priv.h:
        Include records.h, previously part of structs.h
      sql/records.cc:
        Use records.h
      sql/sql_select.h:
        Update to use new declarations.
      sql/structs.h:
        Move declarations of READ_RECORD and related functions to records.h
      f0ccd917
    • Alexander Nozdrin's avatar
      Backporting revision from 6.0: · ad8d89cd
      Alexander Nozdrin authored
      revno: 2617.56.25
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: azalea-bugfixing
      timestamp: Thu 2009-07-09 20:30:43 +0400
      message:
        Add a comment in the source (Bug#40358).
      ad8d89cd
    • Alexander Nozdrin's avatar
      Backporting patch for Bug#38992 from 6.0. · 2397e659
      Alexander Nozdrin authored
      Original revision:
      revno: 2617.55.2
      committer: Alexander Nozdrin <alik@sun.com>
      branch nick: azalea-bf-bug38992
      timestamp: Fri 2009-06-19 16:41:16 +0400
      message:
        Fix for Bug#38992: Server crashes sporadically with
        'waiting for initial ...' msg on windows.
        
        The problem is that connection timeout is too small
        for busy windows box.
        
        The fix is to
          - add support for connect_timeout command line argument
            to mysqltest;
          - set default value of the connect_timeout option to
            120 seconds.
      2397e659
    • Konstantin Osipov's avatar
      Backport of: · abb5e74d
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.13.6
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-3288
      timestamp: Fri 2008-07-11 20:22:44 +0400
      message:
        WL#3288, step 1: ensure that the SQL layer always closes an open
        cursor (rnd or index read) before closing a handler.
      
      
      sql/handler.h:
        Assert that the read is closed in handler destructor.
      sql/sql_select.cc:
        Remove JOIN::table which was a piece of redundancy. The problem was
        that JOIN::cleanup() works only if JOIN::table is not null,
        but JOIN::cleanup also assigns JOIN::table to NULL. This assignment
        is apparently there for safety, from the times when we had no support for correlated
        subqueries. Indeed, in case of a evaluation of a correlated subquery more than once it led
        to JOIN::cleanup doing nothing, and leaving the rnd or index read open.
            
        In do_select(), make sure we call JOIN::join_free() even in case of an
        error.
      sql/sql_select.h:
        Remove JOIN::table, JOIN::all_tables has the same functionality.
      abb5e74d
    • Konstantin Osipov's avatar
      Backport of 2617.65.4 from 6.0-codebase. · 3138ee3b
      Konstantin Osipov authored
      A fix and a test case for Bug#34898 "mysql_info() reports 0 warnings
      while mysql_warning_count() reports 1"
      
      Review the patch by Chad Miller, implement review comments
      (since Chad left) and push the patch.
      
      This bug is actually not a bug. At least according to Monty.
      See Bug#841 "wrong number of warnings" reported back in July 2003
      and closed as "not a bug".
      mysql_info() was printing the number of truncated columns, not
      the number of warnings.
      But since the message of mysql_info() was "Warnings: <number of truncated
      columns>", people would expect to get the number
      of warnings in it, not the number of truncated columns.
      
      So a possible fix would be to change the message of mysql_info()
      to say Rows changed: <n>, truncated: <m>.
      
      Instead, put the number of warnings there. That is, remove the
      feature that thd->cuted_fields (the number of truncated fields)
      is exposed to the client. The number of truncated columns can be
      calculated on the client, by analyzing SHOW WARNINGS output,
      and in future we may remove thd->cuted_fields altogether.
      So let's have one less thing to worry about.
      
      client/mysqltest.cc:
        Fix a bug in mysqltest program which used to return
        a wrong number of affected rows in ps-protocol, and a wrong
        mysql_info() information in both protocols in presence of warnings.
      mysql-test/r/insert.result:
        Update results (Bug#34898)
      mysql-test/suite/rpl/r/rpl_udf.result:
        Update to the changed output of mysqltest: mysql_info() is now printed
        before warnings.
      mysql-test/t/insert.test:
        Add a test case for Bug#34898.
      sql/sql_table.cc:
        A fix for Bug#34898 - report statement warn count, not the
        number of truncated values in mysql_info().
      sql/sql_update.cc:
        A fix for Bug#34898 - report statement warn count, not the
        number of truncated values in mysql_info().
      3138ee3b
    • Konstantin Osipov's avatar
      Merge with next-mr-runtime · 9a2d3666
      Konstantin Osipov authored
      9a2d3666
    • Konstantin Osipov's avatar
      Fix a windows build failure (next-mr-runtime). · 38b403ba
      Konstantin Osipov authored
      sql/sql_cache.cc:
        Use my_hash_init() on Windows as well.
      sql/sql_class.h:
        Use struct Query_cache_block (not class) for forward declaration,
        realing the code to match 6.0 alignment.
      38b403ba
  6. 15 Oct, 2009 10 commits
    • Konstantin Osipov's avatar
      Merge with next-mr-runtime · 4eec84df
      Konstantin Osipov authored
      4eec84df
    • Konstantin Osipov's avatar
      Backport of: · 3bb00f19
      Konstantin Osipov authored
      ------------------------------------------------------------
      revno: 2476.657.208
      committer: anozdrin/alik@station.
      timestamp: Tue 2007-12-04 17:22:53 +0300
      message:
      Remove rpl_probe, enable_rpl_parse and disable_rpl_parse commands
      from mysqltest, the corresponding funtctions have been removed from
      MySQL C API
      
      
      
      client/mysqltest.cc:
        Remove unused functions.
      libmysql/CMakeLists.txt:
        Remove manager.c from Windows build.
      sql-common/client.c:
        A post-merge fix.
      3bb00f19
    • Konstantin Osipov's avatar
      Backport of: · ded234de
      Konstantin Osipov authored
      ------------------------------------------------------------
      revno: 2476.981.1
      committer: msvensson@pilot.mysql.com
      timestamp: Mon 2007-11-26 19:03:23 +0100
      message:
        Bug#31952 Remove undocumented mysql_rpl_* functions.
        - Functions removed + variables in st_mysql and st_mysql_options 
          renamed to "unused".
        - Code updated to work without those functions and variables
      ded234de
    • Konstantin Osipov's avatar
      Backport of: · c8a83977
      Konstantin Osipov authored
      ---------------------------------------------------------------------
      revno: 2476.980.1
      committer: msvensson@pilot.mysql.com
      timestamp: Wed 2007-10-31 18:17:54 +0100
      message:
        Bug#31954 Remove undocumented mysql_manager_* C API functions and
        mysqlmanager (old)
          - Remove the mysql_manager* functions, struct and defines
      c8a83977
    • Alexander Nozdrin's avatar
      A backporting patch for the following revision from 6.0: · 71757339
      Alexander Nozdrin authored
      revno: 2630.22.41
      committer: Alexander Nozdrin <alik@mysql.com>
      branch nick: 6.0-rt-bug39255
      timestamp: Thu 2008-10-16 16:39:30 +0400
      message:
        A patch for Bug#39255: Stored procedures: crash if function
        references nonexistent table.
        
        The problem is not reproduced in 6.0. Adding a test case.
      71757339
    • Alexander Nozdrin's avatar
      Adding funcs_1 into "make test" · 3b3955be
      Alexander Nozdrin authored
      3b3955be
    • Magne Mahre's avatar
      Bug #43054 Assertion `!table->auto_increment_field_not_null' failed when · a363c06e
      Magne Mahre authored
                 redefining trigger
            
      The 'table->auto_increment_field_not_null' flag is only valid within
      processing of a single row, and should be set to FALSE before
      navigating to the next row, or exiting the operation.
            
      This bug was caused by an SQL error occuring while executing a trigger
      after the flag had been set, so the normal resetting was bypassed.
      The table object was then returned to the table share's cache in
      a dirty condition.   When the table object was reused, an assert
      caught that the flag was set.
            
      This patch explicitly clears the flag on error/abort.
      
      
      Backported from mysql-6.0-codebase  revid: 2617.52.1
      a363c06e
    • Magne Mahre's avatar
      Bug #38124 (clean-up patch) · 7e895de8
      Magne Mahre authored
      The fix for Bug #38124 introuced a bug. If the value given 
      for a set_var exceeded the length of the temporary buffer,
      we would read behind the end of the buffer.  Using 
      c_ptr_safe(), instead of c_ptr(), ensures that we won't
      read beyond the buffer limit
      
      mysql-6.0-codebase revid: 2617.44.1
      7e895de8
    • Magne Mahre's avatar
      Bug #37433 Deadlock between open_table, close_open_tables, · 53d54948
      Magne Mahre authored
                      get_table_share, drop_open_table
                  
      In the partition handler code, LOCK_open and share->LOCK_ha_data
      are acquired in the wrong order in certain cases.  When doing a
      multi-row INSERT (i.e a INSERT..SELECT) in a table with auto-
      increment column(s). the increments must be in a monotonically
      continuous increasing sequence (i.e it can't have "holes"). To
      achieve this, a lock is held for the duration of the operation.
      share->LOCK_ha_data was used for this purpose.
                  
      Whenever there was a need to open a view _during_ the operation
      (views are not currently pre-opened the way tables are), and
      LOCK_open was grabbed, a deadlock could occur.  share->LOCK_ha_data
      is other places used _while_ holding LOCK_open.
                  
      A new mutex was introduced in the HA_DATA_PARTITION structure,
      for exclusive use of the autoincrement data fields, so we don't
      need to overload the use of LOCK_ha_data here.
                  
      A module test case has not been supplied, since the problem occurs
      as a result of a race condition, and testing for this condition 
      is thus not deterministic.   Testing for it could be done by
      setting up a test case as described in the bug report.
      53d54948
    • Magne Mahre's avatar
      Bug #38124 "general_log_file" variable silently unset when using expression · ffbe8512
      Magne Mahre authored
                        
      When assigning the new string value to the variable, the
      Item::str_value member was used.  This is not according to
      the protocol.  str_value is an internal member used for
      temporary assignments, and is not consistently set for all
      string operations.  It is set for constant strings, so it would
      work in these cases, but not for string functions (concat,
      substr, etc.)
                        
      The correct approach is to use Item::val_str(..) to evaluate
      and retrieve the string.
      
      Backport from 6.0-codebase
      
      6.0-codebase revno: 2617.31.17
      ffbe8512
  7. 14 Oct, 2009 6 commits
    • Konstantin Osipov's avatar
      Backport of: · 9b41c753
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2617.22.5
      committer: Konstantin Osipov <kostja@sun.com>
      branch nick: mysql-6.0-runtime
      timestamp: Tue 2009-01-27 05:08:48 +0300
      message:
        Remove non-prefixed use of HASH.
        Always use my_hash_init(), my_hash_inited(), my_hash_search(),
        my_hash_element(), my_hash_delete(), my_hash_free() rather
        than non-prefixed counterparts (hash_init(), etc).
        Remove the backward-compatible defines.
      9b41c753
    • Konstantin Osipov's avatar
      Backport of: · 2b75d952
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.28.1
      committer: Konstantin Osipov <kostja@sun.com>
      branch nick: mysql-6.0-runtime
      timestamp: Thu 2008-10-23 15:23:44 +0400
      message:
        Bug#32738 "mysqld: Two slow log option/variable descriptions are
        inaccurate"
        Update option description per suggestion from the documentation team.
      
      sql/mysqld.cc:
        Update options help texts (Bug#32738). Use - instead of _ in option
        names.
      2b75d952
    • Konstantin Osipov's avatar
      Backport of: · d5948e8d
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.22.39
      committer: Konstantin Osipov <kostja@sun.com>
      branch nick: mysql-6.0-runtime
      timestamp: Wed 2008-10-08 23:44:34 +0400
      message:
        Bug #34481 A typo in HugeTLB error Message.
      
      mysys/my_largepage.c:
        Fix a typo.
      d5948e8d
    • Jon Olav Hauglid's avatar
      Backport of revno: 2617.81.4 · 3dce051c
      Jon Olav Hauglid authored
      Bug #47274 assert in open_table on CREATE TABLE <already existing>
      
      The problem was an assertion during execution of CREATE TABLES. 
      This assertion would occur if INSERT DELAYED or REPLACE DELAYED
      were used to update a table containing an AUTO_INCREMENT column
      and if the inserted row had a user-supplied value for that column.
      Any CREATE TABLE statement (including CREATE TABLE SELECT and
      CREATE TABLE LIKE) trying to create the same table and 
      which followed the INSERT/REPLACED would cause the assertion.
      
      The problem was only noticeable on debug builds of the server
      and not present in the mysql-5.1 tree.
      
      The cause of the problem was that the code for delayed insert did
      not properly reset the TABLE->auto_increment_if_null flag after 
      The flag is used to indicate that a non-null value of an auto_increment field
      has been provided by the user or retrieved from a current record.
      Open_tables() contains an assertion that tests this flag, and this
      was triggered by CREATE TABLE.
      
      This patch fixes the problem by resetting the auto_increment_if_null
      field to FALSE once INSERT/REPLACE DELAYED has updated the table, 
      similar to what is done already for regular INSERT statements.
      
      Test case added to delayed.test.
      3dce051c
    • Konstantin Osipov's avatar
      Backport of: · c0c7925c
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.22.31
      committer: Konstantin Osipov <kostja@sun.com>
      branch nick: mysql-6.0-runtime
      timestamp: Thu 2008-10-02 19:08:09 +0400
      message:
        Bug #34818 --default-table-type option should be removed
        Remove the deprecated option.
      
      
      sql/mysqld.cc:
        Remove a deprecated option.
      c0c7925c
    • Konstantin Osipov's avatar
      Backport of: · 595b8f92
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.22.8
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-runtime
      timestamp: Sun 2008-08-10 18:49:52 +0400
      message:
        Get rid of typedef struct for the most commonly used types:
        TABLE, TABLE_SHARE, LEX. This simplifies use of tags
        and forward declarations.
      595b8f92
  8. 13 Oct, 2009 6 commits
    • Konstantin Osipov's avatar
      ---------------------------------------------------------- · c84a2389
      Konstantin Osipov authored
      revno: 2630.2.16
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-runtime
      timestamp: Fri 2008-06-27 13:26:03 +0400
      message:
        Fix max_user_connections_func failure on Solaris.
        A connection that failed to log in due to a resource limit could
        be returned to the thread pool with a dangling link to user_connect
        structure of an old user. Later on it could be authenticated
        to a user that doesn't have a resource limit, so this dangling
        link won't be reset. --pool-of-threads mode made the situation
        easy to reproduce, and thus highlighted a bug that has been
        around forever.
        Make sure there are no dangling links.
      
      sql/sql_connect.cc:
        Do not return a connection structure to the thread pool with a dangling link.
      c84a2389
    • Konstantin Osipov's avatar
      Backport of: · df39e6ab
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.7.1
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-lock-tables-new
      timestamp: Mon 2008-06-02 15:14:18 +0400
      message:
        Fix a test suite timeout in partition.test and partition_csv.test
      
      storage/csv/ha_tina.cc:
        Change the blobroot mem root life cycle and thus fix a memory hog
        in case of many csv handlers.
      df39e6ab
    • Konstantin Osipov's avatar
      Backport of: · e2400f18
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.2.6
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-27430
      timestamp: Mon 2008-05-26 16:12:28 +0400
      message:
        Cover four special cases of WL#4166 with tests:
        - when the query cache is disabled at the time of prepared statement
        reprepare
        - when long data parameters are used
        - when character_set_connection != character_set_client, and a parameter
        conversion takes place
        - when parameter data is out of acceptable range, e.g. year 10000 is
        supplied as part of MYSQL_TYPE_DATETIME value. The server is supposed
        to warn in such case.
      
      mysql-test/include/query_cache_sql_prepare.inc:
        Addditional test for Bug#27430
      mysql-test/r/query_cache_ps_no_prot.result:
        Update result file.
      mysql-test/r/query_cache_ps_ps_prot.result:
        Update result file.
      tests/mysql_client_test.c:
        Add more tests (Bug#27430 and WL#4166).
        Fix test_datetime_range() test to correctly assert for the number
        of warnings. Additionally, print these warnings out.
      e2400f18
    • Konstantin Osipov's avatar
      Backport of: · edebd2a2
      Konstantin Osipov authored
      -----------------------------------------------------------
      revno: 2630.2.4
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-runtime
      timestamp: Fri 2008-05-23 02:42:32 +0400
      message:
        Bug#27430 "Crash in subquery code when in PS and table DDL changed after
        PREPARE"
        Add a test case for the situation with small TDC and many merge children.
      
      from 6.0-codebase.
      
      mysql-test/r/merge.result:
        Update results (Bug#27430)
      mysql-test/t/merge.test:
        Add test case (Bug#27430)
      edebd2a2
    • Konstantin Osipov's avatar
      Backport of the following revision from 6.0-codebase: · 9a4a845a
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2617.1.12
      committer: kostja@bodhi.(none)
      timestamp: Sun 2008-04-20 11:18:52 +0400
      message:
        A fix for Bug#32771 "events_bugs.test fails randomly".
        In Event_scheduler::stop(), which may be called from destructor,
        wait synchronously for the parallel Event_scheduler::stop() to
        complete before returning. This fixes a race between
        MySQL shutdown thread and the scheduler thread who could call
        stop() in parallel.
      
      sql/event_scheduler.cc:
        There was a race condition between the shutdown thread and
        the scheduler thread: the shutdown thread could delete the scheduler
        mutex before the sheduler has stopped.
      9a4a845a
    • Konstantin Osipov's avatar
      Introduce thd->query_cache_tls (thread · 99420dd9
      Konstantin Osipov authored
      local storage for query cache). 
      We need more than one pointer in a thread to
      represent the query cache and net->query_cache_query can not be used
      any more (due to ABI compatibility issues and to different life
      time of NET and THD).
      This is a backport of the following patch from 6.0:
      ----------------------------------------------------------
      revno: 2476.1157.2
      committer: kostja@bodhi.(none)
      timestamp: Sat 2007-06-16 13:29:24 +0400
      
      
      include/mysql.h.pp:
        Update the ABI (NET::query_cache_query is now unused).
      include/mysql_com.h:
        NET::query_cache_query is now unused.
      sql/mysql_priv.h:
        Update signatures of ex-functios now member functions.
      sql/sql_cache.cc:
        Introduce THD::query_cache_tls.
      sql/sql_cache.h:
        Introduce THD::query_cache_tls.
      sql/sql_class.cc:
        Introduce THD::query_cache_tls.
      sql/sql_class.h:
        Introduce THD::query_cache_tls.
      sql/sql_parse.cc:
        Use THD::query_cache_tls.
      sql/sql_select.cc:
        Use THD::query_cache_tls.
      99420dd9
  9. 12 Oct, 2009 1 commit
    • Magne Mahre's avatar
      Bug #33693 general log name and location depend on PID file, · 9a65687b
      Magne Mahre authored
                 not on predefined values
      
      The default name of the PID file was constructed, as documented, 
      based on the hostname.  This name was subsequently used as the
      base for the general log file name.   If the name of the PID
      file was overridden in the configuration, and no explicit name
      was set for the general log file, the path location for the
      PID file was used also for the general log file.
                        
      A new variable, 'default_logfile_name', has been introduced.  This name
      is constructed based on the hostname, and is then used to
      construct both the PID file and the general log file.
                        
      The general log file will now, unless explicitly set, be
      located in the server data directory (as documentated in
      the server docs)
      
      
      mysql-test/t/log_state.test:
        run/mysqld.log was created as a consequence of this bug.
        After the fix it is no longer created, and will thus not
        be deleted.
      9a65687b