Commit graph

449 commits

Author SHA1 Message Date
Tor Didriksen
a73d2ae02c Bug#13986705 CRASH IN GET_INTERVAL_VALUE() WITH DATE CALCULATION WITH UTF32 INTERVALS
This is a followup to the fix for Bug#12340997
get_interval_value() was trying to parse the input string,
looking for leading '-' while skipping whitespace.
The macro my_isspace() does not work for utf32 character set,
since my_charset_utf32_general_ci.ctype == NULL.

Solution: convert input to ASCII before parsing,
and use the character set of the returned ASCII string.
2012-05-21 10:47:12 +02:00
Tor Didriksen
13053fbe54 Bug#13721076 CRASH WITH TIME TYPE/TIMESTAMP() AND WARNINGS IN SUBQUERY
The table contains one time value: '00:00:32'
This value is converted to timestamp by a subquery.

In convert_constant_item we call (*item)->is_null()
which triggers execution of the Item_singlerow_subselect subquery,
and the string "0000-00-00 00:00:32" is cached
by Item_cache_datetime.
We continue execution and call update_null_value, which calls val_int()
on the cached item, which converts the time value to ((longlong) 32)
Then we continue to do (*item)->save_in_field()
which ends up in Item_cache_datetime::val_str() which fails,
since (32 < 101) in number_to_datetime, and val_str() returns NULL.

Item_singlerow_subselect::val_str isnt prepared for this:
if exec() succeeds, and return !null_value, then val_str()
*must* succeed.

Solution: refuse to cache strings like "0000-00-00 00:00:32"
in Item_cache_datetime::cache_value, and return NULL instead.

This is similar to the solution for 
Bug#11766860 - 60085: CRASH IN ITEM::SAVE_IN_FIELD() WITH TIME DATA TYPE

This patch is for 5.5 only.
The issue is not present after WL#946, since a time value
will be converted to a proper timestamp, with the current date
rather than "0000-00-00"


mysql-test/r/subselect.result:
  New test case.
mysql-test/t/subselect.test:
  New test case.
sql/item.cc:
  Verify proper date format before caching timestamps.
sql/item_timefunc.cc:
  Use named constant for readability.
2012-03-14 13:25:14 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
Kent Boortz
6a003dd8ef Updated/added copyright headers 2012-02-15 17:21:38 +01:00
Alexander Barkov
c0badf88c6 Merging BUG#13458237 from 5.1. 2012-01-24 13:24:05 +04:00
Alexander Barkov
f8e924b467 BUG#13458237 - INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY. SIMILAR TO '2009-10-00'
- Reverting the patch for Bug # 12584302
  The patch will be reverted in 5.1 and 5.5.
  The patch will not be reverted in 5.6, the change will
  be properly documented in 5.6.
- Backporting DBUG_ASSERT not to crash on '0000-01-00'
  (already fixed in mysql-trunk (5.6))
2012-01-24 13:00:13 +04:00
Sergey Glukhov
14ea4af7eb 5.1 -> 5.5 merge 2011-07-27 12:51:55 +04:00
Sergey Glukhov
3050742dd9 Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
The problem is that TIME_FUZZY_DATE is explicitly used for get_arg0_date()
function in Item_date_typecast::get_date method. The fix is to use real
fuzzy_date value.


mysql-test/r/func_time.result:
  test case
mysql-test/t/func_time.test:
  test case
sql/item_timefunc.cc:
  use real fuzzy_date value
2011-07-27 12:34:25 +04:00
unknown
7d605ec45f Merge from mysql-5.5.14-release 2011-07-06 01:13:50 +02:00
Kent Boortz
027b5f1ed4 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Georgi Kodinov
54729bbc60 merged mysql-5.5->mysql-5.5-security 2011-06-06 16:17:58 +03:00
Sergey Glukhov
b7ed314fab 5.1 -> 5.5 merge 2011-05-18 10:59:04 +04:00
Sergey Glukhov
3201f92cb3 Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
There are two problems:
1. There is a missing check for 'year' parameter(year can not be greater than 9999) in
   makedate function. fix: added check that year can not be greater than 9999.
2. There is a missing check for zero date in from_days() function.
   fix: added zero date check into Item_func_from_days::get_date()
   function.


mysql-test/r/func_time.result:
  test case
mysql-test/t/func_time.test:
  test case
sql/item_timefunc.cc:
  --added check that year can not be greater than 9999 for makedate() function
  --added zero date check into Item_func_from_days::get_date() function
