1. 26 Feb, 2010 1 commit
    • Alexander Barkov's avatar
      After-fix for WL#2649 Number-to-string conversion. · 69904fa6
      Alexander Barkov authored
      This change fixes test failure for partition_repair_myisam
      and partition_recover_myisam.
      
      The problem was that:
      - the file std_data/corrupt_crash.MYI
        contains charsetnr=63 (binary) for index segments.
      - the new .frm file contains charsetnr=8 (latin1) for
        the same segments.
      As a result REPAIR refused to repair frm+MYI files
      with different segment definition.
      
      This fix restores the old behavior for frm and MYI files:
      they now store charsetnr=63 for numeric/datetime data types.
      69904fa6
  2. 11 Feb, 2010 2 commits
    • Alexander Barkov's avatar
      A post-fix for WL#2649 Number-to-string conversion · 67809619
      Alexander Barkov authored
      Fixing problems discovered by "mtr --embedded" and "mtr --ps"
      
      
        @ libmysqld/lib_sql.cc
         "mtr --embedded --do-test=ps" failed.
         Applying a similar change to the one previously done in protocol.cc,
         to make embedded version work the same with client/server version.
         (a bug in the WL#2649 patch)
      
        @ mysql-test/include/ctype_numconv.inc
        @ mysql-test/r/ctype_binary.result
        @ mysql-test/r/ctype_cp1251.result
        @ mysql-test/r/ctype_latin1.result
        @ mysql-test/r/ctype_ucs.result
      
        - Changing tinyint(30) to tinyint(4)
          due to problems with "mtr --ps"
          Possibly a bug in libmysql.cc, in function fetch_long_with_conversion().
          Zerofill buffer is to short.
      
        - Commenting tests with get_lock/release_lock
          "mtr --ps" failed for some reasons in ctype_cp1251.
      67809619
    • Alexander Barkov's avatar
      WL#2649 Number-to-string conversions · 702166bc
      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.
      702166bc
  3. 09 Feb, 2010 4 commits
  4. 08 Feb, 2010 3 commits
  5. 05 Feb, 2010 6 commits
  6. 04 Feb, 2010 4 commits
  7. 03 Feb, 2010 14 commits
  8. 02 Feb, 2010 6 commits
    • Kent Boortz's avatar
      Changes to be able to create source TAR packages with longer · 673ec7b2
      Kent Boortz authored
      path names than 99 characters, using the USTAR format of the
      resulting source TAR.
      
      To be able to specify the use of USTAR when creating the source
      TAR, we needed both to update the GNU autotools version requirements
      slightly, and update the initiation of the tools to use more
      modern constructs.
      673ec7b2
    • Georgi Kodinov's avatar
      Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with · e4b71385
      Georgi Kodinov authored
        fulltext search and row op.
      
      The search for fulltext indexes is searching for some special 
      predicate layouts. While doing so it's not checking for the number
      of columns of the expressions it tries to calculate.
      And since row expressions can't return a single scalar value there
      was a crash.
      Fixed by checking if the expressions are scalar (in addition to 
      being constant) before calling Item::val_xxx() methods.
      e4b71385
    • Magne Mahre's avatar
      Cleanup fix for WL#5154 that splits commands handling for · 090c75d2
      Magne Mahre authored
      --default-character-set and --character-set-server such
      that only the first will give a deprecation warning.
      Apart from that, the two options should do the same.
      090c75d2
    • Luis Soares's avatar
      BUG#47639: The rpl_binlog_corruption test fails on Windows · 56b911f8
      Luis Soares authored
      The test case rpl_binlog_corruption fails on windows because when
      adding a line to the binary log index file it gets terminated
      with a CR+LF (which btw, is the normal case in windows, but not on
      Unixes - LF). This causes mismatch between the relay log names,
      causing mysqld to report that it cannot find the log file.
      
      We fix this by creating the instrumented index file through
      mysql, ie, using SELECT ... INTO DUMPFILE ..., as opposed on
      relying on ultimatly OS commands like: -- echo "..." >
      index. These changes go into the file and make the procedure
      platform independent:
      
        include/setup_fake_relay_log.inc
      
      Side note: when using SELECT ... INTO DUMPFILE ..., one needs to
      check if mysqld is running with secure_file_priv. If it is, we do
      it in two steps: 1. create the file on the allowed location;
      2. move it to the datadir. If it is not, then we just create the
      file directly on the datadir (so previous step 2. is not needed).
      56b911f8
    • Alexander Nozdrin's avatar
      Revert a patch for Bug#48231, which introduced valgrind warnings. · 59f1be1b
      Alexander Nozdrin authored
      Original revision:
      ------------------------------------------------------------
      revision-id: li-bing.song@sun.com-20100130124925-o6sfex42b6noyc6x
      parent: joro@sun.com-20100129145427-0n79l9hnk0q43ajk
      committer: <Li-Bing.Song@sun.com>
      branch nick: mysql-5.1-bugteam
      timestamp: Sat 2010-01-30 20:49:25 +0800
      message:
        Bug #48321  CURRENT_USER() incorrectly replicated for DROP/RENAME USER;
                    REVOKE/GRANT; ALTER EVENT.
        
        The following statements support the CURRENT_USER() where a user is needed.
          DROP USER 
          RENAME USER CURRENT_USER() ...
          GRANT ... TO CURRENT_USER()
          REVOKE ... FROM CURRENT_USER()
          ALTER DEFINER = CURRENT_USER() EVENT
        but, When these statements are binlogged, CURRENT_USER() just is binlogged
        as 'CURRENT_USER()', it is not expanded to the real user name. When slave 
        executes the log event, 'CURRENT_USER()' is expand to the user of slave 
        SQL thread, but SQL thread's user name always NULL. This breaks the replication.
        
        After this patch, All above statements are rewritten when they are binlogged.
        The CURRENT_USER() is expanded to the real user's name and host.
      ------------------------------------------------------------
      59f1be1b
    • Davi Arnaut's avatar
      Fix for valgrind warning: check whether pointer was initialized. · 2db68457
      Davi Arnaut authored
      storage/myisammrg/ha_myisammrg.cc:
        myisam pointer is not relevant if a error was raised.
      2db68457