1. 17 Oct, 2008 1 commit
    • Georgi Kodinov's avatar
      Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN · a0e3001c
      Georgi Kodinov authored
      fails after the first time
        
      Two separate problems : 
        1. When flattening joins the linked list used for name resolution 
        (next_name_resolution_table) was not updated.
        Fixed by updating the pointers when extending the table list
        
        2. The items created by expanding a * (star) as a column reference
        were marked as fixed, but no cached table was assigned to them 
        (unlike what Item_field::fix_fields does).
        Fixed by assigning a cached table (so the re-preparation is done
        faster).
        
      Note that the fix for #2 hides the fix for #1 in most cases
      (except when a table reference cannot be cached).
      a0e3001c
  2. 15 Oct, 2008 1 commit
    • Davi Arnaut's avatar
      Bug#37075: offset of limit clause might be truncated on 32-bits server w/o big tables · 4ab10baa
      Davi Arnaut authored
      The problem is that the offset argument of the limit clause
      might be truncated on a 32-bits server built without big
      tables support. The truncation was happening because the
      original 64-bits long argument was being cast to a 32-bits
      (ha_rows) offset counter.
      
      The solution is to check if the conversing resulted in value
      truncation and if so, the offset is set to the maximum possible
      value that can fit on the type.
      4ab10baa
  3. 14 Oct, 2008 1 commit
    • Davi Arnaut's avatar
      Bug#38823: Invalid memory access when a SP statement does wildcard expansion · d4c75b7d
      Davi Arnaut authored
      The problem is that field names constructed due to wild-card
      expansion done inside a stored procedure could point to freed
      memory if the expansion was performed after the first call to
      the stored procedure.
      
      The problem was solved by patch for Bug#38691. The solution
      was to allocate the database, table and field names in the
      in the statement memory instead of table memory.
      d4c75b7d
  4. 10 Oct, 2008 3 commits
    • Georgi Kodinov's avatar
      merged 5.0-main -> 5.0-bugteam · 702ae189
      Georgi Kodinov authored
      702ae189
    • Gleb Shchepa's avatar
      Bug #37894: Assertion in init_read_record_seq in handler.h line 1444 · 27f4c34b
      Gleb Shchepa authored
      Select with a "NULL NOT IN" condition containing complex
      subselect from the same table as in the outer select failed
      with an assertion.
      
      
      The failure was caused by a concatenation of circumstances:
      1) an inner select was optimized by make_join_statistics to use
         the QUICK_RANGE_SELECT access method (that implies an index
         scan of the table);
      2) a subselect was independent (constant) from the outer select;
      3) a condition was pushed down into inner select.
      
      During the evaluation of a constant IN expression an optimizer
      temporary changed the access method from index scan to table
      scan, but an engine handler was already initialized for index
      access by make_join_statistics. That caused an assertion.
      
      
      Unnecessary index initialization has been removed from
      the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset
      reinvokes this initialization).
      27f4c34b
    • Gleb Shchepa's avatar
      Bug #39283: Date returned as VARBINARY to client for queries · e7520c4b
      Gleb Shchepa authored
                  with COALESCE and JOIN
      
      The server returned to a client the VARBINARY column type
      instead of the DATE type for a result of the COALESCE,
      IFNULL, IF, CASE, GREATEST or LEAST functions if that result
      was filesorted in an anonymous temporary table during
      the query execution.
      
      For example:
        SELECT COALESCE(t1.date1, t2.date2) AS result
          FROM t1 JOIN t2 ON t1.id = t2.id ORDER BY result;
      
      
      To create a column of various date/time types in a
      temporary table the create_tmp_field_from_item() function
      uses the Item::tmp_table_field_from_field_type() method
      call. However, fields of the MYSQL_TYPE_NEWDATE type were
      missed there, and the VARBINARY columns were created
      by default.
      Necessary condition has been added.
      e7520c4b
  5. 09 Oct, 2008 1 commit
    • Gleb Shchepa's avatar
      Bug#38499: flush tables and multitable table update with · 0b38c93d
      Gleb Shchepa authored
                 derived table cause crash
      
      When a multi-UPDATE command fails to lock some table, and
      subsequently succeeds, the tables need to be reopened if
      they were altered. But the reopening procedure failed for
      derived tables.
      
      Extra cleanup has been added.
      0b38c93d
  6. 08 Oct, 2008 1 commit
  7. 07 Oct, 2008 2 commits
    • Gleb Shchepa's avatar
      Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while · e219979e
      Gleb Shchepa authored
                ``FLUSH TABLES WITH READ LOCK''
      
      Concurrent execution of 1) multitable update with a
      NATURAL/USING join and 2) a such query as "FLUSH TABLES
      WITH READ LOCK" or "ALTER TABLE" of updating table led
      to a server crash.
      
      
      The mysql_multi_update_prepare() function call is optimized
      to lock updating tables only, so it postpones locking to
      the last, and if locking fails, it does cleanup of modified
      syntax structures and repeats a query analysis.  However,
      that cleanup procedure was incomplete for NATURAL/USING join
      syntax data: 1) some Field_item items pointed into freed
      table structures, and 2) the TABLE_LIST::join_columns fields
      was not reset.
      
      Major change:
        short-living Field *Natural_join_column::table_field has
        been replaced with long-living Item*.
      e219979e
    • Georgi Kodinov's avatar
      merged 5.0-5.1.29-rc -> 5.0-bugteam · c3d3f3ec
      Georgi Kodinov authored
      c3d3f3ec
  8. 06 Oct, 2008 5 commits
  9. 04 Oct, 2008 1 commit
  10. 03 Oct, 2008 1 commit
  11. 02 Oct, 2008 8 commits
  12. 01 Oct, 2008 7 commits
  13. 30 Sep, 2008 3 commits
    • Patrick Crews's avatar
      automerge · 2f58dc79
      Patrick Crews authored
      2f58dc79
    • Patrick Crews's avatar
      Automerge · c7f32b02
      Patrick Crews authored
      c7f32b02
    • Gleb Shchepa's avatar
      Fixed bug #17823: 'arc' directories inside database directories. · e20b9de1
      Gleb Shchepa authored
      Server created "arc" directories inside database directories and
      maintained there useless copies of .frm files.
      
      Creation and renaming procedures of those copies as well as
      creation of "arc" directories has been discontinued.
      Removal procedure has been kept untouched to be able to
      cleanup existent database directories by the DROP DATABASE
      query. Also view renaming procedure has been updated to remove
      these directories.
      e20b9de1
  14. 29 Sep, 2008 1 commit
    • Alexey Botchkov's avatar
      Bug#37949 Crash if argument to SP is a subquery that returns more than one row · b6f4b1c0
      Alexey Botchkov authored
           JOIN for the subselect wasn't cleaned if we came upon an error
           during sub_select() execution. That leads to the assertion failure
           in close_thread_tables()
      
           part of the 6.0 code backported
      
      per-file comments:
        mysql-test/r/sp-error.result
      Bug#37949 Crash if argument to SP is a subquery that returns more than one row 
          test result
      
        mysql-test/t/sp-error.test
      Bug#37949 Crash if argument to SP is a subquery that returns more than one row 
          test case
      
        sql/sp_head.cc
      Bug#37949 Crash if argument to SP is a subquery that returns more than one row 
          lex->unit.cleanup() call added if not substatement
      b6f4b1c0
  15. 24 Sep, 2008 1 commit
    • Chad MILLER's avatar
      Bug#35754: mysql_install_db does not work if no hostname is set · bf996620
      Chad MILLER authored
      Machines with hostname set to "localhost" cause uniqueness errors in 
      the SQL bootstrap data.
      
      Now, insert zero lines for cases where the (lowercased) hostname is 
      the same as an already-inserted 'localhost' name.  Also, fix a few tests 
      that expect certain local accounts to have a certain host name.
      bf996620
  16. 23 Sep, 2008 1 commit
  17. 20 Sep, 2008 2 commits
    • Kristofer Pettersson's avatar
      Automerge · cd9aef82
      Kristofer Pettersson authored
      cd9aef82
    • Kristofer Pettersson's avatar
      Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar · 18b3eacb
      Kristofer Pettersson authored
                  
      A stored procedure involving substrings could crash the server on certain
      platforms because of invalid memory reads.
                
      During storing the new blob-field value, the cached value's address range
      overlapped that of the new field value. This caused problems when the 
      cached value storage was reallocated to provide access for a new 
      characater set representation. The patch checks the address ranges, and if
      they overlap, the new field value is copied to a new storage before it is
      converted to the new character set.
      18b3eacb