2011-05-18 10:47:43 +04:00
Kent Boortz
789aa8c485 Updated/added copyright headers 2011-07-04 01:25:49 +02:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Mattias Jonsson
775770145c merge 2011-06-13 11:57:47 +02:00
Georgi Kodinov
c4c808d606 weave merge of mysql-5.5->mysql-5.5-security 2011-05-10 17:20:26 +03:00
unknown
db4c6f56e2 Merge from mysql-5.5.12-release 2011-05-06 10:27:04 +02:00
Karen Langford
83f19ef457 Merge from mysql-5.1.57-release 2011-05-06 10:03:02 +02:00
Tor Didriksen
ae154449f1 Bug#12340997 - DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE()
get_interval_value() was trying to parse the input string,
looking for leading '-' while skipping whitespace.
The macro my_isspace() does not work for utf16 character set,
since my_charset_utf16_general_ci.ctype == NULL.

Solution: convert input to ASCII before parsing.


mysql-test/r/ctype_utf16.result:
  New test case.
mysql-test/t/ctype_utf16.test:
  New test case.
sql/item_timefunc.cc:
  Use val_string_ascii() rather than val_string()
  so that we can safely use my_isspace() for skipping whitespace.
2011-04-28 09:03:56 +02:00
Sergey Glukhov
a60c39a2ff Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION
calc_daynr() function returns negative result
if malformed date with zero year and month is used.
Attempt to calculate week day on negative value
leads to crash. The fix is return NULL for
'W', 'a', 'w' specifiers if zero year and month is used.
Additional fix for calc_daynr():
--added assertion that result can not be negative
--return 0 if zero year and month is used


mysql-test/r/func_time.result:
  test case
mysql-test/t/func_time.test:
  test case
sql-common/my_time.c:
  --added assertion that result can not be negative
  --return 0 if zero year and month is used
sql/item_timefunc.cc:
  eturn NULL for 'W', 'a', 'w' specifiers
  if zero year and month is used.
2011-04-27 11:35:57 +04:00
Georgi Kodinov
efe4af973b merge 5.5->5.5-security 2011-04-07 12:59:51 +03:00
Georgi Kodinov
2db44e8bb4 merged mysql-5.1->mysql-5.1-security 2011-04-07 12:24:10 +03:00
Sergey Glukhov
197bef3876 5.1 -> 5.5 merge 2011-04-27 11:46:23 +04:00
Sergey Glukhov
8cca70e036 5.1 -> 5.5 merge 2011-03-28 17:33:35 +04:00
Sergey Glukhov
d6125b27b3 Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION
Valgrind warning happens due to uninitialized cached_format_type field
which is used later in Item_func_str_to_date::val_str method.
The fix is to init cached_format_type field.


mysql-test/r/func_time.result:
  test case
mysql-test/t/func_time.test:
  test case
sql/item_timefunc.cc:
  init cached_format_type field
2011-03-28 17:24:25 +04:00
Sergey Glukhov
b1b17093c8 5.1->5.5 merge 2011-03-28 12:03:53 +04:00
Sergey Glukhov
d499851be0 Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ...
Valgrind warining happens due to missing
'end of the string' check. The fix is to
check if we reached the end of the string.


mysql-test/r/func_time.result:
  test case
mysql-test/t/func_time.test:
  test case
sql/item_timefunc.cc:
  check if we reached the end of
  the string after leading spaces skipping.
2011-03-28 11:53:18 +04:00
Mattias Jonsson
d53906e387 Bug#11746819:
Bug#28928: UNIX_TIMESTAMP() should be considered unary monotonic by partition pruning

Made UNIX_TIMESTAMP MONOTONIC_INCREASING when it have TIMESTAMP argument (only).
2011-03-16 11:59:01 +01:00
Georgi Kodinov
ace88ca2dd auto-merge 2011-03-15 16:56:11 +02:00
Georgi Kodinov
7a37a7c0c8 Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING DOESN'T
ADHERE TO MAX_ALLOWED_PACKET

Added a check for max_packet_length in CONVERT(, BINARY|CHAR).
Added a test case.
2011-03-15 13:19:30 +02:00
Sergey Vojtovich
659ff29394 BUG#11766720 - setting storage engine to null segfaults mysqld
MONTHNAME(0) claims that it is about to return NOT NULL
value, whereas it actually returns NULL.

As a result storage_engine variable (which cannot be NULL)
protection was bypassed and NULL value was accepted, causing
server crash.

Fixed MONTHNAME(0) to report valid NULL flag.

mysql-test/r/func_time.result:
  A test case for BUG#11766720.
mysql-test/t/func_time.test:
  A test case for BUG#11766720.
sql/item_timefunc.cc:
  MONTHNAME(0) must report NULL, as opposed to base class
  MONTH(0) which is NOT NULL.
  
  Fixed Item_func_monthname to inherit from Item_str_func
  instead of Item_func_month.
sql/item_timefunc.h:
  MONTHNAME(0) must report NULL, as opposed to base class
  MONTH(0) which is NOT NULL.
  
  Fixed Item_func_monthname to inherit from Item_str_func
  instead of Item_func_month.
