Commit graph

25 commits

Author SHA1 Message Date
Alexander Barkov
1094ffd572 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
Mats Kindahl
4ad8ef0602 WL#5016: Fix header file include guards
Adding header include file guards to files that are missing such.
2009-09-23 23:32:31 +02:00
anozdrin/alik@quad.
340906f46d Fix for Bug#30217: Views: changes in metadata behaviour
between 5.0 and 5.1.
  
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
  
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
  - be completely in UTF8;
  - not contain character set introducers.
  
For more information, see WL4052.
2008-02-22 13:30:33 +03:00
holyfoot/hf@hfmain.(none)
44325614ec Merge mysql.com:/home/hf/work/31155/my50-31155
into  mysql.com:/home/hf/work/31155/my51-31155
2007-10-12 15:33:26 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
16db036d82 Bug #31155 gis types in union'd select cause crash.
We use get_geometry_type() call to decide the exact type
of a geometry field to be created (POINT, POLYGON etc)
Though this function was only implemented for few items.
In the bug's case we need to call this function for the
Item_sum instance, where it was not implemented, what is
the reason of the crash.
Fixed by implementing virtual Item::get_geometry_type(),
so it can be called for any Item.
2007-10-04 12:01:28 +05:00
ramil/ram@ramil.myoffice.izhnet.ru
ca66f604f4 Merge mysql.com:/home/ram/work/b26038/b26038.5.0
into  mysql.com:/home/ram/work/b26038/b26038.5.1
2007-03-05 17:12:37 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
08431e7865 Merge mysql.com:/home/ram/work/b26038/b26038.4.1
into  mysql.com:/home/ram/work/b26038/b26038.5.0
2007-02-28 12:13:46 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
049251624a Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL
Having maybe_null flag unset for geometry/spatial functions leads to
wrong Item_func_isnull::val_int()'s results.
Fix: set maybe_null flag and add is_null() methods.
2007-02-21 14:45:19 +04:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
malff/marcsql@weblab.(none)
62c242cc75 Bug#21114 (Foreign key creation fails to table with name format)
Due to the complexity of this change, everything is documented in WL#3565

This patch is the third iteration, it takes into account the comments
received to date.
2006-11-02 11:01:53 -07:00
holyfoot@deer.(none)
4b48b35680 bug #14807 (GeomFromText() should return MYSQL_TYPE_GEOMETRY)
we didn't have code creating GEOMETRY-type fields from Items (expression results)
So i added this code
2006-07-04 12:56:53 +05:00
holyfoot@mysql.com
0a9a755419 merging 2006-06-26 22:32:02 +05:00
holyfoot@deer.(none)
36cea7d4fe bug #10166 (Signed byte values cause data to be padded)
The AsBinary function returns VARCHAR data type with binary collation.
It can cause problem for clients that treat that kind of data as
different from BLOB type.
So now AsBinary returns BLOB.
2006-06-22 22:11:27 +05:00
msvensson@neptunus.(none)
34cec09efb Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-09 11:26:48 +02:00
msvensson@neptunus.(none)
5b5565c30a BUG#10241 cygwin port: invalid pragma interface directives
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
2005-05-04 15:05:56 +02:00
konstantin@mysql.com
e5f4c7a0bd Rename: Item::val -> Item::val_real(). 2004-11-11 21:39:35 +03:00
hf@deer.(none)
d8c626eb53 Additional fix for bug #5136 (Geometry object is corrupted when queried)
CREATE TABLE t1 SELECT POINT(1,2); fixed
2004-09-22 22:36:53 +05:00
monty@mashka.mysql.fi
afd8f38f4e Optimized GIS functions 2004-03-04 08:50:37 +02:00
hf@deer.(none)
6dcda5153b SCRUM:
WL#1163 (Making spatial code optional)
Pack of changes to do in sql/ code.
2004-01-15 21:06:22 +04:00
bell@sanja.is.com.ua
c7bc56f392 fixed printability of gis functions
code covarage for srid, GeomFromText with 2 parameters
code covarage foe print() method of gis functions
2003-11-06 21:03:11 +02:00
bell@laptop.sanja.is.com.ua
ddf4d1e529 fixed printability of Items (all items except subselects)
(SCRUM) (WL#1274)
2003-10-12 17:56:05 +03:00
serg@serg.mylan
08d7f298ee fixed a crash on COMPRESS() and other zlib-dependent functions when compiled w/o zlib
moved them all from different places to item_strfunc.{h,cc}
checksum table command
Com_xxx status variables updated
2003-08-21 16:15:06 +02:00
ram@mysql.r18.ru
a89a7eb327 Renamed xxx_as_text() and xxx__from_text(). 2003-06-20 14:53:37 +05:00
ram@mysql.r18.ru
a36d4212fc Moved spatial functions to the sql/item_geofunc.cc file. 2003-05-30 15:22:34 +05:00