1. 06 Aug, 2007 1 commit
    • unknown's avatar
      A fix and a test case for Bug#29306 "Truncated data in MS Access with decimal (3,1) columns in a · d062116d
      unknown authored
      VIEW".
      
      mysql_list_fields() C API function would incorrectly set MYSQL_FIELD::decimals
      member for some view columns.
      
      The problem was in an incomplete implementation of 
      Item_ident_for_show::make_field(), which is responsible for view
      columns metadata.
      
      
      sql/item.cc:
        A fix for Bug#29306 -- properly initialize decimals in 
        Item_ident_for_show::make_field
      tests/mysql_client_test.c:
        Add a test case forBug#29306. Fix warnings.
      d062116d
  2. 01 Aug, 2007 1 commit
    • unknown's avatar
      Fix an unstable test. It was reliant on the current time. · ce7cbe73
      unknown authored
      
      mysql-test/r/func_time.result:
        Update results (use fixed datetime values instead of NOW()).
      mysql-test/t/func_time.test:
        Use fixed datetime values instead of NOW(): the test would have a sporadic
        failure when current day changed between two consequtive calls to
        NOW(). The test actually tests FROM_DAYS/TO_DAYS functions, 
        so use of NOW() is not necessary.
      ce7cbe73
  3. 31 Jul, 2007 1 commit
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · c8c5323b
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/r/mysqldump.result:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/innodb_mysql.result:
        Manual merge.
      mysql-test/t/innodb_mysql.test:
        Manual merge.
      sql/sql_table.cc:
        Manual merge.
      c8c5323b
  4. 30 Jul, 2007 1 commit
  5. 29 Jul, 2007 1 commit
    • unknown's avatar
      Clean up patch · 83fa71f4
      unknown authored
      - Removed unused variable.
      
      
      sql/sql_lex.cc:
        - Removed unused variable
      83fa71f4
  6. 27 Jul, 2007 5 commits
    • unknown's avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929 · c1fd3178
      unknown authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
      
      c1fd3178
    • unknown's avatar
      Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables · 34695c01
      unknown authored
      When a table was explicitly locked with LOCK TABLES no associated
      tables from any related trigger on the subject table were locked.
      As a result of this the user could experience unexpected locking
      behavior and statement failures similar to "failed: 1100: Table'xx'
      was not locked with LOCK TABLES".
      
      This patch fixes this problem by making sure triggers are
      pre-loaded on any statement if the subject table was explicitly
      locked with LOCK TABLES.
      
      
      mysql-test/r/sp-prelocking.result:
        Added test case
      mysql-test/t/sp-prelocking.test:
        Added test case
      sql/sql_lex.cc:
        - Moved some conditional logic out of the table iteration.
        - Added event map values for LOCK TABLE command.
      sql/table.cc:
        - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
          and set_trg_event_map as methods for manipulating the table event map.
          The original function was only called from st_lex::set_trg_event_type_for_tables
          so it was possible to move the event map creation logic to this function as
          a loop optimization.
      sql/table.h:
        - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
          and set_trg_event_map as methods for manipulating the table event map.
          The original function was only called from st_lex::set_trg_event_type_for_tables
          so it was possible to move the event map creation logic to this function as
          a loop optimization.
      34695c01
    • unknown's avatar
      A fix and a test case for Bug#24918 drop table and lock / inconsistent · 0c371edd
      unknown authored
      between perm and temp tables. Review fixes.
      
      The original bug report complains that if we locked a temporary table
      with LOCK TABLES statement, we would not leave LOCK TABLES mode
      when this temporary table is dropped.
      
      Additionally, the bug was escalated when it was discovered than
      when a temporary transactional table that was previously
      locked with LOCK TABLES statement was dropped, futher actions with
      this table, such as UNLOCK TABLES, would lead to a crash.
      
      The problem originates from incomplete support of transactional temporary
      tables. When we added calls to handler::store_lock()/handler::external_lock()
      to operations that work with such tables, we only covered the normal
      server code flow and did not cover LOCK TABLES mode. 
      In LOCK TABLES mode, ::external_lock(LOCK) would sometimes be called without
      matching ::external_lock(UNLOCK), e.g. when a transactional temporary table
      was dropped. Additionally, this table would be left in the list of LOCKed 
      TABLES.
      
      The patch aims to address this inadequacy. Now, whenever an instance
      of 'handler' is destroyed, we assert that it was priorly
      external_lock(UNLOCK)-ed. All the places that violate this assert
      were fixed.
      
      This patch introduces no changes in behavior -- the discrepancy in
      behavior will be fixed when we start calling ::store_lock()/::external_lock()
      for all tables, regardless whether they are transactional or not, 
      temporary or not.
      
      
      mysql-test/r/innodb_mysql.result:
        Update test results (Bug#24918)
      mysql-test/t/innodb_mysql.test:
        Add a test case for Bug#24918
      sql/handler.h:
        Make handler::external_lock() a protected method. Backport from 5.1 its
        public wrapper handler::ha_external_lock().
        Assert that the handler is not closed if it is still locked.
      sql/lock.cc:
        In mysql_lock_tables only call lock_external() for the list of tables that
        we called store_lock() for. 
        E.g. get_lock_data() does not add non-transactional temporary tables to the
        lock list, so lock_external() should not be called for them.
        
        Use handler::ha_external_lock() instead of handler::external_lock().
        
        Add comments for mysql_lock_remove(), parameterize one strange
        side effect that it has. At least in one place where mysql_lock_remove
        is used, this side effect is not desired (DROP TABLE). The parameter
        will be dropped in 5.1, along with the side effect.
      sql/mysql_priv.h:
        Update declaration of mysql_lock_remove().
      sql/opt_range.cc:
        Deploy handler::ha_external_lock() instead of handler::external_lock()
      sql/sql_base.cc:
        When closing a temporary table, remove the table from the list of LOCKed 
        TABLES of this thread, in case it's there. 
        It's there if it is a transactional temporary table.
        Use a new declaration of mysql_lock_remove().
      sql/sql_class.h:
        Extend the comment for THD::temporary_tables.
      sql/sql_table.cc:
        Deploy handler::ha_external_lock() instead of handler::external_lock()
      0c371edd
    • unknown's avatar
      Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0-engines · a52fe603
      unknown authored
      into  mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.0-engines
      
      a52fe603
    • unknown's avatar
      BUG#29957 - alter_table.test fails · e011d300
      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.
      e011d300
  7. 26 Jul, 2007 2 commits
  8. 25 Jul, 2007 6 commits
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/5.0 · 85958a80
      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).
      85958a80
    • unknown's avatar
      Bug#25679 · 372ef902
      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()
      372ef902
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/4.1-opt · 7193ebc0
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      7193ebc0
    • unknown's avatar
      Patch inspired by BUG#10491: Server returns data as charset · a086d6ec
      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.
      a086d6ec
    • unknown's avatar
      Allow mysql.proc to have extra (unknown) fields. · 24dbbf83
      unknown authored
      This allows 5.0 to work with 5.1 databases.
      
      24dbbf83
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · b465eeee
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.0-29959
      
      b465eeee
  9. 24 Jul, 2007 6 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 40932e9f
      unknown authored
      into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
      
      40932e9f
    • unknown's avatar
      fix compile on Windows for bug25714.c · 6d898841
      unknown authored
      ---
      fix compile on Windows for bug25714.c
      
      
      tests/bug25714.c:
        fix compile on Windows
      6d898841
    • unknown's avatar
      build bug25714 test app on Windows · 8415b222
      unknown authored
      8415b222
    • unknown's avatar
      Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT. · 7fc76f30
      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.
      7fc76f30
    • unknown's avatar
      Merge xiphis.org:/anubis/antony/work/p2-bug25714.1 · 9c00992c
      unknown authored
      into  xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.0
      
      9c00992c
    • unknown's avatar
      Bug#25714 · ebd1eb42
      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''
      ebd1eb42
  10. 23 Jul, 2007 5 commits
    • unknown's avatar
      Bug#29959 (Non-standard bison syntax in sql_yacc.yy) · 27fe6899
      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
      27fe6899
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 2e4369ca
      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
      2e4369ca
    • unknown's avatar
      Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · b3557f8d
      unknown authored
      into  olga.mysql.com:/home/igor/mysql-5.0-opt
      
      b3557f8d
    • unknown's avatar
      table.cc, sql_select.cc: · 0b208f59
      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
      0b208f59
    • unknown's avatar
      Fixed bug #29611. · 51f919dc
      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.
      51f919dc
  11. 22 Jul, 2007 5 commits
  12. 21 Jul, 2007 6 commits