2011-02-18 11:10:30 +03:00
Alexander Barkov
7d88b552e2 Bug#31384 DATE_ADD() and DATE_SUB() return binary data
Problem: DATE_ADD() is a hybrid function and can return
DATE, DATETIME or VARCHAR data type depending on arguments.

In case of VARCHAR data type, DATE_ADD() reported "binary" character set,
which was wrong.

Fix: make DATE_ADD() return @character_set_connection in VARCHAR context.
 @ mysql-test/include/ctype_numconv.inc
   Adding tests
 @ mysql-test/r/ctype_binary.result
   Adding tests
 @ mysql-test/r/ctype_cp1251.result
   Adding tests
 @ mysql-test/r/ctype_latin1.result
   Adding tests
 @ mysql-test/r/ctype_ucs.result
   Adding tests
 @ mysql-test/r/ctype_utf8.result
   Adding tests
 @ sql/item_strfunc.cc
  - Moving code from Item_str_ascii_func::val_str() to
  Item_str_func::val_str_from_val_str_ascii(), as
  this code needs to be shared by Item_date_add_interval.
  - Adding str2 parameter to be used as a buffer, instead of
   using private ascii_buf member.
 @ sql/item_strfunc.h
  - Moving code from Item_str_ascii_func::val_str() to
  Item_str_func::val_str_from_val_str_ascii()
  - Removing "String *val_str_convert_from_ascii(String *str, String *ascii_buf)"
    prototype as it was neither used nor declared.
 @ sql/item_timefunc.h
  - Overwriting parent's charset_for_protocol() method,
    becase we need to behave differenlty in VARCHAR and DATE/DATETYPE context.
  - Adding ascii_buf for conversion.
  - Adding val_str_ascii() prototype.
  - Adding val_str() which uses newly added
    Item_str_func::val_str_from_val_str_ascii(),
    passing ascii_buf as a conversion buffer.
2011-02-10 11:18:08 +03:00
Alexander Nozdrin
bb8361b60d Auto-merge from mysql-5.5.7-rc-release. 2010-11-25 13:46:18 +03:00
Alexander Barkov
46aad8cf1e Merging from mysql-5.1-security 2010-11-12 13:20:58 +03:00
Alexander Barkov
1b583fa5da Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
Problem: When GET_FORMAT() is called two times from the upper
level function (e.g. LEAST in the bug report), on the second
call "res= args[0]->val_str(...)" and str point to the same
String object.

1. Fix: changing the order from
- get val_str into tmp_value then convert to str
to
- get val_str into str then convert to tmp_value

The new order is more correct: the purpose of "str" parameter
is exactly to call val_str() for arguments.
The purpose of String class members (like tmp_value) is to do further
actions on the result.
Doing it in the other way around give unexpected surprises.

2. Using str_value instead of str to do padding, for the same reason.
2010-11-12 13:12:15 +03:00
Oystein Grovlen
7a8515cc20 Bug#57512 str_to_date crash...
str_to_date function should only try to generate a warning for
invalid input strings, not when input value is NULL. In latter
case, val_str() of input argument will return a nil pointer.
Trying to generate a warning using this pointer lead to a
segmentation fault. Solution: Only generate warning when pointer
to input string is non-nil.


mysql-test/r/func_time.result:
  Added test case for Bug#57512
mysql-test/t/func_time.test:
  Added test case for Bug#57512
sql/item_timefunc.cc:
  Skip generating warning when pointer to input string is nil
  since this implies that input argument was NULL.
2010-10-20 15:17:29 +02:00
Evgeny Potemkin
5dc76bfabf Auto-merged. 2010-10-07 12:17:08 +04:00
Evgeny Potemkin
3c9c7efb3b Bug#57039: constant subtime expression returns incorrect result.
The subtime function wasn't able to produce correct int representation of
its result. For constant expressions the Item_datetime_cache is used to
speedup evaluation and Item_datetime_cache expects underlying item to return
correct int representation of DATETIME value. These two factors combined led
to a wrong query result.

Now the Item_func_add_time has function val_datetime which performs the
calculation and saves result into given MYSQL_TIME struct, it also sets
null_value to appropriate value. val_int and val_str member functions
convert the result obtained from val_datetime to int or string respectively
and returns it.

mysql-test/r/func_time.result:
  Added a test case for the bug#57039.
mysql-test/t/func_time.test:
  Added a test case for the bug#57039.
sql/item_timefunc.cc:
  Bug#57039: constant subtime expression returns incorrect result.
  Now the Item_func_add_time has function val_datetime which performs the
  calculation and saves result into given MYSQL_TIME struct, it also sets
  null_value to appropriate value. val_int and val_str member functions
  convert the result obtained from val_datetime to int or string respectively
  and returns it.
