1. 10 Nov, 2009 2 commits
  2. 09 Nov, 2009 2 commits
  3. 06 Nov, 2009 8 commits
    • Evgeny Potemkin's avatar
      Auto-merged fix for the bug#34384. · 6c1a3776
      Evgeny Potemkin authored
      6c1a3776
    • Evgeny Potemkin's avatar
      Bug#34384: Slow down on constant conversion. · a8f968b3
      Evgeny Potemkin authored
      When values of different types are compared they're converted to a type that
      allows correct comparison. This conversion is done for each comparison and
      takes some time. When a constant is being compared it's possible to cache the
      value after conversion to speedup comparison. In some cases (large dataset,
      complex WHERE condition with many type conversions) query might be executed
      7% faster.
      
      A test case isn't provided because all changes are internal and isn't visible
      outside.
      
      The behavior of the Item_cache is changed to cache values on the first request
      of cached value rather than at the moment of storing item to be cached.
      A flag named value_cached is added to the Item_cache class. It's set to TRUE
      when cache holds the value of the last stored item.
      Function named cache_value() is added to the Item_cache class and derived classes.
      This function actually caches the value of the saved item.
      Item_cache_xxx::store functions now only store item to be cached and set
      value_cached flag to FALSE.
      Item_cache_xxx::val_xxx functions are changed to call cache_value function
      prior to returning cached value if value_cached is FALSE.
      The Arg_comparator::set_cmp_func function now calls cache_converted_constant
      to cache constants if they need a type conversion.
      The Item_cache::get_cache function is overloaded to allow setting of the
      cache type.
      The cache_converted_constant function is added to the Arg_comparator class.
      It checks whether a value can and should be cached and if so caches it.
      
      sql/item.cc:
        Bug#34384: Slow down on constant conversion.
        Function named cache_value() is added to the Item_cache class and derived classes.
        This function actually caches the value of the saved item.
        Item_cache_xxx::store functions now only store item to be cached and set
        value_cached flag to FALSE.
        Item_cache_xxx::val_xxx functions are changed to call cache_value function
        prior to returning cached value if value_cached is FALSE.
        The Item_cache::get_cache function is overloaded to allow setting of the
        cache type.
      sql/item.h:
        Bug#34384: Slow down on constant conversion.
        A flag named value_cached is added to the Item_cache class. It's set to TRUE
        when we need to start caching values when the store method is called.
        Function named cache_value() is added to the Item_cache class and derived classes.
      sql/item_cmpfunc.cc:
        Bug#34384: Slow down on constant conversion.
        A helper function cache_converted_constant is added to the Arg_comparator class.
        It checks whether a given item can and should be cached and caches it if so.
        The Arg_comparator::set_cmp_func function now calls cache_converted_constant
        to cache constants if they need a type conversion.
      sql/item_cmpfunc.h:
        Bug#34384: Slow down on constant conversion.
        The cache_converted_constant function is added to the Arg_comparator class.
        It checks whether a value can and should be cached and if so caches it.
      sql/item_subselect.cc:
        Bug#34384: Slow down on constant conversion.
        Force immediate caching of subselect result.
      sql/item_xmlfunc.cc:
        Bug#34384: Slow down on constant conversion.
      sql/sp_rcontext.cc:
        Bug#34384: Slow down on constant conversion.
        Force immediate caching of values of an SP CASE function.
      a8f968b3
    • Luis Soares's avatar
    • Alexey Kopytov's avatar
      Automerge. · dccfac93
      Alexey Kopytov authored
      dccfac93
    • Alexey Kopytov's avatar
      Automerge. · aba25c5c
      Alexey Kopytov authored
      aba25c5c
    • Alexey Kopytov's avatar
      Automerge. · b9272879
      Alexey Kopytov authored
      b9272879
    • Alexey Kopytov's avatar
      Automerge. · e497cf6f
      Alexey Kopytov authored
      e497cf6f
    • Alexey Kopytov's avatar
      Bug #48475: DISTINCT is ignored with GROUP BY WITH ROLLUP and · 4bd2b0b0
      Alexey Kopytov authored
                  only const tables
      
      The problem was caused by two shortcuts in the optimizer that
      are inapplicable in the ROLLUP case.
      
      Normally in a case when only const tables are involved in a
      query, DISTINCT clause can be safely optimized away since there
      may be only one row produced by the join. Similarly, we don't
      need to create a temporary table to resolve DISTINCT/GROUP
      BY/ORDER BY. Both of these are inapplicable when the WITH
      ROLLUP modifier is present.
      
      Fixed by disabling the said optimizations for the WITH ROLLUP
      case.
      
      mysql-test/r/olap.result:
        Added a test case for bug #48475.
      mysql-test/t/olap.test:
        Added a test case for bug #48475.
      sql/sql_select.cc:
        Disabled const-only table optimizations for the WITH ROLLUP
        case.
      4bd2b0b0
  4. 04 Nov, 2009 6 commits
    • Timothy Smith's avatar
      auto-merge · b630ee12
      Timothy Smith authored
      b630ee12
    • Timothy Smith's avatar
      auto-merge · 487a703c
      Timothy Smith authored
      487a703c
    • Timothy Smith's avatar
      Fix for Bug#40700: aclocal warnings for missing cache-id's · fa8bac42
      Timothy Smith authored
      Just change mysql_foo to mysql_cv_foo for one cache-id variable name.  There
      was only one bad variable name, present in 5.0 and 5.1, but not in the -pe
      branch.
      fa8bac42
    • Timothy Smith's avatar
      auto-merge · 239f790e
      Timothy Smith authored
      239f790e
    • Timothy Smith's avatar
      auto-merge · 9598eb2c
      Timothy Smith authored
      9598eb2c
    • Georgi Kodinov's avatar
      Bug #46175: NULL read_view and consistent read assertion · 96d42e56
      Georgi Kodinov authored
      The SE API requires mysql to notify the storage engine that
      it's going to read certain tables at the beginning of the 
      statement (by calling start_stmt(), store_lock() or
      external_lock()).
      These are typically called by the lock_tables(). 
      However SHOW CREATE TABLE is not pre-locking the tables
      because it's not expected to access the data at all.
      But for some view definitions (that include comparing a
      date/datetime/timestamp column to a string returning
      scalar subquery) the JOIN::prepare may still access data
      when materializing the scalar non-correlated subquery
      in Arg_comparator::can_compare_as_dates().
      Fixed by not materializing the subquery when the function
      is called in a SHOW/EXPLAIN/CREATE VIEW
      96d42e56
  5. 05 Nov, 2009 2 commits
    • Davi Arnaut's avatar
      Introduce support for automake-1.11 silent-rules. · 7f9099af
      Davi Arnaut authored
      configure.in:
        Activate silent-rules if automake supports it.
      7f9099af
    • unknown's avatar
      Bug #34739 unexpected binlog file name when --log-bin is set to a directory name · 8d239410
      unknown authored
      If --log-bin is set to a directory name with the trailing 'FN_LIBCHAR', 
      which will be '/' on Unix like systems, and '\\' on Windows like systems. 
      the basename of the binlog is empty so that the created files named 
      '.000001' and '.index'. It is not expected. 
      The same thing happened to --log-bin-index, --relay-log and 
      --relay-log-index options.
      
      To resolve the problem, in these cases the program should report an error 
      and abort.
      
      
      sql/mysqld.cc:
        Added a check for the value of the --log-bin and --log-bin-index arguments, 
        if it's a directory, reports an error and aborts.
      sql/rpl_rli.cc:
        Added a check for the value of the --relay-log and --relay-log-index arguments, 
        if it's a directory, reports an error and aborts.
      8d239410
  6. 04 Nov, 2009 3 commits
    • Georgi Kodinov's avatar
      merge · be43413a
      Georgi Kodinov authored
      be43413a
    • Georgi Kodinov's avatar
    • Luis Soares's avatar
      BUG#47743: rpl.rpl_log_pos fails sporadically · 535d8653
      Luis Soares authored
      BUG#47983: rpl_extraColmaster_myisam failed in PB2 with "Found
      warnings!!"
      
      BUG 45214 fixed the case when get_master_version_and_clock
      function, used by the slave, would not report errors. The slave
      now detects them and if related to transient network failures, it
      prints some warnings and retries to connect. On the other hand,
      if not network related, it just gives up and fails.
      
      As such, sometimes, in PB2, the slave comes across some transient
      communication issues between master and slave, while calling
      get_master_version_and_clock, causing warnings print outs to the
      error log. Nevertheless, in such cases slave retries to connect,
      in which it succeeds, and the test case continues as it normally
      would. But then, at the end of a successful test run, MTR checks
      the error log, finds the unexpected warnings and considers them
      harmful. This causes MTR to report error and, consequently, PB2
      to report a failing test.
      
      We fix this by adding to the global warnings suppress list the
      warnings related to transient network failures only, which are
      reported while in function get_master_version_and_clock.
      535d8653
  7. 03 Nov, 2009 17 commits
    • Timothy Smith's avatar
    • Timothy Smith's avatar
      Bug#48031: mysql_secure_installation -- bash bug regarding passwords with · d252b366
      Timothy Smith authored
        special chars
      
      This script failed when the user tried passwords with multiple spaces, \, # or
      ' characters.  Now proper escaping and quoting is used in all contexts.
      
      This problem occurs in the Perl version of this script, too, so fix it in both
      places.
      d252b366
    • Timothy Smith's avatar
      Bug#48086: mysql_secure_installation does NOT work on Solaris · 0c565113
      Timothy Smith authored
      Remove a bash-ism (if ! ...).
      0c565113
    • Davi Arnaut's avatar
      Automerge. · f9ad9fbb
      Davi Arnaut authored
      f9ad9fbb
    • Davi Arnaut's avatar
      4d13b2c2
    • Konstantin Osipov's avatar
      A fix and a test case for · a8429e84
      Konstantin Osipov authored
      Bug#41756 "Strange error messages about locks from InnoDB".
            
      In JT_EQ_REF (join_read_key()) access method, 
      don't try to unlock rows in the handler, unless certain that 
      a) they were locked
      b) they are not used.
      
      Unlocking of rows is done by the logic of the nested join loop,
      and is unaware of the possible caching that the access method may
      have. This could lead to double unlocking, when a row
      was unlocked first after reading into the cache, and then 
      when taken from cache, as well as to unlocking of rows which
      were actually used (but taken from cache).
            
      Delegate part of the unlocking logic to the access method,
      and in JT_EQ_REF count how many times a record was actually 
      used in the join. Unlock it only if it's usage count is 0.
      
      Implemented review comments.
      
      mysql-test/r/innodb_lock_wait_timeout_1.result:
        Update results (Bug41756).
      mysql-test/t/innodb_lock_wait_timeout_1.test:
        Add a test case (Bug#41756).
      sql/item_subselect.cc:
        Complete struct READ_RECORD initialization with a new
        member to unlock records.
      sql/records.cc:
        Extend READ_RECORD API with a method to unlock read records.
      sql/sql_select.cc:
        In JT_EQ_REF (join_read_key()) access method, 
        don't try to unlock rows in the handler, unless certain that 
        a) they were locked
        b) they are not used.
      sql/sql_select.h:
        Add members to TABLE_REF to count TABLE_REF buffer usage count.
      sql/structs.h:
        Update declarations.
      a8429e84
    • Magnus Blåudd's avatar
      Merge bug#47867 to 5.1-bugteam · bb177df0
      Magnus Blåudd authored
      bb177df0
    • Konstantin Osipov's avatar
      A fix and a test case for · 37501b07
      Konstantin Osipov authored
      Bug#41756 "Strange error messages about locks from InnoDB".
      
      In JT_EQ_REF (join_read_key()) access method,
      don't try to unlock rows in the handler, unless certain that
      a) they were locked
      b) they are not used.
      
      Unlocking of rows is done by the logic of the nested join loop,
      and is unaware of the possible caching that the access method may
      have. This could lead to double unlocking, when a row
      was unlocked first after reading into the cache, and then
      when taken from cache, as well as to unlocking of rows which
      were actually used (but taken from cache).
      
      Delegate part of the unlocking logic to the access method,
      and in JT_EQ_REF count how many times a record was actually
      used in the join. Unlock it only if it's usage count is 0.
      
      Implemented review comments.
      
      
      mysql-test/r/bug41756.result:
        Add result file (Bug#41756)
      mysql-test/t/bug41756-master.opt:
        Use --innodb-locks-unsafe-for-binlog, as in 5.0 just
        using read_committed isolation is not sufficient to 
        reproduce the bug.
      mysql-test/t/bug41756.test:
        Add a test file (Bug#41756)
      sql/item_subselect.cc:
        Complete struct READ_RECORD initialization with a new
        member to unlock records.
      sql/records.cc:
        Extend READ_RECORD API with a method to unlock read records.
      sql/sql_select.cc:
        In JT_EQ_REF (join_read_key()) access method,
        don't try to unlock rows in the handler, unless certain that
        a) they were locked
        b) they are not used.
      sql/sql_select.h:
        Add members to TABLE_REF to count TABLE_REF buffer usage count.
      sql/structs.h:
        Update declarations.
      37501b07
    • Kristofer Pettersson's avatar
      automerge · de14d1eb
      Kristofer Pettersson authored
      de14d1eb
    • Kristofer Pettersson's avatar
    • Sergey Vojtovich's avatar
      Merge of innodb-zip-ss6129 snapshot. · c8df4ffe
      Sergey Vojtovich authored
      c8df4ffe
    • Sergey Vojtovich's avatar
      Clean-up after applying innodb-zip-ss6129 snapshot: · 8247dcee
      Sergey Vojtovich authored
      - re-enabled main.innodb_bug44369;
      - re-enabled main.innodb_bug47777;
      - re-enabled innodb.innodb_information_schema.
      8247dcee
    • Jorgen Loland's avatar
      Bug#48177 - SELECTs with NOT IN subqueries containing NULL · e11daabf
      Jorgen Loland authored
                  values return too many records
      
      WHERE clauses with "outer_value_list NOT IN subselect" were
      handled incorrectly if the outer value list contained multiple 
      items where at least one of these could be NULL. The first 
      outer record with NULL value was handled correctly, but if a 
      second record with NULL value existed, the optimizer would 
      choose to reuse the result it got on the last execution of the 
      subselect. This is incorrect if the outer value list has 
      multiple items.
           
      The fix is to make Item_in_optimizer::val_int (in 
      item_cmpfunc.cc) reuse the result of the latest execution
      for NULL values only if all values in the outer_value_list 
      are NULL.
      
      
      mysql-test/r/subselect3.result:
        Added test for BUG#48177
      mysql-test/t/subselect3.test:
        Added test for BUG#48177
      sql/item_cmpfunc.cc:
        Make Item_in_optimizer::val_int (in item_cmpfunc.cc) reuse the result of the latest execution for NULL values only if all values in the outer_value_list are NULL.
      e11daabf
    • Sergey Vojtovich's avatar
      Applying InnoDB plugin snashot · dd83da97
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6126 | vasil | 2009-10-30 10:36:07 +0200 (Fri, 30 Oct 2009) | 45 lines
      branches/zip: Merge r6112:6125 from branches/5.1:
      
      (skipping r6122 and r6123, Jimmy says these are already present and need
      not be merged):
      
        ------------------------------------------------------------------------
        r6122 | jyang | 2009-10-30 05:18:38 +0200 (Fri, 30 Oct 2009) | 7 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb_bug44369.result
           M /branches/5.1/mysql-test/innodb_bug44369.test
           M /branches/5.1/mysql-test/innodb_bug46000.result
           M /branches/5.1/mysql-test/innodb_bug46000.test
        
        branches/5.1: Chnage WARN_LEVEL_ERROR to WARN_LEVEL_WARN
        for push_warning_printf() call in innodb.
        Fix Bug#47233: Innodb calls push_warning(MYSQL_ERROR::WARN_LEVEL_ERROR)
        
        rb://170 approved by Marko.
        
        
        ------------------------------------------------------------------------
        r6123 | jyang | 2009-10-30 05:43:06 +0200 (Fri, 30 Oct 2009) | 8 lines
        Changed paths:
           M /branches/5.1/os/os0proc.c
        
        branches/5.1: In os_mem_alloc_large(), if we fail to attach
        the shared memory, reset memory pointer ptr to NULL, and
        allocate memory from conventional pool. This is a port
        from branches/zip.
        Bug #48237 Error handling in os_mem_alloc_large appears to be incorrect
        rb://198  Approved by: Marko
        
        
        ------------------------------------------------------------------------
        r6125 | vasil | 2009-10-30 10:31:23 +0200 (Fri, 30 Oct 2009) | 4 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
        
        branches/5.1:
        
        White-space fixup.
        
        ------------------------------------------------------------------------
      dd83da97
    • Sergey Vojtovich's avatar
      Applying InnoDB plugin snashot · 54dcdc1b
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6121 | sunny | 2009-10-30 01:42:11 +0200 (Fri, 30 Oct 2009) | 7 lines
      branches/zip: This test has been problematic for sometime now. The underlying
      bug is that the data dictionaries get out of sync. In the AUTOINC code we
      try and apply salve to the symptoms. In the past MySQL made some unrelated
      change and the dictionaries stopped getting out of sync and this test started
      to fail. Now, it seems they have reverted that changed and the test is
      passing again. I suspect this is not he last time that this test will change.
      
      r6124 | jyang | 2009-10-30 10:02:31 +0200 (Fri, 30 Oct 2009) | 5 lines
      branches/zip: Correct the bug number for -r6109 change
      from # 48273 to #48237
      54dcdc1b
    • Sergey Vojtovich's avatar
      Applying InnoDB plugin snashot · a83f1b03
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6114 | vasil | 2009-10-29 18:43:51 +0200 (Thu, 29 Oct 2009) | 6 lines
      branches/zip:
      
      * Add ChangeLog entries for latest changes
      * Obey alphabetical order in the list of the files
      * White-space fixup
      a83f1b03
    • Sergey Vojtovich's avatar
      Applying InnoDB plugin snashot · 2e63e93c
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6113 | vasil | 2009-10-29 18:15:50 +0200 (Thu, 29 Oct 2009) | 93 lines
      branches/zip: Merge r5912:6112 from branches/5.1:
      
      (after this merge the innodb-autoinc test starts to fail, but
      I commit anyway because it would be easier to investigate the
      failure this way)
      
        ------------------------------------------------------------------------
        r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
        
        branches/5.1: fix bug#42383: Can't create table 'test.bug39438'
        
        For embedded server, MySQL may pass in full path, which is
        currently disallowed. It is needed to relax the condition by
        accepting full paths in the embedded case.
        
        Approved by: Heikki (on IM)
        ------------------------------------------------------------------------
        r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
        
        branches/5.1:
        
        Fix Bug#38996 Race condition in ANALYZE TABLE
        
        by serializing ANALYZE TABLE inside InnoDB.
        
        Approved by:	Heikki (rb://175)
        
        ------------------------------------------------------------------------
        r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           A /branches/5.1/mysql-test/innodb_bug47777.result
           A /branches/5.1/mysql-test/innodb_bug47777.test
        
        branches/5.1: Fix bug #47777. Treat the Geometry data same as
        Binary BLOB in ha_innobase::store_key_val_for_row(), since the
        Geometry data is stored as Binary BLOB in Innodb.
        
        Review: rb://180 approved by Marko Makela.
        
        
        ------------------------------------------------------------------------
        r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
        
        branches/5.1: Ignore negative values supplied by the user when calculating the
        next value to store in dict_table_t. Setting autoincrement columns top negative
        values is undefined behavior and this change should bring the behavior of
        InnoDB closer to what users expect. Added several tests to check.
        rb://162
        
        ------------------------------------------------------------------------
        r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
        
        branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix
        the test results too.
        rb://164
        
        ------------------------------------------------------------------------
        r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
        
        branches/5.1: Copy the maximum AUTOINC value from the old table to the new
        table when MySQL does a CREATE INDEX ON T. This is required because MySQL
        does a table copy, rename and drops the old table.
        Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb
        rb://168
        
        ------------------------------------------------------------------------
        r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines
        Changed paths:
           M /branches/5.1/row/row0mysql.c
        
        branches/5.1:
        
        Fix typo.
        
        ------------------------------------------------------------------------
      2e63e93c