An error occurred fetching the project authors.
  1. 17 Jul, 2006 1 commit
  2. 15 Jul, 2006 2 commits
    • igor@rurik.mysql.com's avatar
      Fixed bug #20869. · 38cd55a7
      igor@rurik.mysql.com authored
      The bug caused a crash of the server if a subquery with
      ORDER BY DESC used the range access method.
      The bug happened because the method QUICK_SELECT_DESC::reset
      was not reworked after MRR interface had been introduced.
      38cd55a7
    • igor@olga.mysql.com's avatar
      Fixed bug #20519. · 4de3186a
      igor@olga.mysql.com authored
      The bug was due to a loss happened during a refactoring made
      on May 30 2005 that modified the function JOIN::reinit.
      As a result of it for any subquery the value of offset_limit_cnt
      was not restored for the following executions. Yet the first 
      execution of the subquery made it equal to 0.
      The fix restores this value in the function JOIN::reinit.  
      4de3186a
  3. 14 Jul, 2006 1 commit
    • igor@olga.mysql.com's avatar
      Fixed bug #19714. · f6080640
      igor@olga.mysql.com authored
      DESCRIBE returned the type BIGINT for a column of a view if the column
      was specified by an expression over values of the type INT.
          
      E.g. for the view defined as follows:
        CREATE VIEW v1 SELECT COALESCE(f1,f2) FROM t1
      DESCRIBE returned type BIGINT for the only column of the view if f1,f2 are
      columns of the INT type.
      At the same time DESCRIBE returned type INT for the only column of the table
      defined by the statement:
        CREATE TABLE t2 SELECT COALESCE(f1,f2) FROM t1.
          
      This inconsistency was removed by the patch.
      
      Now the code chooses between INT/BIGINT depending on the
      precision of the aggregated column type.
       
      Thus both DESCRIBE commands above returns type INT for v1 and t2.
       
      f6080640
  4. 11 Jul, 2006 1 commit
    • evgen@moonbone.local's avatar
      Fixed bug#18503: Queries with a quantified subquery returning empty set · 8ffda481
      evgen@moonbone.local authored
      may return a wrong result.
      
      An Item_sum_hybrid object has the was_values flag which indicates whether any
      values were added to the sum function. By default it is set to true and reset
      to false on any no_rows_in_result() call. This method is called only in
      return_zero_rows() function. An ALL/ANY subquery can be optimized by MIN/MAX
      optimization. The was_values flag is used to indicate whether the subquery
      has returned at least one row. This bug occurs because return_zero_rows() is
      called only when we know that the select will return zero rows before
      starting any scans but often such information is not known.
      In the reported case the return_zero_rows() function is not called and
      the was_values flag is not reset to false and yet the subquery return no rows
      Item_func_not_all and Item_func_nop_all functions return a wrong
      comparison result.
      
      The end_send_group() function now calls no_rows_in_result() for each item
      in the fields_list if there is no rows were found for the (sub)query.
      8ffda481
  5. 10 Jul, 2006 1 commit
    • evgen@moonbone.local's avatar
      Fixed bug#16302: Quantified subquery without any tables gives wrong results · d3418971
      evgen@moonbone.local authored
      The ALL/ANY subqueries are the subject of MIN/MAX optimization. The matter
      of this optimization is to embed MIN() or MAX() function into the subquery
      in order to get only one row by which we can tell whether the expression
      with ALL/ANY subquery is true or false.
      But when it is applied to a subquery like 'select a_constant' the reported bug
      occurs. As no tables are specified in the subquery the do_select() function 
      isn't called for the optimized subquery and thus no values have been added 
      to a MIN()/MAX() function and it returns NULL instead of a_constant.
      This leads to a wrong query result.
      
      For the subquery like 'select a_constant' there is no reason to apply
      MIN/MAX optimization because the subquery anyway will return at most one row.
      Thus the Item_maxmin_subselect class is more appropriate for handling such
      subqueries.
      
      The Item_in_subselect::single_value_transformer() function now checks
      whether tables are specified for the subquery. If no then this subselect is
      handled like a UNION using an Item_maxmin_subselect object.
      d3418971
  6. 27 Jun, 2006 1 commit
  7. 25 May, 2006 1 commit
  8. 17 May, 2006 1 commit
    • evgen@moonbone.local's avatar
      Fixed bug#19077: A nested materialized derived table is used before being populated. · 1d820585
      evgen@moonbone.local authored
      The convert_constant_item() function converts constant items to ints on
      prepare phase to optimize execution speed. In this case it tries to evaluate
      subselect which contains a derived table and is contained in a derived table. 
      All derived tables are filled only after all derived tables are prepared.
      So evaluation of subselect with derived table at the prepare phase will
      return a wrong result.
      
      A new flag with_subselect is added to the Item class. It indicates that
      expression which this item represents is a subselect or contains a subselect.
      It is set to 0 by default. It is set to 1 in the Item_subselect constructor
      for subselects.
      For Item_func and Item_cond derived classes it is set after fixing any argument
      in Item_func::fix_fields() and Item_cond::fix_fields accordingly.
      The convert_constant_item() function now doesn't convert a constant item
      if the with_subselect flag set in it. 
      1d820585
  9. 11 May, 2006 1 commit
    • gkodinov@mysql.com's avatar
      BUG#7549: Missing error message for invalid view selection with subquery. · 0486cfbe
      gkodinov@mysql.com authored
      When a view statement is compiled on CREATE VIEW time, most of the 
      optimizations should not be done. Finding the right optimization 
      for a subquery is one of them.
      Unfortunately the optimizer is resolving the column references of 
      the left expression of IN subqueries in the process of deciding 
      witch optimization to use (if needed). So there should be a 
      special case in Item_in_subselect::fix_fields() : check the 
      validity of the left expression of IN subqueries in CREATE VIEW 
      mode and then proceed as normal. 
      0486cfbe
  10. 10 May, 2006 1 commit
  11. 03 May, 2006 1 commit
    • igor@rurik.mysql.com's avatar
      Fixed bug #14292: performance degradation for a benchmark query. · ae4eb6b5
      igor@rurik.mysql.com authored
      This performance degradation was due to the fact that some
      cost evaluation code added into 4.1 in the function find_best was
      not merged into the code of the function best_access_path added
      together with other code for greedy optimizer.
      Added a parameter to the function print_plan. The parameter contains
      accumulated cost for a given partial join.
       
      The patch does not include a special test case since this performance
      degradation is hard to reproduse with a simple example.
      
      TODO: make the function find_best use the function best_access_path
      in order to remove duplication of code which might result in incomplete
      merges in the future.
      ae4eb6b5
  12. 28 Apr, 2006 1 commit
    • gkodinov@lsmy3.wdf.sap.corp's avatar
      BUG#18492: mysqld reports ER_ILLEGAL_REFERENCE in --ps-protocol · ca793433
      gkodinov@lsmy3.wdf.sap.corp authored
      In the code that converts IN predicates to EXISTS predicates it is changing
      the select list elements to constant 1. Example :
      SELECT ... FROM ...  WHERE a IN (SELECT c FROM ...)
      is transformed to :
      SELECT ... FROM ... WHERE EXISTS (SELECT 1 FROM ...  HAVING a = c)
      However there can be no FROM clause in the IN subquery and it may not be
      a simple select : SELECT ... FROM ... WHERE a IN (SELECT f(..) AS
      c UNION SELECT ...) This query is transformed to : SELECT ... FROM ...
      WHERE EXISTS (SELECT 1 FROM (SELECT f(..) AS c UNION SELECT ...)
      x HAVING a = c) In the above query c in the HAVING clause is made to be
      an Item_null_helper (a subclass of Item_ref) pointing to the real
      Item_field (which is not referenced anywhere else in the query anymore).
      This is done because Item_ref_null_helper collects information whether
      there are NULL values in the result.  This is OK for directly executed
      statements, because the Item_field pointed by the Item_null_helper is
      already fixed when the transformation is done.  But when executed as
      a prepared statement all the Item instances are "un-fixed" before the
      recompilation of the prepared statement. So when the Item_null_helper
      gets fixed it discovers that the Item_field it points to is not fixed
      and issues an error.  The remedy is to keep the original select list
      references when there are no tables in the FROM clause. So the above
      becomes : SELECT ... FROM ...  WHERE EXISTS (SELECT c FROM (SELECT f(..)
      AS c UNION SELECT ...) x HAVING a = c) In this way c is referenced
      directly in the select list as well as by reference in the HAVING
      clause. So it gets correctly fixed even with prepared statements.  And
      since the Item_null_helper subclass of Item_ref_null_helper is not used
      anywhere else it's taken out.
      ca793433
  13. 01 Apr, 2006 1 commit
    • igor@rurik.mysql.com's avatar
      Fixed bug #16504. · af2d79a7
      igor@rurik.mysql.com authored
      Multiple equalities were not adjusted after reading constant tables.
      It resulted in neglecting good index based methods that could be
      used to access of other tables.
      af2d79a7
  14. 23 Mar, 2006 1 commit
  15. 13 Mar, 2006 1 commit
    • evgen@sunlight.local's avatar
      Fixed bug#17366: Unchecked Item_int results in server crash · af660df0
      evgen@sunlight.local authored
      When there is conjunction of conds, the substitute_for_best_equal_field()
      will call the eliminate_item_equal() function in loop to build final
      expression. But if eliminate_item_equal() finds that some cond will always
      evaluate to 0, then that cond will be substituted by Item_int with value ==
      0. In this case on the next iteration eliminate_item_equal() will get that 
      Item_int and treat it as Item_cond. This is leads to memory corruption and
      server crash on cleanup phase.
      
      To the eliminate_item_equal() function was added DBUG_ASSERT for checking
      that all items treaten as Item_cond are really Item_cond.
      The substitute_for_best_equal_field() now checks that if
      eliminate_item_equal() returns Item_int and it's value is 0 then this 
      value is returned as the result of whole conjunction.
      af660df0
  16. 24 Feb, 2006 1 commit
  17. 17 Feb, 2006 1 commit
  18. 14 Feb, 2006 1 commit
    • igor@rurik.mysql.com's avatar
      Fixed bug #16603. · 75b6930d
      igor@rurik.mysql.com authored
      A subquery transformation changes the HAVING clause of the embedding query if the subquery contains
      a GROUP BY clause. Yet the split_sum_func2 function was not applied to the modified HAVING clause.
      This could result in wrong answers.
      75b6930d
  19. 15 Oct, 2005 2 commits
  20. 12 Oct, 2005 2 commits
    • guilhem@mysql.com's avatar
      fixes after merge of 4.1. · a6ceb594
      guilhem@mysql.com authored
      a6ceb594
    • grog@mysql.com's avatar
      sql_yacc.yy: · c248a36e
      grog@mysql.com authored
        Bug #10308: Parse 'purge master logs' with subselect correctly.
      subselect.test:
        Bug #10308: Test for 'purge master logs' with subselect.
      subselect.result:
        Bug #10308: Test result for 'purge master logs' with subselect.
      c248a36e
  21. 23 Aug, 2005 1 commit
    • timour@mysql.com's avatar
      WL#2486 - natural and using join according to SQL:2003 · e0403003
      timour@mysql.com authored
      * Provide backwards compatibility extension to name resolution of
        coalesced columns. The patch allows such columns to be qualified
        with a table (and db) name, as it is in 4.1.
        Based on a patch from Monty.
      
      * Adjusted tests accordingly to test both backwards compatible name
        resolution of qualified columns, and ANSI-style resolution of
        non-qualified columns.
        For this, each affected test has two versions - one with qualified
        columns, and one without. 
      e0403003
  22. 19 Aug, 2005 1 commit
  23. 16 Aug, 2005 2 commits
    • igor@rurik.mysql.com's avatar
      subselect.result: · d553e165
      igor@rurik.mysql.com authored
        Added missing drop statement
      subselect.test:
        Added missing drop statement.
      d553e165
    • igor@rurik.mysql.com's avatar
      sql_select.cc: · 9693dc6a
      igor@rurik.mysql.com authored
        Fixed bug #11479.
        The JOIN::reinit method cannot call setup_tables
        after the optimization phase since this function
        removes some optimization settings for joined
        tables. E.g. it resets values of the null_row flag to 0.
      subselect.result, subselect.test:
        Added a test case for bug #11479.
      9693dc6a
  24. 13 Aug, 2005 2 commits
  25. 12 Aug, 2005 1 commit
    • timour@mysql.com's avatar
      Implementation of WL#2486 - · a247282a
      timour@mysql.com authored
      "Process NATURAL and USING joins according to SQL:2003".
      
      * Some of the main problems fixed by the patch:
        - in "select *" queries the * expanded correctly according to
          ANSI for arbitrary natural/using joins
        - natural/using joins are correctly transformed into JOIN ... ON
          for any number/nesting of the joins.
        - column references are correctly resolved against natural joins
          of any nesting and combined with arbitrary other joins.
      
      * This patch also contains a fix for name resolution of items
        inside the ON condition of JOIN ... ON - in this case items must
        be resolved only against the JOIN operands. To support such
        'local' name resolution, the patch introduces a stack of
        name resolution contexts used at parse time.
      
      NOTICE:
      - This patch is not complete in the sense that
        - there are 2 test cases that still do not pass -
          one in join.test, one in select.test. Both are marked
          with a comment "TODO: WL#2486".
        - it does not include a new test specific for the task
      a247282a
  26. 08 Aug, 2005 2 commits
    • igor@rurik.mysql.com's avatar
      subselect.test, subselect.result: · 73be194f
      igor@rurik.mysql.com authored
        Added a test case for bug #12392.
      item_cmpfunc.cc:
        Fixed bug #12392.
        Missing handling of rows containing NULL components
        when evaluating IN predicates caused a crash.
      73be194f
    • monty@mysql.com's avatar
      Review of new pushed code · 99cb0835
      monty@mysql.com authored
      - Fixed some error condtion when handling dates with 'T'
      - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed
      - Safety fixes and cleanups
      99cb0835
  27. 07 Aug, 2005 2 commits
    • igor@rurik.mysql.com's avatar
      subselect.result: · dafbb34d
      igor@rurik.mysql.com authored
        Correction after manual merge.
      dafbb34d
    • igor@rurik.mysql.com's avatar
      subselect.result: · b2a189ab
      igor@rurik.mysql.com authored
        Added test case for bug #11867.
        Fixed results for two existing test cases.
      subselect.test:
        Added test case for bug #11867.
      item_subselect.cc:
        Fixed bug #11867.
        Added missing code in Item_in_subselect::row_value_transformer
        that caused problems for queries with
        ROW(elems) IN (SELECT DISTINCT cols FROM ...).
      b2a189ab
  28. 30 Jul, 2005 1 commit
    • evgen@moonbone.local's avatar
      Fix bug #11335 View redefines TinyInt(1) column definition · fa0ea365
      evgen@moonbone.local authored
      Item_type_holder doesn't store information about length and exact type of
      original item which results in redefining length to max_length and geometry 
      type to longtext.
      
      Changed the way derived tables except unions are built. Now they are created
      from original field list instead of list of Item_type_holder.
      fa0ea365
  29. 12 Jul, 2005 1 commit
  30. 23 Jun, 2005 2 commits
    • bell@sanja.is.com.ua's avatar
      fixed encrypt() name · ec444444
      bell@sanja.is.com.ua authored
      ec444444
    • igor@rurik.mysql.com's avatar
      opt_range.cc: · 893c6c9b
      igor@rurik.mysql.com authored
        Fixed buf #11487.
        Added a call of  QUICK_RANGE_SELECT::init to the
        QUICK_RANGE_SELECT::reset method. Without it the second
        evaluation of a subquery employing the range access failed.
      subselect.result, subselect.test:
        Added a test case for bug #11487.
      893c6c9b
  31. 20 May, 2005 2 commits