diff options
author | Alexander Barkov <bar@mysql.com> | 2010-02-11 08:17:25 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2010-02-11 08:17:25 +0400 |
commit | 1094ffd572ebd533aa9b61d42ceaccc957f8e6c2 (patch) | |
tree | d6306efc9e4d7e6bc6bf4ae5a58bd6aec40420e9 /mysql-test | |
parent | 68ac1c9c28c7cc7b06d508cdd110f0cde082ffea (diff) | |
download | mariadb-git-1094ffd572ebd533aa9b61d42ceaccc957f8e6c2.tar.gz |
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.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/ctype_numconv.inc | 1605 | ||||
-rw-r--r-- | mysql-test/r/case.result | 14 | ||||
-rw-r--r-- | mysql-test/r/create.result | 4 | ||||
-rw-r--r-- | mysql-test/r/ctype_binary.result | 2581 | ||||
-rw-r--r-- | mysql-test/r/ctype_cp1251.result | 2580 | ||||
-rw-r--r-- | mysql-test/r/ctype_latin1.result | 2580 | ||||
-rw-r--r-- | mysql-test/r/ctype_ucs.result | 2591 | ||||
-rw-r--r-- | mysql-test/r/func_gconcat.result | 4 | ||||
-rw-r--r-- | mysql-test/r/func_str.result | 8 | ||||
-rw-r--r-- | mysql-test/r/metadata.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps_2myisam.result | 72 | ||||
-rw-r--r-- | mysql-test/r/ps_3innodb.result | 72 | ||||
-rw-r--r-- | mysql-test/r/ps_4heap.result | 72 | ||||
-rw-r--r-- | mysql-test/r/ps_5merge.result | 144 | ||||
-rw-r--r-- | mysql-test/r/type_datetime.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_ranges.result | 2 | ||||
-rw-r--r-- | mysql-test/r/union.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/ndb/r/ps_7ndb.result | 72 | ||||
-rw-r--r-- | mysql-test/t/ctype_binary.test | 12 | ||||
-rw-r--r-- | mysql-test/t/ctype_cp1251.test | 10 | ||||
-rw-r--r-- | mysql-test/t/ctype_latin1.test | 11 | ||||
-rw-r--r-- | mysql-test/t/ctype_ucs.test | 14 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 2 |
23 files changed, 12222 insertions, 246 deletions
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc new file mode 100644 index 00000000000..1d393f530f9 --- /dev/null +++ b/mysql-test/include/ctype_numconv.inc @@ -0,0 +1,1605 @@ +--echo # +--echo # Start of WL#2649 Number-to-string conversions +--echo # +# +# Basic constants +# +select hex(concat(1)); +create table t1 as select concat(1) as c1; +show create table t1; +select hex(c1) from t1; +drop table t1; + +select hex(concat(18446744073709551615)); +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +select hex(c1) from t1; +drop table t1; + +select hex(concat(1.1)); +create table t1 as select concat(1.1) as c1; +show create table t1; +select hex(c1) from t1; +drop table t1; + + +# +# Arithmetic operators +# + +select hex(concat('a', 1+2)), charset(concat(1+2)); +create table t1 as select concat(1+2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1-2)); +create table t1 as select concat(1-2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1*2)); +create table t1 as select concat(1*2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1/2)); +create table t1 as select concat(1/2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1 div 2)); +create table t1 as select concat(1 div 2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1 % 2)); +create table t1 as select concat(1 % 2) as c1; +show create table t1; +drop table t1; + +select hex(concat(-1)); +create table t1 as select concat(-1) as c1; +show create table t1; +drop table t1; + +select hex(concat(-(1+2))); +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +drop table t1; + + +# +# Bit functions +# + +select hex(concat(1|2)); +create table t1 as select concat(1|2) as c1; +show create table t1; +drop table t1; + +select hex(concat(1&2)); +create table t1 as select concat(1&2) as c1; +show create table t1; +drop table t1; + +select hex(concat(bit_count(12))); +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +drop table t1; + +select hex(concat(2<<1)); +create table t1 as select concat(2<<1) as c1; +show create table t1; +drop table t1; + +select hex(concat(2>>1)); +create table t1 as select concat(2>>1) as c1; +show create table t1; +drop table t1; + +select hex(concat(~0)); +create table t1 as select concat(~0) as c1; +show create table t1; +drop table t1; + +select hex(concat(3^2)); +create table t1 as select concat(3^2) as c1; +show create table t1; +drop table t1; + + + +# +# Math functions +# +# Note, some tests use LEFT(func(),1) to avoid +# non-deterministic results on various platforms. +# + +select hex(concat(abs(-2))); +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(exp(2)),1)); +create table t1 as select concat(exp(2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(log(2)),1)); +create table t1 as select concat(log(2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(log2(2)),1)); +create table t1 as select concat(log2(2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(log10(2)),1)); +create table t1 as select concat(log10(2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(sqrt(2)),1)); +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(pow(2,2)),1)); +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(acos(0.5)),1)); +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(asin(0.5)),1)); +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(atan(0.5)),1)); +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(cos(0.5)),1)); +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(sin(0.5)),1)); +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(left(concat(tan(0.5)),1)); +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(concat(degrees(0))); +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +drop table t1; + +select hex(concat(radians(0))); +create table t1 as select concat(radians(0)) as c1; +show create table t1; +drop table t1; + +select hex(concat(ceiling(0.5))); +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(concat(floor(0.5))); +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(concat(round(0.5))); +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +drop table t1; + +select hex(concat(sign(0.5))); +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(rand()) as c1; +show create table t1; +drop table t1; + + +# +# String functions +# + +select hex(concat(length('a'))); +create table t1 as select concat(length('a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(char_length('a'))); +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(bit_length('a'))); +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(coercibility('a'))); +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(locate('a','a'))); +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(field('c','a','b','c'))); +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +drop table t1; + +select hex(concat(ascii(61))); +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +drop table t1; + +select hex(concat(ord(61))); +create table t1 as select concat(ord(61)) as c1; +show create table t1; +drop table t1; + +select hex(concat(find_in_set('b','a,b,c,d'))); +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +drop table t1; + + +# +# String hash functions +# + +select md5('a'), hex(md5('a')); +create table t1 as select md5('a') as c1; +show create table t1; +drop table t1; + +select old_password('a'), hex(old_password('a')); +create table t1 as select old_password('a') as c1; +show create table t1; +drop table t1; + +select password('a'), hex(password('a')); +create table t1 as select password('a') as c1; +show create table t1; +drop table t1; + +select sha('a'), hex(sha('a')); +create table t1 as select sha('a') as c1; +show create table t1; +drop table t1; + +select sha1('a'), hex(sha1('a')); +create table t1 as select sha1('a') as c1; +show create table t1; +drop table t1; + +#select sha2('a',224), hex(sha2('a',224)); +#create table t1 as select sha2('a',224) as c1; +#show create table t1; +#drop table t1; + + + +# +# CAST +# + +select hex(concat(cast('-1' as signed))); +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +drop table t1; + +select hex(concat(cast('1' as unsigned))); +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +drop table t1; + +select hex(concat(cast(1/2 as decimal(5,5)))); +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +drop table t1; + +select hex(concat(cast('2001-01-02 03:04:05' as date))); +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +select * from t1; +drop table t1; + +select hex(concat(cast('2001-01-02 03:04:05' as time))); +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +select * from t1; +drop table t1; + +select hex(concat(cast('2001-01-02' as datetime))); +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +select * from t1; +drop table t1; + + +# +# Aggregation: LEAST, GREATEST +# +select hex(concat(least(1,2))); +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +drop table t1; + +select hex(concat(greatest(1,2))); +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +drop table t1; + + +# +# Aggregation: CASE +# +select hex(concat(case when 11 then 22 else 33 end)); +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +drop table t1; + + +# +# Aggregation: COALESCE +# +select hex(concat(coalesce(1,2))); +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +drop table t1; + + +# +# Aggregation: CONCAT_WS, GROUP_CONCAT +# +select hex(concat_ws(1,2,3)); +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +drop table t1; + +select hex(group_concat(1,2,3)); +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +drop table t1; + +# +# Aggregation: UNION +# +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +select hex(c1) from t1 order by c1; +drop table t1; + + +# +# Miscelaneous functions +# + +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +drop table t1; + +select hex(concat(benchmark(0,0))); +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +drop table t1; + +select hex(concat(sleep(0))); +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +drop table t1; + +select hex(concat(get_lock('a',0))); +select hex(concat(release_lock('a'))); +create table t1 as select concat(get_lock('a',0)) as c1; +show create table t1; +drop table t1; + +select hex(concat(is_free_lock('xxxx'))); +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +drop table t1; + +select hex(concat(crc32(''))); +create table t1 as select concat(crc32('')) as c1; +show create table t1; +drop table t1; + +select hex(concat(uncompressed_length(''))); +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(connection_id()) as c1; +show create table t1; +drop table t1; + +select hex(concat(inet_aton('127.1.1.1'))); +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +drop table t1; + +select hex(concat(inet_ntoa(2130772225))); +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +show create table t1; +drop table t1; + +select hex(concat(row_count())); +create table t1 as select concat(row_count()) as c1; +show create table t1; +drop table t1; + +select hex(concat(found_rows())); +create table t1 as select concat(found_rows()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(uuid()) as c1; +show create table t1; +drop table t1; + +# +# Make sure we can mix uuid() to a latin1 object +# with DERIVATION_IMPLICIT (and higher): +# (DERIVATION_COERCIBLE + MY_REPERTOIRE_ASCII allow to do so) +# +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +select charset(concat(uuid(), cast('a' as char character set latin1))); +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +drop table t1; + + +# +# User and system variable functions +# + +# User variables: INT +select hex(concat(@a1:=1)); +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + +set @a2=1; +select hex(concat(@a2)); +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + +# User variables: REAL +select hex(concat(@a1:=sqrt(1))); +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + +set @a2=sqrt(1); +select hex(concat(@a2)); +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + +# User variables: DECIMAL +select hex(concat(@a1:=1.1)); +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + +set @a2=1.1; +select hex(concat(@a2)); +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +show create table t1; +drop table t1; + + +select hex(concat(@@ft_max_word_len)); +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +show create table t1; +drop table t1; + +# +# Comparison functions +# + +select hex(concat('a'='a' IS TRUE)); +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +drop table t1; + +select hex(concat('a'='a' IS NOT TRUE)); +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +drop table t1; + +select hex(concat(NOT 'a'='a')); +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +drop table t1; + +select hex(concat('a' IS NULL)); +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +drop table t1; + +select hex(concat('a' IS NOT NULL)); +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +drop table t1; + +select hex(concat('a' rlike 'a')); +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +drop table t1; + +select hex(concat(strcmp('a','b'))); +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +drop table t1; + +select hex(concat('a' like 'a')); +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +drop table t1; + +select hex(concat('a' between 'b' and 'c')); +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +drop table t1; + +select hex(concat('a' in ('a','b'))); +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +drop table t1; + +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +drop table t1; + +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +drop table t1, t2; + +select hex(ifnull(1,'a')); +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +drop table t1; + +select hex(concat(ifnull(1,1))); +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +drop table t1; + +select hex(concat(ifnull(1.1,1.1))); +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +drop table t1; + +select hex(if(1,'b',1)); +create table t1 as select if(1,'b',1) as c1; +show create table t1; +drop table t1; + +select hex(if(1,1,'b')); +create table t1 as select if(1,1,'b') as c1; +show create table t1; +drop table t1; + +select hex(concat(if(1,1,1))); +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +drop table t1; + +select hex(concat(nullif(1,2))); +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +drop table t1; + +# +# GIS functions +# + +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; + +select hex(concat(x(GeomFromText('Point(1 2)')))); +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(y(GeomFromText('Point(1 2)')))); +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +drop table t1; + +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +drop table t1; + + + +# +# Date/Time functions +# + +select hex(concat(period_add(200902, 2))); +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +drop table t1; + +select hex(concat(period_diff(200902, 200802))); +create table t1 as select concat(period_add(200902, 200802)) as c1; +show create table t1; +drop table t1; + +select hex(concat(to_days(20090224))); +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(dayofmonth(20090224))); +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(dayofyear(20090224))); +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(hour('10:11:12'))); +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +drop table t1; + +select hex(concat(minute('10:11:12'))); +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +drop table t1; + +select hex(concat(second('10:11:12'))); +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +drop table t1; + +select hex(concat(quarter(20090224))); +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(week(20090224))); +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(yearweek(20090224))); +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(year(20090224))); +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(weekday(20090224))); +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(dayofweek(20090224))); +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(unix_timestamp(20090224))); +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +drop table t1; + +select hex(concat(time_to_sec('10:11:12'))); +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +drop table t1; + +select hex(concat(extract(year from 20090702))); +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +drop table t1; + +select hex(concat(microsecond('12:00:00.123456'))); +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +drop table t1; + +select hex(concat(month(20090224))); +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +drop table t1; + + +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +select c1, hex(c1) from t1; +drop table t1; + +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +select c1, hex(c1) from t1; +drop table t1; + +create table t1 as select concat(curdate()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(utc_date()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(curtime()) as c1; +show create table t1; +drop table t1; + +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +drop table t1; + +create table t1 as select concat(utc_time()) as c1; +show create table t1; +drop table t1; + +select hex(concat(sec_to_time(2378))); +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +drop table t1; + +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +drop table t1; + +select hex(concat(maketime(10,11,12))); +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +drop table t1; + +select hex(get_format(DATE,'USA')); +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +drop table t1; + +select hex(left(concat(from_unixtime(1111885200)),4)); +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +drop table t1; + +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +drop table t1; + +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +select * from t1; +drop table t1; + +select hex(concat(makedate(2009,1))); +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +select * from t1; +drop table t1; + +create table t1 as select concat(now()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +drop table t1; + +create table t1 as select concat(sysdate()) as c1; +show create table t1; +drop table t1; + +select hex(concat(addtime('00:00:00','11:22:33'))); +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +drop table t1; + +select hex(concat(subtime('23:59:59','11:22:33'))); +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +drop table t1; + + +# +# Other string functions with numeric input +# +select hex(elt(1,2,3)); +create table t1 as select elt(1,2,3) as c1; +show create table t1; +drop table t1; + +select hex(export_set(1,2,3,4,2)); +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +drop table t1; + +select hex(insert(1133,3,0,22)); +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +drop table t1; + +select hex(lcase(123)); +create table t1 as select lcase(123) as c1; +show create table t1; +drop table t1; + +select hex(left(123,1)); +create table t1 as select left(123,1) as c1; +show create table t1; +drop table t1; + +select hex(lower(123)); +create table t1 as select lower(123) as c1; +show create table t1; +drop table t1; + +select hex(lpad(1,2,0)); +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +drop table t1; + +select hex(ltrim(1)); +create table t1 as select ltrim(1) as c1; +show create table t1; +drop table t1; + +select hex(mid(1,1,1)); +create table t1 as select mid(1,1,1) as c1; +show create table t1; +drop table t1; + +select hex(repeat(1,2)); +create table t1 as select repeat(1,2) as c1; +show create table t1; +drop table t1; + +select hex(replace(1,1,2)); +create table t1 as select replace(1,1,2) as c1; +show create table t1; +drop table t1; + +select hex(reverse(12)); +create table t1 as select reverse(12) as c1; +show create table t1; +drop table t1; + +select hex(right(123,1)); +create table t1 as select right(123,1) as c1; +show create table t1; +drop table t1; + +select hex(rpad(1,2,0)); +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +drop table t1; + +select hex(rtrim(1)); +create table t1 as select rtrim(1) as c1; +show create table t1; +drop table t1; + +select hex(soundex(1)); +create table t1 as select soundex(1) as c1; +show create table t1; +drop table t1; + +select hex(substring(1,1,1)); +create table t1 as select substring(1,1,1) as c1; +show create table t1; +drop table t1; + +select hex(trim(1)); +create table t1 as select trim(1) as c1; +show create table t1; +drop table t1; + +select hex(ucase(1)); +create table t1 as select ucase(1) as c1; +show create table t1; +drop table t1; + +select hex(upper(1)); +create table t1 as select upper(1) as c1; +show create table t1; +drop table t1; + + +# +# Bug#8204 +# +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +update t1 set a= a + 0.1; +select a, hex(a) from t1; +drop table t1; + + +# +# Columns +# +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +select concat(a) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +select concat(a) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +drop table t1; + +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a bit(64)); +# BIT is always BINARY +insert into t1 values (1); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +select concat(a) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +select concat(a) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +create table t2 as select concat(a) from t1; +show create table t2; +drop table t1, t2; + + +# +# create view with string functions with numeric input +# +# Switched off in ucs tests due to bug#50716 +if ($not_ucs) +{ +create view v1 as select concat(1,2,3) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select concat_ws(',',1,2,3) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select elt(1,2,3) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select export_set(1,2,3,4,2) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select insert(1133,3,0,22) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select lcase(123) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select left(123,1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select lower(123) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select lpad(1,2,0) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select ltrim(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select mid(1,1,1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select repeat(1,2) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select replace(1,1,2) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select reverse(12) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select right(123,1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select rpad(1,2,0) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select rtrim(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select soundex(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select substring(1,1,1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select trim(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select ucase(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; + +create view v1 as select upper(1) as c1; +show columns from v1; +select hex(c1) from v1; +drop view v1; +} + + +# +# Views from tables with numeric columns +# +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a bit(64)); +# BIT is always BINARY +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +select hex(a) from v1; +drop table t1; +drop view v1; + +# +# User defined function returning numeric result +# +delimiter |; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +delimiter ;| + +set @a= f1(1); +select hex(@a); +select hex(concat(f1(1))); +create table t1 as select f1(1) as c1; +show create table t1; +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +drop table t1; +drop view v1; +drop function f1; + +delimiter |; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +delimiter ;| + +set @a= f1(123.45); +select hex(@a); +select hex(concat(f1(123.45))); +create table t1 as select f1(123.45) as c1; +show create table t1; +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +drop table t1; +drop view v1; +drop function f1; + +delimiter |; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +delimiter ;| + +set @a= f1(123.45); +select hex(@a); +select hex(concat(f1(123.45))); +create table t1 as select f1(123.45) as c1; +show create table t1; +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +drop table t1; +drop view v1; +drop function f1; + +delimiter |; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +delimiter ;| + +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +select hex(concat(f1(cast('2001-01-02' as date)))); +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +drop table t1; +drop view v1; +drop function f1; + + +--echo # +--echo # End of WL#2649 Number-to-string conversions +--echo # + diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 0c0e2d623c8..fcbf5812312 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -101,16 +101,16 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '', `c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '', - `c3` varbinary(1) NOT NULL DEFAULT '', - `c4` varbinary(1) NOT NULL DEFAULT '', - `c5` varbinary(4) NOT NULL DEFAULT '', - `c6` varbinary(4) NOT NULL DEFAULT '', + `c3` varchar(1) NOT NULL DEFAULT '', + `c4` varchar(1) NOT NULL DEFAULT '', + `c5` varchar(4) NOT NULL DEFAULT '', + `c6` varchar(4) NOT NULL DEFAULT '', `c7` decimal(2,1) NOT NULL DEFAULT '0.0', `c8` decimal(2,1) NOT NULL DEFAULT '0.0', `c9` decimal(2,1) DEFAULT NULL, `c10` double NOT NULL DEFAULT '0', `c11` double NOT NULL DEFAULT '0', - `c12` varbinary(5) NOT NULL DEFAULT '' + `c12` varchar(5) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; SELECT CASE @@ -155,8 +155,8 @@ t1 CREATE TABLE `t1` ( `COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0', `COALESCE('a')` varchar(1) NOT NULL DEFAULT '', `COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0', - `COALESCE(1,'1')` varbinary(1) NOT NULL DEFAULT '', - `COALESCE(1.1,'1')` varbinary(4) NOT NULL DEFAULT '', + `COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '', + `COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '', `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 55e8e15b6a9..ae04aeb9921 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -438,7 +438,7 @@ explain t2; Field Type Null Key Default Extra a int(11) YES NULL b bigint(11) NO 0 -c bigint(11) unsigned NO 0 +c bigint(10) unsigned NO 0 d date YES NULL e varchar(1) NO f datetime YES NULL @@ -457,7 +457,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `ifnull(a,a)` tinyint(4) DEFAULT NULL, `ifnull(b,b)` smallint(6) DEFAULT NULL, - `ifnull(c,c)` mediumint(8) DEFAULT NULL, + `ifnull(c,c)` mediumint(9) DEFAULT NULL, `ifnull(d,d)` int(11) DEFAULT NULL, `ifnull(e,e)` bigint(20) DEFAULT NULL, `ifnull(f,f)` float(3,2) DEFAULT NULL, diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result new file mode 100644 index 00000000000..e7d1eb1b492 --- /dev/null +++ b/mysql-test/r/ctype_binary.result @@ -0,0 +1,2581 @@ +set names binary; +# +# Start of 5.5 tests +# +# +# Start of WL#2649 Number-to-string conversions +# +select hex(concat(1)); +hex(concat(1)) +31 +create table t1 as select concat(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +31 +drop table t1; +select hex(concat(18446744073709551615)); +hex(concat(18446744073709551615)) +3138343436373434303733373039353531363135 +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(20) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +3138343436373434303733373039353531363135 +drop table t1; +select hex(concat(1.1)); +hex(concat(1.1)) +312E31 +create table t1 as select concat(1.1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +312E31 +drop table t1; +select hex(concat('a', 1+2)), charset(concat(1+2)); +hex(concat('a', 1+2)) charset(concat(1+2)) +6133 binary +create table t1 as select concat(1+2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1-2)); +hex(concat(1-2)) +2D31 +create table t1 as select concat(1-2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1*2)); +hex(concat(1*2)) +32 +create table t1 as select concat(1*2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1/2)); +hex(concat(1/2)) +302E35303030 +create table t1 as select concat(1/2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(7) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 div 2)); +hex(concat(1 div 2)) +30 +create table t1 as select concat(1 div 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 % 2)); +hex(concat(1 % 2)) +31 +create table t1 as select concat(1 % 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-1)); +hex(concat(-1)) +2D31 +create table t1 as select concat(-1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-(1+2))); +hex(concat(-(1+2))) +2D33 +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1|2)); +hex(concat(1|2)) +33 +create table t1 as select concat(1|2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1&2)); +hex(concat(1&2)) +30 +create table t1 as select concat(1&2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_count(12))); +hex(concat(bit_count(12))) +32 +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2<<1)); +hex(concat(2<<1)) +34 +create table t1 as select concat(2<<1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2>>1)); +hex(concat(2>>1)) +31 +create table t1 as select concat(2>>1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(~0)); +hex(concat(~0)) +3138343436373434303733373039353531363135 +create table t1 as select concat(~0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(3^2)); +hex(concat(3^2)) +31 +create table t1 as select concat(3^2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(abs(-2))); +hex(concat(abs(-2))) +32 +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(exp(2)),1)); +hex(left(concat(exp(2)),1)) +37 +create table t1 as select concat(exp(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log(2)),1)); +hex(left(concat(log(2)),1)) +30 +create table t1 as select concat(log(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log2(2)),1)); +hex(left(concat(log2(2)),1)) +31 +create table t1 as select concat(log2(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log10(2)),1)); +hex(left(concat(log10(2)),1)) +30 +create table t1 as select concat(log10(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sqrt(2)),1)); +hex(left(concat(sqrt(2)),1)) +31 +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(pow(2,2)),1)); +hex(left(concat(pow(2,2)),1)) +34 +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(acos(0.5)),1)); +hex(left(concat(acos(0.5)),1)) +31 +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(asin(0.5)),1)); +hex(left(concat(asin(0.5)),1)) +30 +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(atan(0.5)),1)); +hex(left(concat(atan(0.5)),1)) +30 +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(cos(0.5)),1)); +hex(left(concat(cos(0.5)),1)) +30 +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sin(0.5)),1)); +hex(left(concat(sin(0.5)),1)) +30 +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(tan(0.5)),1)); +hex(left(concat(tan(0.5)),1)) +30 +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(degrees(0))); +hex(concat(degrees(0))) +30 +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(radians(0))); +hex(concat(radians(0))) +30 +create table t1 as select concat(radians(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ceiling(0.5))); +hex(concat(ceiling(0.5))) +31 +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(floor(0.5))); +hex(concat(floor(0.5))) +30 +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(round(0.5))); +hex(concat(round(0.5))) +31 +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sign(0.5))); +hex(concat(sign(0.5))) +31 +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(rand()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(length('a'))); +hex(concat(length('a'))) +31 +create table t1 as select concat(length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(char_length('a'))); +hex(concat(char_length('a'))) +31 +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_length('a'))); +hex(concat(bit_length('a'))) +38 +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coercibility('a'))); +hex(concat(coercibility('a'))) +34 +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(locate('a','a'))); +hex(concat(locate('a','a'))) +31 +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(11) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(field('c','a','b','c'))); +hex(concat(field('c','a','b','c'))) +33 +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ascii(61))); +hex(concat(ascii(61))) +3534 +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ord(61))); +hex(concat(ord(61))) +3534 +create table t1 as select concat(ord(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(find_in_set('b','a,b,c,d'))); +hex(concat(find_in_set('b','a,b,c,d'))) +32 +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select md5('a'), hex(md5('a')); +md5('a') hex(md5('a')) +0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631 +create table t1 as select md5('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(32) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select old_password('a'), hex(old_password('a')); +old_password('a') hex(old_password('a')) +60671c896665c3fa 36303637316338393636363563336661 +create table t1 as select old_password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(16) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select password('a'), hex(password('a')); +password('a') hex(password('a')) +*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445 +create table t1 as select password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(41) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha('a'), hex(sha('a')); +sha('a') hex(sha('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(40) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha1('a'), hex(sha1('a')); +sha1('a') hex(sha1('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha1('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(40) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('-1' as signed))); +hex(concat(cast('-1' as signed))) +2D31 +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('1' as unsigned))); +hex(concat(cast('1' as unsigned))) +31 +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast(1/2 as decimal(5,5)))); +hex(concat(cast(1/2 as decimal(5,5)))) +302E3530303030 +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(7) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as date))); +hex(concat(cast('2001-01-02 03:04:05' as date))) +323030312D30312D3032 +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as time))); +hex(concat(cast('2001-01-02 03:04:05' as time))) +30333A30343A3035 +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +03:04:05 +drop table t1; +select hex(concat(cast('2001-01-02' as datetime))); +hex(concat(cast('2001-01-02' as datetime))) +323030312D30312D30322030303A30303A3030 +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 00:00:00 +drop table t1; +select hex(concat(least(1,2))); +hex(concat(least(1,2))) +31 +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(greatest(1,2))); +hex(concat(greatest(1,2))) +32 +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(case when 11 then 22 else 33 end)); +hex(concat(case when 11 then 22 else 33 end)) +3232 +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coalesce(1,2))); +hex(concat(coalesce(1,2))) +31 +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat_ws(1,2,3)); +hex(concat_ws(1,2,3)) +323133 +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(group_concat(1,2,3)); +hex(group_concat(1,2,3)) +313233 +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` blob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1 order by c1; +hex(c1) +31 +61 +drop table t1; +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(benchmark(0,0))); +hex(concat(benchmark(0,0))) +30 +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sleep(0))); +hex(concat(sleep(0))) +30 +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(get_lock('a',0))); +hex(concat(get_lock('a',0))) +31 +select hex(concat(release_lock('a'))); +hex(concat(release_lock('a'))) +31 +create table t1 as select concat(get_lock('a',0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(is_free_lock('xxxx'))); +hex(concat(is_free_lock('xxxx'))) +31 +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(crc32(''))); +hex(concat(crc32(''))) +30 +create table t1 as select concat(crc32('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(uncompressed_length(''))); +hex(concat(uncompressed_length(''))) +30 +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(connection_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_aton('127.1.1.1'))); +hex(concat(inet_aton('127.1.1.1'))) +32313330373732323235 +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_ntoa(2130772225))); +hex(concat(inet_ntoa(2130772225))) +3132372E312E312E31 +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +c1 +127.1.1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(31) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(row_count())); +hex(concat(row_count())) +2D31 +create table t1 as select concat(row_count()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(found_rows())); +hex(concat(found_rows())) +30 +create table t1 as select concat(found_rows()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +coercibility(uuid()) coercibility(cast('a' as char character set latin1)) +4 2 +select charset(concat(uuid(), cast('a' as char character set latin1))); +charset(concat(uuid(), cast('a' as char character set latin1))) +latin1 +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1)); +hex(concat(@a1:=1)) +31 +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +hex(c1) +32 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '', + `c2` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1; +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(20) DEFAULT NULL, + `c2` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=sqrt(1))); +hex(concat(@a1:=sqrt(1))) +31 +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=sqrt(1); +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1.1)); +hex(concat(@a1:=1.1)) +312E31 +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '', + `c2` decimal(2,1) NOT NULL DEFAULT '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1.1; +select hex(concat(@a2)); +hex(concat(@a2)) +312E31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(83) DEFAULT NULL, + `c2` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@@ft_max_word_len)); +hex(concat(@@ft_max_word_len)) +3834 +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +hex(c1) +3834 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS TRUE)); +hex(concat('a'='a' IS TRUE)) +31 +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS NOT TRUE)); +hex(concat('a'='a' IS NOT TRUE)) +30 +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NOT 'a'='a')); +hex(concat(NOT 'a'='a')) +30 +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NULL)); +hex(concat('a' IS NULL)) +30 +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NOT NULL)); +hex(concat('a' IS NOT NULL)) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' rlike 'a')); +hex(concat('a' rlike 'a')) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(strcmp('a','b'))); +hex(concat(strcmp('a','b'))) +2D31 +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' like 'a')); +hex(concat('a' like 'a')) +31 +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' between 'b' and 'c')); +hex(concat('a' between 'b' and 'c')) +30 +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' in ('a','b'))); +hex(concat('a' in ('a','b'))) +31 +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +hex(concat(interval(23, 1, 15, 17, 30, 44, 200))) +33 +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +hex(concat(match (a) against ('a'))) +30 +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +select hex(ifnull(1,'a')); +hex(ifnull(1,'a')) +31 +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1,1))); +hex(concat(ifnull(1,1))) +31 +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1.1,1.1))); +hex(concat(ifnull(1.1,1.1))) +312E31 +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,'b',1)); +hex(if(1,'b',1)) +62 +create table t1 as select if(1,'b',1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,1,'b')); +hex(if(1,1,'b')) +31 +create table t1 as select if(1,1,'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(if(1,1,1))); +hex(concat(if(1,1,1))) +31 +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(nullif(1,2))); +hex(concat(nullif(1,2))) +31 +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))) +31 +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +32 +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))) +32 +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +30 +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))) +31 +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +hex(concat(IsSimple(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))) +30 +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))) +31 +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; +select hex(concat(x(GeomFromText('Point(1 2)')))); +hex(concat(x(GeomFromText('Point(1 2)')))) +31 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(y(GeomFromText('Point(1 2)')))); +hex(concat(y(GeomFromText('Point(1 2)')))) +32 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))) +31 +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))) +31 +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +hex(concat(GeometryType(GeomFromText('Point(1 2)')))) +504F494E54 +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +hex(concat(AsText(GeomFromText('Point(1 2)')))) +504F494E542831203229 +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_add(200902, 2))); +hex(concat(period_add(200902, 2))) +323030393034 +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_diff(200902, 200802))); +hex(concat(period_diff(200902, 200802))) +3132 +create table t1 as select concat(period_add(200902, 200802)) as c1; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(to_days(20090224))); +hex(concat(to_days(20090224))) +373333383237 +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofmonth(20090224))); +hex(concat(dayofmonth(20090224))) +3234 +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofyear(20090224))); +hex(concat(dayofyear(20090224))) +3535 +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(hour('10:11:12'))); +hex(concat(hour('10:11:12'))) +3130 +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(minute('10:11:12'))); +hex(concat(minute('10:11:12'))) +3131 +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(second('10:11:12'))); +hex(concat(second('10:11:12'))) +3132 +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(quarter(20090224))); +hex(concat(quarter(20090224))) +31 +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(week(20090224))); +hex(concat(week(20090224))) +38 +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(yearweek(20090224))); +hex(concat(yearweek(20090224))) +323030393038 +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(year(20090224))); +hex(concat(year(20090224))) +32303039 +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(weekday(20090224))); +hex(concat(weekday(20090224))) +31 +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofweek(20090224))); +hex(concat(dayofweek(20090224))) +33 +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(unix_timestamp(20090224))); +hex(concat(unix_timestamp(20090224))) +31323335343232383030 +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(time_to_sec('10:11:12'))); +hex(concat(time_to_sec('10:11:12'))) +3336363732 +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(extract(year from 20090702))); +hex(concat(extract(year from 20090702))) +32303039 +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(microsecond('12:00:00.123456'))); +hex(concat(microsecond('12:00:00.123456'))) +313233343536 +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(month(20090224))); +hex(concat(month(20090224))) +32 +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2003-02-28 323030332D30322D3238 +drop table t1; +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2000-07-03 323030302D30372D3033 +drop table t1; +create table t1 as select concat(curdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_date()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(curtime()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(8) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +c1 hex(c1) +2008-07-18 323030382D30372D3138 +08:42:04 30383A34323A3034 +drop table t1; +create table t1 as select concat(utc_time()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(8) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sec_to_time(2378))); +hex(concat(sec_to_time(2378))) +30303A33393A3338 +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))) +32343A30303A3030 +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(maketime(10,11,12))); +hex(concat(maketime(10,11,12))) +31303A31313A3132 +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(get_format(DATE,'USA')); +hex(get_format(DATE,'USA')) +256D2E25642E2559 +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(17) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(from_unixtime(1111885200)),4)); +hex(left(concat(from_unixtime(1111885200)),4)) +32303035 +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))) +323030332D31322D33312032303A30303A3030 +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))) +323030342D30312D30322031323A30303A3030 +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2004-01-02 12:00:00 +drop table t1; +select hex(concat(makedate(2009,1))); +hex(concat(makedate(2009,1))) +323030392D30312D3031 +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2009-01-01 +drop table t1; +create table t1 as select concat(now()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(sysdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(addtime('00:00:00','11:22:33'))); +hex(concat(addtime('00:00:00','11:22:33'))) +31313A32323A3333 +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(subtime('23:59:59','11:22:33'))); +hex(concat(subtime('23:59:59','11:22:33'))) +31323A33373A3236 +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(elt(1,2,3)); +hex(elt(1,2,3)) +32 +create table t1 as select elt(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(export_set(1,2,3,4,2)); +hex(export_set(1,2,3,4,2)) +323433 +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(127) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(insert(1133,3,0,22)); +hex(insert(1133,3,0,22)) +313132323333 +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lcase(123)); +hex(lcase(123)) +313233 +create table t1 as select lcase(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(123,1)); +hex(left(123,1)) +31 +create table t1 as select left(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lower(123)); +hex(lower(123)) +313233 +create table t1 as select lower(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lpad(1,2,0)); +hex(lpad(1,2,0)) +3031 +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ltrim(1)); +hex(ltrim(1)) +31 +create table t1 as select ltrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(mid(1,1,1)); +hex(mid(1,1,1)) +31 +create table t1 as select mid(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(repeat(1,2)); +hex(repeat(1,2)) +3131 +create table t1 as select repeat(1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(replace(1,1,2)); +hex(replace(1,1,2)) +32 +create table t1 as select replace(1,1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(reverse(12)); +hex(reverse(12)) +3231 +create table t1 as select reverse(12) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(right(123,1)); +hex(right(123,1)) +33 +create table t1 as select right(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rpad(1,2,0)); +hex(rpad(1,2,0)) +3130 +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rtrim(1)); +hex(rtrim(1)) +31 +create table t1 as select rtrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(soundex(1)); +hex(soundex(1)) + +create table t1 as select soundex(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(substring(1,1,1)); +hex(substring(1,1,1)) +31 +create table t1 as select substring(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(trim(1)); +hex(trim(1)) +31 +create table t1 as select trim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ucase(1)); +hex(ucase(1)) +31 +create table t1 as select ucase(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(upper(1)); +hex(upper(1)) +31 +create table t1 as select upper(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varbinary(64) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +a hex(a) +1.1 312E31 +2.1 322E31 +update t1 set a= a + 0.1; +select a, hex(a) from t1; +a hex(a) +1.2000000000000002 312E32303030303030303030303030303032 +2.2 322E32 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303031 001 +303130 010 +313030 100 +drop table t1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030303030303030303030303030303030303030303031 000000000000000000000000000001 +303030303030303030303030303030303030303030303030303030303130 000000000000000000000000000010 +303030303030303030303030303030303030303030303030303030313030 000000000000000000000000000100 +drop table t1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E3435 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303031 00001 +3030303130 00010 +3030313030 00100 +3031303030 01000 +3130303030 10000 +drop table t1; +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303031 00000001 +3030303030303130 00000010 +3030303030313030 00000100 +3030303031303030 00001000 +3030303130303030 00010000 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303031 0000000001 +30303030303030303130 0000000010 +30303030303030313030 0000000100 +30303030303031303030 0000001000 +30303030303130303030 0000010000 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303030303030303030303030303031 00000000000000000001 +3030303030303030303030303030303030303130 00000000000000000010 +3030303030303030303030303030303030313030 00000000000000000100 +3030303030303030303030303030303031303030 00000000000000001000 +3030303030303030303030303030303130303030 00000000000000010000 +drop table t1; +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030312E31 0000000001.1 +303030303030303031302E31 0000000010.1 +303030303030303130302E31 0000000100.1 +303030303030313030302E31 0000001000.1 +303030303031303030302E31 0000010000.1 +drop table t1; +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(22) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303030303030303030303030312E31 00000000000000000001.1 +30303030303030303030303030303030303031302E31 00000000000000000010.1 +30303030303030303030303030303030303130302E31 00000000000000000100.1 +30303030303030303030303030303030313030302E31 00000000000000001000.1 +30303030303030303030303030303031303030302E31 00000000000000010000.1 +drop table t1; +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +3031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +32303031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bit(64)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0000000000000001 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +hex(concat(a)) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +select concat(a) from t1; +concat(a) +0000-00-00 00:00:00 +2001-02-03 04:05:06 +1980-02-03 04:05:06 +2001-02-03 04:05:06 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D3033 +323030312D30322D3033 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +hex(concat(a)) +30303A30303A3031 +30313A30323A3033 +select concat(a) from t1; +concat(a) +00:00:01 +01:02:03 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(4) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(3) YES NULL +select hex(a) from v1; +hex(a) +303031 +303130 +313030 +drop table t1; +drop view v1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(30) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030303030303030303030303030303030303030303031 +303030303030303030303030303030303030303030303030303030303130 +303030303030303030303030303030303030303030303030303030313030 +drop table t1; +drop view v1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E3435 +drop table t1; +drop view v1; +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(6) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(5) YES NULL +select hex(a) from v1; +hex(a) +3030303031 +3030303130 +3030313030 +3031303030 +3130303030 +drop table t1; +drop view v1; +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(9) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(8) YES NULL +select hex(a) from v1; +hex(a) +3030303030303031 +3030303030303130 +3030303030313030 +3030303031303030 +3030303130303030 +drop table t1; +drop view v1; +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(11) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(10) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303031 +30303030303030303130 +30303030303030313030 +30303030303031303030 +30303030303130303030 +drop table t1; +drop view v1; +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(20) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(20) YES NULL +select hex(a) from v1; +hex(a) +3030303030303030303030303030303030303031 +3030303030303030303030303030303030303130 +3030303030303030303030303030303030313030 +3030303030303030303030303030303031303030 +3030303030303030303030303030303130303030 +drop table t1; +drop view v1; +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(12) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030312E31 +303030303030303031302E31 +303030303030303130302E31 +303030303030313030302E31 +303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +concat(a) +123.456 +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(22) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(22) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303030303030303030303030312E31 +30303030303030303030303030303030303031302E31 +30303030303030303030303030303030303130302E31 +30303030303030303030303030303030313030302E31 +30303030303030303030303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(2) YES NULL +select hex(a) from v1; +hex(a) +3031 +drop table t1; +drop view v1; +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(4) YES NULL +select hex(a) from v1; +hex(a) +32303031 +drop table t1; +drop view v1; +create table t1 (a bit(64)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(64) YES NULL +select hex(a) from v1; +hex(a) +0000000000000001 +drop table t1; +drop view v1; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(19) NO +select hex(a) from v1; +hex(a) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(10) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D3033 +323030312D30322D3033 +drop table t1; +drop view v1; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(8) YES NULL +select hex(a) from v1; +hex(a) +30303A30303A3031 +30313A30323A3033 +drop table t1; +drop view v1; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(19) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +set @a= f1(1); +select hex(@a); +hex(@a) +1 +select hex(concat(f1(1))); +hex(concat(f1(1))) +31 +create table t1 as select f1(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(11) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` decimal(18,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(20) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(12) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +hex(@a) +323030312D30312D3032 +select hex(concat(f1(cast('2001-01-02' as date)))); +hex(concat(f1(cast('2001-01-02' as date)))) +323030312D30312D3032 +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +drop view v1; +drop function f1; +# +# End of WL#2649 Number-to-string conversions +# +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index bf0bc07c50e..f2e7c43a3ce 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -81,3 +81,2583 @@ t1 CREATE TABLE `t1` ( `e2` enum('ìë˙êî') DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 DROP TABLE t1; +# +# Start of 5.5 tests +# +# +# Start of WL#2649 Number-to-string conversions +# +select hex(concat(1)); +hex(concat(1)) +31 +create table t1 as select concat(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +31 +drop table t1; +select hex(concat(18446744073709551615)); +hex(concat(18446744073709551615)) +3138343436373434303733373039353531363135 +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +3138343436373434303733373039353531363135 +drop table t1; +select hex(concat(1.1)); +hex(concat(1.1)) +312E31 +create table t1 as select concat(1.1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +312E31 +drop table t1; +select hex(concat('a', 1+2)), charset(concat(1+2)); +hex(concat('a', 1+2)) charset(concat(1+2)) +6133 cp1251 +create table t1 as select concat(1+2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1-2)); +hex(concat(1-2)) +2D31 +create table t1 as select concat(1-2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1*2)); +hex(concat(1*2)) +32 +create table t1 as select concat(1*2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1/2)); +hex(concat(1/2)) +302E35303030 +create table t1 as select concat(1/2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 div 2)); +hex(concat(1 div 2)) +30 +create table t1 as select concat(1 div 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 % 2)); +hex(concat(1 % 2)) +31 +create table t1 as select concat(1 % 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-1)); +hex(concat(-1)) +2D31 +create table t1 as select concat(-1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-(1+2))); +hex(concat(-(1+2))) +2D33 +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1|2)); +hex(concat(1|2)) +33 +create table t1 as select concat(1|2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1&2)); +hex(concat(1&2)) +30 +create table t1 as select concat(1&2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_count(12))); +hex(concat(bit_count(12))) +32 +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2<<1)); +hex(concat(2<<1)) +34 +create table t1 as select concat(2<<1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2>>1)); +hex(concat(2>>1)) +31 +create table t1 as select concat(2>>1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(~0)); +hex(concat(~0)) +3138343436373434303733373039353531363135 +create table t1 as select concat(~0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(3^2)); +hex(concat(3^2)) +31 +create table t1 as select concat(3^2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(abs(-2))); +hex(concat(abs(-2))) +32 +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(exp(2)),1)); +hex(left(concat(exp(2)),1)) +37 +create table t1 as select concat(exp(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log(2)),1)); +hex(left(concat(log(2)),1)) +30 +create table t1 as select concat(log(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log2(2)),1)); +hex(left(concat(log2(2)),1)) +31 +create table t1 as select concat(log2(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log10(2)),1)); +hex(left(concat(log10(2)),1)) +30 +create table t1 as select concat(log10(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sqrt(2)),1)); +hex(left(concat(sqrt(2)),1)) +31 +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(pow(2,2)),1)); +hex(left(concat(pow(2,2)),1)) +34 +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(acos(0.5)),1)); +hex(left(concat(acos(0.5)),1)) +31 +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(asin(0.5)),1)); +hex(left(concat(asin(0.5)),1)) +30 +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(atan(0.5)),1)); +hex(left(concat(atan(0.5)),1)) +30 +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(cos(0.5)),1)); +hex(left(concat(cos(0.5)),1)) +30 +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sin(0.5)),1)); +hex(left(concat(sin(0.5)),1)) +30 +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(tan(0.5)),1)); +hex(left(concat(tan(0.5)),1)) +30 +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(degrees(0))); +hex(concat(degrees(0))) +30 +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(radians(0))); +hex(concat(radians(0))) +30 +create table t1 as select concat(radians(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ceiling(0.5))); +hex(concat(ceiling(0.5))) +31 +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(floor(0.5))); +hex(concat(floor(0.5))) +30 +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(round(0.5))); +hex(concat(round(0.5))) +31 +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sign(0.5))); +hex(concat(sign(0.5))) +31 +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(rand()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(length('a'))); +hex(concat(length('a'))) +31 +create table t1 as select concat(length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(char_length('a'))); +hex(concat(char_length('a'))) +31 +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_length('a'))); +hex(concat(bit_length('a'))) +38 +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coercibility('a'))); +hex(concat(coercibility('a'))) +34 +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(locate('a','a'))); +hex(concat(locate('a','a'))) +31 +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(field('c','a','b','c'))); +hex(concat(field('c','a','b','c'))) +33 +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ascii(61))); +hex(concat(ascii(61))) +3534 +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ord(61))); +hex(concat(ord(61))) +3534 +create table t1 as select concat(ord(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(find_in_set('b','a,b,c,d'))); +hex(concat(find_in_set('b','a,b,c,d'))) +32 +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select md5('a'), hex(md5('a')); +md5('a') hex(md5('a')) +0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631 +create table t1 as select md5('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(32) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select old_password('a'), hex(old_password('a')); +old_password('a') hex(old_password('a')) +60671c896665c3fa 36303637316338393636363563336661 +create table t1 as select old_password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(16) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select password('a'), hex(password('a')); +password('a') hex(password('a')) +*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445 +create table t1 as select password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(41) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha('a'), hex(sha('a')); +sha('a') hex(sha('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha1('a'), hex(sha1('a')); +sha1('a') hex(sha1('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha1('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('-1' as signed))); +hex(concat(cast('-1' as signed))) +2D31 +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('1' as unsigned))); +hex(concat(cast('1' as unsigned))) +31 +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast(1/2 as decimal(5,5)))); +hex(concat(cast(1/2 as decimal(5,5)))) +302E3530303030 +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as date))); +hex(concat(cast('2001-01-02 03:04:05' as date))) +323030312D30312D3032 +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as time))); +hex(concat(cast('2001-01-02 03:04:05' as time))) +30333A30343A3035 +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +03:04:05 +drop table t1; +select hex(concat(cast('2001-01-02' as datetime))); +hex(concat(cast('2001-01-02' as datetime))) +323030312D30312D30322030303A30303A3030 +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 00:00:00 +drop table t1; +select hex(concat(least(1,2))); +hex(concat(least(1,2))) +31 +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(greatest(1,2))); +hex(concat(greatest(1,2))) +32 +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(case when 11 then 22 else 33 end)); +hex(concat(case when 11 then 22 else 33 end)) +3232 +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coalesce(1,2))); +hex(concat(coalesce(1,2))) +31 +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat_ws(1,2,3)); +hex(concat_ws(1,2,3)) +323133 +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(group_concat(1,2,3)); +hex(group_concat(1,2,3)) +313233 +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` text CHARACTER SET cp1251 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1 order by c1; +hex(c1) +31 +61 +drop table t1; +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(benchmark(0,0))); +hex(concat(benchmark(0,0))) +30 +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sleep(0))); +hex(concat(sleep(0))) +30 +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(get_lock('a',0))); +hex(concat(get_lock('a',0))) +31 +select hex(concat(release_lock('a'))); +hex(concat(release_lock('a'))) +31 +create table t1 as select concat(get_lock('a',0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(is_free_lock('xxxx'))); +hex(concat(is_free_lock('xxxx'))) +31 +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(crc32(''))); +hex(concat(crc32(''))) +30 +create table t1 as select concat(crc32('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(uncompressed_length(''))); +hex(concat(uncompressed_length(''))) +30 +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(connection_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_aton('127.1.1.1'))); +hex(concat(inet_aton('127.1.1.1'))) +32313330373732323235 +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_ntoa(2130772225))); +hex(concat(inet_ntoa(2130772225))) +3132372E312E312E31 +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +c1 +127.1.1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(31) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(row_count())); +hex(concat(row_count())) +2D31 +create table t1 as select concat(row_count()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(found_rows())); +hex(concat(found_rows())) +30 +create table t1 as select concat(found_rows()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +coercibility(uuid()) coercibility(cast('a' as char character set latin1)) +4 2 +select charset(concat(uuid(), cast('a' as char character set latin1))); +charset(concat(uuid(), cast('a' as char character set latin1))) +latin1 +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1)); +hex(concat(@a1:=1)) +31 +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +hex(c1) +32 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '', + `c2` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1; +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET cp1251 DEFAULT NULL, + `c2` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=sqrt(1))); +hex(concat(@a1:=sqrt(1))) +31 +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=sqrt(1); +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1.1)); +hex(concat(@a1:=1.1)) +312E31 +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '', + `c2` decimal(2,1) NOT NULL DEFAULT '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1.1; +select hex(concat(@a2)); +hex(concat(@a2)) +312E31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(83) CHARACTER SET cp1251 DEFAULT NULL, + `c2` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@@ft_max_word_len)); +hex(concat(@@ft_max_word_len)) +3834 +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +hex(c1) +3834 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS TRUE)); +hex(concat('a'='a' IS TRUE)) +31 +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS NOT TRUE)); +hex(concat('a'='a' IS NOT TRUE)) +30 +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NOT 'a'='a')); +hex(concat(NOT 'a'='a')) +30 +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NULL)); +hex(concat('a' IS NULL)) +30 +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NOT NULL)); +hex(concat('a' IS NOT NULL)) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' rlike 'a')); +hex(concat('a' rlike 'a')) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(strcmp('a','b'))); +hex(concat(strcmp('a','b'))) +2D31 +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' like 'a')); +hex(concat('a' like 'a')) +31 +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' between 'b' and 'c')); +hex(concat('a' between 'b' and 'c')) +30 +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' in ('a','b'))); +hex(concat('a' in ('a','b'))) +31 +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +hex(concat(interval(23, 1, 15, 17, 30, 44, 200))) +33 +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +hex(concat(match (a) against ('a'))) +30 +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +select hex(ifnull(1,'a')); +hex(ifnull(1,'a')) +31 +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1,1))); +hex(concat(ifnull(1,1))) +31 +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1.1,1.1))); +hex(concat(ifnull(1.1,1.1))) +312E31 +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,'b',1)); +hex(if(1,'b',1)) +62 +create table t1 as select if(1,'b',1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,1,'b')); +hex(if(1,1,'b')) +31 +create table t1 as select if(1,1,'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(if(1,1,1))); +hex(concat(if(1,1,1))) +31 +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(nullif(1,2))); +hex(concat(nullif(1,2))) +31 +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))) +31 +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +32 +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))) +32 +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +30 +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))) +31 +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +hex(concat(IsSimple(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))) +30 +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))) +31 +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; +select hex(concat(x(GeomFromText('Point(1 2)')))); +hex(concat(x(GeomFromText('Point(1 2)')))) +31 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(y(GeomFromText('Point(1 2)')))); +hex(concat(y(GeomFromText('Point(1 2)')))) +32 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))) +31 +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))) +31 +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +hex(concat(GeometryType(GeomFromText('Point(1 2)')))) +504F494E54 +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +hex(concat(AsText(GeomFromText('Point(1 2)')))) +504F494E542831203229 +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` longtext CHARACTER SET cp1251 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_add(200902, 2))); +hex(concat(period_add(200902, 2))) +323030393034 +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_diff(200902, 200802))); +hex(concat(period_diff(200902, 200802))) +3132 +create table t1 as select concat(period_add(200902, 200802)) as c1; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(to_days(20090224))); +hex(concat(to_days(20090224))) +373333383237 +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofmonth(20090224))); +hex(concat(dayofmonth(20090224))) +3234 +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofyear(20090224))); +hex(concat(dayofyear(20090224))) +3535 +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(hour('10:11:12'))); +hex(concat(hour('10:11:12'))) +3130 +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(minute('10:11:12'))); +hex(concat(minute('10:11:12'))) +3131 +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(second('10:11:12'))); +hex(concat(second('10:11:12'))) +3132 +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(quarter(20090224))); +hex(concat(quarter(20090224))) +31 +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(week(20090224))); +hex(concat(week(20090224))) +38 +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(yearweek(20090224))); +hex(concat(yearweek(20090224))) +323030393038 +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(year(20090224))); +hex(concat(year(20090224))) +32303039 +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(weekday(20090224))); +hex(concat(weekday(20090224))) +31 +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofweek(20090224))); +hex(concat(dayofweek(20090224))) +33 +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(unix_timestamp(20090224))); +hex(concat(unix_timestamp(20090224))) +31323335343232383030 +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(time_to_sec('10:11:12'))); +hex(concat(time_to_sec('10:11:12'))) +3336363732 +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(extract(year from 20090702))); +hex(concat(extract(year from 20090702))) +32303039 +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(microsecond('12:00:00.123456'))); +hex(concat(microsecond('12:00:00.123456'))) +313233343536 +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(month(20090224))); +hex(concat(month(20090224))) +32 +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2003-02-28 323030332D30322D3238 +drop table t1; +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2000-07-03 323030302D30372D3033 +drop table t1; +create table t1 as select concat(curdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_date()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(curtime()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +c1 hex(c1) +2008-07-18 323030382D30372D3138 +08:42:04 30383A34323A3034 +drop table t1; +create table t1 as select concat(utc_time()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sec_to_time(2378))); +hex(concat(sec_to_time(2378))) +30303A33393A3338 +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))) +32343A30303A3030 +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(maketime(10,11,12))); +hex(concat(maketime(10,11,12))) +31303A31313A3132 +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(get_format(DATE,'USA')); +hex(get_format(DATE,'USA')) +256D2E25642E2559 +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(17) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(from_unixtime(1111885200)),4)); +hex(left(concat(from_unixtime(1111885200)),4)) +32303035 +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))) +323030332D31322D33312032303A30303A3030 +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))) +323030342D30312D30322031323A30303A3030 +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2004-01-02 12:00:00 +drop table t1; +select hex(concat(makedate(2009,1))); +hex(concat(makedate(2009,1))) +323030392D30312D3031 +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2009-01-01 +drop table t1; +create table t1 as select concat(now()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(sysdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(addtime('00:00:00','11:22:33'))); +hex(concat(addtime('00:00:00','11:22:33'))) +31313A32323A3333 +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(subtime('23:59:59','11:22:33'))); +hex(concat(subtime('23:59:59','11:22:33'))) +31323A33373A3236 +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(elt(1,2,3)); +hex(elt(1,2,3)) +32 +create table t1 as select elt(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(export_set(1,2,3,4,2)); +hex(export_set(1,2,3,4,2)) +323433 +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(127) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(insert(1133,3,0,22)); +hex(insert(1133,3,0,22)) +313132323333 +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lcase(123)); +hex(lcase(123)) +313233 +create table t1 as select lcase(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(123,1)); +hex(left(123,1)) +31 +create table t1 as select left(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lower(123)); +hex(lower(123)) +313233 +create table t1 as select lower(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lpad(1,2,0)); +hex(lpad(1,2,0)) +3031 +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ltrim(1)); +hex(ltrim(1)) +31 +create table t1 as select ltrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(mid(1,1,1)); +hex(mid(1,1,1)) +31 +create table t1 as select mid(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(repeat(1,2)); +hex(repeat(1,2)) +3131 +create table t1 as select repeat(1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(replace(1,1,2)); +hex(replace(1,1,2)) +32 +create table t1 as select replace(1,1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(reverse(12)); +hex(reverse(12)) +3231 +create table t1 as select reverse(12) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(right(123,1)); +hex(right(123,1)) +33 +create table t1 as select right(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rpad(1,2,0)); +hex(rpad(1,2,0)) +3130 +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rtrim(1)); +hex(rtrim(1)) +31 +create table t1 as select rtrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(soundex(1)); +hex(soundex(1)) + +create table t1 as select soundex(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(substring(1,1,1)); +hex(substring(1,1,1)) +31 +create table t1 as select substring(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(trim(1)); +hex(trim(1)) +31 +create table t1 as select trim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ucase(1)); +hex(ucase(1)) +31 +create table t1 as select ucase(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(upper(1)); +hex(upper(1)) +31 +create table t1 as select upper(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +a hex(a) +1.1 312E31 +2.1 322E31 +update t1 set a= a + 0.1; +select a, hex(a) from t1; +a hex(a) +1.2000000000000002 312E32303030303030303030303030303032 +2.2 322E32 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303031 001 +303130 010 +313030 100 +drop table t1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030303030303030303030303030303030303030303031 000000000000000000000000000001 +303030303030303030303030303030303030303030303030303030303130 000000000000000000000000000010 +303030303030303030303030303030303030303030303030303030313030 000000000000000000000000000100 +drop table t1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E3435 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(6) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303031 00001 +3030303130 00010 +3030313030 00100 +3031303030 01000 +3130303030 10000 +drop table t1; +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303031 00000001 +3030303030303130 00000010 +3030303030313030 00000100 +3030303031303030 00001000 +3030303130303030 00010000 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(11) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303031 0000000001 +30303030303030303130 0000000010 +30303030303030313030 0000000100 +30303030303031303030 0000001000 +30303030303130303030 0000010000 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(20) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303030303030303030303030303031 00000000000000000001 +3030303030303030303030303030303030303130 00000000000000000010 +3030303030303030303030303030303030313030 00000000000000000100 +3030303030303030303030303030303031303030 00000000000000001000 +3030303030303030303030303030303130303030 00000000000000010000 +drop table t1; +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030312E31 0000000001.1 +303030303030303031302E31 0000000010.1 +303030303030303130302E31 0000000100.1 +303030303030313030302E31 0000001000.1 +303030303031303030302E31 0000010000.1 +drop table t1; +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(22) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303030303030303030303030312E31 00000000000000000001.1 +30303030303030303030303030303030303031302E31 00000000000000000010.1 +30303030303030303030303030303030303130302E31 00000000000000000100.1 +30303030303030303030303030303030313030302E31 00000000000000001000.1 +30303030303030303030303030303031303030302E31 00000000000000010000.1 +drop table t1; +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +3031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +32303031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bit(64)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0000000000000001 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +hex(concat(a)) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +select concat(a) from t1; +concat(a) +0000-00-00 00:00:00 +2001-02-03 04:05:06 +1980-02-03 04:05:06 +2001-02-03 04:05:06 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D3033 +323030312D30322D3033 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +hex(concat(a)) +30303A30303A3031 +30313A30323A3033 +select concat(a) from t1; +concat(a) +00:00:01 +01:02:03 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(8) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(3) YES NULL +select hex(a) from v1; +hex(a) +303031 +303130 +313030 +drop table t1; +drop view v1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(30) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030303030303030303030303030303030303030303031 +303030303030303030303030303030303030303030303030303030303130 +303030303030303030303030303030303030303030303030303030313030 +drop table t1; +drop view v1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E3435 +drop table t1; +drop view v1; +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(6) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(5) YES NULL +select hex(a) from v1; +hex(a) +3030303031 +3030303130 +3030313030 +3031303030 +3130303030 +drop table t1; +drop view v1; +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(9) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +3030303030303031 +3030303030303130 +3030303030313030 +3030303031303030 +3030303130303030 +drop table t1; +drop view v1; +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(11) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303031 +30303030303030303130 +30303030303030313030 +30303030303031303030 +30303030303130303030 +drop table t1; +drop view v1; +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +3030303030303030303030303030303030303031 +3030303030303030303030303030303030303130 +3030303030303030303030303030303030313030 +3030303030303030303030303030303031303030 +3030303030303030303030303030303130303030 +drop table t1; +drop view v1; +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030312E31 +303030303030303031302E31 +303030303030303130302E31 +303030303030313030302E31 +303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +concat(a) +123.456 +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303030303030303030303030312E31 +30303030303030303030303030303030303031302E31 +30303030303030303030303030303030303130302E31 +30303030303030303030303030303030313030302E31 +30303030303030303030303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(2) YES NULL +select hex(a) from v1; +hex(a) +3031 +drop table t1; +drop view v1; +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +32303031 +drop table t1; +drop view v1; +create table t1 (a bit(64)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(64) YES NULL +select hex(a) from v1; +hex(a) +0000000000000001 +drop table t1; +drop view v1; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) NO +select hex(a) from v1; +hex(a) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D3033 +323030312D30322D3033 +drop table t1; +drop view v1; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +30303A30303A3031 +30313A30323A3033 +drop table t1; +drop view v1; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +set @a= f1(1); +select hex(@a); +hex(@a) +1 +select hex(concat(f1(1))); +hex(concat(f1(1))) +31 +create table t1 as select f1(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(11) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` decimal(18,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(20) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(12) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +hex(@a) +323030312D30312D3032 +select hex(concat(f1(cast('2001-01-02' as date)))); +hex(concat(f1(cast('2001-01-02' as date)))) +323030312D30312D3032 +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +drop view v1; +drop function f1; +# +# End of WL#2649 Number-to-string conversions +# +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 763acd0fea0..61d663b7e76 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -409,3 +409,2583 @@ select hex(cast(_ascii 0x7f as char(1) character set latin1)); hex(cast(_ascii 0x7f as char(1) character set latin1)) 7F End of 5.0 tests +# +# Start of 5.5 tests +# +# +# Start of WL#2649 Number-to-string conversions +# +select hex(concat(1)); +hex(concat(1)) +31 +create table t1 as select concat(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +31 +drop table t1; +select hex(concat(18446744073709551615)); +hex(concat(18446744073709551615)) +3138343436373434303733373039353531363135 +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +3138343436373434303733373039353531363135 +drop table t1; +select hex(concat(1.1)); +hex(concat(1.1)) +312E31 +create table t1 as select concat(1.1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +312E31 +drop table t1; +select hex(concat('a', 1+2)), charset(concat(1+2)); +hex(concat('a', 1+2)) charset(concat(1+2)) +6133 latin1 +create table t1 as select concat(1+2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1-2)); +hex(concat(1-2)) +2D31 +create table t1 as select concat(1-2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1*2)); +hex(concat(1*2)) +32 +create table t1 as select concat(1*2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1/2)); +hex(concat(1/2)) +302E35303030 +create table t1 as select concat(1/2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 div 2)); +hex(concat(1 div 2)) +30 +create table t1 as select concat(1 div 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 % 2)); +hex(concat(1 % 2)) +31 +create table t1 as select concat(1 % 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-1)); +hex(concat(-1)) +2D31 +create table t1 as select concat(-1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-(1+2))); +hex(concat(-(1+2))) +2D33 +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1|2)); +hex(concat(1|2)) +33 +create table t1 as select concat(1|2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1&2)); +hex(concat(1&2)) +30 +create table t1 as select concat(1&2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_count(12))); +hex(concat(bit_count(12))) +32 +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2<<1)); +hex(concat(2<<1)) +34 +create table t1 as select concat(2<<1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2>>1)); +hex(concat(2>>1)) +31 +create table t1 as select concat(2>>1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(~0)); +hex(concat(~0)) +3138343436373434303733373039353531363135 +create table t1 as select concat(~0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(3^2)); +hex(concat(3^2)) +31 +create table t1 as select concat(3^2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(abs(-2))); +hex(concat(abs(-2))) +32 +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(exp(2)),1)); +hex(left(concat(exp(2)),1)) +37 +create table t1 as select concat(exp(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log(2)),1)); +hex(left(concat(log(2)),1)) +30 +create table t1 as select concat(log(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log2(2)),1)); +hex(left(concat(log2(2)),1)) +31 +create table t1 as select concat(log2(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log10(2)),1)); +hex(left(concat(log10(2)),1)) +30 +create table t1 as select concat(log10(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sqrt(2)),1)); +hex(left(concat(sqrt(2)),1)) +31 +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(pow(2,2)),1)); +hex(left(concat(pow(2,2)),1)) +34 +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(acos(0.5)),1)); +hex(left(concat(acos(0.5)),1)) +31 +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(asin(0.5)),1)); +hex(left(concat(asin(0.5)),1)) +30 +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(atan(0.5)),1)); +hex(left(concat(atan(0.5)),1)) +30 +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(cos(0.5)),1)); +hex(left(concat(cos(0.5)),1)) +30 +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sin(0.5)),1)); +hex(left(concat(sin(0.5)),1)) +30 +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(tan(0.5)),1)); +hex(left(concat(tan(0.5)),1)) +30 +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(degrees(0))); +hex(concat(degrees(0))) +30 +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(radians(0))); +hex(concat(radians(0))) +30 +create table t1 as select concat(radians(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ceiling(0.5))); +hex(concat(ceiling(0.5))) +31 +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(floor(0.5))); +hex(concat(floor(0.5))) +30 +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(round(0.5))); +hex(concat(round(0.5))) +31 +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sign(0.5))); +hex(concat(sign(0.5))) +31 +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(rand()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(length('a'))); +hex(concat(length('a'))) +31 +create table t1 as select concat(length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(char_length('a'))); +hex(concat(char_length('a'))) +31 +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_length('a'))); +hex(concat(bit_length('a'))) +38 +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coercibility('a'))); +hex(concat(coercibility('a'))) +34 +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(locate('a','a'))); +hex(concat(locate('a','a'))) +31 +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(field('c','a','b','c'))); +hex(concat(field('c','a','b','c'))) +33 +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ascii(61))); +hex(concat(ascii(61))) +3534 +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ord(61))); +hex(concat(ord(61))) +3534 +create table t1 as select concat(ord(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(find_in_set('b','a,b,c,d'))); +hex(concat(find_in_set('b','a,b,c,d'))) +32 +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select md5('a'), hex(md5('a')); +md5('a') hex(md5('a')) +0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631 +create table t1 as select md5('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(32) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select old_password('a'), hex(old_password('a')); +old_password('a') hex(old_password('a')) +60671c896665c3fa 36303637316338393636363563336661 +create table t1 as select old_password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(16) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select password('a'), hex(password('a')); +password('a') hex(password('a')) +*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445 +create table t1 as select password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(41) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha('a'), hex(sha('a')); +sha('a') hex(sha('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha1('a'), hex(sha1('a')); +sha1('a') hex(sha1('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha1('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('-1' as signed))); +hex(concat(cast('-1' as signed))) +2D31 +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('1' as unsigned))); +hex(concat(cast('1' as unsigned))) +31 +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast(1/2 as decimal(5,5)))); +hex(concat(cast(1/2 as decimal(5,5)))) +302E3530303030 +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as date))); +hex(concat(cast('2001-01-02 03:04:05' as date))) +323030312D30312D3032 +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as time))); +hex(concat(cast('2001-01-02 03:04:05' as time))) +30333A30343A3035 +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +03:04:05 +drop table t1; +select hex(concat(cast('2001-01-02' as datetime))); +hex(concat(cast('2001-01-02' as datetime))) +323030312D30312D30322030303A30303A3030 +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 00:00:00 +drop table t1; +select hex(concat(least(1,2))); +hex(concat(least(1,2))) +31 +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(greatest(1,2))); +hex(concat(greatest(1,2))) +32 +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(case when 11 then 22 else 33 end)); +hex(concat(case when 11 then 22 else 33 end)) +3232 +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coalesce(1,2))); +hex(concat(coalesce(1,2))) +31 +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat_ws(1,2,3)); +hex(concat_ws(1,2,3)) +323133 +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(group_concat(1,2,3)); +hex(group_concat(1,2,3)) +313233 +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` text +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1 order by c1; +hex(c1) +31 +61 +drop table t1; +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(benchmark(0,0))); +hex(concat(benchmark(0,0))) +30 +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sleep(0))); +hex(concat(sleep(0))) +30 +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(get_lock('a',0))); +hex(concat(get_lock('a',0))) +31 +select hex(concat(release_lock('a'))); +hex(concat(release_lock('a'))) +31 +create table t1 as select concat(get_lock('a',0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(is_free_lock('xxxx'))); +hex(concat(is_free_lock('xxxx'))) +31 +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(crc32(''))); +hex(concat(crc32(''))) +30 +create table t1 as select concat(crc32('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(uncompressed_length(''))); +hex(concat(uncompressed_length(''))) +30 +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(connection_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_aton('127.1.1.1'))); +hex(concat(inet_aton('127.1.1.1'))) +32313330373732323235 +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_ntoa(2130772225))); +hex(concat(inet_ntoa(2130772225))) +3132372E312E312E31 +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +c1 +127.1.1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(31) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(row_count())); +hex(concat(row_count())) +2D31 +create table t1 as select concat(row_count()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(found_rows())); +hex(concat(found_rows())) +30 +create table t1 as select concat(found_rows()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +coercibility(uuid()) coercibility(cast('a' as char character set latin1)) +4 2 +select charset(concat(uuid(), cast('a' as char character set latin1))); +charset(concat(uuid(), cast('a' as char character set latin1))) +latin1 +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1)); +hex(concat(@a1:=1)) +31 +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +hex(c1) +32 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '', + `c2` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1; +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL, + `c2` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=sqrt(1))); +hex(concat(@a1:=sqrt(1))) +31 +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=sqrt(1); +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1.1)); +hex(concat(@a1:=1.1)) +312E31 +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '', + `c2` decimal(2,1) NOT NULL DEFAULT '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1.1; +select hex(concat(@a2)); +hex(concat(@a2)) +312E31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(83) DEFAULT NULL, + `c2` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@@ft_max_word_len)); +hex(concat(@@ft_max_word_len)) +3834 +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +hex(c1) +3834 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS TRUE)); +hex(concat('a'='a' IS TRUE)) +31 +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS NOT TRUE)); +hex(concat('a'='a' IS NOT TRUE)) +30 +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NOT 'a'='a')); +hex(concat(NOT 'a'='a')) +30 +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NULL)); +hex(concat('a' IS NULL)) +30 +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NOT NULL)); +hex(concat('a' IS NOT NULL)) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' rlike 'a')); +hex(concat('a' rlike 'a')) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(strcmp('a','b'))); +hex(concat(strcmp('a','b'))) +2D31 +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' like 'a')); +hex(concat('a' like 'a')) +31 +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' between 'b' and 'c')); +hex(concat('a' between 'b' and 'c')) +30 +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' in ('a','b'))); +hex(concat('a' in ('a','b'))) +31 +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +hex(concat(interval(23, 1, 15, 17, 30, 44, 200))) +33 +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +hex(concat(match (a) against ('a'))) +30 +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +select hex(ifnull(1,'a')); +hex(ifnull(1,'a')) +31 +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1,1))); +hex(concat(ifnull(1,1))) +31 +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1.1,1.1))); +hex(concat(ifnull(1.1,1.1))) +312E31 +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,'b',1)); +hex(if(1,'b',1)) +62 +create table t1 as select if(1,'b',1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,1,'b')); +hex(if(1,1,'b')) +31 +create table t1 as select if(1,1,'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(if(1,1,1))); +hex(concat(if(1,1,1))) +31 +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(nullif(1,2))); +hex(concat(nullif(1,2))) +31 +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))) +31 +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +32 +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))) +32 +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +30 +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))) +31 +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +hex(concat(IsSimple(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))) +30 +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))) +31 +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; +select hex(concat(x(GeomFromText('Point(1 2)')))); +hex(concat(x(GeomFromText('Point(1 2)')))) +31 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(y(GeomFromText('Point(1 2)')))); +hex(concat(y(GeomFromText('Point(1 2)')))) +32 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))) +31 +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))) +31 +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +hex(concat(GeometryType(GeomFromText('Point(1 2)')))) +504F494E54 +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +hex(concat(AsText(GeomFromText('Point(1 2)')))) +504F494E542831203229 +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` longtext +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_add(200902, 2))); +hex(concat(period_add(200902, 2))) +323030393034 +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_diff(200902, 200802))); +hex(concat(period_diff(200902, 200802))) +3132 +create table t1 as select concat(period_add(200902, 200802)) as c1; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(to_days(20090224))); +hex(concat(to_days(20090224))) +373333383237 +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofmonth(20090224))); +hex(concat(dayofmonth(20090224))) +3234 +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofyear(20090224))); +hex(concat(dayofyear(20090224))) +3535 +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(hour('10:11:12'))); +hex(concat(hour('10:11:12'))) +3130 +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(minute('10:11:12'))); +hex(concat(minute('10:11:12'))) +3131 +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(second('10:11:12'))); +hex(concat(second('10:11:12'))) +3132 +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(quarter(20090224))); +hex(concat(quarter(20090224))) +31 +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(week(20090224))); +hex(concat(week(20090224))) +38 +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(yearweek(20090224))); +hex(concat(yearweek(20090224))) +323030393038 +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(year(20090224))); +hex(concat(year(20090224))) +32303039 +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(weekday(20090224))); +hex(concat(weekday(20090224))) +31 +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofweek(20090224))); +hex(concat(dayofweek(20090224))) +33 +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(unix_timestamp(20090224))); +hex(concat(unix_timestamp(20090224))) +31323335343232383030 +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(time_to_sec('10:11:12'))); +hex(concat(time_to_sec('10:11:12'))) +3336363732 +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(extract(year from 20090702))); +hex(concat(extract(year from 20090702))) +32303039 +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(microsecond('12:00:00.123456'))); +hex(concat(microsecond('12:00:00.123456'))) +313233343536 +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(month(20090224))); +hex(concat(month(20090224))) +32 +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2003-02-28 323030332D30322D3238 +drop table t1; +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2000-07-03 323030302D30372D3033 +drop table t1; +create table t1 as select concat(curdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_date()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(curtime()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +c1 hex(c1) +2008-07-18 323030382D30372D3138 +08:42:04 30383A34323A3034 +drop table t1; +create table t1 as select concat(utc_time()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sec_to_time(2378))); +hex(concat(sec_to_time(2378))) +30303A33393A3338 +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))) +32343A30303A3030 +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(maketime(10,11,12))); +hex(concat(maketime(10,11,12))) +31303A31313A3132 +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(get_format(DATE,'USA')); +hex(get_format(DATE,'USA')) +256D2E25642E2559 +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(17) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(from_unixtime(1111885200)),4)); +hex(left(concat(from_unixtime(1111885200)),4)) +32303035 +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))) +323030332D31322D33312032303A30303A3030 +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))) +323030342D30312D30322031323A30303A3030 +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2004-01-02 12:00:00 +drop table t1; +select hex(concat(makedate(2009,1))); +hex(concat(makedate(2009,1))) +323030392D30312D3031 +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2009-01-01 +drop table t1; +create table t1 as select concat(now()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(sysdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(addtime('00:00:00','11:22:33'))); +hex(concat(addtime('00:00:00','11:22:33'))) +31313A32323A3333 +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(subtime('23:59:59','11:22:33'))); +hex(concat(subtime('23:59:59','11:22:33'))) +31323A33373A3236 +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(elt(1,2,3)); +hex(elt(1,2,3)) +32 +create table t1 as select elt(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(export_set(1,2,3,4,2)); +hex(export_set(1,2,3,4,2)) +323433 +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(127) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(insert(1133,3,0,22)); +hex(insert(1133,3,0,22)) +313132323333 +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lcase(123)); +hex(lcase(123)) +313233 +create table t1 as select lcase(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(123,1)); +hex(left(123,1)) +31 +create table t1 as select left(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lower(123)); +hex(lower(123)) +313233 +create table t1 as select lower(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lpad(1,2,0)); +hex(lpad(1,2,0)) +3031 +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ltrim(1)); +hex(ltrim(1)) +31 +create table t1 as select ltrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(mid(1,1,1)); +hex(mid(1,1,1)) +31 +create table t1 as select mid(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(repeat(1,2)); +hex(repeat(1,2)) +3131 +create table t1 as select repeat(1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(replace(1,1,2)); +hex(replace(1,1,2)) +32 +create table t1 as select replace(1,1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(reverse(12)); +hex(reverse(12)) +3231 +create table t1 as select reverse(12) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(right(123,1)); +hex(right(123,1)) +33 +create table t1 as select right(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rpad(1,2,0)); +hex(rpad(1,2,0)) +3130 +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rtrim(1)); +hex(rtrim(1)) +31 +create table t1 as select rtrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(soundex(1)); +hex(soundex(1)) + +create table t1 as select soundex(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(substring(1,1,1)); +hex(substring(1,1,1)) +31 +create table t1 as select substring(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(trim(1)); +hex(trim(1)) +31 +create table t1 as select trim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ucase(1)); +hex(ucase(1)) +31 +create table t1 as select ucase(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(upper(1)); +hex(upper(1)) +31 +create table t1 as select upper(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +a hex(a) +1.1 312E31 +2.1 322E31 +update t1 set a= a + 0.1; +select a, hex(a) from t1; +a hex(a) +1.2000000000000002 312E32303030303030303030303030303032 +2.2 322E32 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303031 001 +303130 010 +313030 100 +drop table t1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030303030303030303030303030303030303030303031 000000000000000000000000000001 +303030303030303030303030303030303030303030303030303030303130 000000000000000000000000000010 +303030303030303030303030303030303030303030303030303030313030 000000000000000000000000000100 +drop table t1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E3435 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303031 00001 +3030303130 00010 +3030313030 00100 +3031303030 01000 +3130303030 10000 +drop table t1; +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303031 00000001 +3030303030303130 00000010 +3030303030313030 00000100 +3030303031303030 00001000 +3030303130303030 00010000 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303031 0000000001 +30303030303030303130 0000000010 +30303030303030313030 0000000100 +30303030303031303030 0000001000 +30303030303130303030 0000010000 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303030303030303030303030303031 00000000000000000001 +3030303030303030303030303030303030303130 00000000000000000010 +3030303030303030303030303030303030313030 00000000000000000100 +3030303030303030303030303030303031303030 00000000000000001000 +3030303030303030303030303030303130303030 00000000000000010000 +drop table t1; +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030312E31 0000000001.1 +303030303030303031302E31 0000000010.1 +303030303030303130302E31 0000000100.1 +303030303030313030302E31 0000001000.1 +303030303031303030302E31 0000010000.1 +drop table t1; +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(22) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303030303030303030303030312E31 00000000000000000001.1 +30303030303030303030303030303030303031302E31 00000000000000000010.1 +30303030303030303030303030303030303130302E31 00000000000000000100.1 +30303030303030303030303030303030313030302E31 00000000000000001000.1 +30303030303030303030303030303031303030302E31 00000000000000010000.1 +drop table t1; +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +3031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +32303031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bit(64)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0000000000000001 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +hex(concat(a)) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +select concat(a) from t1; +concat(a) +0000-00-00 00:00:00 +2001-02-03 04:05:06 +1980-02-03 04:05:06 +2001-02-03 04:05:06 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D3033 +323030312D30322D3033 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +hex(concat(a)) +30303A30303A3031 +30313A30323A3033 +select concat(a) from t1; +concat(a) +00:00:01 +01:02:03 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(3) YES NULL +select hex(a) from v1; +hex(a) +303031 +303130 +313030 +drop table t1; +drop view v1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(30) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030303030303030303030303030303030303030303031 +303030303030303030303030303030303030303030303030303030303130 +303030303030303030303030303030303030303030303030303030313030 +drop table t1; +drop view v1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E3435 +drop table t1; +drop view v1; +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(6) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(5) YES NULL +select hex(a) from v1; +hex(a) +3030303031 +3030303130 +3030313030 +3031303030 +3130303030 +drop table t1; +drop view v1; +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(9) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +3030303030303031 +3030303030303130 +3030303030313030 +3030303031303030 +3030303130303030 +drop table t1; +drop view v1; +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(11) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303031 +30303030303030303130 +30303030303030313030 +30303030303031303030 +30303030303130303030 +drop table t1; +drop view v1; +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +3030303030303030303030303030303030303031 +3030303030303030303030303030303030303130 +3030303030303030303030303030303030313030 +3030303030303030303030303030303031303030 +3030303030303030303030303030303130303030 +drop table t1; +drop view v1; +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030312E31 +303030303030303031302E31 +303030303030303130302E31 +303030303030313030302E31 +303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +concat(a) +123.456 +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303030303030303030303030312E31 +30303030303030303030303030303030303031302E31 +30303030303030303030303030303030303130302E31 +30303030303030303030303030303030313030302E31 +30303030303030303030303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(2) YES NULL +select hex(a) from v1; +hex(a) +3031 +drop table t1; +drop view v1; +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +32303031 +drop table t1; +drop view v1; +create table t1 (a bit(64)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(64) YES NULL +select hex(a) from v1; +hex(a) +0000000000000001 +drop table t1; +drop view v1; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) NO +select hex(a) from v1; +hex(a) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D3033 +323030312D30322D3033 +drop table t1; +drop view v1; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +30303A30303A3031 +30313A30323A3033 +drop table t1; +drop view v1; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +set @a= f1(1); +select hex(@a); +hex(@a) +1 +select hex(concat(f1(1))); +hex(concat(f1(1))) +31 +create table t1 as select f1(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(11) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` decimal(18,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(20) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(12) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +hex(@a) +323030312D30312D3032 +select hex(concat(f1(cast('2001-01-02' as date)))); +hex(concat(f1(cast('2001-01-02' as date)))) +323030312D30312D3032 +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +drop view v1; +drop function f1; +# +# End of WL#2649 Number-to-string conversions +# +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index abb21b7cee7..f547c4e8b8c 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -982,12 +982,12 @@ ALTER TABLE t2 ADD a int NOT NULL AFTER status; DROP TABLE t1,t2; select password(name) from bug20536; password(name) -???????????????????? -???????????????????? +*286C12C0F32248BD65B30EE65F3ECFB2AA3F7849 +*947A5674312754578F132655C74A11533B105FF6 select old_password(name) from bug20536; old_password(name) -???????? -???????? +10e155cb44e2adb5 +14e500b131773991 select quote(name) from bug20536; quote(name) ???????? @@ -1231,3 +1231,2586 @@ HEX(DAYNAME(19700101)) 0427043504420432043504400433 SET character_set_connection=latin1; End of 5.0 tests +# +# Start of 5.5 tests +# +SET NAMES latin1; +SET collation_connection=ucs2_general_ci; +# +# Start of WL#2649 Number-to-string conversions +# +select hex(concat(1)); +hex(concat(1)) +0031 +create table t1 as select concat(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +0031 +drop table t1; +select hex(concat(18446744073709551615)); +hex(concat(18446744073709551615)) +00310038003400340036003700340034003000370033003700300039003500350031003600310035 +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +00310038003400340036003700340034003000370033003700300039003500350031003600310035 +drop table t1; +select hex(concat(1.1)); +hex(concat(1.1)) +0031002E0031 +create table t1 as select concat(1.1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +0031002E0031 +drop table t1; +select hex(concat('a', 1+2)), charset(concat(1+2)); +hex(concat('a', 1+2)) charset(concat(1+2)) +00610033 ucs2 +create table t1 as select concat(1+2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1-2)); +hex(concat(1-2)) +002D0031 +create table t1 as select concat(1-2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1*2)); +hex(concat(1*2)) +0032 +create table t1 as select concat(1*2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1/2)); +hex(concat(1/2)) +0030002E0035003000300030 +create table t1 as select concat(1/2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 div 2)); +hex(concat(1 div 2)) +0030 +create table t1 as select concat(1 div 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 % 2)); +hex(concat(1 % 2)) +0031 +create table t1 as select concat(1 % 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-1)); +hex(concat(-1)) +002D0031 +create table t1 as select concat(-1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-(1+2))); +hex(concat(-(1+2))) +002D0033 +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1|2)); +hex(concat(1|2)) +0033 +create table t1 as select concat(1|2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1&2)); +hex(concat(1&2)) +0030 +create table t1 as select concat(1&2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_count(12))); +hex(concat(bit_count(12))) +0032 +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2<<1)); +hex(concat(2<<1)) +0034 +create table t1 as select concat(2<<1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2>>1)); +hex(concat(2>>1)) +0031 +create table t1 as select concat(2>>1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(~0)); +hex(concat(~0)) +00310038003400340036003700340034003000370033003700300039003500350031003600310035 +create table t1 as select concat(~0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(3^2)); +hex(concat(3^2)) +0031 +create table t1 as select concat(3^2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(abs(-2))); +hex(concat(abs(-2))) +0032 +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(exp(2)),1)); +hex(left(concat(exp(2)),1)) +0037 +create table t1 as select concat(exp(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log(2)),1)); +hex(left(concat(log(2)),1)) +0030 +create table t1 as select concat(log(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log2(2)),1)); +hex(left(concat(log2(2)),1)) +0031 +create table t1 as select concat(log2(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log10(2)),1)); +hex(left(concat(log10(2)),1)) +0030 +create table t1 as select concat(log10(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sqrt(2)),1)); +hex(left(concat(sqrt(2)),1)) +0031 +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(pow(2,2)),1)); +hex(left(concat(pow(2,2)),1)) +0034 +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(acos(0.5)),1)); +hex(left(concat(acos(0.5)),1)) +0031 +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(asin(0.5)),1)); +hex(left(concat(asin(0.5)),1)) +0030 +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(atan(0.5)),1)); +hex(left(concat(atan(0.5)),1)) +0030 +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(cos(0.5)),1)); +hex(left(concat(cos(0.5)),1)) +0030 +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sin(0.5)),1)); +hex(left(concat(sin(0.5)),1)) +0030 +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(tan(0.5)),1)); +hex(left(concat(tan(0.5)),1)) +0030 +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(degrees(0))); +hex(concat(degrees(0))) +0030 +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(radians(0))); +hex(concat(radians(0))) +0030 +create table t1 as select concat(radians(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ceiling(0.5))); +hex(concat(ceiling(0.5))) +0031 +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(floor(0.5))); +hex(concat(floor(0.5))) +0030 +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(round(0.5))); +hex(concat(round(0.5))) +0031 +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sign(0.5))); +hex(concat(sign(0.5))) +0031 +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(rand()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(length('a'))); +hex(concat(length('a'))) +0032 +create table t1 as select concat(length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(char_length('a'))); +hex(concat(char_length('a'))) +0031 +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_length('a'))); +hex(concat(bit_length('a'))) +00310036 +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coercibility('a'))); +hex(concat(coercibility('a'))) +0034 +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(locate('a','a'))); +hex(concat(locate('a','a'))) +0031 +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(field('c','a','b','c'))); +hex(concat(field('c','a','b','c'))) +0033 +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ascii(61))); +hex(concat(ascii(61))) +00350034 +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ord(61))); +hex(concat(ord(61))) +00350034 +create table t1 as select concat(ord(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(find_in_set('b','a,b,c,d'))); +hex(concat(find_in_set('b','a,b,c,d'))) +0032 +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select md5('a'), hex(md5('a')); +md5('a') hex(md5('a')) +760f753576f2955b0074758acb4d5fa6 00370036003000660037003500330035003700360066003200390035003500620030003000370034003700350038006100630062003400640035006600610036 +create table t1 as select md5('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(32) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select old_password('a'), hex(old_password('a')); +old_password('a') hex(old_password('a')) +0705298948d1f92f 0030003700300035003200390038003900340038006400310066003900320066 +create table t1 as select old_password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(16) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select password('a'), hex(password('a')); +password('a') hex(password('a')) +*9A48A662559C49521B25C43077059DD109FBD84A 002A0039004100340038004100360036003200350035003900430034003900350032003100420032003500430034003300300037003700300035003900440044003100300039004600420044003800340041 +create table t1 as select password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(41) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha('a'), hex(sha('a')); +sha('a') hex(sha('a')) +3106600e0327ca77371f2526df794ed84322585c 0033003100300036003600300030006500300033003200370063006100370037003300370031006600320035003200360064006600370039003400650064003800340033003200320035003800350063 +create table t1 as select sha('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha1('a'), hex(sha1('a')); +sha1('a') hex(sha1('a')) +3106600e0327ca77371f2526df794ed84322585c 0033003100300036003600300030006500300033003200370063006100370037003300370031006600320035003200360064006600370039003400650064003800340033003200320035003800350063 +create table t1 as select sha1('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('-1' as signed))); +hex(concat(cast('-1' as signed))) +002D0031 +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('1' as unsigned))); +hex(concat(cast('1' as unsigned))) +0031 +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast(1/2 as decimal(5,5)))); +hex(concat(cast(1/2 as decimal(5,5)))) +0030002E00350030003000300030 +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as date))); +hex(concat(cast('2001-01-02 03:04:05' as date))) +0032003000300031002D00300031002D00300032 +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as time))); +hex(concat(cast('2001-01-02 03:04:05' as time))) +00300033003A00300034003A00300035 +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +03:04:05 +drop table t1; +select hex(concat(cast('2001-01-02' as datetime))); +hex(concat(cast('2001-01-02' as datetime))) +0032003000300031002D00300031002D00300032002000300030003A00300030003A00300030 +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 00:00:00 +drop table t1; +select hex(concat(least(1,2))); +hex(concat(least(1,2))) +0031 +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(greatest(1,2))); +hex(concat(greatest(1,2))) +0032 +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(case when 11 then 22 else 33 end)); +hex(concat(case when 11 then 22 else 33 end)) +00320032 +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coalesce(1,2))); +hex(concat(coalesce(1,2))) +0031 +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat_ws(1,2,3)); +hex(concat_ws(1,2,3)) +003200310033 +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(group_concat(1,2,3)); +hex(group_concat(1,2,3)) +003100320033 +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(512) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1 order by c1; +hex(c1) +0031 +0061 +drop table t1; +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(benchmark(0,0))); +hex(concat(benchmark(0,0))) +0030 +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sleep(0))); +hex(concat(sleep(0))) +0030 +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(get_lock('a',0))); +hex(concat(get_lock('a',0))) +0031 +select hex(concat(release_lock('a'))); +hex(concat(release_lock('a'))) +0031 +create table t1 as select concat(get_lock('a',0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(is_free_lock('xxxx'))); +hex(concat(is_free_lock('xxxx'))) +0031 +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(crc32(''))); +hex(concat(crc32(''))) +0030 +create table t1 as select concat(crc32('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(uncompressed_length(''))); +hex(concat(uncompressed_length(''))) +0030 +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(connection_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_aton('127.1.1.1'))); +hex(concat(inet_aton('127.1.1.1'))) +0032003100330030003700370032003200320035 +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_ntoa(2130772225))); +hex(concat(inet_ntoa(2130772225))) +003100320037002E0031002E0031002E0031 +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +c1 +127.1.1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(31) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(row_count())); +hex(concat(row_count())) +002D0031 +create table t1 as select concat(row_count()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(found_rows())); +hex(concat(found_rows())) +0030 +create table t1 as select concat(found_rows()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +coercibility(uuid()) coercibility(cast('a' as char character set latin1)) +4 2 +select charset(concat(uuid(), cast('a' as char character set latin1))); +charset(concat(uuid(), cast('a' as char character set latin1))) +latin1 +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1)); +hex(concat(@a1:=1)) +0031 +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +hex(c1) +0032 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '', + `c2` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1; +select hex(concat(@a2)); +hex(concat(@a2)) +0031 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +0031 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET ucs2 DEFAULT NULL, + `c2` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=sqrt(1))); +hex(concat(@a1:=sqrt(1))) +0031 +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +hex(c1) +0031 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=sqrt(1); +select hex(concat(@a2)); +hex(concat(@a2)) +0031 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +0031 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1.1)); +hex(concat(@a1:=1.1)) +0031002E0031 +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +hex(c1) +0031002E0031 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '', + `c2` decimal(2,1) NOT NULL DEFAULT '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1.1; +select hex(concat(@a2)); +hex(concat(@a2)) +0031002E0031 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +0031002E0031 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(83) CHARACTER SET ucs2 DEFAULT NULL, + `c2` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@@ft_max_word_len)); +hex(concat(@@ft_max_word_len)) +00380034 +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +hex(c1) +00380034 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS TRUE)); +hex(concat('a'='a' IS TRUE)) +0031 +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS NOT TRUE)); +hex(concat('a'='a' IS NOT TRUE)) +0030 +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NOT 'a'='a')); +hex(concat(NOT 'a'='a')) +0030 +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NULL)); +hex(concat('a' IS NULL)) +0030 +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NOT NULL)); +hex(concat('a' IS NOT NULL)) +0031 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' rlike 'a')); +hex(concat('a' rlike 'a')) +0031 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(strcmp('a','b'))); +hex(concat(strcmp('a','b'))) +002D0031 +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' like 'a')); +hex(concat('a' like 'a')) +0031 +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' between 'b' and 'c')); +hex(concat('a' between 'b' and 'c')) +0030 +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' in ('a','b'))); +hex(concat('a' in ('a','b'))) +0031 +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +hex(concat(interval(23, 1, 15, 17, 30, 44, 200))) +0033 +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +hex(concat(match (a) against ('a'))) +0030 +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +select hex(ifnull(1,'a')); +hex(ifnull(1,'a')) +0031 +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1,1))); +hex(concat(ifnull(1,1))) +0031 +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1.1,1.1))); +hex(concat(ifnull(1.1,1.1))) +0031002E0031 +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,'b',1)); +hex(if(1,'b',1)) +0062 +create table t1 as select if(1,'b',1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,1,'b')); +hex(if(1,1,'b')) +0031 +create table t1 as select if(1,1,'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(if(1,1,1))); +hex(concat(if(1,1,1))) +0031 +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(nullif(1,2))); +hex(concat(nullif(1,2))) +0031 +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))) +0031 +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +0032 +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))) +0032 +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +0030 +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))) +0031 +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))) +0030 +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +hex(concat(IsSimple(GeomFromText('POINT(1 1)')))) +0030 +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))) +0030 +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))) +0031 +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; +select hex(concat(x(GeomFromText('Point(1 2)')))); +hex(concat(x(GeomFromText('Point(1 2)')))) +0031 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(y(GeomFromText('Point(1 2)')))); +hex(concat(y(GeomFromText('Point(1 2)')))) +0032 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))) +0031 +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))) +0031 +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +hex(concat(GeometryType(GeomFromText('Point(1 2)')))) +0050004F0049004E0054 +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +hex(concat(AsText(GeomFromText('Point(1 2)')))) +0050004F0049004E005400280031002000320029 +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` longtext CHARACTER SET ucs2 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_add(200902, 2))); +hex(concat(period_add(200902, 2))) +003200300030003900300034 +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_diff(200902, 200802))); +hex(concat(period_diff(200902, 200802))) +00310032 +create table t1 as select concat(period_add(200902, 200802)) as c1; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(to_days(20090224))); +hex(concat(to_days(20090224))) +003700330033003800320037 +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofmonth(20090224))); +hex(concat(dayofmonth(20090224))) +00320034 +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofyear(20090224))); +hex(concat(dayofyear(20090224))) +00350035 +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(hour('10:11:12'))); +hex(concat(hour('10:11:12'))) +00310030 +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(minute('10:11:12'))); +hex(concat(minute('10:11:12'))) +00310031 +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(second('10:11:12'))); +hex(concat(second('10:11:12'))) +00310032 +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(quarter(20090224))); +hex(concat(quarter(20090224))) +0031 +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(week(20090224))); +hex(concat(week(20090224))) +0038 +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(yearweek(20090224))); +hex(concat(yearweek(20090224))) +003200300030003900300038 +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(year(20090224))); +hex(concat(year(20090224))) +0032003000300039 +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(weekday(20090224))); +hex(concat(weekday(20090224))) +0031 +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofweek(20090224))); +hex(concat(dayofweek(20090224))) +0033 +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(unix_timestamp(20090224))); +hex(concat(unix_timestamp(20090224))) +0031003200330035003400320032003800300030 +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(time_to_sec('10:11:12'))); +hex(concat(time_to_sec('10:11:12'))) +00330036003600370032 +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(extract(year from 20090702))); +hex(concat(extract(year from 20090702))) +0032003000300039 +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(microsecond('12:00:00.123456'))); +hex(concat(microsecond('12:00:00.123456'))) +003100320033003400350036 +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(month(20090224))); +hex(concat(month(20090224))) +0032 +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2003-02-28 0032003000300033002D00300032002D00320038 +drop table t1; +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2000-07-03 0032003000300030002D00300037002D00300033 +drop table t1; +create table t1 as select concat(curdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_date()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(curtime()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +c1 hex(c1) +2008-07-18 0032003000300038002D00300037002D00310038 +08:42:04 00300038003A00340032003A00300034 +drop table t1; +create table t1 as select concat(utc_time()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sec_to_time(2378))); +hex(concat(sec_to_time(2378))) +00300030003A00330039003A00330038 +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))) +00320034003A00300030003A00300030 +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(maketime(10,11,12))); +hex(concat(maketime(10,11,12))) +00310030003A00310031003A00310032 +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(get_format(DATE,'USA')); +hex(get_format(DATE,'USA')) +0025006D002E00250064002E00250059 +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(17) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(from_unixtime(1111885200)),4)); +hex(left(concat(from_unixtime(1111885200)),4)) +0032003000300035 +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))) +0032003000300033002D00310032002D00330031002000320030003A00300030003A00300030 +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))) +0032003000300034002D00300031002D00300032002000310032003A00300030003A00300030 +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2004-01-02 12:00:00 +drop table t1; +select hex(concat(makedate(2009,1))); +hex(concat(makedate(2009,1))) +0032003000300039002D00300031002D00300031 +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2009-01-01 +drop table t1; +create table t1 as select concat(now()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(sysdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(addtime('00:00:00','11:22:33'))); +hex(concat(addtime('00:00:00','11:22:33'))) +00310031003A00320032003A00330033 +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(subtime('23:59:59','11:22:33'))); +hex(concat(subtime('23:59:59','11:22:33'))) +00310032003A00330037003A00320036 +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(elt(1,2,3)); +hex(elt(1,2,3)) +0032 +create table t1 as select elt(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(export_set(1,2,3,4,2)); +hex(export_set(1,2,3,4,2)) +003200340033 +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(127) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(insert(1133,3,0,22)); +hex(insert(1133,3,0,22)) +003100310032003200330033 +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lcase(123)); +hex(lcase(123)) +003100320033 +create table t1 as select lcase(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(123,1)); +hex(left(123,1)) +0031 +create table t1 as select left(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lower(123)); +hex(lower(123)) +003100320033 +create table t1 as select lower(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lpad(1,2,0)); +hex(lpad(1,2,0)) +00300031 +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ltrim(1)); +hex(ltrim(1)) +0031 +create table t1 as select ltrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(mid(1,1,1)); +hex(mid(1,1,1)) +0031 +create table t1 as select mid(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(repeat(1,2)); +hex(repeat(1,2)) +00310031 +create table t1 as select repeat(1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(replace(1,1,2)); +hex(replace(1,1,2)) +0032 +create table t1 as select replace(1,1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(reverse(12)); +hex(reverse(12)) +00320031 +create table t1 as select reverse(12) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(right(123,1)); +hex(right(123,1)) +0033 +create table t1 as select right(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rpad(1,2,0)); +hex(rpad(1,2,0)) +00310030 +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rtrim(1)); +hex(rtrim(1)) +0031 +create table t1 as select rtrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(soundex(1)); +hex(soundex(1)) + +create table t1 as select soundex(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(substring(1,1,1)); +hex(substring(1,1,1)) +0031 +create table t1 as select substring(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(trim(1)); +hex(trim(1)) +0031 +create table t1 as select trim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ucase(1)); +hex(ucase(1)) +0031 +create table t1 as select ucase(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(upper(1)); +hex(upper(1)) +0031 +create table t1 as select upper(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +a hex(a) +1.1 0031002E0031 +2.1 0032002E0031 +update t1 set a= a + 0.1; +select a, hex(a) from t1; +a hex(a) +1.2000000000000002 0031002E0032003000300030003000300030003000300030003000300030003000300032 +2.2 0032002E0032 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +003000300031 001 +003000310030 010 +003100300030 100 +drop table t1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300031 000000000000000000000000000001 +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000310030 000000000000000000000000000010 +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003100300030 000000000000000000000000000100 +drop table t1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +hex(concat(a)) +003100320033002E00340035 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(6) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +00300030003000300031 00001 +00300030003000310030 00010 +00300030003100300030 00100 +00300031003000300030 01000 +00310030003000300030 10000 +drop table t1; +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +00300030003000300030003000300031 00000001 +00300030003000300030003000310030 00000010 +00300030003000300030003100300030 00000100 +00300030003000300031003000300030 00001000 +00300030003000310030003000300030 00010000 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(11) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +0030003000300030003000300030003000300031 0000000001 +0030003000300030003000300030003000310030 0000000010 +0030003000300030003000300030003100300030 0000000100 +0030003000300030003000300031003000300030 0000001000 +0030003000300030003000310030003000300030 0000010000 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(20) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +00300030003000300030003000300030003000300030003000300030003000300030003000300031 00000000000000000001 +00300030003000300030003000300030003000300030003000300030003000300030003000310030 00000000000000000010 +00300030003000300030003000300030003000300030003000300030003000300030003100300030 00000000000000000100 +00300030003000300030003000300030003000300030003000300030003000300031003000300030 00000000000000001000 +00300030003000300030003000300030003000300030003000300030003000310030003000300030 00000000000000010000 +drop table t1; +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +003100320033002E003400350036 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +0030003000300030003000300030003000300031002E0031 0000000001.1 +0030003000300030003000300030003000310030002E0031 0000000010.1 +0030003000300030003000300030003100300030002E0031 0000000100.1 +0030003000300030003000300031003000300030002E0031 0000001000.1 +0030003000300030003000310030003000300030002E0031 0000010000.1 +drop table t1; +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +003100320033002E003400350036 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(22) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +00300030003000300030003000300030003000300030003000300030003000300030003000300031002E0031 00000000000000000001.1 +00300030003000300030003000300030003000300030003000300030003000300030003000310030002E0031 00000000000000000010.1 +00300030003000300030003000300030003000300030003000300030003000300030003100300030002E0031 00000000000000000100.1 +00300030003000300030003000300030003000300030003000300030003000300031003000300030002E0031 00000000000000001000.1 +00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1 +drop table t1; +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +00300031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(2) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0032003000300031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bit(64)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0000000000000001 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +hex(concat(a)) +0030003000300030002D00300030002D00300030002000300030003A00300030003A00300030 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +0031003900380030002D00300032002D00300033002000300034003A00300035003A00300036 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +select concat(a) from t1; +concat(a) +0000-00-00 00:00:00 +2001-02-03 04:05:06 +1980-02-03 04:05:06 +2001-02-03 04:05:06 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +hex(concat(a)) +0032003000300031002D00300032002D00300033 +0032003000300031002D00300032002D00300033 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +hex(concat(a)) +00300030003A00300030003A00300031 +00300031003A00300032003A00300033 +select concat(a) from t1; +concat(a) +00:00:01 +01:02:03 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(8) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +hex(concat(a)) +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +0031 +drop table t1; +drop view v1; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(3) YES NULL +select hex(a) from v1; +hex(a) +003000300031 +003000310030 +003100300030 +drop table t1; +drop view v1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(30) YES NULL +select hex(a) from v1; +hex(a) +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300031 +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000310030 +003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003000300030003100300030 +drop table t1; +drop view v1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +003100320033002E00340035 +drop table t1; +drop view v1; +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(6) YES NULL +select hex(a) from v1; +hex(a) +0031 +drop table t1; +drop view v1; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(5) YES NULL +select hex(a) from v1; +hex(a) +00300030003000300031 +00300030003000310030 +00300030003100300030 +00300031003000300030 +00310030003000300030 +drop table t1; +drop view v1; +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(9) YES NULL +select hex(a) from v1; +hex(a) +0031 +drop table t1; +drop view v1; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +00300030003000300030003000300031 +00300030003000300030003000310030 +00300030003000300030003100300030 +00300030003000300031003000300030 +00300030003000310030003000300030 +drop table t1; +drop view v1; +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(11) YES NULL +select hex(a) from v1; +hex(a) +0031 +drop table t1; +drop view v1; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +0030003000300030003000300030003000300031 +0030003000300030003000300030003000310030 +0030003000300030003000300030003100300030 +0030003000300030003000300031003000300030 +0030003000300030003000310030003000300030 +drop table t1; +drop view v1; +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +0031 +drop table t1; +drop view v1; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +00300030003000300030003000300030003000300030003000300030003000300030003000300031 +00300030003000300030003000300030003000300030003000300030003000300030003000310030 +00300030003000300030003000300030003000300030003000300030003000300030003100300030 +00300030003000300030003000300030003000300030003000300030003000300031003000300030 +00300030003000300030003000300030003000300030003000300030003000310030003000300030 +drop table t1; +drop view v1; +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +003100320033002E003400350036 +drop table t1; +drop view v1; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +0030003000300030003000300030003000300031002E0031 +0030003000300030003000300030003000310030002E0031 +0030003000300030003000300030003100300030002E0031 +0030003000300030003000300031003000300030002E0031 +0030003000300030003000310030003000300030002E0031 +drop table t1; +drop view v1; +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +concat(a) +123.456 +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +003100320033002E003400350036 +drop table t1; +drop view v1; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +00300030003000300030003000300030003000300030003000300030003000300030003000300031002E0031 +00300030003000300030003000300030003000300030003000300030003000300030003000310030002E0031 +00300030003000300030003000300030003000300030003000300030003000300030003100300030002E0031 +00300030003000300030003000300030003000300030003000300030003000300031003000300030002E0031 +00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 +drop table t1; +drop view v1; +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(2) YES NULL +select hex(a) from v1; +hex(a) +00300031 +drop table t1; +drop view v1; +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +0032003000300031 +drop table t1; +drop view v1; +create table t1 (a bit(64)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(64) YES NULL +select hex(a) from v1; +hex(a) +0000000000000001 +drop table t1; +drop view v1; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) NO +select hex(a) from v1; +hex(a) +0030003000300030002D00300030002D00300030002000300030003A00300030003A00300030 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +0031003900380030002D00300032002D00300033002000300034003A00300035003A00300036 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +drop table t1; +drop view v1; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +0032003000300031002D00300032002D00300033 +0032003000300031002D00300032002D00300033 +drop table t1; +drop view v1; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +00300030003A00300030003A00300031 +00300031003A00300032003A00300033 +drop table t1; +drop view v1; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) YES NULL +select hex(a) from v1; +hex(a) +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +0032003000300031002D00300032002D00300033002000300034003A00300035003A00300036 +drop table t1; +drop view v1; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +set @a= f1(1); +select hex(@a); +hex(@a) +1 +select hex(concat(f1(1))); +hex(concat(f1(1))) +31 +create table t1 as select f1(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(11) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` decimal(18,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(20) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(12) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +hex(@a) +323030312D30312D3032 +select hex(concat(f1(cast('2001-01-02' as date)))); +hex(concat(f1(cast('2001-01-02' as date)))) +323030312D30312D3032 +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +drop view v1; +drop function f1; +# +# End of WL#2649 Number-to-string conversions +# +SET NAMES latin1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index ebec186591d..4ef9cfb9fe6 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -625,7 +625,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255)); select f2,group_concat(f1) from t1 group by f2; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 f2 f2 253 255 255 Y 0 0 8 -def group_concat(f1) 253 400 1 Y 128 0 63 +def group_concat(f1) 253 400 1 Y 0 0 8 f2 group_concat(f1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 @@ -737,7 +737,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255)); select f2,group_concat(f1) from t1 group by f2; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 f2 f2 253 255 255 Y 0 0 8 -def group_concat(f1) 252 1024 1 Y 128 0 63 +def group_concat(f1) 252 1024 1 Y 0 0 8 f2 group_concat(f1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 3d43cbbfd76..72cf1473594 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -761,7 +761,7 @@ latin2 latin2_general_ci 2 drop table t1; select charset(null), collation(null), coercibility(null); charset(null) collation(null) coercibility(null) -binary binary 5 +binary binary 6 CREATE TABLE t1 (a int, b int); CREATE TABLE t2 (a int, b int); INSERT INTO t1 VALUES (1,1),(2,2); @@ -777,7 +777,7 @@ a b a b 1 1 NULL NULL 2 2 2 2 select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) -where coercibility(t2.a) = 2 order by t1.a,t2.a; +where coercibility(t2.a) = 5 order by t1.a,t2.a; a b a b 1 1 NULL NULL 2 2 2 2 @@ -1230,13 +1230,13 @@ create table t1 (i int); insert into t1 values (1000000000),(1); select lpad(i, 7, ' ') as t from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def t 253 7 7 Y 128 31 63 +def t 253 7 7 Y 0 31 8 t 1000000 1 select rpad(i, 7, ' ') as t from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def t 253 7 7 Y 128 31 63 +def t 253 7 7 Y 0 31 8 t 1000000 1 diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 58dd97ee9f3..5a200bb4783 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -126,7 +126,7 @@ renamed 1 select * from v3 where renamed=1 group by renamed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def v3 v3 renamed renamed 8 12 0 Y 32896 0 63 +def v3 v3 renamed renamed 8 11 0 Y 32896 0 63 renamed drop table t1; drop view v1,v2,v3; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 4f9444c1542..1eaa2e0d256 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1788,11 +1788,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -1818,11 +1818,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -1929,10 +1929,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1976,10 +1976,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2026,10 +2026,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2066,10 +2066,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2114,10 +2114,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2158,10 +2158,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2204,10 +2204,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2242,10 +2242,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 772a7462342..06e232fd9b0 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1771,11 +1771,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -1801,11 +1801,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -1912,10 +1912,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1959,10 +1959,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2009,10 +2009,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2049,10 +2049,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2097,10 +2097,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2141,10 +2141,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2187,10 +2187,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2225,10 +2225,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 84bf7a6fa00..1458f7d4514 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1772,11 +1772,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -1802,11 +1802,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -1913,10 +1913,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1960,10 +1960,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2010,10 +2010,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2050,10 +2050,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2098,10 +2098,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2142,10 +2142,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2188,10 +2188,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2226,10 +2226,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 61d2822fd5b..ad750cccd52 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1708,11 +1708,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -1738,11 +1738,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -1849,10 +1849,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1896,10 +1896,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -1946,10 +1946,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1986,10 +1986,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2034,10 +2034,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2078,10 +2078,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2124,10 +2124,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2162,10 +2162,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -4730,11 +4730,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -4760,11 +4760,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -4871,10 +4871,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -4918,10 +4918,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -4968,10 +4968,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -5008,10 +5008,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -5056,10 +5056,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -5100,10 +5100,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -5146,10 +5146,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -5184,10 +5184,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 054fda90c02..b5d16316c92 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -449,11 +449,11 @@ f4 datetime YES NULL create table t5 as select coalesce(f1,f3) as f4 from t1; desc t5; Field Type Null Key Default Extra -f4 varbinary(20) YES NULL +f4 varchar(20) YES NULL create table t6 as select coalesce(f2,f3) as f4 from t1; desc t6; Field Type Null Key Default Extra -f4 varbinary(20) YES NULL +f4 varchar(20) YES NULL create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1; desc t7; Field Type Null Key Default Extra diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 5e915fbfa2d..7cacaf7cc92 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -271,7 +271,7 @@ drop table t2; create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1; show full columns from t2; Field Type Collation Null Key Default Extra Privileges Comment -auto bigint(12) unsigned NULL NO PRI 0 # +auto int(6) unsigned NULL NO PRI 0 # t1 int(1) NULL NO 0 # t2 varchar(1) latin1_swedish_ci NO # t3 varchar(256) latin1_swedish_ci NO # diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 71f7547386f..2d0914474a4 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varbinary(2) NOT NULL DEFAULT '' + `a` varchar(2) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; @@ -655,7 +655,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f` varbinary(12) DEFAULT NULL + `f` varchar(12) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; @@ -666,7 +666,7 @@ y show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `y` varbinary(10) DEFAULT NULL + `y` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select dt from t2; @@ -677,7 +677,7 @@ y show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `y` varbinary(19) DEFAULT NULL + `y` varchar(19) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT da from t2 UNION select dt from t2; @@ -699,7 +699,7 @@ testc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `dt` varbinary(19) DEFAULT NULL + `dt` varchar(19) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT dt from t2 UNION select sv from t2; @@ -710,7 +710,7 @@ testv show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `dt` varbinary(19) DEFAULT NULL + `dt` varchar(19) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT sc from t2 UNION select sv from t2; diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result index fcb2d641cf0..cab660e391c 100644 --- a/mysql-test/suite/ndb/r/ps_7ndb.result +++ b/mysql-test/suite/ndb/r/ps_7ndb.result @@ -1771,11 +1771,11 @@ t5 CREATE TABLE `t5` ( `const06` varchar(10) NOT NULL DEFAULT '', `param06` longtext, `const07` date DEFAULT NULL, - `param07` longblob, + `param07` longtext, `const08` varchar(19) NOT NULL DEFAULT '', `param08` longtext, `const09` datetime DEFAULT NULL, - `param09` longblob, + `param09` longtext, `const10` int(10) NOT NULL DEFAULT '0', `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, @@ -1801,11 +1801,11 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63 def test t5 t5 const06 const06 253 10 10 N 1 0 8 def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8 def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63 +def test t5 t5 param07 param07 252 4294967295 10 Y 16 0 8 def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 +def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 @@ -1912,10 +1912,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -1959,10 +1959,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2009,10 +2009,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2049,10 +2049,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2097,10 +2097,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2141,10 +2141,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 @@ -2187,10 +2187,10 @@ def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 def @arg11 246 83 6 Y 32896 30 63 def @arg12 246 83 6 Y 32896 30 63 -def @arg13 251 16777216 10 Y 128 31 63 -def @arg14 251 16777216 19 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 8 Y 128 31 63 +def @arg13 251 16777216 10 Y 0 31 8 +def @arg14 251 16777216 19 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 8 Y 0 31 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 @@ -2225,10 +2225,10 @@ def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 def @arg11 246 83 0 Y 32896 30 63 def @arg12 246 83 0 Y 32896 30 63 -def @arg13 251 16777216 0 Y 128 31 63 -def @arg14 251 16777216 0 Y 128 31 63 -def @arg15 251 16777216 19 Y 128 31 63 -def @arg16 251 16777216 0 Y 128 31 63 +def @arg13 251 16777216 0 Y 0 31 8 +def @arg14 251 16777216 0 Y 0 31 8 +def @arg15 251 16777216 19 Y 0 31 8 +def @arg16 251 16777216 0 Y 0 31 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test new file mode 100644 index 00000000000..8b57854de83 --- /dev/null +++ b/mysql-test/t/ctype_binary.test @@ -0,0 +1,12 @@ + +set names binary; + +--echo # +--echo # Start of 5.5 tests +--echo # + +--source include/ctype_numconv.inc + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index b6a1cfc3f98..4dfb0be3892 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -58,3 +58,13 @@ SHOW CREATE TABLE t1; DROP TABLE t1; # End of 4.1 tests + +--echo # +--echo # Start of 5.5 tests +--echo # + +--source include/ctype_numconv.inc + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index b12436f77ba..1733ee299d1 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -127,3 +127,14 @@ DROP TABLE `abc˙def`; select hex(cast(_ascii 0x7f as char(1) character set latin1)); --echo End of 5.0 tests + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--source include/ctype_numconv.inc + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 310576b9478..8d4b478e68d 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -733,3 +733,17 @@ SELECT HEX(DAYNAME(19700101)); SET character_set_connection=latin1; --echo End of 5.0 tests + + +--echo # +--echo # Start of 5.5 tests +--echo # + +SET NAMES latin1; +SET collation_connection=ucs2_general_ci; +--source include/ctype_numconv.inc +SET NAMES latin1; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index a570e70d81d..556a19efce5 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -442,7 +442,7 @@ where collation(t2.a) = _utf8'binary' order by t1.a,t2.a; select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) where charset(t2.a) = _utf8'binary' order by t1.a,t2.a; select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) -where coercibility(t2.a) = 2 order by t1.a,t2.a; +where coercibility(t2.a) = 5 order by t1.a,t2.a; DROP TABLE t1, t2; # |