sql/item_timefunc.h:
  Bug#57039: constant subtime expression returns incorrect result.
2010-10-07 11:07:56 +04:00
Alexey Kopytov
d72c594739 Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam.
conflicts:
   conflict      dbug/dbug.c
   conflict      sql/sql_load.cc
2010-10-02 00:12:27 +04:00
Alexey Kopytov
faf54ff95c Bug #56709: Memory leaks at running the 5.1 test suite
Fixed a number of memory leaks discovered by valgrind.

dbug/dbug.c:
  This is actually an addendum to the fix for bug #52629:
  
  - there is no point in limiting the fix to just global
  variables, session ones are also affected.
  - zero all fields when allocating a new 'state' structure so
  that FreeState() does not deal with unitialized data later.
  - add a check for a NULL pointer in DBUGCloseFile()
mysql-test/r/partition_error.result:
  Added a test case for bug #56709.
mysql-test/r/variables_debug.result:
  Added a test case for bug #56709.
mysql-test/t/partition_error.test:
  Added a test case for bug #56709.
mysql-test/t/variables_debug.test:
  Added a test case for bug #56709.
sql/item_timefunc.cc:
  There is no point in declaring 'value' as a member of
  Item_extract and dynamically allocating memory for it in
  Item_extract::fix_length_and_dec(), since this string is only
  used as a temporary storage in Item_extract::val_int().
sql/item_timefunc.h:
  Removed 'value' from the Item_extract class definition.
sql/sql_load.cc:
  - we may need to deallocate 'buffer' even when 'error' is
    non-zero in some cases, since 'error' is public, and there is
    external code modifying it.
  - assign NULL to buffer when deallocating it so that we don't
    do it twice in the destructor
  - there is no point in changing 'error' in the destructor.
2010-09-22 23:33:18 +04:00
Evgeny Potemkin
e435df8e09 Bug#56271: Wrong comparison result with STR_TO_DATE function
The Item_func_str_to_date class wasn't providing correct integer DATETIME
representation as expected. This led to wrong comparison result and didn't
allowed the STR_TO_DATE function to be used with indexes.
Also, STR_TO_DATE function was inconsisted on throwing warnings/errors.
Fixed now.

val_int and result_as_longlong methods were added to the Item_func_str_to_date
class. 

mysql-test/r/func_time.result:
  Test case result adjusted after fixing bug#56271.
mysql-test/r/parser.result:
  Test case result adjusted after fixing bug#56271.
mysql-test/r/select.result:
  A test case result adjusted after fixing bug#56271.
mysql-test/r/strict.result:
  Test case result adjusted after fixing bug#56271.
mysql-test/r/type_datetime.result:
  Added a test case for the bug#56271.
mysql-test/t/strict.test:
  Test case adjusted after fixing bug#56271.
mysql-test/t/type_datetime.test:
  Added a test case for the bug#56271.
sql/item_timefunc.cc:
  Bug#56271: Wrong comparison result with STR_TO_DATE function
  val_int and result_as_longlong methods were added to the Item_func_str_to_date
  class. 
  Item_func_str_to_date::get_date now throws the ER_WRONG_VALUE_FOR_TYPE warning
  on incorrect value.
sql/item_timefunc.h:
  Bug#56271: Wrong comparison result with STR_TO_DATE function
  val_int and result_as_longlong methods were added to the Item_func_str_to_date
  class.
2010-09-07 10:45:00 +04:00
Davi Arnaut
1c924a1652 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-09 09:28:51 -03:00
Davi Arnaut
11fae04527 Bug#45288: pb2 returns a lot of compilation warnings on linux
Although the C standard mandates that sprintf return the number
of bytes written, some very ancient systems (i.e. SunOS 4)
returned a pointer to the buffer instead. Since these systems
are not supported anymore and are hopefully long dead by now,
simply remove the portability wrapper that dealt with this
discrepancy. The autoconf check was causing trouble with GCC.
2010-07-09 09:00:17 -03:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
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
2010-03-31 16:05:33 +02:00
Georgi Kodinov
318c2dd90d merge 5.0-bugteam -> 5.1-bugteam 2010-02-26 15:16:46 +02:00
Christopher Powers
53e8dc26ef Bug #48739 MySQL crashes on specific INTERVAL in select query
Fixed crash caused by x64 int/long incompatibility introduced
in Bug #29125.


sql/item_timefunc.cc:
  Fixed crash caused by int/long incompatibility on x64 systems.
                  
  Changed two "uint" casts and a "long" declartion to "int" in order to
  ensure that the integer sign is preserved.
                  
  See Bug #48739 for details.
2010-02-25 09:49:09 -06:00
Alexander Barkov
702166bcde WL#2649 Number-to-string conversions
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.
2010-02-11 08:17:25 +04:00