An error occurred fetching the project authors.
  1. 13 Nov, 2010 1 commit
    • Alexander Nozdrin's avatar
      Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME · 5af51e4a
      Alexander Nozdrin authored
      structure buffer).
      
      This is a follow-up for WL#4435. The bug actually existed not only
      MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value()
      was written in an assumption that it's working with expressions, i.e.
      with basic data types.
      
      There are two different quick fixes here:
        a) Change Item_param::make_field() -- remove setting of
           Send_field::length, Send_field::charsetnr, Send_field::flags and
           Send_field::type.
      
           That would lead to marshalling all data using basic types to the client
           (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and
           MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be
           sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc.
      
           That could be Ok for the client, because the client library does
           reverse conversion automatically (the client program would see DATETIME
           as MYSQL_TIME object). However, there is a problem with metadata --
           the metadata would be wrong (misleading): it would say that DATETIME is
           marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING.
      
        b) Set Item_param::param_type properly to actual underlying field type.
           That would lead to double conversion inside the server: for example,
           MYSQL_TIME-object would be converted into STRING-object
           (in Item_param::set_value()), and then converted back to MYSQL_TIME-object
           (in Item_param::send()).
      
           The data however would be marshalled more properly, and also metadata would
           be correct.
      
      This patch implements b).
      
      There is also a possibility to avoid double conversion either by clonning
      the data field, or by storing a reference to it and using it on Item::send()
      time. That requires more work and might be done later.
      5af51e4a
  2. 04 Nov, 2010 1 commit
    • Jorgen Loland's avatar
      Bug#57882 - Item_func_conv_charset::val_str(String*): · eeb8bce9
      Jorgen Loland authored
                  Assertion `fixed == 1' failed
      
      (also fixes duplicate bug 57515)
      
      agg_item_set_converter() (item.cc) handles conversion of 
      character sets by creating a new Item. fix_fields() is then 
      called on this newly created item. Prior to this patch, it was
      not checked whether fix_fields() was successful or not. Thus, 
      agg_item_set_converter() would return success even when an 
      error occured. This patch makes it return error (TRUE) if 
      fix_fields() fails.
      eeb8bce9
  3. 08 Oct, 2010 1 commit
    • Alexander Barkov's avatar
      The fix for · c57244fb
      Alexander Barkov authored
       Bug#55744 GROUP_CONCAT + CASE + ucs return garbage
      revealed problems in how character set aggregation
      code works with prepared statements.
      
      This patch fixes (hopefully) the problems.
      c57244fb
  4. 07 Oct, 2010 1 commit
    • Evgeny Potemkin's avatar
      Bug#57095: Wrongly chosen expression cache type led to a wrong result. · 2fd0bc63
      Evgeny Potemkin authored
      The coalesce function returned DATETIME type due to a DATETIME argument, but
      since it's not a date/time function it can't return correct int value for
      it. Nevertheless Item_datetime_cache was chosen to cache coalesce's result
      and that led to a wrong result.
      
      Now Item_datetime_cache is used only for those function that could return
      correct int representation of DATETIME values.
      2fd0bc63
  5. 13 Sep, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #55779: select does not work properly in mysql server · 79c1faa0
      Gleb Shchepa authored
                  Version "5.1.42 SUSE MySQL RPM"
      
      When a query was using a DATE or DATETIME value formatted
      using different formatting than "yyyy-mm-dd HH:MM:SS", a
      query with a greater-or-equal '>=' condition matched only
      greater values in an indexed TIMESTAMP column.
      
      The problem was introduced by the fix for the bug 46362
      and partially solved (for DATE and DATETIME columns only)
      by the fix for the bug 47925.
      
      The stored_field_cmp_to_item function has been modified
      to take into account TIMESTAMP columns like we do for
      DATE and DATETIME columns.
      79c1faa0
  6. 09 Sep, 2010 1 commit
    • Alexey Kopytov's avatar
      Addendum patch for bug #54190. · f563a012
      Alexey Kopytov authored
      The patch caused some test failures when merged to 5.5 because,
      unlike 5.1, it utilizes Item_cache_row to actually cache row
      values. The problem was that Item_cache_row::bring_value()
      essentially did nothing. In particular, it did not update its
      null_value, so all Item_cache_row objects were always having
      their null_values set to TRUE. This went unnoticed previously,
      but now when Arg_comparator::compare_row() actually depends on
      the row's null_value to evaluate the comparison, the problem
      has surfaced.
      
      Fixed by calling the underlying item's bring_value() and
      updating null_value in Item_cache_row::bring_value().
      
      Since the problem also exists in 5.1 code (albeit hidden, since
      the relevant code is not used anywhere), the addendum patch is
      against 5.1.
      f563a012
  7. 31 Aug, 2010 1 commit
  8. 25 Aug, 2010 2 commits
  9. 23 Aug, 2010 1 commit
  10. 14 Aug, 2010 1 commit
    • Evgeny Potemkin's avatar
      Bug#49746: Const expression caching led to NDB not using engine condition · 48738f73
      Evgeny Potemkin authored
      pushdown.
            
      NDB supports only a limited set of item nodes for use in engine condition
      pushdown. Because of this adding cache for const expression effectively
      disabled this optimization.
            
      The ndb_serialize_cond function is extended to support Item_cache and treat
      it as a constant values.
      A helper function called ndb_serialize_const is added. It is used to create
      Ndb_cond value node from given const item.
      48738f73
  11. 02 Aug, 2010 1 commit
  12. 20 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · c96b249f
      Davi Arnaut authored
      Fix warnings flagged by the new warning option -Wunused-but-set-variable
      that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
      option causes a warning whenever a local variable is assigned to but is
      later unused. It also warns about meaningless pointer dereferences.
      c96b249f
  13. 19 Jul, 2010 1 commit
    • Evgeny Potemkin's avatar
      Bug#49771: Incorrect MIN/MAX for date/time values. · 589027b2
      Evgeny Potemkin authored
      This bug is a design flaw of the fix for the bug#33546. It assumed that an
      item can be used only in one comparison context, but actually it isn't the
      case. Item_cache_datetime is used to store result for MIX/MAX aggregate
      functions. Because Arg_comparator always compares datetime values as INTs when
      possible the Item_cache_datetime most time caches only INT value. But
      since all datetime values has STRING result type MIN/MAX functions are asked
      for a STRING value when the result is being sent to a client. The
      Item_cache_datetime was designed to avoid conversions and get INT/STRING
      values from an underlying item, but at the moment the values is asked
      underlying item doesn't hold it anymore thus wrong result is returned.
      Beside that MIN/MAX aggregate functions was wrongly initializing cached result
      and this led to a wrong result.
      
      The Item::has_compatible_context helper function is added. It checks whether
      this and given items has the same comparison context or can be compared as
      DATETIME values by Arg_comparator. The equality propagation optimization is
      adjusted to take into account that items which being compared as DATETIME
      can have different comparison contexts.
      The Item_cache_datetime now converts cached INT value to a correct STRING
      DATETIME value by means of number_to_datetime & my_TIME_to_str functions.
      The Arg_comparator::set_cmp_context_for_datetime helper function is added. 
      It sets comparison context of items being compared as DATETIMEs to INT if
      items will be compared as longlong.
      The Item_sum_hybrid::setup function now correctly initializes its result
      value.
      In order to avoid unnecessary conversions Item_sum_hybrid now states that it
      can provide correct longlong value if the item being aggregated can do it
      too.
      589027b2
  14. 02 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#53445: Build with -Wall and fix warnings that it generates · 93fb8bb2
      Davi Arnaut authored
      Apart strict-aliasing warnings, fix the remaining warnings
      generated by GCC 4.4.4 -Wall and -Wextra flags.
      
      One major source of warnings was the in-house function my_bcmp
      which (unconventionally) took pointers to unsigned characters
      as the byte sequences to be compared. Since my_bcmp and bcmp
      are deprecated functions whose only difference with memcmp is
      the return value, every use of the function is replaced with
      memcmp as the special return value wasn't actually being used
      by any caller.
      
      There were also various other warnings, mostly due to type
      mismatches, missing return values, missing prototypes, dead
      code (unreachable) and ignored return values.
      93fb8bb2
  15. 10 Jun, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#42733: Type-punning warnings when compiling MySQL -- · 53b88296
      Davi Arnaut authored
                  strict aliasing violations.
      
      One somewhat major source of strict-aliasing violations and
      related warnings is the SQL_LIST structure. For example,
      consider its member function `link_in_list` which takes
      a pointer to pointer of type T (any type) as a pointer to
      pointer to unsigned char. Dereferencing this pointer, which
      is done to reset the next field, violates strict-aliasing
      rules and might cause problems for surrounding code that
      uses the next field of the object being added to the list.
      
      The solution is to use templates to parametrize the SQL_LIST
      structure in order to deference the pointers with compatible
      types. As a side bonus, it becomes possible to remove quite
      a few casts related to acessing data members of SQL_LIST.
      53b88296
  16. 31 May, 2010 1 commit
  17. 28 May, 2010 1 commit
    • oystein.grovlen@sun.com's avatar
      Bug#52168 decimal casting catastrophes: crashes and valgrind errors on simple casts · 80fc19ad
      oystein.grovlen@sun.com authored
      The problem is that if a NULL is stored in an Item_cache_decimal object,
      the associated my_decimal object is not initialized.  However, it is still
      accessed when val_int() is called. The fix is to check for null_value
      within val_int(), and return without accessing the my_decimal object when
      the cached value is NULL.
      
      Bug#52122 reports the same issue for val_real(), and this patch also includes
      fixes for val_real() and val_str() and corresponding test cases from that
      bug report.  
      
      Also, NULL is returned from val_decimal() when value is null. This will
      avoid that callers access an uninitialized my_decimal object.
      
      Made similar changes to all other Item_cache classes.  Now all val_*
      methods should return a well defined value when actual value is NULL.
      80fc19ad
  18. 05 May, 2010 3 commits
    • Alexander Nozdrin's avatar
      Patch for Bug#50511 (Sometimes wrong handling of user variables containing NULL). · d91c271b
      Alexander Nozdrin authored
            
      The bug happened under the following condition:
        - there was a user variable of type REAL, containing NULL value
        - there was a table with a NOT_NULL column of any type but REAL, having
          default value (or auto increment);
        - a row was inserted into the table with the user variable as value.
          A warning was emitted here.
      
      The problem was that handling of NULL values of REAL type was not properly
      implemented: it didn't expect that REAL NULL value can be assigned to other
      data type.
      
      Basically, the problem was that set_field_to_null() was used instead of
      set_field_to_null_with_conversions().
      
      The fix is to use the right function, or more generally, to allow conversion of
      REAL NULL values to other data types.
      d91c271b
    • Alexander Barkov's avatar
      Bug#52849 [Com]: datetime index not work · 6bf10a86
      Alexander Barkov authored
      Problem: after introduction of "WL#2649 Number-to-string conversions"
      
      This query:
        SET NAMES cp850; -- Or any other non-latin1 ASCII-based character set
        SELECT * FROM t1
        WHERE datetime_column='2010-01-01 00:00:00'
      started to add extra character set conversion: 
        SELECT * FROM t1
        WHERE CONVERT(datetime_column USING cp850)='2010-01-01 00:00:00';
      
      so index on DATETIME column was not used anymore.
      Fix:
        avoid convertion of NUMERIC/DATETIME items
        (i.e. those with derivation DERIVATION_NUMERIC).
      6bf10a86
    • Georgi Kodinov's avatar
      On behalf of Kristofer : · 1132c354
      Georgi Kodinov authored
      Bug#53417 my_getwd() makes assumptions on the buffer sizes which not always hold true
            
      The mysys library contains many functions for rewriting file paths. Most of these
      functions makes implicit assumptions on the buffer sizes they write to. If a path is put
      in my_realpath() it will propagate to my_getwd() which assumes that the buffer holding
      the path name is greater than 2. This is not true in cases.
            
      In the special case where a VARBIN_ITEM is passed as argument to the LOAD_FILE function
      this can lead to a crash.
            
      This patch fixes the issue by introduce more safe guards agaist buffer overruns.
      1132c354
  19. 13 Apr, 2010 1 commit
    • Konstantin Osipov's avatar
      A fix for Bug#11918 "SP does not accept variables in LIMIT clause" · b8d014b8
      Konstantin Osipov authored
      Allow stored procedure variables in LIMIT clause.
      Only allow variables of INTEGER types. 
      Handle negative values by means of an implicit cast to UNSIGNED 
      (similarly to prepared statement placeholders).
      Add tests.
      Make sure replication works by not doing NAME_CONST substitution
      for variables in LIMIT clause.
      Add replication tests.
      b8d014b8
  20. 07 Apr, 2010 1 commit
    • Mats Kindahl's avatar
      WL#5030: Splitting mysql_priv.h · 0768deeb
      Mats Kindahl authored
      Adding my_global.h first in all files using
      NO_EMBEDDED_ACCESS_CHECKS.
      
      Correcting a merge problem resulting from a changed definition
      of check_some_access compared to the original patches.
      0768deeb
  21. 06 Apr, 2010 1 commit
  22. 01 Apr, 2010 1 commit
    • Anurag Shekhar's avatar
      Bug #47904 Incorrect results w/ table subquery, derived SQs, and LEFT JOIN · 92a41960
      Anurag Shekhar authored
             on index
      
      'my_decimal' class has two members which can be used to access the 
      value. The member variable buf (inherited from parent class decimal_t) 
      is set to member variable buffer so that both are pointing to same value.
      
      Item_copy_decimal::copy() uses memcpy to clone 'my_decimal'. The member
      buffer is declared as an array and memcpy results in copying the values
      of the array, but the inherited member buf, which should be pointing at
      the begining of the array 'buffer' starts pointing to the begining of 
      buffer in original object (which is being cloned). Further updates on 
      'my_decimal' updates only the inherited member 'buf' but leaves 
      buffer unchanged.
      
      Later when the new object (which now holds a inconsistent value) is cloned
      again using proper cloning function 'my_decimal2decimal' the buf pointer
      is fixed resulting in loss of the current value.
      
      Using my_decimal2decimal instead of memcpy in Item_copy_decimal::copy()
      fixed this problem.
      92a41960
  23. 31 Mar, 2010 1 commit
    • Mats Kindahl's avatar
      WL#5030: Split and remove mysql_priv.h · e409d6f6
      Mats Kindahl authored
      This patch:
      
      - Moves all definitions from the mysql_priv.h file into
        header files for the component where the variable is
        defined
      - Creates header files if the component lacks one
      - Eliminates all include directives from mysql_priv.h
      - Eliminates all circular include cycles
      - Rename time.cc to sql_time.cc
      - Rename mysql_priv.h to sql_priv.h
      e409d6f6
  24. 23 Mar, 2010 1 commit
    • Georgi Kodinov's avatar
      Bug #51850: crash/memory overlap when using load data infile and set · d9175c21
      Georgi Kodinov authored
        col equal to itself!
      
      There's no need to copy the value of a field into itself.
      While generally harmless (except for some performance penalties)
      it may be dangerous when the copy code doesn't expect this.
      Fixed by checking if the source field is the same as the destination
      field before copying the data.
      Note that we must preserve the order of assignment of the null 
      flags (hence the null_value assignment addition).
      d9175c21
  25. 15 Mar, 2010 1 commit
  26. 12 Mar, 2010 1 commit
  27. 09 Mar, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#51650: crash with user variables and triggers · 154fcda8
      Davi Arnaut authored
      The problem was that bits of the destructive equality propagation
      optimization weren't being undone after the execution of a stored
      program. Modifications to the parse tree that are based on transient
      properties must be undone to enable the re-execution of stored
      programs.
      
      The solution is to cleanup any references to predicates generated
      by the equality propagation during the execution of a stored program.
      154fcda8
  28. 26 Feb, 2010 1 commit
  29. 25 Feb, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #45360: wrong results · 79d8de67
      Gleb Shchepa authored
      Propagation of a large unsigned numeric constant
      in the WHERE expression led to wrong result.
      
      For example,
      "WHERE a = CAST(0xFFFFFFFFFFFFFFFF AS USIGNED) AND FOO(a)",
      where a is an UNSIGNED BIGINT, and FOO() accepts strings,
      was transformed to "... AND FOO('-1')".
      
      That has been fixed.
      
      Also EXPLAIN EXTENDED printed incorrect numeric constants in
      transformed WHERE expressions like above. That has been
      fixed too.
      79d8de67
  30. 24 Feb, 2010 1 commit
  31. 17 Feb, 2010 1 commit
  32. 11 Feb, 2010 1 commit
    • Alexander Barkov's avatar
      WL#2649 Number-to-string conversions · 1094ffd5
      Alexander Barkov authored
      added:
        include/ctype_numconv.inc
        mysql-test/include/ctype_numconv.inc
        mysql-test/r/ctype_binary.result
        mysql-test/t/ctype_binary.test
        Adding tests
      
      modified:
      
        mysql-test/r/bigint.result
        mysql-test/r/case.result
        mysql-test/r/create.result
        mysql-test/r/ctype_cp1251.result
        mysql-test/r/ctype_latin1.result
        mysql-test/r/ctype_ucs.result
        mysql-test/r/func_gconcat.result
        mysql-test/r/func_str.result
        mysql-test/r/metadata.result
        mysql-test/r/ps_1general.result
        mysql-test/r/ps_2myisam.result
        mysql-test/r/ps_3innodb.result
        mysql-test/r/ps_4heap.result
        mysql-test/r/ps_5merge.result
        mysql-test/r/show_check.result
        mysql-test/r/type_datetime.result
        mysql-test/r/type_ranges.result
        mysql-test/r/union.result
        mysql-test/suite/ndb/r/ps_7ndb.result
        mysql-test/t/ctype_cp1251.test
        mysql-test/t/ctype_latin1.test
        mysql-test/t/ctype_ucs.test
        mysql-test/t/func_str.test
          Fixing tests
      
      
        @ sql/field.cc
           - Return str result using my_charset_numeric.
           - Using real multi-byte aware str_to_XXX functions
             to handle tricky charset values propely (e.g. UCS2)
        @ sql/field.h
           - Changing derivation of non-string field types to DERIVATION_NUMERIC.
           - Changing binary() for numeric/datetime fields to always
           return TRUE even if charset is not my_charset_bin. We need
           this to keep ha_base_keytype() return HA_KEYTYPE_BINARY.
           - Adding BINARY_FLAG into some fields, because it's not
           being set automatically anymore with
           "my_charset_bin to my_charset_numeric" change.
          - Changing derivation for numeric/datetime datatypes to a weaker
            value, to make "SELECT concat('string', field)" use character
            set of the string literal for the result of the function.
        @ sql/item.cc
           - Implementing generic val_str_ascii().
           - Using max_char_length() instead of direct read of max_length
             to make "tricky" charsets like UCS2 work.
             NOTE: in the future we'll possibly remove all direct reads of max_length
           - Fixing Item_num::safe_charset_converter().
             Previously it alligned binary string to
             character string (for example by adding leading 0x00
             when doing binary->UCS2 conversion). Now it just
             converts from my_charset_numbner to "tocs".
           - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work.
           - Other misc changes
        @ sql/item.h
           - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to
             bit operations instead of hard-coded bit masks.
           - Addding new method DTCollation.set_numeric().
           - Adding new methods to Item.
           - Adding helper functions to make code look nicer:
             agg_item_charsets_for_string_result()
             agg_item_charsets_for_comparison()
           - Changing charset for Item_num-derived items
             from my_charset_bin to my_charset_numeric
             (which is an alias for latin1).
        @ sql/item_cmpfunc.cc
           - Using new helper functions
           - Other misc changes
        @ sql/item_cmpfunc.h
           - Fixing strcmp() to return max_length=2.
             Previously it returned 1, which was wrong,
             because it did not fit '-1'.
        @ sql/item_func.cc
           - Using new helper functions
           - Other minor changes
        @ sql/item_func.h
           - Removing unused functions
           - Adding helper functions
             agg_arg_charsets_for_string_result()
             agg_arg_charsets_for_comparison()
           - Adding set_numeric() into constructors of numeric items.
           - Using fix_length_and_charset() and fix_char_length()
             instead of direct write to max_length.
        @ sql/item_geofunc.cc
           - Changing class for Item_func_geometry_type and
             Item_func_as_wkt from Item_str_func to
             Item_str_ascii_func, to make them return UCS2 result
             properly (when character_set_connection=ucs2).
        @ sql/item_geofunc.h
           - Changing class for Item_func_geometry_type and
             Item_func_as_wkt from Item_str_func to
             Item_str_ascii_func, to make them return UCS2 result
             properly (when @@character_set_connection=ucs2).
        @ sql/item_strfunc.cc
           - Implementing Item_str_func::val_str().
           - Renaming val_str to val_str_ascii for some items,
             to make them work with UCS2 properly.
           - Using new helper functions
           - All single-argument functions that expect string
             result now call this method:
             agg_arg_charsets_for_string_result(collation, args, 1);
             This enables character set conversion to @@character_set_connection
             in case of pure numeric input.
        @ sql/item_strfunc.h
           - Introducing Item_str_ascii_func - for functions
             which return pure ASCII data, for performance purposes,
             as well as for the cases when the old implementation
             of val_str() was heavily 8-bit oriented and implementing
             a UCS2-aware version is tricky.
        @ sql/item_sum.cc
           - Using new helper functions.
        @ sql/item_timefunc.cc
           - Using my_charset_numeric instead of my_charset_bin.
           - Using fix_char_length(), fix_length_and_charset()
             and fix_length_and_charset_datetime()
             instead of direct write to max_length.
           - Using tricky-charset aware function str_to_time_with_warn()
        @ sql/item_timefunc.h
           - Using new helper functions for charset and length initialization.
           - Changing base class for Item_func_get_format() to make
             it return UCS2 properly (when character_set_connection=ucs2).
        @ sql/item_xmlfunc.cc
           - Using new helper function
        @ sql/my_decimal.cc
           - Adding a new DECIMAL to CHAR converter
             with real multibyte support (e.g. UCS2)
      
        @ sql/mysql_priv.h
           - Introducing a new derivation level for numeric/datetime data types.
           - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC.
           - Adding prototypes for str_set_decimal()
           - Adding prototypes for character-set aware str_to_xxx() functions.
        @ sql/protocol.cc
           - Changing charsetnr to "binary" client-side metadata for
             numeric/datetime data types.
        @ sql/time.cc
           - Adding to_ascii() helper function, to convert a string
             in any character set to ascii representation. In the
             future can be extended to understand digits written
             in various non-Latin word scripts.
           - Adding real multy-byte character set aware versions for str_to_XXXX,
             to make these these type of queries work correct:
               INSERT INTO t1 SET datetime_column=ucs2_expression;
         @  strings/ctype-ucs2.c
           - endptr was not calculated correctly. INSERTing of UCS2
             values into numeric columns returned warnings about
             truncated wrong data.
      1094ffd5
  33. 06 Feb, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #45640: optimizer bug produces wrong results · 57e5f848
      Gleb Shchepa authored
      Grouping by a subquery in a query with a distinct aggregate
      function lead to a wrong result (wrong and unordered
      grouping values).
      
      There are two related problems:
      
      1) The query like this:
      
         SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) c
         FROM t1 GROUP BY aa
      
      returned wrong result, because the outer reference "t1.a"
      in the subquery was substituted with the Item_ref item.
      
      The Item_ref item obtains data from the result_field object
      that refreshes once after the end of each group. This data
      is not applicable to filesort since filesort() doesn't care
      about groups (and doesn't update result_field objects with
      copy_fields() and so on). Also that data is not applicable
      to group separation algorithm: end_send_group() checks every
      record with test_if_group_changed() that evaluates Item_ref
      items, but it refreshes those Item_ref-s only after the end
      of group, that is a vicious circle and the grouped column
      values in the output are shifted.
      
      Fix: if
             a) we grouping by a subquery and
             b) that subquery has outer references to FROM list
                of the grouping query,
           then we substitute these outer references with
           Item_direct_ref like references under aggregate
           functions: Item_direct_ref obtains data directly
           from the current record.
      
      2) The query with a non-trivial grouping expression like:
      
         SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) c
         FROM t1 GROUP BY aa+0
      
      also returned wrong result, since JOIN::exec() substitutes
      references to top-level aliases in SELECT list with Item_copy
      caching items. Item_copy items have same refreshing policy
      as Item_ref items, so the whole groping expression with
      Item_copy inside returns wrong result in filesort() and
      end_send_group().
      
      Fix: include aliased items into GROUP BY item tree instead
           of Item_ref references to them.
      57e5f848
  34. 11 Feb, 2010 1 commit
  35. 15 Jan, 2010 1 commit
    • Georgi Kodinov's avatar
      Bug #46175: NULL read_view and consistent read assertion · 440f5a9c
      Georgi Kodinov authored
      The optimizer must not continue executing the current query
      if e.g. the storage engine reports an error.
      This is somewhat hard to implement with Item::val_xxx()
      because they do not have means to return error code.
      This is why we need to check the thread's error state after
      a call to one of the Item::val_xxx() methods.
      
      Fixed store_key_item::copy_inner() to return an error state 
      if an error happened during the call to Item::save_in_field() 
      because it calls Item::val_xxx().
      Also added similar checks to related places.
      440f5a9c
  36. 22 Dec, 2009 2 commits
    • Alexey Kopytov's avatar
      Backport of WL #2934: Make/find library for doing float/double · f02525be
      Alexey Kopytov authored
                            to string conversions and vice versa" 
      Initial import of the dtoa.c code and custom wrappers around it 
      to allow its usage from the server code. 
       
      Conversion of FLOAT/DOUBLE values to DECIMAL ones or strings 
      and vice versa has been significantly reworked. As the new 
      algoritms are more precise than the older ones, results of such 
      conversions may not always match those obtained from older 
      server versions. This in turn may break compatibility for some 
      applications. 
       
      This patch also fixes the following bugs: 
      - bug #12860 "Difference in zero padding of exponent between 
      Unix and Windows" 
      - bug #21497 "DOUBLE truncated to unusable value" 
      - bug #26788 "mysqld (debug) aborts when inserting specific 
      numbers into char fields" 
      - bug #24541 "Data truncated..." on decimal type columns 
      without any good reason" 
      f02525be
    • Sergei Golubchik's avatar
      WL#4738 streamline/simplify @@variable creation process · ae2768ce
      Sergei Golubchik authored
      Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
      Bug#20415 Output of mysqld --help --verbose is incomplete
      Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
      Bug#32902 plugin variables don't know their names
      Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
      Bug#34829 No default value for variable and setting default does not raise error
      Bug#34834 ? Is accepted as a valid sql mode
      Bug#34878 Few variables have default value according to documentation but error occurs  
      Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
      Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
      Bug#40988 log_output_basic.test succeeded though syntactically false.
      Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
      Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
      Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
      Bug#44797 plugins w/o command-line options have no disabling option in --help
      Bug#46314 string system variables don't support expressions
      Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
      Bug#46586 When using the plugin interface the type "set" for options caused a crash.
      Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
      Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
      Bug#49417 some complaints about mysqld --help --verbose output
      Bug#49540 DEFAULT value of binlog_format isn't the default value
      Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
      Bug#49644 init_connect and \0
      Bug#49645 init_slave and multi-byte characters
      Bug#49646 mysql --show-warnings crashes when server dies
      ae2768ce