1. 30 Jul, 2010 4 commits
    • Davi Arnaut's avatar
      415fea54
    • Davi Arnaut's avatar
      Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run · a6f726c5
      Davi Arnaut authored
      Fix a regression (due to a typo) which caused spurious incorrect
      argument errors for long data stream parameters if all forms of
      logging were disabled (binary, general and slow logs).
      
      sql/sql_prepare.cc:
        Add a missing logical NOT operator.
      a6f726c5
    • Davi Arnaut's avatar
      Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run · a9538cac
      Davi Arnaut authored
      Fix a regression (due to a typo) which caused spurious incorrect
      argument errors for long data stream parameters if all forms of
      logging were disabled (binary, general and slow logs).
      
      mysql-test/t/mysql_client_test.test:
        Save the status of the slow_log.
      sql/sql_prepare.cc:
        Add a missing logical NOT operator.
      tests/mysql_client_test.c:
        Disable all query logs when running C tests. Fixes a omission
        when, slow log should have been disabled too.
        
        Run test case for Bug#54041 with query logs enabled and disabled.
      a9538cac
    • unknown's avatar
      Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile · 5e13086b
      unknown authored
      With statement- or mixed-mode logging, "LOAD DATA INFILE" queries
      are written to the binlog using special types of log events.
      When mysqlbinlog reads such events, it re-creates the file in a
      temporary directory with a generated filename and outputs a
      "LOAD DATA INFILE" query where the filename is replaced by the
      generated file. The temporary file is not deleted by mysqlbinlog
      after termination.
      
      To fix the problem, in mixed mode we go to row-based. In SBR, we
      document it to remind user the tmpfile is left in a temporary
      directory.
      
      
      mysql-test/suite/binlog/r/binlog_mixed_load_data.result:
        Test result for BUG#34283.
      mysql-test/suite/binlog/t/binlog_mixed_load_data.test:
        Added the test file to verify that 'load data infile...' statement
        will go to row-based in mixed mode.
      sql/sql_load.cc:
        Added code to go to row-based in mixed mode for
        'load data infile ...' statement
      5e13086b
  2. 28 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#53463: YaSSL patch appears to be reverted · f6748155
      Davi Arnaut authored
      The problem is that the fix Bug#29784 was mistakenly
      reverted when updating YaSSL to a newer version.
      
      The solution is to re-apply the fix and this time
      actually add a meaningful test case so that possible
      regressions are caught.
      
      extra/yassl/taocrypt/src/coding.cpp:
        Fixed buffer allocation to compute the proper maximum
        decoded size: (EncodedLength * 3/4) + 3
      mysql-test/std_data/server8k-cert.pem:
        Update certificate.
      mysql-test/std_data/server8k-key.pem:
        Update key.
      mysql-test/t/ssl_8k_key-master.opt:
        Start the server using the certificate and key that
        triggers the problem.
      f6748155
  3. 29 Jul, 2010 4 commits
    • Vasil Dimov's avatar
      Merge mysql-5.1-innodb -> mysql-5.1-bugteam · 060db3d3
      Vasil Dimov authored
      060db3d3
    • Vasil Dimov's avatar
      Merge mysql-5.1-bugteam -> mysql-5.1-innodb · c110066b
      Vasil Dimov authored
      c110066b
    • Alexander Barkov's avatar
      Postfix for BUG#45012. · 6f6a3e52
      Alexander Barkov authored
      Problem: The original patch didn't compile on debug_werror
      due to wrong format in printf("%d") for size_t variables.
      
      Fix: Adding cast to (int).
      6f6a3e52
    • unknown's avatar
      BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave · 2124538d
      unknown authored
      /*![:version:] Query Code */, where [:version:] is a sequence of 5 
      digits representing the mysql server version(e.g /*!50200 ... */),
      is a special comment that the query in it can be executed on those 
      servers whose versions are larger than the version appearing in the 
      comment. It leads to a security issue when slave's version is larger 
      than master's. A malicious user can improve his privileges on slaves. 
      Because slave SQL thread is running with SUPER privileges, so it can
      execute queries that he/she does not have privileges on master.
      
      This bug is fixed with the logic below: 
      - To replace '!' with ' ' in the magic comments which are not applied on
        master. So they become common comments and will not be applied on slave.
      
      - Example:
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
        will be binlogged as
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/
      
      mysql-test/suite/rpl/t/rpl_conditional_comments.test:
        Test the patch for this bug.
      sql/mysql_priv.h:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_lex.cc:
        To replace '!' with ' ' in the magic comments which are not applied on
        master.
      sql/sql_lex.h:
        Remove the const limitation on parameter buff, as it can be modified in the function since
        this patch.
        Add member function yyUnput for Lex_input_stream. It set a character back the query buff.
      sql/sql_parse.cc:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_partition.cc:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/sql_partition.h:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/table.h:
        Remove the const limitation on variable partition_info, as it can be modified since
        this patch.
      2124538d
  4. 28 Jul, 2010 1 commit
  5. 24 Jul, 2010 1 commit
  6. 26 Jul, 2010 2 commits
    • Sven Sandberg's avatar
      merged BUG#55322 to 5.1-bugteam · d7c1b752
      Sven Sandberg authored
      d7c1b752
    • Alexander Barkov's avatar
      Bug#45012 my_like_range_cp932 generates invalid string · e57a9d6f
      Alexander Barkov authored
      Problem: The functions my_like_range_xxx() returned
      badly formed maximum strings for Asian character sets,
      which made problems for storage engines.
      
      Fix: 
      - Removed a number my_like_range_xxx() implementations,
        which were in fact dumplicate code pieces.
      - Using generic my_like_range_mb() instead.
      - Setting max_sort_char member properly for Asian character sets
      - Adding unittest/strings/strings-t.c, 
        to test that my_like_range_xxx() return well-formed 
        min and max strings.
      
      Notes:
      
      - No additional tests in mysql/t/ available.
        Old tests cover the affected code well enough.
      e57a9d6f
  7. 23 Jul, 2010 3 commits
  8. 22 Jul, 2010 2 commits
  9. 21 Jul, 2010 7 commits
    • Georgi Kodinov's avatar
      merge · 1df84604
      Georgi Kodinov authored
      1df84604
    • Georgi Kodinov's avatar
      merge · 296c503e
      Georgi Kodinov authored
      296c503e
    • Georgi Kodinov's avatar
      merge · d3d32008
      Georgi Kodinov authored
      d3d32008
    • Georgi Kodinov's avatar
      Addendum #4 to bug #53095 · e24abd90
      Georgi Kodinov authored
      SHOW DATABASES LIKE ... was not converting to lowercase on comparison as the
      documentation is suggesting. 
      Fixed it to behave similarly to SHOW TABLES LIKE ... and updated the failing
      on MacOSX lowercase_table2 test case.
      e24abd90
    • Alexey Kopytov's avatar
      Automerge. · d26c6d62
      Alexey Kopytov authored
      d26c6d62
    • Joerg Bruehe's avatar
    • Dmitry Shulga's avatar
      Fixed bug #42496 - the server could crash on a debug assert after a failure · bd41af86
      Dmitry Shulga authored
      to write into a closed socket
      
      sql/protocol.cc:
        Protocol::flush modified: set thd->main_da.can_overwrite_status= TRUE
        before call to net_flush() in order to prevent crash on assert in case
        of socket write failure, reset it to FALSE when net_flush() returned;
        Protocol::send_fields modified: return from method with error if call to
        my_net_write(), proto.write() or write_eof_packet() failed.
      sql/sql_cache.cc:
        Query_cache::send_result_to_client modified: call to
        thd->main_da.disable_status() only if write to socket
        was successful.
      sql/sql_cursor.cc:
        Materialized_cursor::fetch modified: leave method if call to
        result->send_data() failed.
      sql/sql_prepare.cc:
        send_prep_stmt() modified: call to thd->main_da.disable_status()
        only if thd->protocol_text.send_fields() completed successfully.
      bd41af86
  10. 20 Jul, 2010 4 commits
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 9a5fa17f
      Davi Arnaut authored
      Fix warnings flagged by the new warning option -Wunused-but-set-variable
      that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
      option causes a warning whenever a local variable is assigned to but is
      later unused. It also warns about meaningless pointer dereferences.
      
      client/mysql.cc:
        Meaningless pointer dereferences.
      client/mysql_upgrade.c:
        Check whether reading from the file succeeded.
      extra/comp_err.c:
        Unused.
      extra/yassl/src/yassl_imp.cpp:
        Skip instead of reading data that is discarded.
      include/my_pthread.h:
        Variable is only used in debug builds.
      include/mysys_err.h:
        Add new error messages.
      mysys/errors.c:
        Add new error message for permission related functions.
      mysys/mf_iocache.c:
        Variable is only checked under THREAD.
      mysys/my_copy.c:
        Raise a error if chmod or chown fails.
      mysys/my_redel.c:
        Raise a error if chmod or chown fails.
      regex/engine.c:
        Use a equivalent variable for the assert.
      server-tools/instance-manager/instance_options.cc:
        Unused.
      sql/field.cc:
        Unused.
      sql/item.cc:
        Unused.
      sql/log.cc:
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
        
        Adjust doxygen comment to the right function.
        
        Pass message lenght to log function.
      sql/mysqld.cc:
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
      sql/partition_info.cc:
        Unused.
      sql/slave.cc:
        No need to set pointer to the address of '\0'.
      sql/spatial.cc:
        Unused. Left for historical purposes.
      sql/sql_acl.cc:
        Unused.
      sql/sql_base.cc:
        Pointers are always set to the same variables.
      sql/sql_parse.cc:
        End statement if reading fails.
        
        Store the buffer after it has actually been updated.
      sql/sql_repl.cc:
        No need to set pointer to the address of '\0'.
      sql/sql_show.cc:
        Put variable under the same ifdef block.
      sql/udf_example.c:
        Set null pointer flag appropriately.
      storage/csv/ha_tina.cc:
        Meaningless dereferences.
      storage/example/ha_example.cc:
        Return the error since it's available.
      storage/myisam/mi_locking.c:
        Remove unused and dead code.
      9a5fa17f
    • Davi Arnaut's avatar
      Bug#52514: mysql 5.1 do_abi_check does not compile w/ gcc4.5 · c36fee08
      Davi Arnaut authored
                 due to GCC preprocessor change
            
      The problem is that newer GCC versions treats missing headers
      as fatal errors. The solution is to use a guard macro to prevent
      the inclusion of system headers when checking the ABI with the
      C Preprocessor.
      
      Reference: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15638
                 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44836
      
      Makefile.am:
        Define guard macro.
      configure.in:
        Remove workaround.
      include/mysql.h:
        Guard the header inclusion.
      include/mysql.h.pp:
        Header is not included anymore.
      c36fee08
    • Davi Arnaut's avatar
      Bug#54453: Failing assertion: trx->active_trans when renaming a · b0035c76
      Davi Arnaut authored
                 table with active trx
      
      Essentially, the problem is that InnoDB does a implicit commit
      when a cursor (table handler) is unlocked/closed, creating
      a dissonance between the transaction state within the server
      layer and the storage engine layer. Theoretically, a statement
      transaction can encompass several table instances in a similar
      manner to a multiple statement transaction, hence it does not
      make sense to limit a statement transaction to the lifetime of
      the table instances (cursors) used within it.
      
      Since this particular instance of the problem is only triggerable
      on 5.1 and is masked on 5.5 due 2PC being skipped (assertion is in
      the prepare phase of a 2PC), the solution (which is less risky) is
      to explicitly end the transaction before the cached table is unlock
      on rename table.
      
      The patch is to be null merged into trunk.
      
      mysql-test/include/commit.inc:
        Fix counters, the binlog engine does not get involved anymore.
      mysql-test/suite/innodb_plugin/r/innodb_bug54453.result:
        Add test case result for Bug#54453
      mysql-test/suite/innodb_plugin/t/innodb_bug54453.test:
        Add test case for Bug#54453
      sql/sql_table.cc:
        End transaction as otherwise InnoDB will end it behind our backs.
      b0035c76
    • Sven Sandberg's avatar
      BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET · 689a96fc
      Sven Sandberg authored
      Problem: when SHOW BINLOG EVENTS was issued, it increased the value of
      @@session.max_allowed_packet. This allowed a non-root user to increase
      the amount of memory used by her thread arbitrarily. Thus, it removes
      the bound on the amount of system resources used by a client, so it
      presents a security risk (DoS attack).
      
      Fix: it is correct to increase the value of @@session.max_allowed_packet
      while executing SHOW BINLOG EVENTS (see BUG 30435). However, the
      increase should only be temporary. Thus, the fix is to restore the value
      when SHOW BINLOG EVENTS ends.
      The value of @@session.max_allowed_packet is also increased in
      mysql_binlog_send (i.e., the binlog dump thread). It is not clear if this
      can cause any trouble, since normally the client that issues
      COM_BINLOG_DUMP will not issue any other commands that would be affected
      by the increased value of @@session.max_allowed_packet. However, we
      restore the value just in case.
      
      
      mysql-test/suite/rpl/r/rpl_packet.result:
        update result file
      mysql-test/suite/rpl/t/rpl_packet.test:
        Add test that verifies that @@session.max_allowed_packet does not change
        when issuing SHOW BINLOG EVENTS.
        Make previous sub-test clean up.
        Add comments listing the bugs in this test case.
      sql/sql_repl.cc:
        Restore the old value of thd->variables.max_allowed_packet at the
        end of mysql_binlog_send and mysql_show_binlog_events.
      689a96fc
  11. 19 Jul, 2010 4 commits
  12. 16 Jul, 2010 3 commits
    • Davi Arnaut's avatar
      Bug#48327: Some crashes specific to FreeBSD ("embedded") · 92f3fc92
      Davi Arnaut authored
      Bug#47139: Test "merge" crashes in "embedded" run
      
      Backport patch for Bug#47139
      92f3fc92
    • Georgi Kodinov's avatar
      dcaef242
    • Ramil Kalimullin's avatar
      Fix for bug #50667: The InnoDB plugin prevents initialization · 37c97fd4
      Ramil Kalimullin authored
      of the "embedded" server
      
      Problem: mysqltest_embedded failed to load ha_innodb_plugin library
      on some platforms (due to some unresolved references).
      
      Fix: on FreeBSD use -export-dynamic flag building mysqltest_embedded.
      That allows to use its global symbols to resolve references in the
      dynamically loaded plugin library.
      
      
      libmysqld/examples/Makefile.am:
        Fix for bug #50667: The InnoDB plugin prevents initialization
        of the "embedded" server
          - use -export-dynamic (on FreeBSD/DragonFly) building
        mysqltest_embedded to allow using its global symbols 
        to resolve references in the dynamically loaded plugin libraries.
      37c97fd4
  13. 15 Jul, 2010 1 commit
    • Alexey Kopytov's avatar
      Backport of the fix for bug#25421 to 5.0. · 4c28b677
      Alexey Kopytov authored
      Calculating the estimated number of records for a range scan
      may take a significant time, and it was impossible for a user
      to interrupt that process by killing the connection or the
      query.
      
      Fixed by checking the thread's 'killed' status in
      check_quick_keys() and interrupting the calculation process if
      it is set to a non-zero value.
      4c28b677
  14. 12 Jul, 2010 1 commit
    • Alexey Kopytov's avatar
      Bug#55061: Build failing on sol 8 x86 - assembler code vs · e98169d5
      Alexey Kopytov authored
                 compiler problem
      
      GCC-style inline assembly is not supported by the Sun Studio
      compilers prior to version 12.
      
      Added a check for the Sun Studio version to avoid using 
      _FPU_GETCW() / _FPU_SETCW() when inline assembly is
       unsupported. This can lead to some differences in floating
      point calculations on Solaris 8/x86 which, however, is not worth
      bothering with Sun-style assembly .il templates.
      e98169d5
  15. 09 Jul, 2010 2 commits