1. 31 Jul, 2007 1 commit
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 91f54bf1
      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.
      91f54bf1
  2. 30 Jul, 2007 1 commit
  3. 29 Jul, 2007 1 commit
    • unknown's avatar
      Clean up patch · 151e6aba
      unknown authored
      - Removed unused variable.
      
      
      sql/sql_lex.cc:
        - Removed unused variable
      151e6aba
  4. 27 Jul, 2007 5 commits
    • unknown's avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929 · 421fa784
      unknown authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
      
      
      421fa784
    • unknown's avatar
      Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables · 07955aea
      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.
      07955aea
    • unknown's avatar
      A fix and a test case for Bug#24918 drop table and lock / inconsistent · 0936976e
      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()
      0936976e
    • unknown's avatar
      Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0-engines · 766725c5
      unknown authored
      into  mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.0-engines
      
      
      766725c5
    • unknown's avatar
      BUG#29957 - alter_table.test fails · e92ce5d5
      unknown authored
      INSERT/DELETE/UPDATE followed by ALTER TABLE within LOCK TABLES
      may cause table corruption on Windows.
      
      That happens because ALTER TABLE writes outdated shared state
      info into index file.
      
      Fixed by removing obsolete workaround.
      
      Affects MyISAM tables on Windows only.
      
      
      myisam/mi_extra.c:
        On windows when mi_extra(HA_EXTRA_PREPARE_FOR_DELETE) is called,
        we release external lock and close index file. If we're in LOCK
        TABLES, MyISAM state info doesn't get updated until UNLOCK TABLES.
        
        That means when we release external lock and we're in LOCK TABLES,
        we may write outdated state info.
        
        As SQL layer closes all table instances, we do not need this
        workaround anymore.
      mysql-test/r/alter_table.result:
        A test case for BUG#29957.
      mysql-test/t/alter_table.test:
        A test case for BUG#29957.
      e92ce5d5
  5. 26 Jul, 2007 2 commits
  6. 25 Jul, 2007 6 commits
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/5.0 · 2df3b7b0
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      
      mysql-test/t/create.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/create.result:
        Merge with 5.0 (main).
      2df3b7b0
    • unknown's avatar
      Bug#25679 · b42247bc
      unknown authored
        "Federated Denial of Service"
        Federated storage engine used to attempt to open connections within
        the ::create() and ::open() methods which are invoked while LOCK_open
        mutex is being held by mysqld. As a result, no other client sessions
        can open tables while Federated is attempting to open a connection.
        Long DNS lookup times would stall mysqld's operation and a rogue
        connection string which connects to a remote server which simply
        stalls during handshake can stall mysqld for a much longer period of
        time.
        This patch moves the opening of the connection much later, when the
        federated actually issues queries, by which time the LOCK_open mutex is
        no longer being held.
      
      
      mysql-test/r/federated.result:
        change of test/results due to patch for bug25679
      mysql-test/t/federated.test:
        change of test/results due to patch for bug25679
      sql/ha_federated.cc:
        bug25679
          remove function check_foreign_fata_source()
          ha_federated::open() no longer opens the federated connection.
          ha_federated::create() no longer opens and tests connection.
          ha_federated::real_connect() opens connection and tests presence of table.
          ha_federated::real_query() sends query, calling real_connect() if neccessary.
      sql/ha_federated.h:
        bug25679
          new methods real_query() and real_connect()
      b42247bc
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/4.1-opt · 0784d924
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      
      0784d924
    • unknown's avatar
      Patch inspired by BUG#10491: Server returns data as charset · 2612fc43
      unknown authored
      binary SHOW CREATE TABLE or SELECT FROM I_S.
      
      The problem is that mysqldump generates incorrect dump for a table
      with non-ASCII column name if the mysqldump's character set is
      ASCII.
      
      The fix is to:
        1. Switch character_set_client for the mysqldump's connection
        to binary before issuing SHOW CREATE TABLE statement in order
        to avoid conversion.
        
        2. Dump switch character_set_client statements to UTF8 and back
        for CREATE TABLE statement.
      
      
      client/mysqldump.c:
        1. Switch character_set_client for the mysqldump's connection
        to binary before issuing SHOW CREATE TABLE statement in order
        to avoid conversion.
        
        2. Dump switch character_set_client statements to UTF8 and back
        for CREATE TABLE statement.
      mysql-test/r/mysqldump-max.result:
        Update result file.
      mysql-test/r/mysqldump.result:
        Update result file.
      mysql-test/r/openssl_1.result:
        Update result file.
      mysql-test/r/show_check.result:
        Update result file.
      mysql-test/t/show_check.test:
        Test case:
          - create a table with non-ASCII column name;
          - dump the database by mysqldump using ASCII character set;
          - drop the database;
          - load the dump;
          - check that the table has been re-created properly.
      2612fc43
    • unknown's avatar
      Allow mysql.proc to have extra (unknown) fields. · 48e879f9
      unknown authored
      This allows 5.0 to work with 5.1 databases.
      
      
      48e879f9
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · cf81182c
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.0-29959
      
      
      cf81182c
  7. 24 Jul, 2007 6 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 607ab14c
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      
      607ab14c
    • unknown's avatar
      fix compile on Windows for bug25714.c · 5415dcc3
      unknown authored
      ---
      fix compile on Windows for bug25714.c
      
      
      tests/bug25714.c:
        fix compile on Windows
      5415dcc3
    • unknown's avatar
      build bug25714 test app on Windows · 4ab0c0cf
      unknown authored
      4ab0c0cf
    • unknown's avatar
      Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT. · c4d53e31
      unknown authored
      When the SQL_BIG_RESULT flag is specified SELECT should store items from the
      select list in the filesort data and use them when sending to a client.
      The get_addon_fields function is responsible for creating necessary structures
      for that. But this function was allowed to do so only for SELECT and
      INSERT .. SELECT queries. This makes the SQL_BIG_RESULT useless for
      the CREATE .. SELECT queries.
      
      Now the get_addon_fields allows storing select list items in the filesort
      data for the CREATE .. SELECT queries.
      
      
      mysql-test/t/create.test:
        Added a test case for the bug#15130: CREATE .. SELECT was denied to use
        advantages of the SQL_BIG_RESULT.
      mysql-test/r/create.result:
        Added a test case for the bug#15130: CREATE .. SELECT was denied to use
        advantages of the SQL_BIG_RESULT.
      sql/filesort.cc:
        Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
        Now the get_addon_fields allows storing select list items in the filesort
        data for the CREATE .. SELECT queries.
      c4d53e31
    • unknown's avatar
      Merge xiphis.org:/anubis/antony/work/p2-bug25714.1 · 594d71a4
      unknown authored
      into  xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.0
      
      
      594d71a4
    • unknown's avatar
      Bug#25714 · 0f85ae9f
      unknown authored
        "getGeneratedKeys() does not work with FEDERATED table"
        mysql_insert() expected the storage engine to update the row data
        during the write_row() operation with the value of the new auto-
        increment field. The field must be updated when only one row has
        been inserted as mysql_insert() would ignore the thd->last_insert.
        This patch implements HA_STATUS_AUTO support in ha_federated::info()
        and ensures that ha_federated::write_row() does update the row's
        auto-increment value.
        The test case was written in C as the protocol's 'id' value is
        accessible through libmysqlclient and not via SQL statements.
        mysql-test-run.pl was extended to enable running the test binary.
      
      
      mysql-test/mysql-test-run.pl:
        bug25714
          implement support to run C test for bug25714
      sql/ha_federated.cc:
        bug25714
          The storage engine instance property auto_increment_value was not
          being set.
          mysql_insert() requires that the storage engine updates the row with
          the auto-increment value, especially when only inserting one row.
          Implement support for ha_federated::info(HA_STATUS_AUTO)
      tests/Makefile.am:
        bug25714
          build C test for bug
      mysql-test/include/have_bug25714.inc:
        New BitKeeper file ``mysql-test/include/have_bug25714.inc''
      mysql-test/r/federated_bug_25714.result:
        New BitKeeper file ``mysql-test/r/federated_bug_25714.result''
      mysql-test/r/have_bug25714.require:
        New BitKeeper file ``mysql-test/r/have_bug25714.require''
      mysql-test/t/federated_bug_25714.test:
        New BitKeeper file ``mysql-test/t/federated_bug_25714.test''
      tests/bug25714.c:
        New BitKeeper file ``tests/bug25714.c''
      0f85ae9f
  8. 23 Jul, 2007 5 commits
    • unknown's avatar
      Bug#29959 (Non-standard bison syntax in sql_yacc.yy) · 04fc8b71
      unknown authored
      In sql/sql_yacc.yy, use the %prec construct at the end of rule join_table
      
      
      sql/sql_yacc.yy:
        In sql/sql_yacc.yy, use the %prec construct at the end of rule join_table
      04fc8b71
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · c29002a5
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B29644-5.0-opt
      
      
      sql/ha_innodb.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      mysql-test/r/innodb_mysql.result:
        5.0-opt merge
      mysql-test/t/innodb_mysql.test:
        5.0-opt merge
      c29002a5
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · f76d006a
      unknown authored
      into  olga.mysql.com:/home/igor/mysql-5.0-opt
      
      
      f76d006a
    • unknown's avatar
      table.cc, sql_select.cc: · c38fa3f3
      unknown authored
        Limit the fix for bug 28591 to InnoDB only
      
      
      sql/sql_select.cc:
        Limit the fix for bug 28591 to InnoDB only
      sql/table.cc:
        Limit the fix for bug 28591 to InnoDB only
      c38fa3f3
    • unknown's avatar
      Fixed bug #29611. · d50caace
      unknown authored
      If a primary key is defined over column c of enum type then 
      the EXPLAIN command for a look-up query of the form
        SELECT * FROM t WHERE c=0
      said that the query was with an impossible where condition though the
      query correctly returned non-empty result set when the table indeed 
      contained rows with error empty strings for column c. 
      
      This kind of misbehavior was due to a bug in the function 
      Field_enum::store(longlong,bool) that erroneously returned 1 if
      the the value to be stored was equal to 0. 
      Note that the method 
      Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
      correctly returned 0 if a value of the error empty string 
      was stored. 
      
      
      mysql-test/r/type_enum.result:
        Added a test case for bug #29661.
      mysql-test/t/type_enum.test:
        Added a test case for bug #29661.
      sql/field.cc:
        Fixed bug #29611.
        If a primary key was defined over column c of enum type then 
        the EXPLAIN command for a look-up query of the form
          SELECT * FROM t WHERE c=0
        said that the query was with an impossible where condition though the
        query correctly returned non-empty result set when the table indeed 
        contained rows with error empty strings for column c. 
        
        This kind of misbehavior was due to a bug in the function 
        Field_enum::store(longlong,bool) that erroneously returned 1 if
        the the value to be stored was equal to 0. 
        Note that the method 
        Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
        correctly returned 0 if a value of the error empty string 
        was stored.
      d50caace
  9. 22 Jul, 2007 5 commits
  10. 21 Jul, 2007 8 commits
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 5f0036eb
      unknown authored
      into  olga.mysql.com:/home/igor/mysql-5.0-opt
      
      
      5f0036eb
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29338 · 9260c30d
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      
      mysql-test/r/sp.result:
        Auto merged
      mysql-test/t/sp.test:
        Merge with local tree.
      9260c30d
    • unknown's avatar
      sp.test, sp.result: · 9cad4f08
      unknown authored
        Additional test case fix for bug #29338.
      
      
      mysql-test/t/sp.test:
        Additional test case fix for bug #29338.
      mysql-test/r/sp.result:
        Additional test case fix for bug #29338.
      9cad4f08
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/mysql-5.0-opt · 7507cbaa
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29911
      
      
      7507cbaa
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29338 · aed9a5fe
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      
      mysql-test/r/sp.result:
        Merge with local tree
      mysql-test/t/sp.test:
        Merge with local tree
      aed9a5fe
    • unknown's avatar
      Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug29911 · 3520da5b
      unknown authored
      into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29911
      
      
      mysql-test/t/having.test:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      mysql-test/r/having.result:
        SCCS merged
      3520da5b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · be7b4043
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      
      mysql-test/r/create.result:
        Auto merged
      mysql-test/t/create.test:
        Auto merged
      sql/sql_class.h:
        Auto merged
      be7b4043
    • unknown's avatar
      Fixed bug #29911. · 72c6c789
      unknown authored
      This bug manifested itself for join queries with GROUP BY and HAVING clauses
      whose SELECT lists contained DISTINCT. It occurred when the optimizer could
      deduce that the result set would have not more than one row.
      The bug could lead to wrong result sets for queries of this type because
      HAVING conditions were erroneously ignored in some cases in the function
      remove_duplicates.   
      
      
      mysql-test/r/having.result:
        Added a test case for bug #29911.
      mysql-test/t/having.test:
        Added a test case for bug #29911.
      72c6c789