1. 19 Jun, 2009 4 commits
    • Matthias Leich's avatar
    • Matthias Leich's avatar
      Fix for Bug#40545, Bug#40209, Bug#40618, Bug#38346 · 59730d8f
      Matthias Leich authored
        Details:
        - Limit the queries to character sets and collations
          which are most probably available in all build types.
          But try to preserve the intention of the tests.
        - Remove the variants adjusted to some build types.
      
        Note:
        1. The results of the review by Bar are included.
        2. I am not able to check the correctness of this patch
           on any existing build type and any MySQL version.
           So it could happen that the new test fails somewhere.
      59730d8f
    • V Narayanan's avatar
      Bug#43572 Handle failures from hash_init · 336c8106
      V Narayanan authored
            
      Failure to allocate memory for the hash->array element,
      caused hash_init to return without initializing the other
      members of the hash. Thus although the dynamic array
      buffer may be allocated at a later point in the code, the
      incompletely initialized hash caused fatal failures.
      
      This patch moves the initialization of the other members
      of the hash above the array allocation, so that the usage
      of this hash will not result in fatal failures.
      
      include/hash.h:
        Bug#43572 Handle failures from hash_init
        
        hash_inited is used to verify that the hash is
        valid. After the change induced by the current
        patch hash->array.buffer !=0 is not a valid check
        for this condition, since, the dynamic array can
        be allocated even at a later time. Bootstrap SQL
        script is setting some variables, which are
        actually not set due to this hash_inited issue.
        Thus we get empty grant tables.
        
        A better way to check if the hash is valid is
        to verify that hash->blength is greater than 0.
      mysys/hash.c:
        Bug#43572 Handle failures from hash_init
        
        Move the initialization of the other members
        of the hash above the array allocation, so that
        the usage of this hash will not result in fatal
        failures.
      336c8106
    • Staale Smedseng's avatar
      Bug #32223 SETting max_allowed_packet variable · 37d2019d
      Staale Smedseng authored
            
      Inconsistent behavior of session variable max_allowed_packet 
      (and net_buffer_length); only assignment to the global variable 
      has any effect, without this being obvious to the user.
            
      The patch for Bug#22891 is backported to 5.0, making the two
      session variables read-only. As this is a backport to GA 
      software, the error used when trying to assign to the read-
      only variable is ER_UNKNOWN_ERROR. The error message is the 
      same as in 5.1+.
      
      mysql-test/t/variables.test:
        Tests are changed to account for the new semantics, and assignment to the read-only variables is added to test 
        the emission of the correct error message.
      sql/set_var.cc:
        Both max_allowed_packet and net_buffer_length are changed 
        to be of type sys_var_thd_ulong_session_readonly. ER_UNKNOWN_ERROR is used to indicate an attempt to assign 
        to an instance of a read-only variable.
      sql/set_var.h:
        Class sys_var_thd_ulong_session_readonly is added.
      37d2019d
  2. 18 Jun, 2009 1 commit
  3. 17 Jun, 2009 4 commits
  4. 15 Jun, 2009 4 commits
    • Georgi Kodinov's avatar
      automerge · 77899990
      Georgi Kodinov authored
      77899990
    • Georgi Kodinov's avatar
      merged 5.0-main to 5.0-bugteam · 9d0d363b
      Georgi Kodinov authored
      9d0d363b
    • Bernt M. Johnsen's avatar
      d6a9e61c
    • Georgi Kodinov's avatar
      Bug #44810: index merge and order by with low sort_buffer_size · 6df6c8ee
      Georgi Kodinov authored
      crashes server!
      
      The problem affects the scenario when index merge is followed by a filesort
      and the sort buffer is not big enough for all the sort keys.
      In this case the filesort function will read the data to the end through the 
      index merge quick access method (and thus closing the cursor etc), 
      but will leave the pointer to the quick select method in place.
      It will then create a temporary file to hold the results of the filesort and
      will add it as a sort output file (in sort.io_cache).
      Note that filesort will copy the original 'sort' structure in an automatic
      variable and restore it after it's done.
      As a result at exiting filesort() we have a sort.io_cache filled in and 
      nothing else (as a result of close of the cursors at end of reading data 
      through index merge).
      Now create_sort_index() will note that there is a select and will clean it up
      (as it's been used already by filesort() reading the data in). While doing that
      a special case in the index merge destructor will clean up the sort.io_cache,
      assuming it's an output of the index merge method and is not needed anymore.
      As a result the code that tries to read the data back from the filesort output 
      will get no data in both memory and disk and will crash.
            
      Fixed similarly to how filesort() does it : by copying the sort.io_cache structure
      to a local variable, removing the pointer to the io_cache (so that it's not freed 
      by QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT) and restoring the original 
      structure (together with the valid pointer) after the cleanup is done.
      This is a safe thing to do because all the structures are already cleaned up by
      hitting the end of the index merge's read method (QUICK_INDEX_MERGE_SELECT::get_next()) 
      and the cleanup code being written in a way that tolerates repeating cleanups.
      
      mysql-test/r/index_merge.result:
        Bug #44810: test case
      mysql-test/t/index_merge.test:
        Bug #44810: test case
      sql/sql_select.cc:
        Bug #44810: preserve the io_cache produced by filesort while cleaning up
        the index merge quick access method (QUICK_INDEX_MERGE_SELECT).
      6df6c8ee
  5. 12 Jun, 2009 2 commits
    • Georgi Kodinov's avatar
      fixed the build-tags command · dfb06c38
      Georgi Kodinov authored
      dfb06c38
    • Georgi Kodinov's avatar
      Bug #45386: Wrong query result with MIN function in field list, · 3e82a86e
      Georgi Kodinov authored
      WHERE and GROUP BY clause
      
      Loose index scan may use range conditions on the argument of 
      the MIN/MAX aggregate functions to find the beginning/end of 
      the interval that satisfies the range conditions in a single go.
      These range conditions may have open or closed minimum/maximum 
      values. When the comparison returns 0 (equal) the code should 
      check the type of the min/max values of the current interval 
      and accept or reject the row based on whether the limit is 
      open or not.
      There was a wrong composite condition on checking this and it was
      not working in all cases.
      Fixed by simplifying the conditions and reversing the logic.
      
      mysql-test/r/group_min_max.result:
        Bug #45386: test case
      mysql-test/t/group_min_max.test:
        Bug #45386: test case
      sql/opt_range.cc:
        Bug #45386: fix the check whether to use the value if on the
        interval boundry
      3e82a86e
  6. 11 Jun, 2009 3 commits
  7. 10 Jun, 2009 2 commits
    • Davi Arnaut's avatar
      Bug#41190: shared memory connections do not work in Vista, if server started from cmdline · afacea4d
      Davi Arnaut authored
      Backport to MySQL 5.0/1 fix by Vladislav Vaintroub:
      
      In Vista and later and also in when using terminal services, when
      server is started from  command line, client cannot connect to it
      via shared memory protocol.
      
      This is a regression introduced when  Bug#24731 was fixed.  The
      reason is that client is trying to attach to shared memory using
      global kernel object  namespace (all kernel objects are prefixed
      with Global\). However, server started from the command line in
      Vista and later will create shared memory and events using current
      session namespace. Thus, client is unable to find the server and
      connection fails.
      
      The fix for the client is to first try to find server using "local"
      names  (omitting Global\  prefix) and only if server is not found,
      trying global namespace.
      afacea4d
    • Alexey Kopytov's avatar
      Bug #45236: large blob inserts from mysqldump fail, possible · 897a1b56
      Alexey Kopytov authored
                  memory issue ? 
       
      The mysql command line client could misinterpret some character 
      sequences as commands under some circumstances. 
       
      The upper limit for internal readline buffer was raised to 1 GB 
      (the same as for server's max_allowed_packet) so that any input 
      line is processed by add_line() as a whole rather than in 
      chunks.
      
      client/mysql.cc:
        The upper limit for internal readline buffer was raised to 1 GB 
        (the same as for server's max_allowed_packet) so that any input 
        line is processed by add_line() as a whole rather than in 
        chunks.
      mysql-test/r/mysql-bug45236.result:
        Added a test case for bug #45236.
      mysql-test/t/mysql-bug45236.test:
        Added a test case for bug #45236.
      897a1b56
  8. 09 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · a073ee45
      Staale Smedseng authored
      with gcc 4.3.2
            
      Compiling MySQL with gcc 4.3.2 and later produces a number of 
      warnings, many of which are new with the recent compiler
      versions.
            
      This bug will be resolved in more than one patch to limit the
      size of changesets. This is the first patch, fixing a number 
      of the warnings, predominantly "suggest using parentheses 
      around && in ||", and empty for and while bodies.
      a073ee45
  9. 06 Jun, 2009 2 commits
  10. 05 Jun, 2009 6 commits
  11. 04 Jun, 2009 5 commits
    • Tatiana A. Nurnberg's avatar
      Bug#32149: Long semaphore wait for adaptive hash latch · e34085fe
      Tatiana A. Nurnberg authored
      Holding on to the temporary inno hash index latch is an optimization in
      many cases, but a pessimization in some others.
      
      Release temporary latches for those corner cases we (or rather, or customers,
      thanks!) have identified, that is, when we are about to do something that
      might take a really long time, like REPAIR or filesort.
      
      sql/ha_myisam.cc:
        Let go of (inno, for now) latch when doing MyISAM-repair.
        (optimize passes through repair.) ("Stuck" in "Repair with
        keycache".)
      sql/sql_insert.cc:
        Let go of (inno, for now) latch when doing CREATE...SELECT
        in select_insert::send_data() -- it might take a while.
        ("stuck" in "Sending data")
      sql/sql_select.cc:
        Release temporary (inno, for now) latch on
        - free_tmp_table() (this can take surprisingly long, "removing tmp table")
        - create_myisam_from_heap() (HEAP table overflowing onto disk as MyISAM,
          "converting HEAP to MyISAM")
      e34085fe
    • Bernt M. Johnsen's avatar
    • Bernt M. Johnsen's avatar
      a3ac1f7e
    • Georgi Kodinov's avatar
      Bug #36995: valgrind error in remove_const during subquery executions · a037071a
      Georgi Kodinov authored
      When copying the Item class one must copy its attributes as well.
      
      mysql-test/r/innodb_mysql.result:
        Bug #36995: test case
      mysql-test/t/innodb_mysql.test:
        Bug #36995: test case
      sql/item.cc:
        Bug #36995: copy attributes in the copy constructor
      a037071a
    • Sergey Glukhov's avatar
      Bug#44798 MySQL engine crashes when creating stored procedures with execute_priv=N · 8041311e
      Sergey Glukhov authored
      The crash happens because of uninitialized
      lex->ssl_cipher, lex->x509_subject, lex->x509_issuer variables.
      The fix is to add initialization of these variables for
      stored procedures&functions.
      
      
      mysql-test/r/sp_notembedded.result:
        test result
      mysql-test/t/sp_notembedded.test:
        test case
      sql/sql_acl.cc:
        The crash happens because of uninitialized
        lex->ssl_cipher, lex->x509_subject, lex->x509_issuer variables.
        The fix is to add initialization of these variables for
        stored procedures&functions.
      8041311e
  12. 02 Jun, 2009 1 commit
    • Sergey Glukhov's avatar
      Bug#45152 crash with round() function on longtext column in a derived table · 33734e95
      Sergey Glukhov authored
      The crash happens due to wrong max_length value which is set on
      Item_func_round::fix_length_and_dec() stage. The value is set to
      args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
      The fix is to set max_length using float_length() function.
      
      
      
      mysql-test/r/func_math.result:
        test result
      mysql-test/t/func_math.test:
        test case
      sql/item_func.cc:
        The crash happens due to wrong max_length value which is set on
        Item_func_round::fix_length_and_dec() stage. The value is set to
        args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
        The fix is to set max_length using float_length() function.
      33734e95
  13. 01 Jun, 2009 1 commit
  14. 31 May, 2009 3 commits
  15. 30 May, 2009 1 commit
    • Davi Arnaut's avatar
      MySQL 5.0 backport of Chad Miller's patch for Bug#34309: · 92e2fa7f
      Davi Arnaut authored
      Bug#34309: '_PC' macro redefinition
      
      For reasons that are now a mystery, we had defined a CPP symbol to
      help ancient compilers work better (in some way that's lost to history).
      This interferes with at least one modern compiler.
      
      Now, don't define the _PC symbol.  Those other underscore-leading
      symbols are suspect also, but at least the names aren't inscrutable.
      Let's leave them for now.
      92e2fa7f