An error occurred fetching the project authors.
  1. 02 Oct, 2007 1 commit
  2. 28 Sep, 2007 1 commit
    • evgen@moonbone.local's avatar
      Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used. · b9e81c2a
      evgen@moonbone.local authored
      The change_to_use_tmp_fields function leaves the orig_table member of an
      expression's tmp table field filled for the new Item_field being created.
      Later orig_table is used by the Field::make_field function to provide some
      info about original table and field name to a user. This is ok for a field
      but for an expression it should be empty.
      
      The change_to_use_tmp_fields function now resets orig_table member of
      an expression's tmp table field to prevent providing a wrong info to a user.
      The Field::make_field function now resets the table_name and the org_col_name
      variables when the orig_table is set to 0.
      b9e81c2a
  3. 24 Sep, 2007 1 commit
  4. 14 Sep, 2007 1 commit
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug #31001: ORDER BY DESC in InnoDB not working · a2afc56f
      gkodinov/kgeorge@magare.gmz authored
      The optimizer sets index traversal in reverse order only if there are 
       used key parts that are not compared to a constant.
      However using the primary key as an ORDER BY suffix rendered the check
      incomplete : going in reverse order must still be used even if 
      all the parts of the secondary key are compared to a constant.
      
      Fixed by relaxing the check and set reverse traversal even when all
      the secondary index keyparts are compared to a const.
      Also account for the case when all the primary keys are compared to a
      constant.
      a2afc56f
  5. 28 Aug, 2007 1 commit
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug #30377: EXPLAIN loses last_query_cost when used with UNION · cfaa0983
      gkodinov/kgeorge@magare.gmz authored
      Currently the Last_query_cost session status variable shows
      only the cost of a single flat subselect. For complex queries
      (with subselects or unions etc) Last_query_cost is not valid
      as it was showing the cost for the last optimized subselect.
      Fixed by reseting to zero Last_query_cost when the complete
      cost of the query cannot be determined.
      Last_query_cost will be non-zero only for single flat queries.
      cfaa0983
  6. 27 Aug, 2007 1 commit
    • mhansson/martin@linux-st28.site's avatar
      Bug #30596 GROUP BY optimization gives wrong result order · a4d5d920
      mhansson/martin@linux-st28.site authored
      The optimization that uses a unique index to remove GROUP BY, did not 
      ensure that the index was actually used, thus violating the ORDER BY
      that is impled by GROUP BY.
      Fixed by replacing GROUP BY with ORDER BY if the GROUP BY clause contains
      a unique index. In case GROUP BY ... ORDER BY null is used, GROUP BY is
      simply removed.
      a4d5d920
  7. 25 Aug, 2007 1 commit
  8. 20 Aug, 2007 1 commit
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #30287. · 5d3809c2
      gshchepa/uchum@gleb.loc authored
      The server created temporary tables for filesort in the working directory
      instead of the specified tmpdir directory.
      5d3809c2
  9. 17 Aug, 2007 1 commit
    • evgen@moonbone.local's avatar
      Bug#30245: A wrong type of a BIT field is reported when grouped by it. · 9a83ddda
      evgen@moonbone.local authored
      HEAP tables can't index BIT fields. Due to this when grouping by such fields is
      needed they are converted to a fields of the LONG type when temporary table
      is being created. But a side effect of this is that a wrong type of BIT
      fields is returned to a client.
      
      Now the JOIN::prepare and the create_distinct_group functions are create
      additional hidden copy of BIT fields to preserve original fields untouched.
      New hidden fields are used for grouping instead.
      9a83ddda
  10. 15 Aug, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #30396. · d790ec42
      igor@olga.mysql.com authored
      The bug caused memory corruption for some queries with top OR level
      in the WHERE condition if they contained equality predicates and 
      other sargable predicates in disjunctive parts of the condition.
      
      The corruption happened because the upper bound of the memory
      allocated for KEY_FIELD and SARGABLE_PARAM internal structures
      containing info about potential lookup keys was calculated incorrectly
      in some cases. In particular it was calculated incorrectly when the
      WHERE condition was an OR formula with disjuncts being AND formulas
      including equalities and other sargable predicates.
      d790ec42
  11. 31 Jul, 2007 2 commits
    • sergefp@mysql.com's avatar
      BUG#29582: huge memory consumption with union, subselect, joins: · c37f9b9e
      sergefp@mysql.com authored
      - Don't call mysql_select() several times for the select that enumerates
        a temporary table with the results of the UNION. Making this call for
        every subquery execution caused O(#enumerated-rows-in-the-outer-query) 
        memory allocations.
      - Instead, call join->reinit() and join->exec(), and
        = disable constant table detection for such joins,  
        = provide special handling for table-less constant subqueries.
      c37f9b9e
    • holyfoot/hf@mysql.com/hfmain.(none)'s avatar
      Bug #29717 INSERT INTO SELECT inserts values even if · f1ee2d06
      holyfoot/hf@mysql.com/hfmain.(none) authored
       SELECT statement itself returns empty.
      
      As a result of this bug 'SELECT AGGREGATE_FUNCTION(fld) ... GROUP BY'
      can return one row instead of an empty result set.
      
      When GROUP BY only has fields of constant tables
      (with a single row), the optimizer deletes the group_list.
      After that we lose the information about whether we had an
      GROUP BY statement. Though it's important
      as SELECT min(x) from empty_table; and
         SELECT min(x) from empty_table GROUP BY y; have to return
      different results - the first query should return one row,
      second - an empty result set.
      So here we add the 'group_optimized_away' flag to remember this case
      when GROUP BY exists in the query and is removed
      by the optimizer, and check this flag in end_send_group()
      f1ee2d06
  12. 26 Jul, 2007 1 commit
  13. 23 Jul, 2007 1 commit
  14. 21 Jul, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #29911. · 07e0cd2f
      igor@olga.mysql.com authored
      This bug manifested itself for join queries with GROUP BY and HAVING clauses
      whose SELECT lists contained DISTINCT. It occurred when the optimizer could
      deduce that the result set would have not more than one row.
      The bug could lead to wrong result sets for queries of this type because
      HAVING conditions were erroneously ignored in some cases in the function
      remove_duplicates.   
      07e0cd2f
  15. 20 Jul, 2007 1 commit
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug #28591: MySQL need not sort the records in case of · 8fc401e2
      gkodinov/kgeorge@magare.gmz authored
      ORDER BY primary_key on InnoDB table
      
      Queries that use an InnoDB secondary index to retrieve
      data don't need to sort in case of ORDER BY primary key
      if the secondary index is compared to constant(s).
      They can also skip sorting if ORDER BY contains both the
      the secondary key parts and the primary key parts (in
      that order).
      This is because InnoDB returns the rows in order of the
      primary key for rows with the same values of the secondary
      key columns.
      Fixed by preventing temp table sort for the qualifying 
      queries.
      8fc401e2
  16. 12 Jul, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #29604. · 7f64144b
      igor@olga.mysql.com authored
      A bug in the restore_prev_nj_state function allowed interleaving 
      inner tables of outer join operations with outer tables. With the
      current implementation of the nested loops algorithm it could lead
      to wrong result sets for queries with nested outer joins.
      Another bug in this procedure effectively blocked evaluation of some
      valid execution plans for queries with nested outer joins. 
      7f64144b
  17. 06 Jul, 2007 1 commit
    • kostja@bodhi.(none)'s avatar
      Remove typedef st_table_list TABLE_LIST and always use name 'TABLE_LIST'. · a33bc2c2
      kostja@bodhi.(none) authored
      The need arose when working on Bug 26141, where it became
      necessary to replace TABLE_LIST with its forward declaration in a few
      headers, and this involved a lot of s/TABLE_LIST/st_table_list/.
      Although other workarounds exist, this patch is in line
      with our general strategy of moving away from typedef-ed names.
      Sometime in future we might also rename TABLE_LIST to follow the
      coding style, but this is a huge change.
      a33bc2c2
  18. 29 Jun, 2007 1 commit
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug#27333: subquery grouped for aggregate of outer · 38172240
      gkodinov/kgeorge@magare.gmz authored
      query / no aggregate of subquery
       The optimizer counts the aggregate functions that 
       appear as top level expressions (in all_fields) in 
       the current subquery. Later it makes a list of these
       that it uses to actually execute the aggregates in
       end_send_group().
       That count is used in several places as a flag whether
       there are aggregates functions.
       While collecting the above info it must not consider
       aggregates that are not aggregated in the current 
       context. It must treat them as normal expressions 
       instead. Not doing that leads to incorrect data about
       the query, e.g. running a query that actually has no
       aggregate functions as if it has some (and hence is
       expected to return only one row).
       Fixed by ignoring the aggregates that are not aggregated
       in the current context. 
       One other smaller omission discovered and fixed in the 
       process : the place of aggregation was not calculated for
       user defined functions. Fixed by calling 
       Item_sum::init_sum_func_check() and 
       Item_sum::check_sum_func() as it's done for the rest of 
       the aggregate functions.
      38172240
  19. 24 Jun, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #25602. A query with DISTINCT in the select list to which · 59b9077c
      igor@olga.mysql.com authored
      the loose scan optimization for grouping queries was applied returned 
      a wrong result set when the query was used with the SQL_BIG_RESULT
      option.
      
      The SQL_BIG_RESULT option forces to use sorting algorithm for grouping
      queries instead of employing a suitable index. The current loose scan
      optimization is applied only for one table queries when the suitable
      index is covering. It does not make sense to use sort algorithm in this
      case. However the create_sort_index function does not take into account
      the possible choice of the loose scan to implement the DISTINCT operator
      which makes sorting unnecessary. Moreover the current implementation of
      the loose scan for queries with distinct assumes that sorting will
      never happen. Thus in this case create_sort_index should not call
      the function filesort.
      59b9077c
  20. 23 Jun, 2007 1 commit
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #29095. · fbbb30a6
      gshchepa/uchum@gleb.loc authored
      INSERT into table from SELECT from the same table
      with ORDER BY and LIMIT was inserting other data
      than sole SELECT ... ORDER BY ... LIMIT returns.
      
      One part of the patch for bug #9676 improperly pushed
      LIMIT to temporary table in the presence of the ORDER BY
      clause.
      That part has been removed.
      fbbb30a6
  21. 20 Jun, 2007 1 commit
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #28898. · 2379f977
      gshchepa/uchum@gleb.loc authored
      For a join query with GROUP BY and/or ORDER BY and a view reference
      in the FROM list the metadata erroneously showed empty table aliases
      and database names for the view columns.
      2379f977
  22. 18 Jun, 2007 1 commit
    • mhansson/martin@linux-st28.site's avatar
      Bug#28677: SELECT on missing column gives extra error · cc2d534a
      mhansson/martin@linux-st28.site authored
      The method select_insert::send_error does two things, it rolls back a statement
      being executed and outputs an error message. But when a 
      nonexistent column is referenced, an error message has been published already and
      there is no need to publish another.
      Fixed by moving all functionality beyond publishing an error message into 
      select_insert::abort() and calling only that function.
      cc2d534a
  23. 11 Jun, 2007 1 commit
  24. 07 Jun, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #28449: a crash may happen at some rare conditions when · 56996041
      igor@olga.mysql.com authored
      a temporary table has grown out of heap memory reserved for it and 
      the remaining disk space is not big enough to store the table as
      a MyISAM table.
      
      The crash happens because the function create_myisam_from_heap
      does not handle safely the mem_root structure associated 
      with the converted table in the case when an error has occurred.
      56996041
  25. 02 Jun, 2007 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #28728: a crash when executing EXPLAIN EXTENDED for a query · 5cbebf0a
      igor@olga.mysql.com authored
      using a derived table over a grouping subselect.
      
      This crash happens only when materialization of the derived tables 
      requires creation of auxiliary temporary table, for example when
      a grouping operation is carried out with usage of a temporary table.
      
      The crash happened because EXPLAIN EXTENDED when printing the query
      expression made an attempt to use the objects created in the mem_root
      of the temporary table which has been already freed by the moment
      when printing is called.
      
      This bug appeared after the method Item_field::print() had been 
      introduced.    
      5cbebf0a
  26. 31 May, 2007 2 commits
    • kaa@polly.local's avatar
      Fix for bug #27643 "query failed : 1114 (The table '' is full) · d435b3ed
      kaa@polly.local authored
      Problem:
      
      HASH indexes on VARCHAR columns with binary collations did not ignore trailing spaces from strings before comparisons. This could result in duplicate records being successfully inserted into a MEMORY table with unique key constraints.
      
      As a direct consequence of the above, internal MEMORY tables used for GROUP BY calculation in testcases for bug #27643 contained duplicate rows which resulted in duplicate key errors when converting those temporary tables to MyISAM. Additionally, that error was incorrectly converted to the 'table is full' error.
      
      Solution:
      
      - ignore trailing spaces in VARCHAR fields with binary collations when calculating hashes.
      - return a proper error from create_myisam_from_heap() when conversion fails.
      d435b3ed
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #28598. · e16953df
      gshchepa/uchum@gleb.loc authored
      mysqld crashed when a long-running explain query was killed from
      another connection.
      
      When the current thread caught a kill signal executing the function
      best_extension_by_limited_search it just silently returned to  
      the calling function greedy_search without initializing elements of
      the join->best_positions array.
      However, the greedy_search function ignored thd->killed status
      after a calls to the best_extension_by_limited_search function, and
      after several calls the greedy_search function used an uninitialized
      data from the join->best_positions[idx] to search position in the
      join->best_ref array. 
      That search failed, and greedy_search tried to call swap_variables
      function with NULL argument - that caused a crash.
      e16953df
  27. 30 May, 2007 1 commit
  28. 26 May, 2007 2 commits
  29. 24 May, 2007 1 commit
  30. 22 May, 2007 1 commit
  31. 21 May, 2007 1 commit
  32. 15 May, 2007 1 commit
  33. 10 May, 2007 1 commit
  34. 04 May, 2007 3 commits
    • gkodinov/kgeorge@magare.gmz's avatar
      bug #27531: · 13e55b8a
      gkodinov/kgeorge@magare.gmz authored
       fixed coverage of out-of-mem errors
      13e55b8a
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug #27531: the 4.1 fix. · d11e1f24
      gkodinov/kgeorge@magare.gmz authored
      When checking for applicability of join cache
      we must disable its usage only if there is no
      temp table in use.
      When a temp table is used we can use join
      cache (and it will not make the result-set 
      unordered) to fill the temp table. The filesort() 
      operation is then applied to the data in the temp 
      table and hence is not affected by join cache
      usage.
      Fixed by narrowing the condition for disabling 
      join cache to exclude the case where temp table
      is used.
      d11e1f24
    • gkodinov/kgeorge@magare.gmz's avatar
      Bug #27807. · 6badb08c
      gkodinov/kgeorge@magare.gmz authored
      Non-correlated scalar subqueries may get executed
      in EXPLAIN at the optimization phase if they are
      part of a right hand sargable expression.
      If the scalar subquery uses a temp table to 
      materialize its results it will replace the 
      subquery structure from the parser with a simple
      select from the materialization table.
      As a result the EXPLAIN will crash as the 
      temporary materialization table is not to be shown
      in EXPLAIN at all.
      Fixed by preserving the original query structure
      right after calling optimize() for scalar subqueries
      with temp tables executed during EXPLAIN.
      6badb08c
  35. 02 May, 2007 1 commit