diff options
author | Michael Widenius <monty@askmonty.org> | 2011-05-08 13:24:06 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-05-08 13:24:06 +0300 |
commit | 5ab92b1f850c62718907d166b47553440502043c (patch) | |
tree | 447166d5a99f147b27daa6f637b0a23df789a0aa /mysql-test | |
parent | 8ac88c88f0038350064429fda626233260eb6721 (diff) | |
download | mariadb-git-5ab92b1f850c62718907d166b47553440502043c.tar.gz |
Adding support for Dynamic columns (WL#34):
- COLUMN_CREATE(column_nr, value, [column_nr,value]...)
- COLUMN_ADD(blob,column_nr, value, column_nr,value]...)
- COLUMN_DELETE(blob, column_nr, column_nr...)
- COLUMN_EXISTS(blob, column_nr)
- COLUMN_LIST(blob, column_nr)
- COLUMN_GET(string, column_nr AS type)
Added cast(X as DOUBLE) and cast(x as INT)
Better warning and error messages for wrong cast's
Created some sub functions to simplify and reuse code.
Added a lot of conversation functions with error/warnings for what went wrong.
Fixed some issues when casting time to datetime.
Added functions to dynamic strings and Strings to allow one to move a string buffer from dynamic strings to String (to save malloc+ copy)
Added dynamic columns library to libmysqlclient
include/Makefile.am:
Added ma_dyncol.h
include/decimal.h:
Added 'const' to arguments for some functions.
include/my_sys.h:
Added dynstr_reassociate()
include/my_time.h:
Added TIME_SUBSECOND_RANGE
Added double_to_datetime()
Added flag argument to str_to_time()
libmysql/CMakeLists.txt:
Added mysys/ma_dyncol.c
libmysql/Makefile.shared:
Added ma_dyncol
libmysql/libmysql.c:
Added argument to str_to_time()
mysql-test/r/bigint.result:
Better error messages
mysql-test/r/cast.result:
Better warning and error messages
A lot of new cast() tests
mysql-test/r/func_math.result:
Better warning messages
mysql-test/r/func_str.result:
Better warning messages
mysql-test/r/func_time.result:
Better warning messages
mysql-test/r/sp-vars.result:
Better warning messages
mysql-test/r/strict.result:
Better warning messages
New test result
mysql-test/r/type_newdecimal.result:
Better warning messages
mysql-test/r/warnings.result:
Better warning messages
mysql-test/suite/funcs_1/r/innodb_func_view.result:
Updated results after better cast warnings
mysql-test/suite/funcs_1/r/memory_func_view.result:
Updated results after better cast warnings
mysql-test/suite/funcs_1/r/myisam_func_view.result:
Updated results after better cast warnings
mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test:
Added begin...commit to speed up test.
mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
Added begin...commit to speed up test.
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
Added begin...commit to speed up test.
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
Added begin...commit to speed up test.
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
Added begin...commit to speed up test.
mysql-test/suite/parts/r/rpl_partition.result:
Added begin...commit to speed up test.
mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
Removed duplicated --big_test
mysql-test/suite/parts/t/rpl_partition.test:
Added begin...commit to speed up test.
mysql-test/suite/pbxt/r/cast.result:
Updated results after better cast warnings
mysql-test/suite/pbxt/r/func_str.result:
Updated results after better cast warnings
mysql-test/suite/pbxt/r/type_newdecimal.result:
Updated results after better cast warnings
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
Added begin...commit to speed up test.
mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
Added begin...commit to speed up test.
mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result:
More warnings
mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result:
More warnings
mysql-test/t/cast.test:
A lot of new cast() tests
mysql-test/t/strict.test:
Added new test
mysys/CMakeLists.txt:
Added ma_dyncol.c
mysys/Makefile.am:
Added ma_dyncol.c
mysys/string.c:
Added dynstr_reassociate() to move a buffer from dynamic_strings to some other allocator
sql-common/my_time.c:
Added 'fuzzydate' flag to str_to_time()
Added support for microseconds to my_time_to_str() and my_datetime_to_str()
Reset second_parts in number_to_datetime()
Added double_to_datetime()
sql/field.cc:
Added double_to_longlong() and truncate_double() to simplify and reuse code
sql/field.h:
New prototypes
sql/item.cc:
Changed Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) to be aware of type of argument.
(Needed to make it microsecond safe and get better warnings).
Updated call to str_to_time_with_warn()
sql/item.h:
Added struct st_dyncall_create_def used by dynamic columns
Added virtual bool dynamic_result() to tell if type of argument may change over calls.
sql/item_cmpfunc.cc:
Added Item_func_dyncol_exists()
sql/item_cmpfunc.h:
Added class Item_func_dyncol_exists
sql/item_create.cc:
Added get_length_and_scale() to simplify other functions
Simplified and extended create_func_cast()
Added support for cast(X as double(X,Y))
Added functions to create dynamic column functions.
sql/item_create.h:
Added prototypes
sql/item_func.cc:
Extended cast functions Item_func_signed() and Item_func_unsigned() to work with dynamic types
Added Item_double_typecast()
sql/item_func.h:
Added class Item_double_typecast()
sql/item_strfunc.cc:
Added functions for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
sql/item_strfunc.h:
Added classes for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
sql/item_timefunc.cc:
Added flag argument to str_to_time_with_warn()
Updated Item_char_typecast() to handle result type that may change between calls (for dynamic columns)
Added Item_time_typecast::get_date() to ensure that we cast a datetime to time properly.
sql/item_timefunc.h:
Added get_date() to Item_time_typecast() to allow proper results for casting time to datetime
sql/lex.h:
Added new SQL function names
sql/my_decimal.cc:
Added 'const' to some arguments.
Better error message in case of errors (we now print out the wrong value)
Added my_decimal2int()
sql/my_decimal.h:
Moved some constants to my_decimal_limits.h
Updated prototypes.
Made my_decimal2int() a function as it's rather long (no reason to have it inline)
Added decimal2my_decimal() function.
sql/mysql_priv.h:
Prototypes for new functions
sql/share/errmsg.txt:
New error messages for wrong casts and dynamic columns
sql/sql_acl.cc:
Fixed indentation
sql/sql_base.cc:
Added dynamic_column_error_message()
sql/sql_string.h:
Added reassociate() to move a buffer to be owned by String object.
sql/sql_yacc.yy:
Added syntax for COLUMN_ functions.
sql/time.cc:
Updated str_to_datetime_with_warn() flag argument to same type as other functions
Added conversion flag to str_to_time_with_warn() (Similar to all datetime functions)
Added conversion functions with warnings: double_to_datetime_with_warn() and decimal_to_datetime_with_warn()
strings/decimal.c:
Added 'const' to arguments for some functions.
unittest/mysys/Makefile.am:
Added test for dynamic columns code
Diffstat (limited to 'mysql-test')
31 files changed, 2913 insertions, 460 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 8f9b75fc664..38c417b4628 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -362,12 +362,12 @@ select cast(19999999999999999999 as signed); cast(19999999999999999999 as signed) 9223372036854775807 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '19999999999999999999' to INT. Value truncated. select cast(-19999999999999999999 as signed); cast(-19999999999999999999 as signed) -9223372036854775808 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-19999999999999999999' to INT. Value truncated. select -9223372036854775808; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def -9223372036854775808 8 20 20 N 32897 0 63 diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index dd61396e485..094ccce76c2 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -1,9 +1,13 @@ select CAST(1-2 AS UNSIGNED); CAST(1-2 AS UNSIGNED) 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER); CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER) -1 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select CAST('10 ' as unsigned integer); CAST('10 ' as unsigned integer) 10 @@ -12,9 +16,15 @@ Warning 1292 Truncated incorrect INTEGER value: '10 ' select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1; cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1 18446744073709551611 18446744073709551611 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1; cast(-5 as unsigned) -1 cast(-5 as unsigned) + 1 18446744073709551610 18446744073709551612 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select ~5, cast(~5 as signed); ~5 cast(~5 as signed) 18446744073709551610 -6 @@ -29,6 +39,51 @@ cast(5 as unsigned) -6.0 select cast(NULL as signed), cast(1/0 as signed); cast(NULL as signed) cast(1/0 as signed) NULL NULL +select cast(1 as double(5,2)); +cast(1 as double(5,2)) +1.00 +select cast("5.2222" as double(5,2)); +cast("5.2222" as double(5,2)) +5.22 +select cast(12.444 as double(5,2)); +cast(12.444 as double(5,2)) +12.44 +select cast(cast(12.444 as decimal(10,3)) as double(5,2)); +cast(cast(12.444 as decimal(10,3)) as double(5,2)) +12.44 +select cast(null as double(5,2)); +cast(null as double(5,2)) +NULL +select cast(12.444 as double); +cast(12.444 as double) +12.444 +select cast(cast("20:01:01" as time) as datetime); +cast(cast("20:01:01" as time) as datetime) +0000-00-00 20:01:01 +select cast(cast("8:46:06.23434" AS time) as decimal(32,10)); +cast(cast("8:46:06.23434" AS time) as decimal(32,10)) +84606.2343400000 +select cast(cast(20010203101112.121314 as double) as datetime); +cast(cast(20010203101112.121314 as double) as datetime) +2001-02-03 10:11:12.125000 +select cast(cast(010203101112.12 as double) as datetime); +cast(cast(010203101112.12 as double) as datetime) +2001-02-03 10:11:12.120000 +select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime); +cast(cast(20010203101112.121314 as decimal(32,6)) as datetime) +2001-02-03 10:11:12.121314 +select cast(20010203101112.121314 as datetime); +cast(20010203101112.121314 as datetime) +2001-02-03 10:11:12.121314 +select cast(110203101112.121314 as datetime); +cast(110203101112.121314 as datetime) +2011-02-03 10:11:12.121314 +select cast(cast(010203101112.12 as double) as datetime); +cast(cast(010203101112.12 as double) as datetime) +2001-02-03 10:11:12.120000 +select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as time); +cast(cast("2011-04-05 8:46:06.23434" AS datetime) as time) +08:46:06.234340 select cast(NULL as unsigned), cast(1/0 as unsigned); cast(NULL as unsigned) cast(1/0 as unsigned) NULL NULL @@ -111,6 +166,115 @@ select 10E+0+'a'; 10 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'a' +select cast("a" as double(5,2)); +cast("a" as double(5,2)) +0.00 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'a' +select cast(1000 as decimal(5,2)); +cast(1000 as decimal(5,2)) +999.99 +Warnings: +Error 1264 Out of range value for column 'cast(1000 as decimal(5,2))' at row 1 +select cast(-1000 as decimal(5,2)); +cast(-1000 as decimal(5,2)) +-999.99 +Warnings: +Error 1264 Out of range value for column 'cast(-1000 as decimal(5,2))' at row 1 +select cast(1000 as double(5,2)); +cast(1000 as double(5,2)) +999.99 +Warnings: +Warning 1264 Out of range value for column 'cast(1000 as double(5,2))' at row 1 +select cast(-1000 as double(5,2)); +cast(-1000 as double(5,2)) +-999.99 +Warnings: +Warning 1264 Out of range value for column 'cast(-1000 as double(5,2))' at row 1 +select cast(010203101112.121314 as datetime); +cast(010203101112.121314 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '10203101112.121314' +select cast(120010203101112.121314 as datetime); +cast(120010203101112.121314 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '120010203101112.121314' +select cast(cast(1.1 as decimal) as datetime); +cast(cast(1.1 as decimal) as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '1' +select cast(cast(-1.1 as decimal) as datetime); +cast(cast(-1.1 as decimal) as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '-1' +select cast('0' as date); +cast('0' as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0' +select cast('' as date); +cast('' as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '' +select cast('0' as datetime); +cast('0' as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0' +select cast('' as datetime); +cast('' as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '' +select cast('0' as time); +cast('0' as time) +00:00:00 +select cast('' as time); +cast('' as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '' +select cast(NULL as DATE); +cast(NULL as DATE) +NULL +select cast(NULL as DATETIME); +cast(NULL as DATETIME) +NULL +select cast(NULL as TIME); +cast(NULL as TIME) +NULL +select cast(NULL as BINARY); +cast(NULL as BINARY) +NULL +select cast(cast(120010203101112.121314 as double) as datetime); +cast(cast(120010203101112.121314 as double) as datetime) +NULL +select cast(cast(1.1 as double) as datetime); +cast(cast(1.1 as double) as datetime) +NULL +select cast(cast(-1.1 as double) as datetime); +cast(cast(-1.1 as double) as datetime) +NULL +explain extended select cast(10 as double(5,2)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(10 as double(5,2)) AS `cast(10 as double(5,2))` +explain extended select cast(10 as double); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(10 as double) AS `cast(10 as double)` +explain extended select cast(10 as decimal(5,2)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(10 as decimal(5,2)) AS `cast(10 as decimal(5,2))` select cast('18446744073709551616' as unsigned); cast('18446744073709551616' as unsigned) 18446744073709551615 @@ -146,6 +310,18 @@ cast('' as signed) 0 Warnings: Warning 1292 Truncated incorrect INTEGER value: '' +select cast(1 as double(5,6)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). +select cast(1 as decimal(5,6)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). +select cast(1 as double(66,6)); +ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65. +select cast(1 as decimal(66,6)); +ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65. +select cast(1 as decimal(64,63)); +ERROR 42000: Too big scale 63 specified for column '1'. Maximum is 30. +select cast(1 as double(64,63)); +ERROR 42000: Too big scale 63 specified for column '1'. Maximum is 30. set names binary; select cast(_latin1'test' as char character set latin2); cast(_latin1'test' as char character set latin2) @@ -255,12 +431,6 @@ cast("2001-1-1" as datetime) = "2001-01-01 00:00:00" select cast("1:2:3" as TIME) = "1:02:03"; cast("1:2:3" as TIME) = "1:02:03" 0 -select cast(NULL as DATE); -cast(NULL as DATE) -NULL -select cast(NULL as BINARY); -cast(NULL as BINARY) -NULL CREATE TABLE t1 (a enum ('aac','aab','aaa') not null); INSERT INTO t1 VALUES ('aaa'),('aab'),('aac'); SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ; @@ -337,6 +507,21 @@ Warning 1105 Cast to signed converted positive out-of-range integer to it's nega select cast(1.0e+300 as signed int); cast(1.0e+300 as signed int) 9223372036854775807 +create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double(5,2)), cast(1 as decimal(5,3)), cast("A" as binary), cast("A" as char(100)), cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME), cast("1:2:3" as TIME); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0', + `cast(1 as signed)` int(1) NOT NULL DEFAULT '0', + `cast(1 as double(5,2))` double(5,2) DEFAULT NULL, + `cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000', + `cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '', + `cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '', + `cast("2001-1-1" as DATE)` date DEFAULT NULL, + `cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL, + `cast("1:2:3" as TIME)` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; CREATE TABLE t1 (f1 double); INSERT INTO t1 SET f1 = -1.0e+30 ; INSERT INTO t1 SET f1 = +1.0e+30 ; diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result new file mode 100644 index 00000000000..f58340841c2 --- /dev/null +++ b/mysql-test/r/dyncol.result @@ -0,0 +1,1187 @@ +# +# column create +# +select hex(COLUMN_CREATE(1, NULL AS char character set utf8)); +hex(COLUMN_CREATE(1, NULL AS char character set utf8)) +000000 +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)); +hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) +0001000100030861666166 +select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)); +hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) +0001000100033F31323132 +select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)); +hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) +0001000100033F31322E3132 +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)); +hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) +0001000100033F3939393939393939393939393939393939393939393939393939393939 +select hex(COLUMN_CREATE(1, NULL AS unsigned int)); +hex(COLUMN_CREATE(1, NULL AS unsigned int)) +000000 +select hex(COLUMN_CREATE(1, 1212 AS unsigned int)); +hex(COLUMN_CREATE(1, 1212 AS unsigned int)) +000100010001BC04 +select hex(COLUMN_CREATE(1, 7 AS unsigned int)); +hex(COLUMN_CREATE(1, 7 AS unsigned int)) +00010001000107 +select hex(COLUMN_CREATE(1, 8 AS unsigned int)); +hex(COLUMN_CREATE(1, 8 AS unsigned int)) +00010001000108 +select hex(COLUMN_CREATE(1, 127 AS unsigned int)); +hex(COLUMN_CREATE(1, 127 AS unsigned int)) +0001000100017F +select hex(COLUMN_CREATE(1, 128 AS unsigned int)); +hex(COLUMN_CREATE(1, 128 AS unsigned int)) +00010001000180 +select hex(COLUMN_CREATE(1, 12.12 AS unsigned int)); +hex(COLUMN_CREATE(1, 12.12 AS unsigned int)) +0001000100010C +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS unsigned int)); +hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS unsigned int)) +000100010001FFFFFFFFFFFFFF7F +Warnings: +Error 1655 Got overflow when converting '99999999999999999999999999999' to INT. Value truncated. +select hex(COLUMN_CREATE(1, NULL AS int)); +hex(COLUMN_CREATE(1, NULL AS int)) +000000 +select hex(COLUMN_CREATE(1, 1212 AS int)); +hex(COLUMN_CREATE(1, 1212 AS int)) +0001000100007809 +select hex(COLUMN_CREATE(1, 7 AS int)); +hex(COLUMN_CREATE(1, 7 AS int)) +0001000100000E +select hex(COLUMN_CREATE(1, 8 AS int)); +hex(COLUMN_CREATE(1, 8 AS int)) +00010001000010 +select hex(COLUMN_CREATE(1, 127 AS int)); +hex(COLUMN_CREATE(1, 127 AS int)) +000100010000FE +select hex(COLUMN_CREATE(1, 128 AS int)); +hex(COLUMN_CREATE(1, 128 AS int)) +0001000100000001 +select hex(COLUMN_CREATE(1, 12.12 AS int)); +hex(COLUMN_CREATE(1, 12.12 AS int)) +00010001000018 +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS int)); +hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS int)) +000100010000FEFFFFFFFFFFFFFF +Warnings: +Error 1655 Got overflow when converting '99999999999999999999999999999' to INT. Value truncated. +select hex(COLUMN_CREATE(1, NULL AS double)); +hex(COLUMN_CREATE(1, NULL AS double)) +000000 +select hex(COLUMN_CREATE(1, 1212 AS double)); +hex(COLUMN_CREATE(1, 1212 AS double)) +0001000100020000000000F09240 +select hex(COLUMN_CREATE(1, 12.12 AS double)); +hex(COLUMN_CREATE(1, 12.12 AS double)) +0001000100023D0AD7A3703D2840 +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS double)); +hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS double)) +00010001000221D7E6FAE031F445 +select hex(COLUMN_CREATE(1, NULL AS decimal)); +hex(COLUMN_CREATE(1, NULL AS decimal)) +000000 +select hex(COLUMN_CREATE(1, 1212 AS decimal)); +hex(COLUMN_CREATE(1, 1212 AS decimal)) +0001000100040900800004BC +select hex(COLUMN_CREATE(1, 7 AS decimal)); +hex(COLUMN_CREATE(1, 7 AS decimal)) +000100010004090080000007 +select hex(COLUMN_CREATE(1, 8 AS decimal)); +hex(COLUMN_CREATE(1, 8 AS decimal)) +000100010004090080000008 +select hex(COLUMN_CREATE(1, 127 AS decimal)); +hex(COLUMN_CREATE(1, 127 AS decimal)) +00010001000409008000007F +select hex(COLUMN_CREATE(1, 128 AS decimal)); +hex(COLUMN_CREATE(1, 128 AS decimal)) +000100010004090080000080 +select hex(COLUMN_CREATE(1, 12.12 AS decimal)); +hex(COLUMN_CREATE(1, 12.12 AS decimal)) +00010001000402028C0C +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS decimal)); +hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS decimal)) +0001000100041D00E33B9AC9FF3B9AC9FF3B9AC9FF +select hex(COLUMN_CREATE(1, NULL AS date)); +hex(COLUMN_CREATE(1, NULL AS date)) +000000 +select hex(COLUMN_CREATE(1, "2011-04-05" AS date)); +hex(COLUMN_CREATE(1, "2011-04-05" AS date)) +00010001000685B60F +select hex(COLUMN_CREATE(1, NULL AS time)); +hex(COLUMN_CREATE(1, NULL AS time)) +000000 +select hex(COLUMN_CREATE(1, "0:45:49.000001" AS time)); +hex(COLUMN_CREATE(1, "0:45:49.000001" AS time)) +000100010007010010B70000 +select hex(COLUMN_CREATE(1, NULL AS datetime)); +hex(COLUMN_CREATE(1, NULL AS datetime)) +000000 +select hex(COLUMN_CREATE(1, "2011-04-05 0:45:49.000001" AS datetime)); +hex(COLUMN_CREATE(1, "2011-04-05 0:45:49.000001" AS datetime)) +00010001000585B60F010010B70000 +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, +2, 1212 AS unsigned int, +3, 1212 AS int, +4, 12.12 AS double, +4+1, 12.12 AS decimal, +6, "2011-04-05" AS date, +7, "- 0:45:49.000001" AS time, +8, "2011-04-05 0:45:49.000001" AS datetime)); +hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, +2, 1212 AS unsigned int, +3, 1212 AS int, +4, 12.12 AS double, +4+1, 12.12 AS decimal, +6, "2011-04-05" AS date, +7, "- 0:45:49.000001" AS time, +8, "2011-04-05 0:45:49.000001" AS datetime)) +01080001000300020029000300380004004A0005008C000600AE000700C7000800F5000861666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 +explain extended +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, +2, 1212 AS unsigned int, +3, 1212 AS int, +4, 12.12 AS double, +4+1, 12.12 AS decimal, +6, "2011-04-05" AS date, +7, "- 0:45:49.000001" AS time, +8, "2011-04-05 0:45:49.000001" AS datetime)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select hex(column_create(1,'afaf' AS char charset utf8 ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,(4 + 1),12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, +2, 1212 AS unsigned int, +3, 1212 AS int, +4, 12.12 AS double, +4+1, 12.12 AS decimal, +6, "2011-04-05" AS date, +7, "- 0:45:49.000001" AS time, +8, "2011-04-05 0:45:49.000001" AS datetime))` +# +# column get uint +# +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int); +column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int) +1212 +explain extended +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212 AS unsigned int),1) as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int)` +explain extended +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212 AS unsigned int),1) as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned)` +select column_get(column_create(1, 1212 AS decimal), 1 as unsigned int); +column_get(column_create(1, 1212 AS decimal), 1 as unsigned int) +1212 +select column_get(column_create(1, 1212 AS double), 1 as unsigned int); +column_get(column_create(1, 1212 AS double), 1 as unsigned int) +1212 +select column_get(column_create(1, 1212 AS int), 1 as unsigned int); +column_get(column_create(1, 1212 AS int), 1 as unsigned int) +1212 +select column_get(column_create(1, "1212" AS char), 1 as unsigned int); +column_get(column_create(1, "1212" AS char), 1 as unsigned int) +1212 +select column_get(column_create(1, "2011-04-05" AS date), 1 as unsigned int); +column_get(column_create(1, "2011-04-05" AS date), 1 as unsigned int) +20110405 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as unsigned int); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as unsigned int) +84606 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as unsigned int); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as unsigned int) +20110405084606 +select column_get(column_create(1, NULL AS unsigned int), 1 as unsigned int); +column_get(column_create(1, NULL AS unsigned int), 1 as unsigned int) +NULL +# column geint truncation & warnings +select column_get(column_create(1, -1212 AS int), 1 as unsigned int); +column_get(column_create(1, -1212 AS int), 1 as unsigned int) +18446744073709550404 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as unsigned int); +column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as unsigned int) +18446744073709551615 +Warnings: +Error 1655 Got overflow when converting '99999999999999999999999999999' to UNSIGNED INT. Value truncated. +select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as unsigned int); +column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as unsigned int) +1000 +select column_get(column_create(1, -1 AS decimal), 1 as unsigned int); +column_get(column_create(1, -1 AS decimal), 1 as unsigned int) +0 +Warnings: +Error 1655 Got overflow when converting '-1' to UNSIGNED INT. Value truncated. +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int); +column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int) +18446744073709551615 +Warnings: +Warning 1655 Got overflow when converting '1e+29' to UNSIGNED INT. Value truncated. +select column_get(column_create(1, 999.9 AS double), 1 as unsigned int); +column_get(column_create(1, 999.9 AS double), 1 as unsigned int) +1000 +select column_get(column_create(1, -1 AS double), 1 as unsigned int); +column_get(column_create(1, -1 AS double), 1 as unsigned int) +0 +Warnings: +Warning 1655 Got overflow when converting '-1' to UNSIGNED INT. Value truncated. +select column_get(column_create(1, "1212III" AS char), 1 as unsigned int); +column_get(column_create(1, "1212III" AS char), 1 as unsigned int) +1212 +Warnings: +Warning 1657 Encountered illegal value '1212III' when converting to UNSIGNED INT +# +# column get int +# +select column_get(column_create(1, 1212 AS int), 1 as int); +column_get(column_create(1, 1212 AS int), 1 as int) +1212 +explain extended +select column_get(column_create(1, 1212 AS int), 1 as int); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212 AS int),1) as signed) AS `column_get(column_create(1, 1212 AS int), 1 as int)` +explain extended +select column_get(column_create(1, 1212 AS int), 1 as signed int); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212 AS int),1) as signed) AS `column_get(column_create(1, 1212 AS int), 1 as signed int)` +select column_get(column_create(1, -1212 AS int), 1 as int); +column_get(column_create(1, -1212 AS int), 1 as int) +-1212 +select column_get(column_create(1, 1212 AS decimal), 1 as int); +column_get(column_create(1, 1212 AS decimal), 1 as int) +1212 +select column_get(column_create(1, 1212 AS double), 1 as int); +column_get(column_create(1, 1212 AS double), 1 as int) +1212 +select column_get(column_create(1, 1212 AS unsigned int), 1 as int); +column_get(column_create(1, 1212 AS unsigned int), 1 as int) +1212 +select column_get(column_create(1, "1212" AS char), 1 as int); +column_get(column_create(1, "1212" AS char), 1 as int) +1212 +select column_get(column_create(1, "-1212" AS char), 1 as int); +column_get(column_create(1, "-1212" AS char), 1 as int) +-1212 +select column_get(column_create(1, "2011-04-05" AS date), 1 as int); +column_get(column_create(1, "2011-04-05" AS date), 1 as int) +20110405 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as int); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as int) +84606 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as int); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as int) +20110405084606 +select column_get(column_create(1, NULL AS int), 1 as int); +column_get(column_create(1, NULL AS int), 1 as int) +NULL +#column gett truncation & warnings +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as int); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as int) +-1 +Warnings: +Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as int); +column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as int) +9223372036854775807 +Warnings: +Error 1655 Got overflow when converting '99999999999999999999999999999' to INT. Value truncated. +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as int); +column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as int) +-9223372036854775808 +Warnings: +Error 1655 Got overflow when converting '-99999999999999999999999999999' to INT. Value truncated. +select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as int); +column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as int) +1000 +select column_get(column_create(1, 999.9 AS double), 1 as int); +column_get(column_create(1, 999.9 AS double), 1 as int) +1000 +select column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int); +column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int) +-9223372036854775808 +Warnings: +Warning 1655 Got overflow when converting '-1e+29' to INT. Value truncated. +select column_get(column_create(1, "-1212III" AS char), 1 as int); +column_get(column_create(1, "-1212III" AS char), 1 as int) +-1212 +Warnings: +Warning 1657 Encountered illegal value '-1212III' when converting to INT +select column_get(column_create(1, "1212III" AS char), 1 as int); +column_get(column_create(1, "1212III" AS char), 1 as int) +1212 +Warnings: +Warning 1657 Encountered illegal value '1212III' when converting to INT +# +#column get char +# +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8); +column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8) +1212 +explain extended +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,'1212' AS char charset utf8 ),1) as char charset utf8) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8)` +select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8); +column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) +1212 +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as char charset utf8); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as char charset utf8) +18446744073709551615 +select column_get(column_create(1, 1212 AS int), 1 as char charset utf8); +column_get(column_create(1, 1212 AS int), 1 as char charset utf8) +1212 +select column_get(column_create(1, -1212 AS int), 1 as char charset utf8); +column_get(column_create(1, -1212 AS int), 1 as char charset utf8) +-1212 +select column_get(column_create(1, 9223372036854775807 AS int), 1 as char charset utf8); +column_get(column_create(1, 9223372036854775807 AS int), 1 as char charset utf8) +9223372036854775807 +select column_get(column_create(1, -9223372036854775808 AS int), 1 as char charset utf8); +column_get(column_create(1, -9223372036854775808 AS int), 1 as char charset utf8) +-9223372036854775808 +select column_get(column_create(1, 1212.12 AS decimal), 1 as char charset utf8); +column_get(column_create(1, 1212.12 AS decimal), 1 as char charset utf8) +1212.12 +select column_get(column_create(1, 1212.12 AS double), 1 as char charset utf8); +column_get(column_create(1, 1212.12 AS double), 1 as char charset utf8) +1212.12 +select column_get(column_create(1, "2011-04-05" AS date), 1 as char charset utf8); +column_get(column_create(1, "2011-04-05" AS date), 1 as char charset utf8) +2011-04-05 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as char charset utf8); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as char charset utf8) +08:46:06.234340 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8) +2011-04-05 08:46:06.234340 +select column_get(column_create(1, NULL AS char charset utf8), 1 as char charset utf8); +column_get(column_create(1, NULL AS char charset utf8), 1 as char charset utf8) +NULL +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary); +column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary) +1212 +explain extended +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,'1212' AS char charset utf8 ),1) as char charset binary) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary)` +# +# column get real +# +select column_get(column_create(1, 1212.12 AS double), 1 as double); +column_get(column_create(1, 1212.12 AS double), 1 as double) +1212.12 +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as double); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as double) AS `column_get(column_create(1, 1212.12 AS double), 1 as double)` +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as double(6,2)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as double(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as double(6,2))` +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double) +1.84467440737096e+19 +select column_get(column_create(1, 9223372036854775807 AS int), 1 as double); +column_get(column_create(1, 9223372036854775807 AS int), 1 as double) +9.22337203685478e+18 +select column_get(column_create(1, -9223372036854775808 AS int), 1 as double); +column_get(column_create(1, -9223372036854775808 AS int), 1 as double) +-9.22337203685478e+18 +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as double); +column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as double) +1e+29 +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as double); +column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as double) +-1e+29 +select column_get(column_create(1, "2011-04-05" AS date), 1 as double); +column_get(column_create(1, "2011-04-05" AS date), 1 as double) +20110405 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as double); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as double) +84606.23434 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double) +20110405084606.2 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)) +20110405084606.234375 +select column_get(column_create(1, NULL AS double), 1 as double); +column_get(column_create(1, NULL AS double), 1 as double) +NULL +# column get real truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as double); +column_get(column_create(1, "1223.5aa" AS char), 1 as double) +1223.5 +Warnings: +Warning 1657 Encountered illegal value '1223.5aa' when converting to DOUBLE +select column_get(column_create(1, "aa" AS char), 1 as double); +column_get(column_create(1, "aa" AS char), 1 as double) +0 +Warnings: +Warning 1657 Encountered illegal value 'aa' when converting to DOUBLE +select column_get(column_create(1, "1223.5555" AS double), 1 as double(5,2)); +column_get(column_create(1, "1223.5555" AS double), 1 as double(5,2)) +999.99 +Warnings: +Warning 1264 Out of range value for column 'column_get(column_create(1, "1223.5555" AS double), 1 as double(5,2))' at row 1 +select column_get(column_create(1, "1223.5555" AS double), 1 as double(3,2)); +column_get(column_create(1, "1223.5555" AS double), 1 as double(3,2)) +9.99 +Warnings: +Warning 1264 Out of range value for column 'column_get(column_create(1, "1223.5555" AS double), 1 as double(3,2))' at row 1 +# +# column get decimal +# +select column_get(column_create(1, 1212.12 AS double), 1 as decimal); +column_get(column_create(1, 1212.12 AS double), 1 as decimal) +1212 +select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)); +column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)) +1212.12 +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as decimal); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as decimal(10,0)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal)` +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as decimal(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2))` +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)) +18446744073709551615 +select column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal(32,0)); +column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal(32,0)) +9223372036854775807 +select column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal(32,0)); +column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal(32,0)) +-9223372036854775808 +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as decimal(40,10)); +column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as decimal(40,10)) +-99999999999999999999999999999.0000000000 +select column_get(column_create(1, "2011-04-05" AS date), 1 as decimal(32,6)); +column_get(column_create(1, "2011-04-05" AS date), 1 as decimal(32,6)) +20110405.000000 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as decimal(32,6)); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as decimal(32,6)) +84606.234340 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal(32,6)); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal(32,6)) +20110405084606.230000 +select column_get(column_create(1, NULL as decimal), 1 as decimal(32,10)); +column_get(column_create(1, NULL as decimal), 1 as decimal(32,10)) +NULL +select column_get(column_create(1, "1223.5555" as decimal(10,5)), 1 as decimal(6,2)); +column_get(column_create(1, "1223.5555" as decimal(10,5)), 1 as decimal(6,2)) +1223.56 +# column get decimal truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as decimal(32,10)); +column_get(column_create(1, "1223.5aa" AS char), 1 as decimal(32,10)) +1223.5000000000 +Warnings: +Warning 1657 Encountered illegal value '1223.5aa' when converting to DECIMAL +select column_get(column_create(1, "aa" AS char), 1 as decimal(32,10)); +column_get(column_create(1, "aa" AS char), 1 as decimal(32,10)) +0.0000000000 +Warnings: +Warning 1657 Encountered illegal value 'aa' when converting to DECIMAL +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal) +9999999999 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal)' at row 1 +select column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal); +column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal) +9999999999 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal)' at row 1 +select column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal); +column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal) +-9999999999 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal)' at row 1 +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as decimal); +column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as decimal) +9999999999 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as decimal)' at row 1 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal) +9999999999 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal)' at row 1 +select column_get(column_create(1, "1223.5555" as double), 1 as decimal(5,2)); +column_get(column_create(1, "1223.5555" as double), 1 as decimal(5,2)) +999.99 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, "1223.5555" as double), 1 as decimal(5,2))' at row 1 +select column_get(column_create(1, "-1223.5555" as double), 1 as decimal(5,2)); +column_get(column_create(1, "-1223.5555" as double), 1 as decimal(5,2)) +-999.99 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, "-1223.5555" as double), 1 as decimal(5,2))' at row 1 +select column_get(column_create(1, "1223.5555" AS double), 1 as decimal(3,2)); +column_get(column_create(1, "1223.5555" AS double), 1 as decimal(3,2)) +9.99 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, "1223.5555" AS double), 1 as decimal(3,2))' at row 1 +select column_get(column_create(1, "1223.5555" AS decimal(10,5)), 1 as decimal(3,2)); +column_get(column_create(1, "1223.5555" AS decimal(10,5)), 1 as decimal(3,2)) +9.99 +Warnings: +Error 1264 Out of range value for column 'column_get(column_create(1, "1223.5555" AS decimal(10,5)), 1 as decimal(3,2))' at row 1 +# +# column get datetime +# +select column_get(column_create(1, 20010203101112.121314 as double), 1 as datetime); +column_get(column_create(1, 20010203101112.121314 as double), 1 as datetime) +2001-02-03 10:11:12.125000 +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as datetime); +column_get(column_create(1, 20010203101112.121314 as decimal), 1 as datetime) +2001-02-03 10:11:12.121314 +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as datetime); +column_get(column_create(1, 20010203101112 as unsigned int), 1 as datetime) +2001-02-03 10:11:12 +select column_get(column_create(1, 20010203101112 as int), 1 as datetime); +column_get(column_create(1, 20010203101112 as int), 1 as datetime) +2001-02-03 10:11:12 +select column_get(column_create(1, "20010203101112" as char), 1 as datetime); +column_get(column_create(1, "20010203101112" as char), 1 as datetime) +2001-02-03 10:11:12 +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as datetime); +column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as datetime) +2001-02-03 10:11:12 +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as datetime); +column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as datetime) +2001-02-03 10:11:12.121314 +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as datetime); +column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as datetime) +2001-02-03 10:11:12.121314 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as datetime); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as datetime) +2011-04-05 08:46:06.234340 +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as datetime) +2011-00-00 08:46:06.234340 +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as datetime) +2011-00-01 08:46:06.234340 +select column_get(column_create(1, 20010203 as unsigned int), 1 as datetime); +column_get(column_create(1, 20010203 as unsigned int), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, 20010203 as int), 1 as datetime); +column_get(column_create(1, 20010203 as int), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, 20010203), 1 as datetime); +column_get(column_create(1, 20010203), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, 20010203.0), 1 as datetime); +column_get(column_create(1, 20010203.0), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, 20010203.0 as double), 1 as datetime); +column_get(column_create(1, 20010203.0 as double), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, "2001-02-03"), 1 as datetime); +column_get(column_create(1, "2001-02-03"), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, "20010203"), 1 as datetime); +column_get(column_create(1, "20010203"), 1 as datetime) +2001-02-03 00:00:00 +select column_get(column_create(1, 0), 1 as datetime); +column_get(column_create(1, 0), 1 as datetime) +0000-00-00 00:00:00 +select column_get(column_create(1, "2001021"), 1 as datetime); +column_get(column_create(1, "2001021"), 1 as datetime) +2020-01-02 01:00:00 +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime); +column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime) +0000-00-00 08:46:06.234340 +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime) +2011-02-30 18:46:06.234340 +select column_get(column_create(1, "0000-00-000" AS CHAR), 1 as datetime); +column_get(column_create(1, "0000-00-000" AS CHAR), 1 as datetime) +0000-00-00 00:00:00 +select column_get(column_create(1, "2001-00-02" AS CHAR), 1 as datetime); +column_get(column_create(1, "2001-00-02" AS CHAR), 1 as datetime) +2001-00-02 00:00:00 +set @@sql_mode=""; +# column get datetime truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as datetime); +column_get(column_create(1, "1223.5aa" AS char), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '1223.5aa' +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as datetime); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as datetime) +NULL +Warnings: +Warning 1657 Encountered illegal value '18446744073709551615' when converting to DATE or DATETIME +select column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime); +column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime) +NULL +Warnings: +Warning 1657 Encountered illegal value '9223372036854775807' when converting to DATE or DATETIME +select column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime); +column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime) +NULL +Warnings: +Warning 1657 Encountered illegal value '-9223372036854775808' when converting to DATE or DATETIME +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime); +column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '99999999999999999999999999999' +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime); +column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '9.99999999999999914332e+28 ' +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-02-32 8:46:06.23434' +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-13-01 8:46:06.23434' +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as datetime); +column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-02-30 8:46:06.23434' +select column_get(column_create(1, "20010231"), 1 as datetime); +column_get(column_create(1, "20010231"), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '20010231' +select column_get(column_create(1, "0" AS CHAR), 1 as datetime); +column_get(column_create(1, "0" AS CHAR), 1 as datetime) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0' +# +# column get date +# +select column_get(column_create(1, 20010203101112.121314 as double), 1 as date); +column_get(column_create(1, 20010203101112.121314 as double), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as date); +column_get(column_create(1, 20010203101112.121314 as decimal), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as date); +column_get(column_create(1, 20010203101112 as unsigned int), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203101112 as int), 1 as date); +column_get(column_create(1, 20010203101112 as int), 1 as date) +2001-02-03 +select column_get(column_create(1, "20010203101112" as char), 1 as date); +column_get(column_create(1, "20010203101112" as char), 1 as date) +2001-02-03 +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as date); +column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as date) +2001-02-03 +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as date); +column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as date) +2001-02-03 +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as date); +column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as date) +2001-02-03 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as date); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as date) +2011-04-05 +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as date) +2011-00-00 +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as date) +2011-00-01 +select column_get(column_create(1, 20010203 as unsigned int), 1 as date); +column_get(column_create(1, 20010203 as unsigned int), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203 as int), 1 as date); +column_get(column_create(1, 20010203 as int), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203), 1 as date); +column_get(column_create(1, 20010203), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203.0), 1 as date); +column_get(column_create(1, 20010203.0), 1 as date) +2001-02-03 +select column_get(column_create(1, 20010203.0 as double), 1 as date); +column_get(column_create(1, 20010203.0 as double), 1 as date) +2001-02-03 +select column_get(column_create(1, "2001-02-03"), 1 as date); +column_get(column_create(1, "2001-02-03"), 1 as date) +2001-02-03 +select column_get(column_create(1, "20010203"), 1 as date); +column_get(column_create(1, "20010203"), 1 as date) +2001-02-03 +select column_get(column_create(1, 0), 1 as date); +column_get(column_create(1, 0), 1 as date) +0000-00-00 +select column_get(column_create(1, "2001021"), 1 as date); +column_get(column_create(1, "2001021"), 1 as date) +2020-01-02 +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as date) +2011-02-30 +select column_get(column_create(1, "0000-00-000" AS CHAR), 1 as date); +column_get(column_create(1, "0000-00-000" AS CHAR), 1 as date) +0000-00-00 +select column_get(column_create(1, "2001-00-02" AS CHAR), 1 as date); +column_get(column_create(1, "2001-00-02" AS CHAR), 1 as date) +2001-00-02 +set @@sql_mode=""; +# column get date truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as date); +column_get(column_create(1, "1223.5aa" AS char), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '1223.5aa' +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as date); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as date) +NULL +Warnings: +Warning 1657 Encountered illegal value '18446744073709551615' when converting to DATE or DATETIME +select column_get(column_create(1, 9223372036854775807 AS int), 1 as date); +column_get(column_create(1, 9223372036854775807 AS int), 1 as date) +NULL +Warnings: +Warning 1657 Encountered illegal value '9223372036854775807' when converting to DATE or DATETIME +select column_get(column_create(1, -9223372036854775808 AS int), 1 as date); +column_get(column_create(1, -9223372036854775808 AS int), 1 as date) +NULL +Warnings: +Warning 1657 Encountered illegal value '-9223372036854775808' when converting to DATE or DATETIME +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date); +column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '99999999999999999999999999999' +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date); +column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '9.99999999999999914332e+28 ' +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-02-32 8:46:06.23434' +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-13-01 8:46:06.23434' +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as date); +column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2011-02-30 8:46:06.23434' +select column_get(column_create(1, "20010231"), 1 as date); +column_get(column_create(1, "20010231"), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '20010231' +select column_get(column_create(1, "0" AS CHAR), 1 as date); +column_get(column_create(1, "0" AS CHAR), 1 as date) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0' +# +# column get time +# +select column_get(column_create(1, 20010203101112.121314 as double), 1 as time); +column_get(column_create(1, 20010203101112.121314 as double), 1 as time) +10:11:12.100000 +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as time); +column_get(column_create(1, 20010203101112.121314 as decimal), 1 as time) +10:11:12.121314 +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as time); +column_get(column_create(1, 20010203101112 as unsigned int), 1 as time) +10:11:12 +select column_get(column_create(1, 20010203101112 as int), 1 as time); +column_get(column_create(1, 20010203101112 as int), 1 as time) +10:11:12 +select column_get(column_create(1, "20010203101112" as char), 1 as time); +column_get(column_create(1, "20010203101112" as char), 1 as time) +10:11:12 +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as time); +column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as time) +10:11:12 +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as time); +column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as time) +10:11:12.121314 +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as time); +column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as time) +10:11:12.121314 +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as time); +column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as time) +08:46:06.234340 +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as time) +08:46:06.234340 +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as time) +08:46:06.234340 +select column_get(column_create(1, "830:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "830:46:06.23434" AS CHAR), 1 as time) +830:46:06.234340 +select cast("-830:46:06.23434" AS time); +cast("-830:46:06.23434" AS time) +-830:46:06.234340 +select 1,cast("-830:46:06.23434" AS time); +1 cast("-830:46:06.23434" AS time) +1 -830:46:06.234340 +select hex(column_create(1, "-830:46:06.23434" AS CHAR)); +hex(column_create(1, "-830:46:06.23434" AS CHAR)) +000100010003082D3833303A34363A30362E3233343334 +select column_get(column_create(1, "-830:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "-830:46:06.23434" AS CHAR), 1 as time) +-830:46:06.234340 +select column_get(column_create(1, "0" AS CHAR), 1 as time); +column_get(column_create(1, "0" AS CHAR), 1 as time) +00:00:00 +select column_get(column_create(1, "6" AS CHAR), 1 as time); +column_get(column_create(1, "6" AS CHAR), 1 as time) +00:00:06 +select column_get(column_create(1, "1:6" AS CHAR), 1 as time); +column_get(column_create(1, "1:6" AS CHAR), 1 as time) +01:06:00 +select column_get(column_create(1, "2:1:6" AS CHAR), 1 as time); +column_get(column_create(1, "2:1:6" AS CHAR), 1 as time) +02:01:06 +select column_get(column_create(1, 0), 1 as time); +column_get(column_create(1, 0), 1 as time) +00:00:00 +select column_get(column_create(1, "2001021"), 1 as time); +column_get(column_create(1, "2001021"), 1 as time) +200:10:21 +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as time) +18:46:06.234340 +set @@sql_mode=""; +# column get date truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as time); +column_get(column_create(1, "1223.5aa" AS char), 1 as time) +00:12:23.500000 +Warnings: +Warning 1292 Truncated incorrect time value: '1223.5aa' +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as time); +column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '18446744073709551615' +select column_get(column_create(1, 9223372036854775807 AS int), 1 as time); +column_get(column_create(1, 9223372036854775807 AS int), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '9223372036854775807' +select column_get(column_create(1, -9223372036854775808 AS int), 1 as time); +column_get(column_create(1, -9223372036854775808 AS int), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '-9223372036854775808' +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time); +column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '99999999999999999999999999999' +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time); +column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '1e+29' +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2011-02-32 8:46:06.23434' +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2011-13-01 8:46:06.23434' +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as time); +column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as time) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2011-02-30 8:46:06.23434' +select column_get(column_create(1, "2001-02-03"), 1 as time); +column_get(column_create(1, "2001-02-03"), 1 as time) +00:20:01 +Warnings: +Warning 1292 Truncated incorrect time value: '2001-02-03' +select column_get(column_create(1, "20010203"), 1 as time); +column_get(column_create(1, "20010203"), 1 as time) +838:59:59 +Warnings: +Warning 1292 Truncated incorrect time value: '20010203' +# column add +select hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer)); +hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer)) +00020001000002001078097809 +select hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer)); +hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer)) +0001000100007809 +select hex(column_add(column_create(1, 1212 as integer), 1, NULL as integer)); +hex(column_add(column_create(1, 1212 as integer), 1, NULL as integer)) +000000 +select hex(column_add(column_create(1, 1212 as integer), 2, NULL as integer)); +hex(column_add(column_create(1, 1212 as integer), 2, NULL as integer)) +0001000100007809 +select hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer)); +hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer)) +000200010000020008167809 +select column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 1 as integer); +column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 1 as integer) +11 +select column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 2 as integer); +column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 2 as integer) +1212 +select hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer, 2, 11 as integer)); +hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer, 2, 11 as integer)) +000200010000020010780916 +select hex(column_add(column_create(1, NULL as integer), 1, 1212 as integer, 2, 11 as integer)); +hex(column_add(column_create(1, NULL as integer), 1, 1212 as integer, 2, 11 as integer)) +000200010000020010780916 +select hex(column_add(column_create(1, 1212 as integer, 2, 1212 as integer), 1, 11 as integer)); +hex(column_add(column_create(1, 1212 as integer, 2, 1212 as integer), 1, 11 as integer)) +000200010000020008167809 +select hex(column_add(column_create(1, 1), 1, null)); +hex(column_add(column_create(1, 1), 1, null)) +000000 +select column_list(column_add(column_create(1, 1), 1, null)); +column_list(column_add(column_create(1, 1), 1, null)) + +select column_list(column_add(column_create(1, 1), 1, "")); +column_list(column_add(column_create(1, 1), 1, "")) +1 +select hex(column_add("", 1, 1)); +hex(column_add("", 1, 1)) +00010001000002 +# column delete +select hex(column_delete(column_create(1, 1212 as integer, 2, 1212 as integer), 1)); +hex(column_delete(column_create(1, 1212 as integer, 2, 1212 as integer), 1)) +0001000200007809 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2)) +0002000100000300080206 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 3)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 3)) +0002000100000200080204 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 4)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 4)) +000300010000020008030010020406 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 1)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 1)) +00010003000006 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 3)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 3)) +00010001000002 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3)) +000000 +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3, 10)); +hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3, 10)) +000000 +select hex(column_delete(column_create(1, 1), 1)); +hex(column_delete(column_create(1, 1), 1)) +000000 +select hex(column_delete("", 1)); +hex(column_delete("", 1)) + +# column exists +select column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 1); +column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 1) +1 +select column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 4); +column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 4) +0 +# column list +select column_list(column_create(1, 1212 as integer, 2, 1212 as integer)); +column_list(column_create(1, 1212 as integer, 2, 1212 as integer)) +1,2 +select column_list(column_create(1, 1212 as integer)); +column_list(column_create(1, 1212 as integer)) +1 +select column_list(column_create(1, NULL as integer)); +column_list(column_create(1, NULL as integer)) + +# +# check error handling +# +select HEX(COLUMN_CREATE(1, 5, 1, 5)); +ERROR 22007: Illegal value used as argument of dynamic column function +select HEX(COLUMN_CREATE("", 1, 5, 1, 5)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1 +select COLUMN_LIST("a"); +ERROR HY000: Encountered illegal format of dynamic column string +select column_delete("a", 1); +ERROR HY000: Encountered illegal format of dynamic column string +select hex(column_delete("", 1)); +hex(column_delete("", 1)) + +select hex(column_delete("", -1)); +ERROR 22007: Illegal value used as argument of dynamic column function +select hex(column_create(-1, 1)); +ERROR 22007: Illegal value used as argument of dynamic column function +select hex(column_create(65536, 1)); +ERROR 22007: Illegal value used as argument of dynamic column function +select hex(column_add("", -1, 1)); +ERROR 22007: Illegal value used as argument of dynamic column function +select hex(column_add("", 65536, 1)); +ERROR 22007: Illegal value used as argument of dynamic column function +select hex(column_get("", -1 as int)); +hex(column_get("", -1 as int)) +NULL +# +# Test with table +# +create table t1 (id int primary key, str mediumblob); +insert into t1 values (1, ''), (2, ''), (3, ''), (4, ''), (5, null); +select id, str, column_get(str, 1 as int) from t1; +id str column_get(str, 1 as int) +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL NULL +update t1 set str=column_create(1, id, 2, "a") where id < 3; +update t1 set str=column_add(str, 1, id, 2, "b") where id >= 4; +select id, column_get(str, 1 as int), column_get(str, 2 as char) from t1 where column_exists(str,1) or column_exists(str,2); +id column_get(str, 1 as int) column_get(str, 2 as char) +1 1 a +2 2 a +4 4 b +update t1 set str=column_create(1, id, 10, "test") where id = 5; +insert into t1 values (6, column_create(10, "test2")); +update t1 set str=column_add(str, 2, 'c', 1, column_get(str, 1 as int) + 1, 3, 100) where id > 2; +select id, length(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1; +id length(str) column_get(str, 1 as int) column_get(str, 2 as char) column_get(str, 3 as int) +1 12 1 a NULL +2 12 2 a NULL +3 12 NULL c 100 +4 16 5 c 100 +5 24 6 c 100 +6 21 NULL c 100 +select column_get(str, 2 as char), sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char); +column_get(str, 2 as char) sum(column_get(str, 1 as int)) +a 3 +c 11 +select column_get(str, 2 as char), sum(column_get(str, 1 as int)) from t1 where column_exists(str, 2) <> 0 group by 1; +column_get(str, 2 as char) sum(column_get(str, 1 as int)) +a 3 +c 11 +select sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char) order by sum(column_get(str, 1 as int)) desc; +sum(column_get(str, 1 as int)) +11 +3 +select sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char) having sum(column_get(str, 1 as int)) > 2; +sum(column_get(str, 1 as int)) +3 +11 +select sum(column_get(str, 1 as int)) from t1 where column_get(str, 3 as int) > 50 group by column_get(str, 2 as char); +sum(column_get(str, 1 as int)) +11 +select id, column_list(str) from t1 where id= 5; +id column_list(str) +5 1,2,3,10 +update t1 set str=column_delete(str, 3, 4, 2) where id= 5; +select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1; +id length(str) column_list(str) column_get(str, 1 as int) column_get(str, 2 as char) column_get(str, 3 as int) +1 12 1,2 1 a NULL +2 12 1,2 2 a NULL +3 12 2,3 NULL c 100 +4 16 1,2,3 5 c 100 +5 15 1,10 6 NULL NULL +6 21 2,3,10 NULL c 100 +update t1 set str=column_add(str, 4, 45 as char, 2, 'c') where id= 5; +select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1 where id = 5; +id length(str) column_list(str) column_get(str, 1 as int) column_get(str, 2 as char) column_get(str, 3 as int) +5 26 1,2,4,10 6 c NULL +select id, length(str), column_list(str), column_exists(str, 4) from t1; +id length(str) column_list(str) column_exists(str, 4) +1 12 1,2 0 +2 12 1,2 0 +3 12 2,3 0 +4 16 1,2,3 0 +5 26 1,2,4,10 1 +6 21 2,3,10 0 +select sum(column_get(str, 1 as int)), column_list(str) from t1 group by 2; +sum(column_get(str, 1 as int)) column_list(str) +3 1,2 +5 1,2,3 +6 1,2,4,10 +NULL 2,3 +NULL 2,3,10 +select id, hex(str) from t1; +id hex(str) +1 00020001000002000B020861 +2 00020001000002000B040861 +3 0002000200030300100863C8 +4 00030001000002000B0300180A0863C8 +5 00040001000002000B04001B0A00330C08633F34350874657374 +6 0003000200030300100A001B0863C8087465737432 +update t1 set str=column_add(str, 4, repeat("a", 100000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("a", 100000); +id +5 +select id from t1 where column_get(str,4 as char(100)) = repeat("a", 100); +id +5 +Warnings: +Warning 1292 Truncated incorrect CHAR(100) value: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +update t1 set str=column_add(str, 4, repeat("b", 10000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("b", 10000); +id +5 +update t1 set str=column_add(str, 4, repeat("c", 100)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("c", 100); +id +5 +update t1 set str=column_add(str, 4, repeat("d", 10000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("d", 10000); +id +5 +update t1 set str=column_add(str, 4, repeat("e", 10), 5, repeat("f", 100000)) where id=5; +select id from t1 where column_get(str,5 as char(100000)) = repeat("f", 100000); +id +5 +select id, column_list(str), length(str) from t1 where id=5; +id column_list(str) length(str) +5 1,2,4,5,10 100048 +update t1 set str=column_delete(str, 5) where id=5; +select id, column_list(str), length(str) from t1 where id=5; +id column_list(str) length(str) +5 1,2,4,10 34 +drop table t1; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 3a626084c9e..ea9e034e6c5 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -285,33 +285,55 @@ set names default; select cast(-2 as unsigned), 18446744073709551614, -2; cast(-2 as unsigned) 18446744073709551614 -2 18446744073709551614 18446744073709551614 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2); abs(cast(-2 as unsigned)) abs(18446744073709551614) abs(-2) 18446744073709551614 18446744073709551614 2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2); ceiling(cast(-2 as unsigned)) ceiling(18446744073709551614) ceiling(-2) 18446744073709551614 18446744073709551614 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2); floor(cast(-2 as unsigned)) floor(18446744073709551614) floor(-2) 18446744073709551614 18446744073709551614 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2); format(cast(-2 as unsigned), 2) format(18446744073709551614, 2) format(-2, 2) 18,446,744,073,709,551,614.00 18,446,744,073,709,551,614.00 -2.00 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2); sqrt(cast(-2 as unsigned)) sqrt(18446744073709551614) sqrt(-2) 4294967296 4294967296 NULL +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1); round(cast(-2 as unsigned), 1) round(18446744073709551614, 1) round(-2, 1) 18446744073709551614 18446744073709551614 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2); round(4, cast(-2 as unsigned)) round(4, 18446744073709551614) round(4, -2) 4 4 0 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1); truncate(cast(-2 as unsigned), 1) truncate(18446744073709551614, 1) truncate(-2, 1) 18446744073709551614 18446744073709551614 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2); truncate(4, cast(-2 as unsigned)) truncate(4, 18446744073709551614) truncate(4, -2) 4 4 0 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select round(10000000000000000000, -19), truncate(10000000000000000000, -19); round(10000000000000000000, -19) truncate(10000000000000000000, -19) 10000000000000000000 10000000000000000000 @@ -363,12 +385,18 @@ round(4, -4294967200) truncate(4, -4294967200) select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3); mod(cast(-2 as unsigned), 3) mod(18446744073709551614, 3) mod(-2, 3) 2 2 -2 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2); mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2) 5 5 1 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5); pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5) 2.13598703592091e+96 2.13598703592091e+96 -32 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1)); INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0); SELECT a DIV 900 y FROM t1 GROUP BY y; @@ -488,7 +516,7 @@ SELECT -9999999999999999991 DIV -1; -9999999999999999991 DIV -1 -9223372036854775808 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999991' to INT. Value truncated. SELECT -9223372036854775808 DIV -1; -9223372036854775808 DIV -1 -9223372036854775808 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index bbfd3880d2e..03fa25ba7b5 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1533,7 +1533,7 @@ select locate('lo','hello',-18446744073709551615); locate('lo','hello',-18446744073709551615) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select locate('lo','hello',18446744073709551615); locate('lo','hello',18446744073709551615) 0 @@ -1541,22 +1541,22 @@ select locate('lo','hello',-18446744073709551616); locate('lo','hello',-18446744073709551616) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select locate('lo','hello',18446744073709551616); locate('lo','hello',18446744073709551616) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select locate('lo','hello',-18446744073709551617); locate('lo','hello',-18446744073709551617) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select locate('lo','hello',18446744073709551617); locate('lo','hello',18446744073709551617) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select left('hello', 10); left('hello', 10) hello @@ -1588,8 +1588,8 @@ select left('hello', -18446744073709551615); left('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select left('hello', 18446744073709551615); left('hello', 18446744073709551615) hello @@ -1597,26 +1597,26 @@ select left('hello', -18446744073709551616); left('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select left('hello', 18446744073709551616); left('hello', 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select left('hello', -18446744073709551617); left('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select left('hello', 18446744073709551617); left('hello', 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select right('hello', 10); right('hello', 10) hello @@ -1648,8 +1648,8 @@ select right('hello', -18446744073709551615); right('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select right('hello', 18446744073709551615); right('hello', 18446744073709551615) hello @@ -1657,26 +1657,26 @@ select right('hello', -18446744073709551616); right('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select right('hello', 18446744073709551616); right('hello', 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select right('hello', -18446744073709551617); right('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select right('hello', 18446744073709551617); right('hello', 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', 2, -1); substring('hello', 2, -1) @@ -1708,8 +1708,8 @@ select substring('hello', -18446744073709551615, 1); substring('hello', -18446744073709551615, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 18446744073709551615, 1); substring('hello', 18446744073709551615, 1) @@ -1717,26 +1717,26 @@ select substring('hello', -18446744073709551616, 1); substring('hello', -18446744073709551616, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 18446744073709551616, 1); substring('hello', 18446744073709551616, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', -18446744073709551617, 1); substring('hello', -18446744073709551617, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 18446744073709551617, 1); substring('hello', 18446744073709551617, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', 1, -1); substring('hello', 1, -1) @@ -1762,8 +1762,8 @@ select substring('hello', 1, -18446744073709551615); substring('hello', 1, -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 1, 18446744073709551615); substring('hello', 1, 18446744073709551615) hello @@ -1771,26 +1771,26 @@ select substring('hello', 1, -18446744073709551616); substring('hello', 1, -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 1, 18446744073709551616); substring('hello', 1, 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', 1, -18446744073709551617); substring('hello', 1, -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 1, 18446744073709551617); substring('hello', 1, 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', -1, -1); substring('hello', -1, -1) @@ -1816,10 +1816,10 @@ select substring('hello', -18446744073709551615, -18446744073709551615); substring('hello', -18446744073709551615, -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 18446744073709551615, 18446744073709551615); substring('hello', 18446744073709551615, 18446744073709551615) @@ -1827,34 +1827,34 @@ select substring('hello', -18446744073709551616, -18446744073709551616); substring('hello', -18446744073709551616, -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 18446744073709551616, 18446744073709551616); substring('hello', 18446744073709551616, 18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', -18446744073709551617, -18446744073709551617); substring('hello', -18446744073709551617, -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 18446744073709551617, 18446744073709551617); substring('hello', 18446744073709551617, 18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', -1, 1, 'hi'); insert('hello', -1, 1, 'hi') hello @@ -1880,7 +1880,7 @@ select insert('hello', -18446744073709551615, 1, 'hi'); insert('hello', -18446744073709551615, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 18446744073709551615, 1, 'hi'); insert('hello', 18446744073709551615, 1, 'hi') hello @@ -1888,22 +1888,22 @@ select insert('hello', -18446744073709551616, 1, 'hi'); insert('hello', -18446744073709551616, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 18446744073709551616, 1, 'hi'); insert('hello', 18446744073709551616, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', -18446744073709551617, 1, 'hi'); insert('hello', -18446744073709551617, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 18446744073709551617, 1, 'hi'); insert('hello', 18446744073709551617, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', 1, -1, 'hi'); insert('hello', 1, -1, 'hi') hi @@ -1929,7 +1929,7 @@ select insert('hello', 1, -18446744073709551615, 'hi'); insert('hello', 1, -18446744073709551615, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 1, 18446744073709551615, 'hi'); insert('hello', 1, 18446744073709551615, 'hi') hi @@ -1937,22 +1937,22 @@ select insert('hello', 1, -18446744073709551616, 'hi'); insert('hello', 1, -18446744073709551616, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 1, 18446744073709551616, 'hi'); insert('hello', 1, 18446744073709551616, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', 1, -18446744073709551617, 'hi'); insert('hello', 1, -18446744073709551617, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 1, 18446744073709551617, 'hi'); insert('hello', 1, 18446744073709551617, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', -1, -1, 'hi'); insert('hello', -1, -1, 'hi') hello @@ -1978,8 +1978,8 @@ select insert('hello', -18446744073709551615, -18446744073709551615, 'hi'); insert('hello', -18446744073709551615, -18446744073709551615, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 18446744073709551615, 18446744073709551615, 'hi'); insert('hello', 18446744073709551615, 18446744073709551615, 'hi') hello @@ -1987,26 +1987,26 @@ select insert('hello', -18446744073709551616, -18446744073709551616, 'hi'); insert('hello', -18446744073709551616, -18446744073709551616, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 18446744073709551616, 18446744073709551616, 'hi'); insert('hello', 18446744073709551616, 18446744073709551616, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', -18446744073709551617, -18446744073709551617, 'hi'); insert('hello', -18446744073709551617, -18446744073709551617, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 18446744073709551617, 18446744073709551617, 'hi'); insert('hello', 18446744073709551617, 18446744073709551617, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select repeat('hello', -1); repeat('hello', -1) @@ -2038,8 +2038,8 @@ select repeat('hello', -18446744073709551615); repeat('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select repeat('hello', 18446744073709551615); repeat('hello', 18446744073709551615) NULL @@ -2049,27 +2049,27 @@ select repeat('hello', -18446744073709551616); repeat('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select repeat('hello', 18446744073709551616); repeat('hello', 18446744073709551616) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select repeat('hello', -18446744073709551617); repeat('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select repeat('hello', 18446744073709551617); repeat('hello', 18446744073709551617) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select space(-1); space(-1) @@ -2102,8 +2102,8 @@ select space(-18446744073709551615); space(-18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select space(18446744073709551615); space(18446744073709551615) NULL @@ -2113,27 +2113,27 @@ select space(-18446744073709551616); space(-18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select space(18446744073709551616); space(18446744073709551616) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select space(-18446744073709551617); space(-18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select space(18446744073709551617); space(18446744073709551617) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select rpad('hello', -1, '1'); rpad('hello', -1, '1') @@ -2166,8 +2166,8 @@ select rpad('hello', -18446744073709551615, '1'); rpad('hello', -18446744073709551615, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select rpad('hello', 18446744073709551615, '1'); rpad('hello', 18446744073709551615, '1') NULL @@ -2177,27 +2177,27 @@ select rpad('hello', -18446744073709551616, '1'); rpad('hello', -18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select rpad('hello', 18446744073709551616, '1'); rpad('hello', 18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated select rpad('hello', -18446744073709551617, '1'); rpad('hello', -18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select rpad('hello', 18446744073709551617, '1'); rpad('hello', 18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated select lpad('hello', -1, '1'); lpad('hello', -1, '1') @@ -2230,8 +2230,8 @@ select lpad('hello', -18446744073709551615, '1'); lpad('hello', -18446744073709551615, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select lpad('hello', 18446744073709551615, '1'); lpad('hello', 18446744073709551615, '1') NULL @@ -2241,27 +2241,27 @@ select lpad('hello', -18446744073709551616, '1'); lpad('hello', -18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select lpad('hello', 18446744073709551616, '1'); lpad('hello', 18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated select lpad('hello', -18446744073709551617, '1'); lpad('hello', -18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select lpad('hello', 18446744073709551617, '1'); lpad('hello', 18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated SET @orig_sql_mode = @@SQL_MODE; SET SQL_MODE=traditional; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index a97c040d9ac..9c446b4e21f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1014,6 +1014,7 @@ SELECT MAKETIME(CAST(-1 AS UNSIGNED), 0, 0); MAKETIME(CAST(-1 AS UNSIGNED), 0, 0) 838:59:59 Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect time value: '18446744073709551615:00:00' SELECT EXTRACT(HOUR FROM '100000:02:03'); EXTRACT(HOUR FROM '100000:02:03') @@ -1033,6 +1034,7 @@ SELECT SEC_TO_TIME(CAST(-1 AS UNSIGNED)); SEC_TO_TIME(CAST(-1 AS UNSIGNED)) 838:59:59 Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect time value: '18446744073709551615' SET NAMES latin1; SET character_set_results = NULL; diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result index f5420a62f63..6cd70466d1b 100644 --- a/mysql-test/r/sp-vars.result +++ b/mysql-test/r/sp-vars.result @@ -380,7 +380,7 @@ ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 1 SELECT sp_vars_check_ret2(); ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 1 SELECT sp_vars_check_ret3(); -ERROR HY000: Incorrect integer value: 'Hello, world' for column 'sp_vars_check_ret3()' at row 1 +ERROR 22007: Incorrect integer value: 'Hello, world' for column 'sp_vars_check_ret3()' at row 1 SELECT sp_vars_check_ret4(); sp_vars_check_ret4() 154.12 diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 241f4198bf7..4cd68a52748 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -260,24 +260,24 @@ INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE)); INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE)); -ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0' INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE)); -ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10' INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0 15:30' INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10 15:30' INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0 15:30' INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10 15:30' INSERT INTO t1 (col3) VALUES(CAST('0000-00-00' AS DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' drop table t1; @@ -287,24 +287,26 @@ INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE)); -ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0' INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE)); -ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10' +INSERT INTO t1 (col1) VALUES('2004-0-10'); +ERROR 22007: Incorrect date value: '2004-0-10' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0 15:30' INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10 15:30' INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 +ERROR 22007: Incorrect datetime value: '2004-10-0 15:30' INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); -ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1 +ERROR 22007: Incorrect datetime value: '2004-0-10 15:30' INSERT INTO t1 (col3) VALUES(CONVERT('0000-00-00',DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' drop table t1; @@ -364,9 +366,9 @@ Warnings: Error 1365 Division by 0 Error 1365 Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); ERROR 01000: Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); @@ -447,9 +449,9 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); ERROR 01000: Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); @@ -531,9 +533,9 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); ERROR 01000: Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); @@ -615,9 +617,9 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); ERROR 01000: Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); @@ -697,9 +699,9 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); ERROR 01000: Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); @@ -776,7 +778,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1 INSERT INTO t1 VALUES ('-100E+1'); ERROR 22003: Out of range value for column 'col1' at row 1 INSERT INTO t1 VALUES ('-100E'); -ERROR HY000: Incorrect decimal value: '-100E' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: '-100E' for column 'col1' at row 1 UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11; ERROR 22003: Out of range value for column 'col1' at row 6 UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0; @@ -784,11 +786,11 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR HY000: Incorrect decimal value: '' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); -ERROR HY000: Incorrect decimal value: '1a' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: '1a' for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); Warnings: Note 1265 Data truncated for column 'col1' at row 1 @@ -1361,34 +1363,34 @@ col5 mediumint, col6 mediumint unsigned, col7 int, col8 int unsigned, col9 bigint, col10 bigint unsigned); insert into t1(col1) values('-'); -ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'col1' at row 1 insert into t1(col2) values('+'); -ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'col2' at row 1 insert into t1(col3) values('-'); -ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'col3' at row 1 insert into t1(col4) values('+'); -ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'col4' at row 1 insert into t1(col5) values('-'); -ERROR HY000: Incorrect integer value: '-' for column 'col5' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'col5' at row 1 insert into t1(col6) values('+'); -ERROR HY000: Incorrect integer value: '+' for column 'col6' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'col6' at row 1 insert into t1(col7) values('-'); -ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'col7' at row 1 insert into t1(col8) values('+'); -ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'col8' at row 1 insert into t1(col9) values('-'); -ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'col9' at row 1 insert into t1(col10) values('+'); -ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'col10' at row 1 drop table t1; set sql_mode='traditional'; create table t1(a year); insert into t1 values ('-'); -ERROR HY000: Incorrect integer value: '-' for column 'a' at row 1 +ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1 insert into t1 values ('+'); -ERROR HY000: Incorrect integer value: '+' for column 'a' at row 1 +ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1 insert into t1 values (''); -ERROR HY000: Incorrect integer value: '' for column 'a' at row 1 +ERROR 22007: Incorrect integer value: '' for column 'a' at row 1 insert into t1 values ('2000a'); ERROR 01000: Data truncated for column 'a' at row 1 insert into t1 values ('2E3x'); diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 70ee3a56cf3..3ce3805df62 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -825,7 +825,7 @@ Error 1365 Division by 0 Error 1365 Division by 0 Error 1365 Division by 0 INSERT INTO Sow6_2f VALUES ('a59b'); -ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1 drop table Sow6_2f; select 10.3330000000000/12.34500000; 10.3330000000000/12.34500000 @@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999 x 99999999999999999999999999999999999999999999999999999999999999999 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x 100000000000000000000000000000000000000000000000000000000000000000 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1380,15 +1380,15 @@ create table t1 (c1 decimal(64)); insert into t1 values( 89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values( 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values(1e100); Warnings: @@ -1432,7 +1432,7 @@ select cast(19999999999999999999 as unsigned); cast(19999999999999999999 as unsigned) 18446744073709551615 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '19999999999999999999' to UNSIGNED INT. Value truncated. create table t1(a decimal(18)); insert into t1 values(123456789012345678); alter table t1 modify column a decimal(19); @@ -1674,7 +1674,7 @@ CREATE TABLE t1 SELECT /* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001 AS c1; Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. DESC t1; Field Type Null Key Default Extra c1 decimal(65,0) NO 0 diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 95a969d3791..1c75e415b75 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -324,7 +324,7 @@ select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t; CAST(a AS DECIMAL(13,5)) 0.00000 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' create table t1 (a integer unsigned); insert into t1 values (1),(-1),(0),(-2); diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index c62c91f1d57..625606014c0 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -945,8 +945,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -960,8 +960,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -2450,6 +2450,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2462,6 +2464,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2556,7 +2560,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2571,7 +2577,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2587,9 +2595,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2603,9 +2611,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. DROP VIEW v1; @@ -2620,6 +2628,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2632,6 +2643,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2955,8 +2969,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2970,8 +2984,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -3282,9 +3296,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3300,9 +3314,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 DROP VIEW v1; @@ -3372,9 +3386,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3389,9 +3403,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3408,11 +3422,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3430,11 +3444,11 @@ NULL NULL 1 -1.00 -1 -3333.33 -3333.3333 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3454,9 +3468,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3471,9 +3485,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3490,11 +3504,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3510,11 +3524,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3908,8 +3922,8 @@ my_time, id FROM t1_values WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: @@ -3923,8 +3937,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index f83a931af5c..05293451727 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -2451,6 +2451,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2463,6 +2465,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2557,7 +2561,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2572,7 +2578,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2588,9 +2596,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2604,9 +2612,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. DROP VIEW v1; @@ -2621,6 +2629,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2633,6 +2644,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2956,8 +2970,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2971,8 +2985,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -3283,9 +3297,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3301,9 +3315,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 DROP VIEW v1; @@ -3373,9 +3387,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3390,9 +3404,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3409,11 +3423,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3431,11 +3445,11 @@ NULL NULL 1 -1.00 -1 -3333.33 -3333.3333 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3455,9 +3469,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3472,9 +3486,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3491,11 +3505,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3511,11 +3525,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3909,8 +3923,8 @@ my_time, id FROM t1_values WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: @@ -3924,8 +3938,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index f83a931af5c..05293451727 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999 0.000000000000000000000000000000 4 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -2451,6 +2451,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2463,6 +2465,8 @@ NULL NULL 1 8385959 838:59:59 3 130000 13:00:00 4 100000 10:00:00 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2557,7 +2561,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2572,7 +2578,9 @@ NULL NULL 1 18446744073709551615 -1 5 Warnings: Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2588,9 +2596,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2604,9 +2612,9 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 0 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated. +Error 1655 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated. DROP VIEW v1; @@ -2621,6 +2629,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2633,6 +2644,9 @@ NULL NULL 1 9223372036854775807 9223372036854775807 3 0 0 4 18446744073709551615 -1 5 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2956,8 +2970,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2971,8 +2985,8 @@ NULL NULL 1 0 0.000000000000000000000000000000 4 -1 -1.000000000000000000000000000000 5 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. +Error 1655 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated. DROP VIEW v1; @@ -3283,9 +3297,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3301,9 +3315,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 30 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1 DROP VIEW v1; @@ -3373,9 +3387,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3390,9 +3404,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3409,11 +3423,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3431,11 +3445,11 @@ NULL NULL 1 -1.00 -1 -3333.33 -3333.3333 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' Warning 1292 Truncated incorrect DECIMAL value: '-1' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333' @@ -3455,9 +3469,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3472,9 +3486,9 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL +Error 1657 Encountered illegal value '' when converting to DECIMAL DROP VIEW v1; @@ -3491,11 +3505,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3511,11 +3525,11 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Error 1366 Incorrect decimal value: '' for column '' at row 0 +Error 1657 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3909,8 +3923,8 @@ my_time, id FROM t1_values WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: @@ -3924,8 +3938,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 -0000-00-00 00:00:00 -838:59:59 2 -0000-00-00 00:00:00 838:59:59 3 +NULL -838:59:59 2 +NULL 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test index 0daa1c3c739..0b1e560b58d 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test +++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test @@ -26,6 +26,7 @@ CREATE TABLE t3( disable_query_log; +begin; let $1 = 100; while ($1) { @@ -44,6 +45,7 @@ while ($1) } dec $1; } +commit; enable_query_log; diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc index 49d0b6fc69f..844ba70df4a 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc @@ -16,12 +16,14 @@ --echo --- Delete rows and partitions of tables with $sqlfunc --echo ------------------------------------------------------------------------- +begin; eval delete from $t1 where col1=$val2; eval delete from $t2 where col1=$val2; eval delete from $t3 where col1=$val2; eval delete from $t4 where col1=$val2; eval delete from $t5 where col1=$val2; eval delete from $t6 where col1=$val2; +commit; eval select * from $t1 order by col1; eval select * from $t2 order by col1; @@ -29,12 +31,14 @@ eval select * from $t3 order by col1; eval select * from $t4 order by colint; eval select * from $t5 order by colint; +begin; eval insert into $t1 values ($val2); eval insert into $t2 values ($val2); eval insert into $t3 values ($val2); eval insert into $t4 values (60,$val2); eval insert into $t5 values (60,$val2); eval insert into $t6 values (60,$val2); +commit; eval select * from $t1 order by col1; eval select * from $t2 order by col1; diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc index 83d0fa37375..0de6bd7d2f5 100644 --- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc @@ -113,6 +113,7 @@ $part_t6; --echo --- Access tables with $sqlfunc --echo ------------------------------------------------------------------------- +begin; eval insert into t1 values ($val1); eval insert into t1 values ($val2); @@ -123,6 +124,7 @@ eval insert into t2 values ($val3); eval insert into t3 values ($val1); eval insert into t3 values ($val2); eval insert into t3 values ($val3); +commit; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t4; @@ -142,12 +144,14 @@ select * from t6 order by colint; if ($do_long_tests) { + begin; eval update t1 set col1=$val4 where col1=$val1; eval update t2 set col1=$val4 where col1=$val1; eval update t3 set col1=$val4 where col1=$val1; eval update t4 set col1=$val4 where col1=$val1; eval update t5 set col1=$val4 where col1=$val1; eval update t6 set col1=$val4 where col1=$val1; + commit; select * from t1 order by col1; select * from t2 order by col1; diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result index c5b4e0a8665..7568f87f2ce 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result @@ -47,6 +47,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with abs(col1) ------------------------------------------------------------------------- +begin; insert into t1 values (5 ); insert into t1 values (13 ); insert into t2 values (5 ); @@ -55,6 +56,7 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6; @@ -217,12 +219,14 @@ colint col1 50 56 51 34 55 123 +begin; update t1 set col1=15 where col1=5 ; update t2 set col1=15 where col1=5 ; update t3 set col1=15 where col1=5 ; update t4 set col1=15 where col1=5 ; update t5 set col1=15 where col1=5 ; update t6 set col1=15 where col1=5 ; +commit; select * from t1 order by col1; col1 13 @@ -877,12 +881,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1=13 ; delete from t2 where col1=13 ; delete from t3 where col1=13 ; delete from t4 where col1=13 ; delete from t5 where col1=13 ; delete from t6 where col1=13 ; +commit; select * from t1 order by col1; col1 15 @@ -986,12 +992,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t1 values (13 ); insert into t2 values (13 ); insert into t3 values (13 ); insert into t4 values (60,13 ); insert into t5 values (60,13 ); insert into t6 values (60,13 ); +commit; select * from t1 order by col1; col1 13 @@ -1274,12 +1282,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1=13 ; delete from t22 where col1=13 ; delete from t33 where col1=13 ; delete from t44 where col1=13 ; delete from t55 where col1=13 ; delete from t66 where col1=13 ; +commit; select * from t11 order by col1; col1 15 @@ -1383,12 +1393,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t11 values (13 ); insert into t22 values (13 ); insert into t33 values (13 ); insert into t44 values (60,13 ); insert into t55 values (60,13 ); insert into t66 values (60,13 ); +commit; select * from t11 order by col1; col1 13 @@ -1732,6 +1744,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with mod(col1,10) ------------------------------------------------------------------------- +begin; insert into t1 values (5); insert into t1 values (19); insert into t2 values (5); @@ -1740,6 +1753,7 @@ insert into t2 values (17); insert into t3 values (5); insert into t3 values (19); insert into t3 values (17); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6; @@ -1902,12 +1916,14 @@ colint col1 50 56 51 34 55 123 +begin; update t1 set col1=15 where col1=5; update t2 set col1=15 where col1=5; update t3 set col1=15 where col1=5; update t4 set col1=15 where col1=5; update t5 set col1=15 where col1=5; update t6 set col1=15 where col1=5; +commit; select * from t1 order by col1; col1 15 @@ -2562,12 +2578,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- +begin; delete from t1 where col1=19; delete from t2 where col1=19; delete from t3 where col1=19; delete from t4 where col1=19; delete from t5 where col1=19; delete from t6 where col1=19; +commit; select * from t1 order by col1; col1 15 @@ -2673,12 +2691,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); insert into t4 values (60,19); insert into t5 values (60,19); insert into t6 values (60,19); +commit; select * from t1 order by col1; col1 15 @@ -2970,12 +2990,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- +begin; delete from t11 where col1=19; delete from t22 where col1=19; delete from t33 where col1=19; delete from t44 where col1=19; delete from t55 where col1=19; delete from t66 where col1=19; +commit; select * from t11 order by col1; col1 15 @@ -3081,12 +3103,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); insert into t44 values (60,19); insert into t55 values (60,19); insert into t66 values (60,19); +commit; select * from t11 order by col1; col1 15 @@ -3439,6 +3463,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with day(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-02-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-02-03'); @@ -3447,6 +3472,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -3486,12 +3512,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-02-03'; update t2 set col1='2006-02-05' where col1='2006-02-03'; update t3 set col1='2006-02-05' where col1='2006-02-03'; update t4 set col1='2006-02-05' where col1='2006-02-03'; update t5 set col1='2006-02-05' where col1='2006-02-03'; update t6 set col1='2006-02-05' where col1='2006-02-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -3695,12 +3723,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -3722,12 +3752,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -3789,12 +3821,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -3816,12 +3850,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -3944,6 +3980,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-02-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-02-03'); @@ -3952,6 +3989,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -3991,12 +4029,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-02-03'; update t2 set col1='2006-02-05' where col1='2006-02-03'; update t3 set col1='2006-02-05' where col1='2006-02-03'; update t4 set col1='2006-02-05' where col1='2006-02-03'; update t5 set col1='2006-02-05' where col1='2006-02-03'; update t6 set col1='2006-02-05' where col1='2006-02-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -4200,12 +4240,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4227,12 +4269,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -4294,12 +4338,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4321,12 +4367,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -4449,6 +4497,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-02-17'); insert into t2 values ('2006-01-03'); @@ -4457,6 +4506,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -4496,12 +4546,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4705,12 +4757,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-02-17'; delete from t2 where col1='2006-02-17'; delete from t3 where col1='2006-02-17'; delete from t4 where col1='2006-02-17'; delete from t5 where col1='2006-02-17'; delete from t6 where col1='2006-02-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4734,12 +4788,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-02-17'); insert into t2 values ('2006-02-17'); insert into t3 values ('2006-02-17'); insert into t4 values (60,'2006-02-17'); insert into t5 values (60,'2006-02-17'); insert into t6 values (60,'2006-02-17'); +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4805,12 +4861,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-02-17'; delete from t22 where col1='2006-02-17'; delete from t33 where col1='2006-02-17'; delete from t44 where col1='2006-02-17'; delete from t55 where col1='2006-02-17'; delete from t66 where col1='2006-02-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4834,12 +4892,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-02-17'); insert into t22 values ('2006-02-17'); insert into t33 values ('2006-02-17'); insert into t44 values (60,'2006-02-17'); insert into t55 values (60,'2006-02-17'); insert into t66 values (60,'2006-02-17'); +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4966,6 +5026,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-03'); @@ -4974,6 +5035,7 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -5013,12 +5075,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -5222,12 +5286,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5249,12 +5315,14 @@ colint col1 1 2006-02-03 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -5317,12 +5385,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5344,12 +5414,14 @@ colint col1 1 2006-02-03 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -5473,6 +5545,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with extract(month from col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-02-17'); insert into t2 values ('2006-01-03'); @@ -5481,6 +5554,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -5520,12 +5594,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5729,12 +5805,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-02-17'; delete from t2 where col1='2006-02-17'; delete from t3 where col1='2006-02-17'; delete from t4 where col1='2006-02-17'; delete from t5 where col1='2006-02-17'; delete from t6 where col1='2006-02-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5758,12 +5836,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-02-17'); insert into t2 values ('2006-02-17'); insert into t3 values ('2006-02-17'); insert into t4 values (60,'2006-02-17'); insert into t5 values (60,'2006-02-17'); insert into t6 values (60,'2006-02-17'); +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5824,12 +5904,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-02-17'; delete from t22 where col1='2006-02-17'; delete from t33 where col1='2006-02-17'; delete from t44 where col1='2006-02-17'; delete from t55 where col1='2006-02-17'; delete from t66 where col1='2006-02-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5853,12 +5935,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-02-17'); insert into t22 values ('2006-02-17'); insert into t33 values ('2006-02-17'); insert into t44 values (60,'2006-02-17'); insert into t55 values (60,'2006-02-17'); insert into t66 values (60,'2006-02-17'); +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5980,6 +6064,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with hour(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09'); insert into t1 values ('14:30'); insert into t2 values ('09:09'); @@ -5988,6 +6073,7 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -6027,12 +6113,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:30' where col1='09:09'; update t2 set col1='10:30' where col1='09:09'; update t3 set col1='10:30' where col1='09:09'; update t4 set col1='10:30' where col1='09:09'; update t5 set col1='10:30' where col1='09:09'; update t6 set col1='10:30' where col1='09:09'; +commit; select * from t1 order by col1; col1 10:30:00 @@ -6236,12 +6324,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30'; delete from t2 where col1='14:30'; delete from t3 where col1='14:30'; delete from t4 where col1='14:30'; delete from t5 where col1='14:30'; delete from t6 where col1='14:30'; +commit; select * from t1 order by col1; col1 10:30:00 @@ -6265,12 +6355,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30'); insert into t2 values ('14:30'); insert into t3 values ('14:30'); insert into t4 values (60,'14:30'); insert into t5 values (60,'14:30'); insert into t6 values (60,'14:30'); +commit; select * from t1 order by col1; col1 10:30:00 @@ -6334,12 +6426,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30'; delete from t22 where col1='14:30'; delete from t33 where col1='14:30'; delete from t44 where col1='14:30'; delete from t55 where col1='14:30'; delete from t66 where col1='14:30'; +commit; select * from t11 order by col1; col1 10:30:00 @@ -6363,12 +6457,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30'); insert into t22 values ('14:30'); insert into t33 values ('14:30'); insert into t44 values (60,'14:30'); insert into t55 values (60,'14:30'); insert into t66 values (60,'14:30'); +commit; select * from t11 order by col1; col1 10:30:00 @@ -6493,6 +6589,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with microsecond(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15.000002'); insert into t1 values ('04:30:01.000018'); insert into t2 values ('09:09:15.000002'); @@ -6501,6 +6598,7 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -6540,12 +6638,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t2 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t3 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t4 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t5 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t6 set col1='05:30:34.000037' where col1='09:09:15.000002'; +commit; select * from t1 order by col1; col1 04:30:01 @@ -6749,12 +6849,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='04:30:01.000018'; delete from t2 where col1='04:30:01.000018'; delete from t3 where col1='04:30:01.000018'; delete from t4 where col1='04:30:01.000018'; delete from t5 where col1='04:30:01.000018'; delete from t6 where col1='04:30:01.000018'; +commit; select * from t1 order by col1; col1 05:30:34 @@ -6776,12 +6878,14 @@ colint col1 1 05:30:34 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('04:30:01.000018'); insert into t2 values ('04:30:01.000018'); insert into t3 values ('04:30:01.000018'); insert into t4 values (60,'04:30:01.000018'); insert into t5 values (60,'04:30:01.000018'); insert into t6 values (60,'04:30:01.000018'); +commit; select * from t1 order by col1; col1 04:30:01 @@ -6840,12 +6944,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='04:30:01.000018'; delete from t22 where col1='04:30:01.000018'; delete from t33 where col1='04:30:01.000018'; delete from t44 where col1='04:30:01.000018'; delete from t55 where col1='04:30:01.000018'; delete from t66 where col1='04:30:01.000018'; +commit; select * from t11 order by col1; col1 05:30:34 @@ -6867,12 +6973,14 @@ colint col1 1 05:30:34 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('04:30:01.000018'); insert into t22 values ('04:30:01.000018'); insert into t33 values ('04:30:01.000018'); insert into t44 values (60,'04:30:01.000018'); insert into t55 values (60,'04:30:01.000018'); insert into t66 values (60,'04:30:01.000018'); +commit; select * from t11 order by col1; col1 04:30:01 @@ -6992,6 +7100,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with minute(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15'); insert into t1 values ('14:30:45'); insert into t2 values ('09:09:15'); @@ -7000,6 +7109,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -7039,12 +7149,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:24:23' where col1='09:09:15'; update t2 set col1='10:24:23' where col1='09:09:15'; update t3 set col1='10:24:23' where col1='09:09:15'; update t4 set col1='10:24:23' where col1='09:09:15'; update t5 set col1='10:24:23' where col1='09:09:15'; update t6 set col1='10:24:23' where col1='09:09:15'; +commit; select * from t1 order by col1; col1 10:24:23 @@ -7248,12 +7360,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:45'; delete from t2 where col1='14:30:45'; delete from t3 where col1='14:30:45'; delete from t4 where col1='14:30:45'; delete from t5 where col1='14:30:45'; delete from t6 where col1='14:30:45'; +commit; select * from t1 order by col1; col1 10:24:23 @@ -7277,12 +7391,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:45'); insert into t2 values ('14:30:45'); insert into t3 values ('14:30:45'); insert into t4 values (60,'14:30:45'); insert into t5 values (60,'14:30:45'); insert into t6 values (60,'14:30:45'); +commit; select * from t1 order by col1; col1 10:24:23 @@ -7349,12 +7465,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:45'; delete from t22 where col1='14:30:45'; delete from t33 where col1='14:30:45'; delete from t44 where col1='14:30:45'; delete from t55 where col1='14:30:45'; delete from t66 where col1='14:30:45'; +commit; select * from t11 order by col1; col1 10:24:23 @@ -7378,12 +7496,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:45'); insert into t22 values ('14:30:45'); insert into t33 values ('14:30:45'); insert into t44 values (60,'14:30:45'); insert into t55 values (60,'14:30:45'); insert into t66 values (60,'14:30:45'); +commit; select * from t11 order by col1; col1 10:24:23 @@ -7511,6 +7631,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with second(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:09'); insert into t1 values ('14:30:20'); insert into t2 values ('09:09:09'); @@ -7519,6 +7640,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -7558,12 +7680,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:22:33' where col1='09:09:09'; update t2 set col1='10:22:33' where col1='09:09:09'; update t3 set col1='10:22:33' where col1='09:09:09'; update t4 set col1='10:22:33' where col1='09:09:09'; update t5 set col1='10:22:33' where col1='09:09:09'; update t6 set col1='10:22:33' where col1='09:09:09'; +commit; select * from t1 order by col1; col1 10:22:33 @@ -7767,12 +7891,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:20'; delete from t2 where col1='14:30:20'; delete from t3 where col1='14:30:20'; delete from t4 where col1='14:30:20'; delete from t5 where col1='14:30:20'; delete from t6 where col1='14:30:20'; +commit; select * from t1 order by col1; col1 10:22:33 @@ -7796,12 +7922,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:20'); insert into t2 values ('14:30:20'); insert into t3 values ('14:30:20'); insert into t4 values (60,'14:30:20'); insert into t5 values (60,'14:30:20'); insert into t6 values (60,'14:30:20'); +commit; select * from t1 order by col1; col1 10:22:33 @@ -7868,12 +7996,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:20'; delete from t22 where col1='14:30:20'; delete from t33 where col1='14:30:20'; delete from t44 where col1='14:30:20'; delete from t55 where col1='14:30:20'; delete from t66 where col1='14:30:20'; +commit; select * from t11 order by col1; col1 10:22:33 @@ -7897,12 +8027,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:20'); insert into t22 values ('14:30:20'); insert into t33 values ('14:30:20'); insert into t44 values (60,'14:30:20'); insert into t55 values (60,'14:30:20'); insert into t66 values (60,'14:30:20'); +commit; select * from t11 order by col1; col1 10:22:33 @@ -8030,6 +8162,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with month(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-12-17'); insert into t2 values ('2006-01-03'); @@ -8038,6 +8171,7 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -8077,12 +8211,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-11-06' where col1='2006-01-03'; update t2 set col1='2006-11-06' where col1='2006-01-03'; update t3 set col1='2006-11-06' where col1='2006-01-03'; update t4 set col1='2006-11-06' where col1='2006-01-03'; update t5 set col1='2006-11-06' where col1='2006-01-03'; update t6 set col1='2006-11-06' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8286,12 +8422,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-12-17'; delete from t2 where col1='2006-12-17'; delete from t3 where col1='2006-12-17'; delete from t4 where col1='2006-12-17'; delete from t5 where col1='2006-12-17'; delete from t6 where col1='2006-12-17'; +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8315,12 +8453,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-12-17'); insert into t2 values ('2006-12-17'); insert into t3 values ('2006-12-17'); insert into t4 values (60,'2006-12-17'); insert into t5 values (60,'2006-12-17'); insert into t6 values (60,'2006-12-17'); +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8384,12 +8524,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-12-17'; delete from t22 where col1='2006-12-17'; delete from t33 where col1='2006-12-17'; delete from t44 where col1='2006-12-17'; delete from t55 where col1='2006-12-17'; delete from t66 where col1='2006-12-17'; +commit; select * from t11 order by col1; col1 2006-11-06 @@ -8413,12 +8555,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-12-17'); insert into t22 values ('2006-12-17'); insert into t33 values ('2006-12-17'); insert into t44 values (60,'2006-12-17'); insert into t55 values (60,'2006-12-17'); insert into t66 values (60,'2006-12-17'); +commit; select * from t11 order by col1; col1 2006-11-06 @@ -8543,6 +8687,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with quarter(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-12-17'); insert into t2 values ('2006-01-03'); @@ -8551,6 +8696,7 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -8590,12 +8736,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-07-30' where col1='2006-01-03'; update t2 set col1='2006-07-30' where col1='2006-01-03'; update t3 set col1='2006-07-30' where col1='2006-01-03'; update t4 set col1='2006-07-30' where col1='2006-01-03'; update t5 set col1='2006-07-30' where col1='2006-01-03'; update t6 set col1='2006-07-30' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8799,12 +8947,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-12-17'; delete from t2 where col1='2006-12-17'; delete from t3 where col1='2006-12-17'; delete from t4 where col1='2006-12-17'; delete from t5 where col1='2006-12-17'; delete from t6 where col1='2006-12-17'; +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8828,12 +8978,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-12-17'); insert into t2 values ('2006-12-17'); insert into t3 values ('2006-12-17'); insert into t4 values (60,'2006-12-17'); insert into t5 values (60,'2006-12-17'); insert into t6 values (60,'2006-12-17'); +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8896,12 +9048,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-12-17'; delete from t22 where col1='2006-12-17'; delete from t33 where col1='2006-12-17'; delete from t44 where col1='2006-12-17'; delete from t55 where col1='2006-12-17'; delete from t66 where col1='2006-12-17'; +commit; select * from t11 order by col1; col1 2006-07-30 @@ -8925,12 +9079,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-12-17'); insert into t22 values ('2006-12-17'); insert into t33 values ('2006-12-17'); insert into t44 values (60,'2006-12-17'); insert into t55 values (60,'2006-12-17'); insert into t66 values (60,'2006-12-17'); +commit; select * from t11 order by col1; col1 2006-07-30 @@ -9054,6 +9210,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15'); insert into t1 values ('14:30:45'); insert into t2 values ('09:09:15'); @@ -9062,6 +9219,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -9101,12 +9259,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:33:11' where col1='09:09:15'; update t2 set col1='10:33:11' where col1='09:09:15'; update t3 set col1='10:33:11' where col1='09:09:15'; update t4 set col1='10:33:11' where col1='09:09:15'; update t5 set col1='10:33:11' where col1='09:09:15'; update t6 set col1='10:33:11' where col1='09:09:15'; +commit; select * from t1 order by col1; col1 10:33:11 @@ -9310,12 +9470,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:45'; delete from t2 where col1='14:30:45'; delete from t3 where col1='14:30:45'; delete from t4 where col1='14:30:45'; delete from t5 where col1='14:30:45'; delete from t6 where col1='14:30:45'; +commit; select * from t1 order by col1; col1 10:33:11 @@ -9339,12 +9501,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:45'); insert into t2 values ('14:30:45'); insert into t3 values ('14:30:45'); insert into t4 values (60,'14:30:45'); insert into t5 values (60,'14:30:45'); insert into t6 values (60,'14:30:45'); +commit; select * from t1 order by col1; col1 10:33:11 @@ -9410,12 +9574,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:45'; delete from t22 where col1='14:30:45'; delete from t33 where col1='14:30:45'; delete from t44 where col1='14:30:45'; delete from t55 where col1='14:30:45'; delete from t66 where col1='14:30:45'; +commit; select * from t11 order by col1; col1 10:33:11 @@ -9439,12 +9605,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:45'); insert into t22 values ('14:30:45'); insert into t33 values ('14:30:45'); insert into t44 values (60,'14:30:45'); insert into t55 values (60,'14:30:45'); insert into t66 values (60,'14:30:45'); +commit; select * from t11 order by col1; col1 10:33:11 @@ -9571,6 +9739,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with weekday(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-12-03'); insert into t1 values ('2006-11-17'); insert into t2 values ('2006-12-03'); @@ -9579,6 +9748,7 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -9618,12 +9788,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-06' where col1='2006-12-03'; update t2 set col1='2006-02-06' where col1='2006-12-03'; update t3 set col1='2006-02-06' where col1='2006-12-03'; update t4 set col1='2006-02-06' where col1='2006-12-03'; update t5 set col1='2006-02-06' where col1='2006-12-03'; update t6 set col1='2006-02-06' where col1='2006-12-03'; +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9827,12 +9999,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-11-17'; delete from t2 where col1='2006-11-17'; delete from t3 where col1='2006-11-17'; delete from t4 where col1='2006-11-17'; delete from t5 where col1='2006-11-17'; delete from t6 where col1='2006-11-17'; +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9856,12 +10030,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-11-17'); insert into t2 values ('2006-11-17'); insert into t3 values ('2006-11-17'); insert into t4 values (60,'2006-11-17'); insert into t5 values (60,'2006-11-17'); insert into t6 values (60,'2006-11-17'); +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9923,12 +10099,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-11-17'; delete from t22 where col1='2006-11-17'; delete from t33 where col1='2006-11-17'; delete from t44 where col1='2006-11-17'; delete from t55 where col1='2006-11-17'; delete from t66 where col1='2006-11-17'; +commit; select * from t11 order by col1; col1 2006-02-06 @@ -9952,12 +10130,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-11-17'); insert into t22 values ('2006-11-17'); insert into t33 values ('2006-11-17'); insert into t44 values (60,'2006-11-17'); insert into t55 values (60,'2006-11-17'); insert into t66 values (60,'2006-11-17'); +commit; select * from t11 order by col1; col1 2006-02-06 @@ -10080,6 +10260,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; insert into t1 values ('1996-01-03'); insert into t1 values ('2000-02-17'); insert into t2 values ('1996-01-03'); @@ -10088,6 +10269,7 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -10127,12 +10309,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2002-02-15' where col1='1996-01-03'; update t2 set col1='2002-02-15' where col1='1996-01-03'; update t3 set col1='2002-02-15' where col1='1996-01-03'; update t4 set col1='2002-02-15' where col1='1996-01-03'; update t5 set col1='2002-02-15' where col1='1996-01-03'; update t6 set col1='2002-02-15' where col1='1996-01-03'; +commit; select * from t1 order by col1; col1 2000-02-17 @@ -10336,12 +10520,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; delete from t1 where col1='2000-02-17'; delete from t2 where col1='2000-02-17'; delete from t3 where col1='2000-02-17'; delete from t4 where col1='2000-02-17'; delete from t5 where col1='2000-02-17'; delete from t6 where col1='2000-02-17'; +commit; select * from t1 order by col1; col1 2002-02-15 @@ -10365,12 +10551,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2000-02-17'); insert into t2 values ('2000-02-17'); insert into t3 values ('2000-02-17'); insert into t4 values (60,'2000-02-17'); insert into t5 values (60,'2000-02-17'); insert into t6 values (60,'2000-02-17'); +commit; select * from t1 order by col1; col1 2000-02-17 @@ -10434,12 +10622,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; delete from t11 where col1='2000-02-17'; delete from t22 where col1='2000-02-17'; delete from t33 where col1='2000-02-17'; delete from t44 where col1='2000-02-17'; delete from t55 where col1='2000-02-17'; delete from t66 where col1='2000-02-17'; +commit; select * from t11 order by col1; col1 2002-02-15 @@ -10463,12 +10653,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2000-02-17'); insert into t22 values ('2000-02-17'); insert into t33 values ('2000-02-17'); insert into t44 values (60,'2000-02-17'); insert into t55 values (60,'2000-02-17'); insert into t66 values (60,'2000-02-17'); +commit; select * from t11 order by col1; col1 2000-02-17 @@ -10593,6 +10785,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-08-17'); insert into t2 values ('2006-01-03'); @@ -10601,6 +10794,7 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -10640,12 +10834,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-11-15' where col1='2006-01-03'; update t2 set col1='2006-11-15' where col1='2006-01-03'; update t3 set col1='2006-11-15' where col1='2006-01-03'; update t4 set col1='2006-11-15' where col1='2006-01-03'; update t5 set col1='2006-11-15' where col1='2006-01-03'; update t6 set col1='2006-11-15' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-08-17 @@ -10849,12 +11045,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-08-17'; delete from t2 where col1='2006-08-17'; delete from t3 where col1='2006-08-17'; delete from t4 where col1='2006-08-17'; delete from t5 where col1='2006-08-17'; delete from t6 where col1='2006-08-17'; +commit; select * from t1 order by col1; col1 2006-11-15 @@ -10878,12 +11076,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-08-17'); insert into t2 values ('2006-08-17'); insert into t3 values ('2006-08-17'); insert into t4 values (60,'2006-08-17'); insert into t5 values (60,'2006-08-17'); insert into t6 values (60,'2006-08-17'); +commit; select * from t1 order by col1; col1 2006-08-17 @@ -10950,12 +11150,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-08-17'; delete from t22 where col1='2006-08-17'; delete from t33 where col1='2006-08-17'; delete from t44 where col1='2006-08-17'; delete from t55 where col1='2006-08-17'; delete from t66 where col1='2006-08-17'; +commit; select * from t11 order by col1; col1 2006-11-15 @@ -10979,12 +11181,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-08-17'); insert into t22 values ('2006-08-17'); insert into t33 values ('2006-08-17'); insert into t44 values (60,'2006-08-17'); insert into t55 values (60,'2006-08-17'); insert into t66 values (60,'2006-08-17'); +commit; select * from t11 order by col1; col1 2006-08-17 diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result index 3cd8e10a4f3..f2935a9e6e9 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result @@ -47,6 +47,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with abs(col1) ------------------------------------------------------------------------- +begin; insert into t1 values (5 ); insert into t1 values (13 ); insert into t2 values (5 ); @@ -55,6 +56,7 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6; @@ -217,12 +219,14 @@ colint col1 50 56 51 34 55 123 +begin; update t1 set col1=15 where col1=5 ; update t2 set col1=15 where col1=5 ; update t3 set col1=15 where col1=5 ; update t4 set col1=15 where col1=5 ; update t5 set col1=15 where col1=5 ; update t6 set col1=15 where col1=5 ; +commit; select * from t1 order by col1; col1 13 @@ -877,12 +881,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1=13 ; delete from t2 where col1=13 ; delete from t3 where col1=13 ; delete from t4 where col1=13 ; delete from t5 where col1=13 ; delete from t6 where col1=13 ; +commit; select * from t1 order by col1; col1 15 @@ -986,12 +992,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t1 values (13 ); insert into t2 values (13 ); insert into t3 values (13 ); insert into t4 values (60,13 ); insert into t5 values (60,13 ); insert into t6 values (60,13 ); +commit; select * from t1 order by col1; col1 13 @@ -1274,12 +1282,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1=13 ; delete from t22 where col1=13 ; delete from t33 where col1=13 ; delete from t44 where col1=13 ; delete from t55 where col1=13 ; delete from t66 where col1=13 ; +commit; select * from t11 order by col1; col1 15 @@ -1383,12 +1393,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t11 values (13 ); insert into t22 values (13 ); insert into t33 values (13 ); insert into t44 values (60,13 ); insert into t55 values (60,13 ); insert into t66 values (60,13 ); +commit; select * from t11 order by col1; col1 13 @@ -1732,6 +1744,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with mod(col1,10) ------------------------------------------------------------------------- +begin; insert into t1 values (5); insert into t1 values (19); insert into t2 values (5); @@ -1740,6 +1753,7 @@ insert into t2 values (17); insert into t3 values (5); insert into t3 values (19); insert into t3 values (17); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6; @@ -1902,12 +1916,14 @@ colint col1 50 56 51 34 55 123 +begin; update t1 set col1=15 where col1=5; update t2 set col1=15 where col1=5; update t3 set col1=15 where col1=5; update t4 set col1=15 where col1=5; update t5 set col1=15 where col1=5; update t6 set col1=15 where col1=5; +commit; select * from t1 order by col1; col1 15 @@ -2562,12 +2578,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- +begin; delete from t1 where col1=19; delete from t2 where col1=19; delete from t3 where col1=19; delete from t4 where col1=19; delete from t5 where col1=19; delete from t6 where col1=19; +commit; select * from t1 order by col1; col1 15 @@ -2673,12 +2691,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); insert into t4 values (60,19); insert into t5 values (60,19); insert into t6 values (60,19); +commit; select * from t1 order by col1; col1 15 @@ -2970,12 +2990,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- +begin; delete from t11 where col1=19; delete from t22 where col1=19; delete from t33 where col1=19; delete from t44 where col1=19; delete from t55 where col1=19; delete from t66 where col1=19; +commit; select * from t11 order by col1; col1 15 @@ -3081,12 +3103,14 @@ colint col1 50 56 51 34 55 123 +begin; insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); insert into t44 values (60,19); insert into t55 values (60,19); insert into t66 values (60,19); +commit; select * from t11 order by col1; col1 15 @@ -3439,6 +3463,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with day(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-02-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-02-03'); @@ -3447,6 +3472,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -3486,12 +3512,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-02-03'; update t2 set col1='2006-02-05' where col1='2006-02-03'; update t3 set col1='2006-02-05' where col1='2006-02-03'; update t4 set col1='2006-02-05' where col1='2006-02-03'; update t5 set col1='2006-02-05' where col1='2006-02-03'; update t6 set col1='2006-02-05' where col1='2006-02-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -3695,12 +3723,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -3722,12 +3752,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -3789,12 +3821,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -3816,12 +3850,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -3944,6 +3980,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-02-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-02-03'); @@ -3952,6 +3989,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -3991,12 +4029,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-02-03'; update t2 set col1='2006-02-05' where col1='2006-02-03'; update t3 set col1='2006-02-05' where col1='2006-02-03'; update t4 set col1='2006-02-05' where col1='2006-02-03'; update t5 set col1='2006-02-05' where col1='2006-02-03'; update t6 set col1='2006-02-05' where col1='2006-02-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -4200,12 +4240,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4227,12 +4269,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -4294,12 +4338,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4321,12 +4367,14 @@ colint col1 1 2006-02-05 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -4449,6 +4497,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-02-17'); insert into t2 values ('2006-01-03'); @@ -4457,6 +4506,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -4496,12 +4546,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4705,12 +4757,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-02-17'; delete from t2 where col1='2006-02-17'; delete from t3 where col1='2006-02-17'; delete from t4 where col1='2006-02-17'; delete from t5 where col1='2006-02-17'; delete from t6 where col1='2006-02-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4734,12 +4788,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-02-17'); insert into t2 values ('2006-02-17'); insert into t3 values ('2006-02-17'); insert into t4 values (60,'2006-02-17'); insert into t5 values (60,'2006-02-17'); insert into t6 values (60,'2006-02-17'); +commit; select * from t1 order by col1; col1 2006-02-05 @@ -4805,12 +4861,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-02-17'; delete from t22 where col1='2006-02-17'; delete from t33 where col1='2006-02-17'; delete from t44 where col1='2006-02-17'; delete from t55 where col1='2006-02-17'; delete from t66 where col1='2006-02-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4834,12 +4892,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-02-17'); insert into t22 values ('2006-02-17'); insert into t33 values ('2006-02-17'); insert into t44 values (60,'2006-02-17'); insert into t55 values (60,'2006-02-17'); insert into t66 values (60,'2006-02-17'); +commit; select * from t11 order by col1; col1 2006-02-05 @@ -4966,6 +5026,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-03'); @@ -4974,6 +5035,7 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -5013,12 +5075,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-01-17 @@ -5222,12 +5286,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-01-17'; delete from t2 where col1='2006-01-17'; delete from t3 where col1='2006-01-17'; delete from t4 where col1='2006-01-17'; delete from t5 where col1='2006-01-17'; delete from t6 where col1='2006-01-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5249,12 +5315,14 @@ colint col1 1 2006-02-03 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-01-17'); insert into t2 values ('2006-01-17'); insert into t3 values ('2006-01-17'); insert into t4 values (60,'2006-01-17'); insert into t5 values (60,'2006-01-17'); insert into t6 values (60,'2006-01-17'); +commit; select * from t1 order by col1; col1 2006-01-17 @@ -5317,12 +5385,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-01-17'; delete from t22 where col1='2006-01-17'; delete from t33 where col1='2006-01-17'; delete from t44 where col1='2006-01-17'; delete from t55 where col1='2006-01-17'; delete from t66 where col1='2006-01-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5344,12 +5414,14 @@ colint col1 1 2006-02-03 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-01-17'); insert into t22 values ('2006-01-17'); insert into t33 values ('2006-01-17'); insert into t44 values (60,'2006-01-17'); insert into t55 values (60,'2006-01-17'); insert into t66 values (60,'2006-01-17'); +commit; select * from t11 order by col1; col1 2006-01-17 @@ -5473,6 +5545,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with extract(month from col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-02-17'); insert into t2 values ('2006-01-03'); @@ -5481,6 +5554,7 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -5520,12 +5594,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-05' where col1='2006-01-03'; update t2 set col1='2006-02-05' where col1='2006-01-03'; update t3 set col1='2006-02-05' where col1='2006-01-03'; update t4 set col1='2006-02-05' where col1='2006-01-03'; update t5 set col1='2006-02-05' where col1='2006-01-03'; update t6 set col1='2006-02-05' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5729,12 +5805,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-02-17'; delete from t2 where col1='2006-02-17'; delete from t3 where col1='2006-02-17'; delete from t4 where col1='2006-02-17'; delete from t5 where col1='2006-02-17'; delete from t6 where col1='2006-02-17'; +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5758,12 +5836,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-02-17'); insert into t2 values ('2006-02-17'); insert into t3 values ('2006-02-17'); insert into t4 values (60,'2006-02-17'); insert into t5 values (60,'2006-02-17'); insert into t6 values (60,'2006-02-17'); +commit; select * from t1 order by col1; col1 2006-02-05 @@ -5824,12 +5904,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-02-17'; delete from t22 where col1='2006-02-17'; delete from t33 where col1='2006-02-17'; delete from t44 where col1='2006-02-17'; delete from t55 where col1='2006-02-17'; delete from t66 where col1='2006-02-17'; +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5853,12 +5935,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-02-17'); insert into t22 values ('2006-02-17'); insert into t33 values ('2006-02-17'); insert into t44 values (60,'2006-02-17'); insert into t55 values (60,'2006-02-17'); insert into t66 values (60,'2006-02-17'); +commit; select * from t11 order by col1; col1 2006-02-05 @@ -5980,6 +6064,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with hour(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09'); insert into t1 values ('14:30'); insert into t2 values ('09:09'); @@ -5988,6 +6073,7 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -6027,12 +6113,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:30' where col1='09:09'; update t2 set col1='10:30' where col1='09:09'; update t3 set col1='10:30' where col1='09:09'; update t4 set col1='10:30' where col1='09:09'; update t5 set col1='10:30' where col1='09:09'; update t6 set col1='10:30' where col1='09:09'; +commit; select * from t1 order by col1; col1 10:30:00 @@ -6236,12 +6324,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30'; delete from t2 where col1='14:30'; delete from t3 where col1='14:30'; delete from t4 where col1='14:30'; delete from t5 where col1='14:30'; delete from t6 where col1='14:30'; +commit; select * from t1 order by col1; col1 10:30:00 @@ -6265,12 +6355,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30'); insert into t2 values ('14:30'); insert into t3 values ('14:30'); insert into t4 values (60,'14:30'); insert into t5 values (60,'14:30'); insert into t6 values (60,'14:30'); +commit; select * from t1 order by col1; col1 10:30:00 @@ -6334,12 +6426,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30'; delete from t22 where col1='14:30'; delete from t33 where col1='14:30'; delete from t44 where col1='14:30'; delete from t55 where col1='14:30'; delete from t66 where col1='14:30'; +commit; select * from t11 order by col1; col1 10:30:00 @@ -6363,12 +6457,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30'); insert into t22 values ('14:30'); insert into t33 values ('14:30'); insert into t44 values (60,'14:30'); insert into t55 values (60,'14:30'); insert into t66 values (60,'14:30'); +commit; select * from t11 order by col1; col1 10:30:00 @@ -6493,6 +6589,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with microsecond(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15.000002'); insert into t1 values ('04:30:01.000018'); insert into t2 values ('09:09:15.000002'); @@ -6501,6 +6598,7 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -6540,12 +6638,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t2 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t3 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t4 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t5 set col1='05:30:34.000037' where col1='09:09:15.000002'; update t6 set col1='05:30:34.000037' where col1='09:09:15.000002'; +commit; select * from t1 order by col1; col1 04:30:01 @@ -6749,12 +6849,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='04:30:01.000018'; delete from t2 where col1='04:30:01.000018'; delete from t3 where col1='04:30:01.000018'; delete from t4 where col1='04:30:01.000018'; delete from t5 where col1='04:30:01.000018'; delete from t6 where col1='04:30:01.000018'; +commit; select * from t1 order by col1; col1 05:30:34 @@ -6776,12 +6878,14 @@ colint col1 1 05:30:34 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('04:30:01.000018'); insert into t2 values ('04:30:01.000018'); insert into t3 values ('04:30:01.000018'); insert into t4 values (60,'04:30:01.000018'); insert into t5 values (60,'04:30:01.000018'); insert into t6 values (60,'04:30:01.000018'); +commit; select * from t1 order by col1; col1 04:30:01 @@ -6840,12 +6944,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='04:30:01.000018'; delete from t22 where col1='04:30:01.000018'; delete from t33 where col1='04:30:01.000018'; delete from t44 where col1='04:30:01.000018'; delete from t55 where col1='04:30:01.000018'; delete from t66 where col1='04:30:01.000018'; +commit; select * from t11 order by col1; col1 05:30:34 @@ -6867,12 +6973,14 @@ colint col1 1 05:30:34 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('04:30:01.000018'); insert into t22 values ('04:30:01.000018'); insert into t33 values ('04:30:01.000018'); insert into t44 values (60,'04:30:01.000018'); insert into t55 values (60,'04:30:01.000018'); insert into t66 values (60,'04:30:01.000018'); +commit; select * from t11 order by col1; col1 04:30:01 @@ -6992,6 +7100,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with minute(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15'); insert into t1 values ('14:30:45'); insert into t2 values ('09:09:15'); @@ -7000,6 +7109,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -7039,12 +7149,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:24:23' where col1='09:09:15'; update t2 set col1='10:24:23' where col1='09:09:15'; update t3 set col1='10:24:23' where col1='09:09:15'; update t4 set col1='10:24:23' where col1='09:09:15'; update t5 set col1='10:24:23' where col1='09:09:15'; update t6 set col1='10:24:23' where col1='09:09:15'; +commit; select * from t1 order by col1; col1 10:24:23 @@ -7248,12 +7360,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:45'; delete from t2 where col1='14:30:45'; delete from t3 where col1='14:30:45'; delete from t4 where col1='14:30:45'; delete from t5 where col1='14:30:45'; delete from t6 where col1='14:30:45'; +commit; select * from t1 order by col1; col1 10:24:23 @@ -7277,12 +7391,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:45'); insert into t2 values ('14:30:45'); insert into t3 values ('14:30:45'); insert into t4 values (60,'14:30:45'); insert into t5 values (60,'14:30:45'); insert into t6 values (60,'14:30:45'); +commit; select * from t1 order by col1; col1 10:24:23 @@ -7349,12 +7465,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:45'; delete from t22 where col1='14:30:45'; delete from t33 where col1='14:30:45'; delete from t44 where col1='14:30:45'; delete from t55 where col1='14:30:45'; delete from t66 where col1='14:30:45'; +commit; select * from t11 order by col1; col1 10:24:23 @@ -7378,12 +7496,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:45'); insert into t22 values ('14:30:45'); insert into t33 values ('14:30:45'); insert into t44 values (60,'14:30:45'); insert into t55 values (60,'14:30:45'); insert into t66 values (60,'14:30:45'); +commit; select * from t11 order by col1; col1 10:24:23 @@ -7511,6 +7631,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with second(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:09'); insert into t1 values ('14:30:20'); insert into t2 values ('09:09:09'); @@ -7519,6 +7640,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -7558,12 +7680,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:22:33' where col1='09:09:09'; update t2 set col1='10:22:33' where col1='09:09:09'; update t3 set col1='10:22:33' where col1='09:09:09'; update t4 set col1='10:22:33' where col1='09:09:09'; update t5 set col1='10:22:33' where col1='09:09:09'; update t6 set col1='10:22:33' where col1='09:09:09'; +commit; select * from t1 order by col1; col1 10:22:33 @@ -7767,12 +7891,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:20'; delete from t2 where col1='14:30:20'; delete from t3 where col1='14:30:20'; delete from t4 where col1='14:30:20'; delete from t5 where col1='14:30:20'; delete from t6 where col1='14:30:20'; +commit; select * from t1 order by col1; col1 10:22:33 @@ -7796,12 +7922,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:20'); insert into t2 values ('14:30:20'); insert into t3 values ('14:30:20'); insert into t4 values (60,'14:30:20'); insert into t5 values (60,'14:30:20'); insert into t6 values (60,'14:30:20'); +commit; select * from t1 order by col1; col1 10:22:33 @@ -7868,12 +7996,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:20'; delete from t22 where col1='14:30:20'; delete from t33 where col1='14:30:20'; delete from t44 where col1='14:30:20'; delete from t55 where col1='14:30:20'; delete from t66 where col1='14:30:20'; +commit; select * from t11 order by col1; col1 10:22:33 @@ -7897,12 +8027,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:20'); insert into t22 values ('14:30:20'); insert into t33 values ('14:30:20'); insert into t44 values (60,'14:30:20'); insert into t55 values (60,'14:30:20'); insert into t66 values (60,'14:30:20'); +commit; select * from t11 order by col1; col1 10:22:33 @@ -8030,6 +8162,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with month(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-12-17'); insert into t2 values ('2006-01-03'); @@ -8038,6 +8171,7 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -8077,12 +8211,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-11-06' where col1='2006-01-03'; update t2 set col1='2006-11-06' where col1='2006-01-03'; update t3 set col1='2006-11-06' where col1='2006-01-03'; update t4 set col1='2006-11-06' where col1='2006-01-03'; update t5 set col1='2006-11-06' where col1='2006-01-03'; update t6 set col1='2006-11-06' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8286,12 +8422,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-12-17'; delete from t2 where col1='2006-12-17'; delete from t3 where col1='2006-12-17'; delete from t4 where col1='2006-12-17'; delete from t5 where col1='2006-12-17'; delete from t6 where col1='2006-12-17'; +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8315,12 +8453,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-12-17'); insert into t2 values ('2006-12-17'); insert into t3 values ('2006-12-17'); insert into t4 values (60,'2006-12-17'); insert into t5 values (60,'2006-12-17'); insert into t6 values (60,'2006-12-17'); +commit; select * from t1 order by col1; col1 2006-11-06 @@ -8384,12 +8524,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-12-17'; delete from t22 where col1='2006-12-17'; delete from t33 where col1='2006-12-17'; delete from t44 where col1='2006-12-17'; delete from t55 where col1='2006-12-17'; delete from t66 where col1='2006-12-17'; +commit; select * from t11 order by col1; col1 2006-11-06 @@ -8413,12 +8555,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-12-17'); insert into t22 values ('2006-12-17'); insert into t33 values ('2006-12-17'); insert into t44 values (60,'2006-12-17'); insert into t55 values (60,'2006-12-17'); insert into t66 values (60,'2006-12-17'); +commit; select * from t11 order by col1; col1 2006-11-06 @@ -8543,6 +8687,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with quarter(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-12-17'); insert into t2 values ('2006-01-03'); @@ -8551,6 +8696,7 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -8590,12 +8736,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-07-30' where col1='2006-01-03'; update t2 set col1='2006-07-30' where col1='2006-01-03'; update t3 set col1='2006-07-30' where col1='2006-01-03'; update t4 set col1='2006-07-30' where col1='2006-01-03'; update t5 set col1='2006-07-30' where col1='2006-01-03'; update t6 set col1='2006-07-30' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8799,12 +8947,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-12-17'; delete from t2 where col1='2006-12-17'; delete from t3 where col1='2006-12-17'; delete from t4 where col1='2006-12-17'; delete from t5 where col1='2006-12-17'; delete from t6 where col1='2006-12-17'; +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8828,12 +8978,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-12-17'); insert into t2 values ('2006-12-17'); insert into t3 values ('2006-12-17'); insert into t4 values (60,'2006-12-17'); insert into t5 values (60,'2006-12-17'); insert into t6 values (60,'2006-12-17'); +commit; select * from t1 order by col1; col1 2006-07-30 @@ -8896,12 +9048,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-12-17'; delete from t22 where col1='2006-12-17'; delete from t33 where col1='2006-12-17'; delete from t44 where col1='2006-12-17'; delete from t55 where col1='2006-12-17'; delete from t66 where col1='2006-12-17'; +commit; select * from t11 order by col1; col1 2006-07-30 @@ -8925,12 +9079,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-12-17'); insert into t22 values ('2006-12-17'); insert into t33 values ('2006-12-17'); insert into t44 values (60,'2006-12-17'); insert into t55 values (60,'2006-12-17'); insert into t66 values (60,'2006-12-17'); +commit; select * from t11 order by col1; col1 2006-07-30 @@ -9054,6 +9210,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; insert into t1 values ('09:09:15'); insert into t1 values ('14:30:45'); insert into t2 values ('09:09:15'); @@ -9062,6 +9219,7 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6; @@ -9101,12 +9259,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; update t1 set col1='10:33:11' where col1='09:09:15'; update t2 set col1='10:33:11' where col1='09:09:15'; update t3 set col1='10:33:11' where col1='09:09:15'; update t4 set col1='10:33:11' where col1='09:09:15'; update t5 set col1='10:33:11' where col1='09:09:15'; update t6 set col1='10:33:11' where col1='09:09:15'; +commit; select * from t1 order by col1; col1 10:33:11 @@ -9310,12 +9470,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; delete from t1 where col1='14:30:45'; delete from t2 where col1='14:30:45'; delete from t3 where col1='14:30:45'; delete from t4 where col1='14:30:45'; delete from t5 where col1='14:30:45'; delete from t6 where col1='14:30:45'; +commit; select * from t1 order by col1; col1 10:33:11 @@ -9339,12 +9501,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t1 values ('14:30:45'); insert into t2 values ('14:30:45'); insert into t3 values ('14:30:45'); insert into t4 values (60,'14:30:45'); insert into t5 values (60,'14:30:45'); insert into t6 values (60,'14:30:45'); +commit; select * from t1 order by col1; col1 10:33:11 @@ -9410,12 +9574,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- +begin; delete from t11 where col1='14:30:45'; delete from t22 where col1='14:30:45'; delete from t33 where col1='14:30:45'; delete from t44 where col1='14:30:45'; delete from t55 where col1='14:30:45'; delete from t66 where col1='14:30:45'; +commit; select * from t11 order by col1; col1 10:33:11 @@ -9439,12 +9605,14 @@ colint col1 2 04:30:01 3 00:59:22 4 05:30:34 +begin; insert into t11 values ('14:30:45'); insert into t22 values ('14:30:45'); insert into t33 values ('14:30:45'); insert into t44 values (60,'14:30:45'); insert into t55 values (60,'14:30:45'); insert into t66 values (60,'14:30:45'); +commit; select * from t11 order by col1; col1 10:33:11 @@ -9571,6 +9739,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with weekday(col1) ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-12-03'); insert into t1 values ('2006-11-17'); insert into t2 values ('2006-12-03'); @@ -9579,6 +9748,7 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -9618,12 +9788,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-02-06' where col1='2006-12-03'; update t2 set col1='2006-02-06' where col1='2006-12-03'; update t3 set col1='2006-02-06' where col1='2006-12-03'; update t4 set col1='2006-02-06' where col1='2006-12-03'; update t5 set col1='2006-02-06' where col1='2006-12-03'; update t6 set col1='2006-02-06' where col1='2006-12-03'; +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9827,12 +9999,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-11-17'; delete from t2 where col1='2006-11-17'; delete from t3 where col1='2006-11-17'; delete from t4 where col1='2006-11-17'; delete from t5 where col1='2006-11-17'; delete from t6 where col1='2006-11-17'; +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9856,12 +10030,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-11-17'); insert into t2 values ('2006-11-17'); insert into t3 values ('2006-11-17'); insert into t4 values (60,'2006-11-17'); insert into t5 values (60,'2006-11-17'); insert into t6 values (60,'2006-11-17'); +commit; select * from t1 order by col1; col1 2006-02-06 @@ -9923,12 +10099,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-11-17'; delete from t22 where col1='2006-11-17'; delete from t33 where col1='2006-11-17'; delete from t44 where col1='2006-11-17'; delete from t55 where col1='2006-11-17'; delete from t66 where col1='2006-11-17'; +commit; select * from t11 order by col1; col1 2006-02-06 @@ -9952,12 +10130,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-11-17'); insert into t22 values ('2006-11-17'); insert into t33 values ('2006-11-17'); insert into t44 values (60,'2006-11-17'); insert into t55 values (60,'2006-11-17'); insert into t66 values (60,'2006-11-17'); +commit; select * from t11 order by col1; col1 2006-02-06 @@ -10080,6 +10260,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; insert into t1 values ('1996-01-03'); insert into t1 values ('2000-02-17'); insert into t2 values ('1996-01-03'); @@ -10088,6 +10269,7 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -10127,12 +10309,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2002-02-15' where col1='1996-01-03'; update t2 set col1='2002-02-15' where col1='1996-01-03'; update t3 set col1='2002-02-15' where col1='1996-01-03'; update t4 set col1='2002-02-15' where col1='1996-01-03'; update t5 set col1='2002-02-15' where col1='1996-01-03'; update t6 set col1='2002-02-15' where col1='1996-01-03'; +commit; select * from t1 order by col1; col1 2000-02-17 @@ -10336,12 +10520,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; delete from t1 where col1='2000-02-17'; delete from t2 where col1='2000-02-17'; delete from t3 where col1='2000-02-17'; delete from t4 where col1='2000-02-17'; delete from t5 where col1='2000-02-17'; delete from t6 where col1='2000-02-17'; +commit; select * from t1 order by col1; col1 2002-02-15 @@ -10365,12 +10551,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2000-02-17'); insert into t2 values ('2000-02-17'); insert into t3 values ('2000-02-17'); insert into t4 values (60,'2000-02-17'); insert into t5 values (60,'2000-02-17'); insert into t6 values (60,'2000-02-17'); +commit; select * from t1 order by col1; col1 2000-02-17 @@ -10434,12 +10622,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- +begin; delete from t11 where col1='2000-02-17'; delete from t22 where col1='2000-02-17'; delete from t33 where col1='2000-02-17'; delete from t44 where col1='2000-02-17'; delete from t55 where col1='2000-02-17'; delete from t66 where col1='2000-02-17'; +commit; select * from t11 order by col1; col1 2002-02-15 @@ -10463,12 +10653,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2000-02-17'); insert into t22 values ('2000-02-17'); insert into t33 values ('2000-02-17'); insert into t44 values (60,'2000-02-17'); insert into t55 values (60,'2000-02-17'); insert into t66 values (60,'2000-02-17'); +commit; select * from t11 order by col1; col1 2000-02-17 @@ -10593,6 +10785,7 @@ partition p1 values less than maxvalue); ------------------------------------------------------------------------- --- Access tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; insert into t1 values ('2006-01-03'); insert into t1 values ('2006-08-17'); insert into t2 values ('2006-01-03'); @@ -10601,6 +10794,7 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); +commit; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5; load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6; @@ -10640,12 +10834,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; update t1 set col1='2006-11-15' where col1='2006-01-03'; update t2 set col1='2006-11-15' where col1='2006-01-03'; update t3 set col1='2006-11-15' where col1='2006-01-03'; update t4 set col1='2006-11-15' where col1='2006-01-03'; update t5 set col1='2006-11-15' where col1='2006-01-03'; update t6 set col1='2006-11-15' where col1='2006-01-03'; +commit; select * from t1 order by col1; col1 2006-08-17 @@ -10849,12 +11045,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; delete from t1 where col1='2006-08-17'; delete from t2 where col1='2006-08-17'; delete from t3 where col1='2006-08-17'; delete from t4 where col1='2006-08-17'; delete from t5 where col1='2006-08-17'; delete from t6 where col1='2006-08-17'; +commit; select * from t1 order by col1; col1 2006-11-15 @@ -10878,12 +11076,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t1 values ('2006-08-17'); insert into t2 values ('2006-08-17'); insert into t3 values ('2006-08-17'); insert into t4 values (60,'2006-08-17'); insert into t5 values (60,'2006-08-17'); insert into t6 values (60,'2006-08-17'); +commit; select * from t1 order by col1; col1 2006-08-17 @@ -10950,12 +11150,14 @@ colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- +begin; delete from t11 where col1='2006-08-17'; delete from t22 where col1='2006-08-17'; delete from t33 where col1='2006-08-17'; delete from t44 where col1='2006-08-17'; delete from t55 where col1='2006-08-17'; delete from t66 where col1='2006-08-17'; +commit; select * from t11 order by col1; col1 2006-11-15 @@ -10979,12 +11181,14 @@ colint col1 2 2006-01-17 3 2006-01-25 4 2006-02-05 +begin; insert into t11 values ('2006-08-17'); insert into t22 values ('2006-08-17'); insert into t33 values ('2006-08-17'); insert into t44 values (60,'2006-08-17'); insert into t55 values (60,'2006-08-17'); insert into t66 values (60,'2006-08-17'); +commit; select * from t11 order by col1; col1 2006-08-17 diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result index 00247f218e4..048ae77b367 100644 --- a/mysql-test/suite/parts/r/rpl_partition.result +++ b/mysql-test/suite/parts/r/rpl_partition.result @@ -96,13 +96,19 @@ DELETE FROM t3 WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| +begin; CALL p1(); +commit; SELECT count(*) as "Master regular" FROM t1; Master regular 500 +begin; CALL p2(); +commit; SELECT count(*) as "Master bykey" FROM t2; Master bykey 500 +begin; CALL p3(); +commit; SELECT count(*) as "Master byrange" FROM t3; Master byrange 500 show create table t3; diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test index 115bc08a624..20348cc331d 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test @@ -26,13 +26,11 @@ let $debug= 0; let $do_long_tests= 1; # +# This test takes long time, so only run it with the --big mtr-flag. --source include/big_test.inc # The server must support partitioning. --source include/have_partition.inc -# This test takes long time, so only run it with the --big mtr-flag. ---source include/big_test.inc - #------------------------------------------------------------------------------# # Engine specific settings and requirements diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test index 409f428b34b..5294ff9fe3c 100644 --- a/mysql-test/suite/parts/t/rpl_partition.test +++ b/mysql-test/suite/parts/t/rpl_partition.test @@ -127,11 +127,17 @@ delimiter ;| ############ Test Section ################### +begin; CALL p1(); +commit; SELECT count(*) as "Master regular" FROM t1; +begin; CALL p2(); +commit; SELECT count(*) as "Master bykey" FROM t2; +begin; CALL p3(); +commit; SELECT count(*) as "Master byrange" FROM t3; --sync_slave_with_master diff --git a/mysql-test/suite/pbxt/r/cast.result b/mysql-test/suite/pbxt/r/cast.result index bc0c983c8e1..481593f0016 100644 --- a/mysql-test/suite/pbxt/r/cast.result +++ b/mysql-test/suite/pbxt/r/cast.result @@ -1,9 +1,13 @@ select CAST(1-2 AS UNSIGNED); CAST(1-2 AS UNSIGNED) 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER); CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER) -1 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select CAST('10 ' as unsigned integer); CAST('10 ' as unsigned integer) 10 @@ -12,9 +16,15 @@ Warning 1292 Truncated incorrect INTEGER value: '10 ' select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1; cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1 18446744073709551611 18446744073709551611 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1; cast(-5 as unsigned) -1 cast(-5 as unsigned) + 1 18446744073709551610 18446744073709551612 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select ~5, cast(~5 as signed); ~5 cast(~5 as signed) 18446744073709551610 -6 diff --git a/mysql-test/suite/pbxt/r/func_str.result b/mysql-test/suite/pbxt/r/func_str.result index 4dc909f42e4..a90e96ecc6b 100644 --- a/mysql-test/suite/pbxt/r/func_str.result +++ b/mysql-test/suite/pbxt/r/func_str.result @@ -1504,7 +1504,7 @@ select locate('lo','hello',-18446744073709551615); locate('lo','hello',-18446744073709551615) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select locate('lo','hello',18446744073709551615); locate('lo','hello',18446744073709551615) 0 @@ -1512,22 +1512,22 @@ select locate('lo','hello',-18446744073709551616); locate('lo','hello',-18446744073709551616) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select locate('lo','hello',18446744073709551616); locate('lo','hello',18446744073709551616) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select locate('lo','hello',-18446744073709551617); locate('lo','hello',-18446744073709551617) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select locate('lo','hello',18446744073709551617); locate('lo','hello',18446744073709551617) 0 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select left('hello', 10); left('hello', 10) hello @@ -1559,8 +1559,8 @@ select left('hello', -18446744073709551615); left('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select left('hello', 18446744073709551615); left('hello', 18446744073709551615) hello @@ -1568,26 +1568,26 @@ select left('hello', -18446744073709551616); left('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select left('hello', 18446744073709551616); left('hello', 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select left('hello', -18446744073709551617); left('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select left('hello', 18446744073709551617); left('hello', 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select right('hello', 10); right('hello', 10) hello @@ -1619,8 +1619,8 @@ select right('hello', -18446744073709551615); right('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select right('hello', 18446744073709551615); right('hello', 18446744073709551615) hello @@ -1628,26 +1628,26 @@ select right('hello', -18446744073709551616); right('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select right('hello', 18446744073709551616); right('hello', 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select right('hello', -18446744073709551617); right('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select right('hello', 18446744073709551617); right('hello', 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', 2, -1); substring('hello', 2, -1) @@ -1679,8 +1679,8 @@ select substring('hello', -18446744073709551615, 1); substring('hello', -18446744073709551615, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 18446744073709551615, 1); substring('hello', 18446744073709551615, 1) @@ -1688,26 +1688,26 @@ select substring('hello', -18446744073709551616, 1); substring('hello', -18446744073709551616, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 18446744073709551616, 1); substring('hello', 18446744073709551616, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', -18446744073709551617, 1); substring('hello', -18446744073709551617, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 18446744073709551617, 1); substring('hello', 18446744073709551617, 1) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', 1, -1); substring('hello', 1, -1) @@ -1733,8 +1733,8 @@ select substring('hello', 1, -18446744073709551615); substring('hello', 1, -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 1, 18446744073709551615); substring('hello', 1, 18446744073709551615) hello @@ -1742,26 +1742,26 @@ select substring('hello', 1, -18446744073709551616); substring('hello', 1, -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 1, 18446744073709551616); substring('hello', 1, 18446744073709551616) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', 1, -18446744073709551617); substring('hello', 1, -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 1, 18446744073709551617); substring('hello', 1, 18446744073709551617) hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select substring('hello', -1, -1); substring('hello', -1, -1) @@ -1787,10 +1787,10 @@ select substring('hello', -18446744073709551615, -18446744073709551615); substring('hello', -18446744073709551615, -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select substring('hello', 18446744073709551615, 18446744073709551615); substring('hello', 18446744073709551615, 18446744073709551615) @@ -1798,34 +1798,34 @@ select substring('hello', -18446744073709551616, -18446744073709551616); substring('hello', -18446744073709551616, -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select substring('hello', 18446744073709551616, 18446744073709551616); substring('hello', 18446744073709551616, 18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select substring('hello', -18446744073709551617, -18446744073709551617); substring('hello', -18446744073709551617, -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select substring('hello', 18446744073709551617, 18446744073709551617); substring('hello', 18446744073709551617, 18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', -1, 1, 'hi'); insert('hello', -1, 1, 'hi') hello @@ -1851,7 +1851,7 @@ select insert('hello', -18446744073709551615, 1, 'hi'); insert('hello', -18446744073709551615, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 18446744073709551615, 1, 'hi'); insert('hello', 18446744073709551615, 1, 'hi') hello @@ -1859,22 +1859,22 @@ select insert('hello', -18446744073709551616, 1, 'hi'); insert('hello', -18446744073709551616, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 18446744073709551616, 1, 'hi'); insert('hello', 18446744073709551616, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', -18446744073709551617, 1, 'hi'); insert('hello', -18446744073709551617, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 18446744073709551617, 1, 'hi'); insert('hello', 18446744073709551617, 1, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', 1, -1, 'hi'); insert('hello', 1, -1, 'hi') hi @@ -1900,7 +1900,7 @@ select insert('hello', 1, -18446744073709551615, 'hi'); insert('hello', 1, -18446744073709551615, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 1, 18446744073709551615, 'hi'); insert('hello', 1, 18446744073709551615, 'hi') hi @@ -1908,22 +1908,22 @@ select insert('hello', 1, -18446744073709551616, 'hi'); insert('hello', 1, -18446744073709551616, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 1, 18446744073709551616, 'hi'); insert('hello', 1, 18446744073709551616, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', 1, -18446744073709551617, 'hi'); insert('hello', 1, -18446744073709551617, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 1, 18446744073709551617, 'hi'); insert('hello', 1, 18446744073709551617, 'hi') hi Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select insert('hello', -1, -1, 'hi'); insert('hello', -1, -1, 'hi') hello @@ -1949,8 +1949,8 @@ select insert('hello', -18446744073709551615, -18446744073709551615, 'hi'); insert('hello', -18446744073709551615, -18446744073709551615, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select insert('hello', 18446744073709551615, 18446744073709551615, 'hi'); insert('hello', 18446744073709551615, 18446744073709551615, 'hi') hello @@ -1958,26 +1958,26 @@ select insert('hello', -18446744073709551616, -18446744073709551616, 'hi'); insert('hello', -18446744073709551616, -18446744073709551616, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select insert('hello', 18446744073709551616, 18446744073709551616, 'hi'); insert('hello', 18446744073709551616, 18446744073709551616, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. select insert('hello', -18446744073709551617, -18446744073709551617, 'hi'); insert('hello', -18446744073709551617, -18446744073709551617, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select insert('hello', 18446744073709551617, 18446744073709551617, 'hi'); insert('hello', 18446744073709551617, 18446744073709551617, 'hi') hello Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. select repeat('hello', -1); repeat('hello', -1) @@ -2009,8 +2009,8 @@ select repeat('hello', -18446744073709551615); repeat('hello', -18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select repeat('hello', 18446744073709551615); repeat('hello', 18446744073709551615) NULL @@ -2020,27 +2020,27 @@ select repeat('hello', -18446744073709551616); repeat('hello', -18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select repeat('hello', 18446744073709551616); repeat('hello', 18446744073709551616) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select repeat('hello', -18446744073709551617); repeat('hello', -18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select repeat('hello', 18446744073709551617); repeat('hello', 18446744073709551617) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select space(-1); space(-1) @@ -2073,8 +2073,8 @@ select space(-18446744073709551615); space(-18446744073709551615) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select space(18446744073709551615); space(18446744073709551615) NULL @@ -2084,27 +2084,27 @@ select space(-18446744073709551616); space(-18446744073709551616) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select space(18446744073709551616); space(18446744073709551616) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select space(-18446744073709551617); space(-18446744073709551617) Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select space(18446744073709551617); space(18446744073709551617) NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select rpad('hello', -1, '1'); rpad('hello', -1, '1') @@ -2137,8 +2137,8 @@ select rpad('hello', -18446744073709551615, '1'); rpad('hello', -18446744073709551615, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select rpad('hello', 18446744073709551615, '1'); rpad('hello', 18446744073709551615, '1') NULL @@ -2148,27 +2148,27 @@ select rpad('hello', -18446744073709551616, '1'); rpad('hello', -18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select rpad('hello', 18446744073709551616, '1'); rpad('hello', 18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated select rpad('hello', -18446744073709551617, '1'); rpad('hello', -18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select rpad('hello', 18446744073709551617, '1'); rpad('hello', 18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated select lpad('hello', -1, '1'); lpad('hello', -1, '1') @@ -2201,8 +2201,8 @@ select lpad('hello', -18446744073709551615, '1'); lpad('hello', -18446744073709551615, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551615' to INT. Value truncated. select lpad('hello', 18446744073709551615, '1'); lpad('hello', 18446744073709551615, '1') NULL @@ -2212,27 +2212,27 @@ select lpad('hello', -18446744073709551616, '1'); lpad('hello', -18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551616' to INT. Value truncated. select lpad('hello', 18446744073709551616, '1'); lpad('hello', 18446744073709551616, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551616' to INT. Value truncated. Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated select lpad('hello', -18446744073709551617, '1'); lpad('hello', -18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '-18446744073709551617' to INT. Value truncated. select lpad('hello', 18446744073709551617, '1'); lpad('hello', 18446744073709551617, '1') NULL Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. +Error 1655 Got overflow when converting '18446744073709551617' to INT. Value truncated. Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated SET @orig_sql_mode = @@SQL_MODE; SET SQL_MODE=traditional; diff --git a/mysql-test/suite/pbxt/r/type_newdecimal.result b/mysql-test/suite/pbxt/r/type_newdecimal.result index 4978a244c76..d5c76c59ff2 100644 --- a/mysql-test/suite/pbxt/r/type_newdecimal.result +++ b/mysql-test/suite/pbxt/r/type_newdecimal.result @@ -825,7 +825,7 @@ Error 1365 Division by 0 Error 1365 Division by 0 Error 1365 Division by 0 INSERT INTO Sow6_2f VALUES ('a59b'); -ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 +ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1 drop table Sow6_2f; select 10.3330000000000/12.34500000; 10.3330000000000/12.34500000 @@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999 x 99999999999999999999999999999999999999999999999999999999999999999 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x 100000000000000000000000000000000000000000000000000000000000000000 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1368,15 +1368,15 @@ create table t1 (c1 decimal(64)); insert into t1 values( 89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values( 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. +Error 1655 Got overflow when converting '' to DECIMAL. Value truncated. Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values(1e100); Warnings: @@ -1447,4 +1447,4 @@ select cast(19999999999999999999 as unsigned); cast(19999999999999999999 as unsigned) 18446744073709551615 Warnings: -Error 1292 Truncated incorrect DECIMAL value: '' +Error 1655 Got overflow when converting '19999999999999999999' to UNSIGNED INT. Value truncated. diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index f8734b48295..b02164ac61b 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -90,13 +90,19 @@ DELETE FROM test.byrange_tbl WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| +begin; CALL test.proc_norm(); +commit; SELECT count(*) as "Master regular" FROM test.regular_tbl; Master regular 500 +begin; CALL test.proc_bykey(); +commit; SELECT count(*) as "Master bykey" FROM test.bykey_tbl; Master bykey 500 +begin; CALL test.proc_byrange(); +commit; SELECT count(*) as "Master byrange" FROM test.byrange_tbl; Master byrange 500 show create table test.byrange_tbl; diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test index 782c01ec04f..afc0c2cbd4b 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test @@ -127,11 +127,17 @@ delimiter ;| ############ Test Section ################### +begin; CALL test.proc_norm(); +commit; SELECT count(*) as "Master regular" FROM test.regular_tbl; +begin; CALL test.proc_bykey(); +commit; SELECT count(*) as "Master bykey" FROM test.bykey_tbl; +begin; CALL test.proc_byrange(); +commit; SELECT count(*) as "Master byrange" FROM test.byrange_tbl; --sync_slave_with_master diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result index 83f755a2e7f..3a2f5c55d68 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result @@ -2686,10 +2686,15 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select * from t1; a b 1 1 -1 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # Convert() @@ -2703,10 +2708,15 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select * from t1; a b 1 1 -1 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result index 844aae38af2..c0635070394 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result @@ -2686,10 +2686,15 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select * from t1; a b 1 1 -1 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # Convert() @@ -2703,10 +2708,15 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement select * from t1; a b 1 1 -1 18446744073709551615 +Warnings: +Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 8e60d548c2f..e128c86380b 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -11,6 +11,21 @@ select ~5, cast(~5 as signed); explain extended select ~5, cast(~5 as signed); select cast(5 as unsigned) -6.0; select cast(NULL as signed), cast(1/0 as signed); +select cast(1 as double(5,2)); +select cast("5.2222" as double(5,2)); +select cast(12.444 as double(5,2)); +select cast(cast(12.444 as decimal(10,3)) as double(5,2)); +select cast(null as double(5,2)); +select cast(12.444 as double); +select cast(cast("20:01:01" as time) as datetime); +select cast(cast("8:46:06.23434" AS time) as decimal(32,10)); +select cast(cast(20010203101112.121314 as double) as datetime); +select cast(cast(010203101112.12 as double) as datetime); +select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime); +select cast(20010203101112.121314 as datetime); +select cast(110203101112.121314 as datetime); +select cast(cast(010203101112.12 as double) as datetime); +select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as time); # # Bug #28250: Run-Time Check Failure #3 - The variable 'value' is being used # without being def @@ -42,6 +57,44 @@ select cast('a10' as unsigned integer); select 10+'a'; select 10.0+cast('a' as decimal); select 10E+0+'a'; +select cast("a" as double(5,2)); +select cast(1000 as decimal(5,2)); +select cast(-1000 as decimal(5,2)); +select cast(1000 as double(5,2)); +select cast(-1000 as double(5,2)); +select cast(010203101112.121314 as datetime); +select cast(120010203101112.121314 as datetime); +select cast(cast(1.1 as decimal) as datetime); +select cast(cast(-1.1 as decimal) as datetime); +select cast('0' as date); +select cast('' as date); +select cast('0' as datetime); +select cast('' as datetime); +select cast('0' as time); +select cast('' as time); +select cast(NULL as DATE); +select cast(NULL as DATETIME); +select cast(NULL as TIME); +select cast(NULL as BINARY); + +# +# We have to disable warnings for these as the printed double value is +# not portable +# +--disable_warnings +select cast(cast(120010203101112.121314 as double) as datetime); +select cast(cast(1.1 as double) as datetime); +select cast(cast(-1.1 as double) as datetime); +--enable_warnings + + +# +# Some EXPLAIN EXTENDED to ensure the print functions are correct +# + +explain extended select cast(10 as double(5,2)); +explain extended select cast(10 as double); +explain extended select cast(10 as decimal(5,2)); # out-of-range cases select cast('18446744073709551616' as unsigned); @@ -52,6 +105,20 @@ select cast('abc' as signed); select cast('1a' as signed); select cast('' as signed); +--error ER_M_BIGGER_THAN_D +select cast(1 as double(5,6)); +--error ER_M_BIGGER_THAN_D +select cast(1 as decimal(5,6)); +--error ER_TOO_BIG_PRECISION +select cast(1 as double(66,6)); +--error ER_TOO_BIG_PRECISION +select cast(1 as decimal(66,6)); +--error ER_TOO_BIG_SCALE +select cast(1 as decimal(64,63)); +--error ER_TOO_BIG_SCALE +select cast(1 as double(64,63)); + + # # Character set conversion # @@ -124,8 +191,6 @@ set names binary; select cast("2001-1-1" as date) = "2001-01-01"; select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"; select cast("1:2:3" as TIME) = "1:02:03"; -select cast(NULL as DATE); -select cast(NULL as BINARY); # # Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions @@ -172,6 +237,14 @@ select cast(repeat('1',20) as signed); select cast(1.0e+300 as signed int); # +# Test that we create the correct types with create ... select cast() +# + +create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double(5,2)), cast(1 as decimal(5,3)), cast("A" as binary), cast("A" as char(100)), cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME), cast("1:2:3" as TIME); +show create table t1; +drop table t1; + +# # Bugs: #15098: CAST(column double TO signed int), wrong result # CREATE TABLE t1 (f1 double); diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test new file mode 100644 index 00000000000..8e1c99a48a4 --- /dev/null +++ b/mysql-test/t/dyncol.test @@ -0,0 +1,462 @@ +# +# Dynamic column function test +# + +--echo # +--echo # column create +--echo # +select hex(COLUMN_CREATE(1, NULL AS char character set utf8)); +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)); +select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)); +select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)); +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)); +select hex(COLUMN_CREATE(1, NULL AS unsigned int)); +select hex(COLUMN_CREATE(1, 1212 AS unsigned int)); +select hex(COLUMN_CREATE(1, 7 AS unsigned int)); +select hex(COLUMN_CREATE(1, 8 AS unsigned int)); +select hex(COLUMN_CREATE(1, 127 AS unsigned int)); +select hex(COLUMN_CREATE(1, 128 AS unsigned int)); +select hex(COLUMN_CREATE(1, 12.12 AS unsigned int)); +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS unsigned int)); +select hex(COLUMN_CREATE(1, NULL AS int)); +select hex(COLUMN_CREATE(1, 1212 AS int)); +select hex(COLUMN_CREATE(1, 7 AS int)); +select hex(COLUMN_CREATE(1, 8 AS int)); +select hex(COLUMN_CREATE(1, 127 AS int)); +select hex(COLUMN_CREATE(1, 128 AS int)); +select hex(COLUMN_CREATE(1, 12.12 AS int)); +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS int)); +select hex(COLUMN_CREATE(1, NULL AS double)); +select hex(COLUMN_CREATE(1, 1212 AS double)); +select hex(COLUMN_CREATE(1, 12.12 AS double)); +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS double)); +select hex(COLUMN_CREATE(1, NULL AS decimal)); +select hex(COLUMN_CREATE(1, 1212 AS decimal)); +select hex(COLUMN_CREATE(1, 7 AS decimal)); +select hex(COLUMN_CREATE(1, 8 AS decimal)); +select hex(COLUMN_CREATE(1, 127 AS decimal)); +select hex(COLUMN_CREATE(1, 128 AS decimal)); +select hex(COLUMN_CREATE(1, 12.12 AS decimal)); +select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS decimal)); +select hex(COLUMN_CREATE(1, NULL AS date)); +select hex(COLUMN_CREATE(1, "2011-04-05" AS date)); +select hex(COLUMN_CREATE(1, NULL AS time)); +select hex(COLUMN_CREATE(1, "0:45:49.000001" AS time)); +select hex(COLUMN_CREATE(1, NULL AS datetime)); +select hex(COLUMN_CREATE(1, "2011-04-05 0:45:49.000001" AS datetime)); +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, + 2, 1212 AS unsigned int, + 3, 1212 AS int, + 4, 12.12 AS double, + 4+1, 12.12 AS decimal, + 6, "2011-04-05" AS date, + 7, "- 0:45:49.000001" AS time, + 8, "2011-04-05 0:45:49.000001" AS datetime)); +explain extended +select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, + 2, 1212 AS unsigned int, + 3, 1212 AS int, + 4, 12.12 AS double, + 4+1, 12.12 AS decimal, + 6, "2011-04-05" AS date, + 7, "- 0:45:49.000001" AS time, + 8, "2011-04-05 0:45:49.000001" AS datetime)); + + +--echo # +--echo # column get uint +--echo # +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int); +explain extended +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int); +explain extended +select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned); +select column_get(column_create(1, 1212 AS decimal), 1 as unsigned int); +select column_get(column_create(1, 1212 AS double), 1 as unsigned int); +select column_get(column_create(1, 1212 AS int), 1 as unsigned int); +select column_get(column_create(1, "1212" AS char), 1 as unsigned int); +select column_get(column_create(1, "2011-04-05" AS date), 1 as unsigned int); +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as unsigned int); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as unsigned int); +select column_get(column_create(1, NULL AS unsigned int), 1 as unsigned int); +--echo # column geint truncation & warnings +select column_get(column_create(1, -1212 AS int), 1 as unsigned int); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as unsigned int); +select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as unsigned int); +select column_get(column_create(1, -1 AS decimal), 1 as unsigned int); +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int); +select column_get(column_create(1, 999.9 AS double), 1 as unsigned int); +select column_get(column_create(1, -1 AS double), 1 as unsigned int); +select column_get(column_create(1, "1212III" AS char), 1 as unsigned int); + +--echo # +--echo # column get int +--echo # +select column_get(column_create(1, 1212 AS int), 1 as int); +explain extended +select column_get(column_create(1, 1212 AS int), 1 as int); +explain extended +select column_get(column_create(1, 1212 AS int), 1 as signed int); +select column_get(column_create(1, -1212 AS int), 1 as int); +select column_get(column_create(1, 1212 AS decimal), 1 as int); +select column_get(column_create(1, 1212 AS double), 1 as int); +select column_get(column_create(1, 1212 AS unsigned int), 1 as int); +select column_get(column_create(1, "1212" AS char), 1 as int); +select column_get(column_create(1, "-1212" AS char), 1 as int); +select column_get(column_create(1, "2011-04-05" AS date), 1 as int); +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as int); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as int); +select column_get(column_create(1, NULL AS int), 1 as int); +--echo #column gett truncation & warnings +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as int); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as int); +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as int); +select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as int); +select column_get(column_create(1, 999.9 AS double), 1 as int); +select column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int); +select column_get(column_create(1, "-1212III" AS char), 1 as int); +select column_get(column_create(1, "1212III" AS char), 1 as int); + +--echo # +--echo #column get char +--echo # +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8); +explain extended +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8); +select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as char charset utf8); +select column_get(column_create(1, 1212 AS int), 1 as char charset utf8); +select column_get(column_create(1, -1212 AS int), 1 as char charset utf8); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as char charset utf8); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as char charset utf8); +select column_get(column_create(1, 1212.12 AS decimal), 1 as char charset utf8); +select column_get(column_create(1, 1212.12 AS double), 1 as char charset utf8); +select column_get(column_create(1, "2011-04-05" AS date), 1 as char charset utf8); +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as char charset utf8); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8); +select column_get(column_create(1, NULL AS char charset utf8), 1 as char charset utf8); +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary); +explain extended +select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary); + +--echo # +--echo # column get real +--echo # +select column_get(column_create(1, 1212.12 AS double), 1 as double); +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as double); +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as double(6,2)); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as double); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as double); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as double); +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as double); +select column_get(column_create(1, "2011-04-05" AS date), 1 as double); +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as double); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)); +select column_get(column_create(1, NULL AS double), 1 as double); + +-- echo # column get real truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as double); +select column_get(column_create(1, "aa" AS char), 1 as double); +select column_get(column_create(1, "1223.5555" AS double), 1 as double(5,2)); +select column_get(column_create(1, "1223.5555" AS double), 1 as double(3,2)); + +--echo # +--echo # column get decimal +--echo # +select column_get(column_create(1, 1212.12 AS double), 1 as decimal); +select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)); +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as decimal); +explain extended +select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal(32,0)); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal(32,0)); +select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as decimal(40,10)); +select column_get(column_create(1, "2011-04-05" AS date), 1 as decimal(32,6)); +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as decimal(32,6)); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal(32,6)); +select column_get(column_create(1, NULL as decimal), 1 as decimal(32,10)); +select column_get(column_create(1, "1223.5555" as decimal(10,5)), 1 as decimal(6,2)); + +-- echo # column get decimal truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as decimal(32,10)); +select column_get(column_create(1, "aa" AS char), 1 as decimal(32,10)); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as decimal); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as decimal); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as decimal); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as decimal); +select column_get(column_create(1, "1223.5555" as double), 1 as decimal(5,2)); +select column_get(column_create(1, "-1223.5555" as double), 1 as decimal(5,2)); +select column_get(column_create(1, "1223.5555" AS double), 1 as decimal(3,2)); +select column_get(column_create(1, "1223.5555" AS decimal(10,5)), 1 as decimal(3,2)); + +--echo # +--echo # column get datetime +--echo # +select column_get(column_create(1, 20010203101112.121314 as double), 1 as datetime); +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as datetime); +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as datetime); +select column_get(column_create(1, 20010203101112 as int), 1 as datetime); +select column_get(column_create(1, "20010203101112" as char), 1 as datetime); +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as datetime); +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as datetime); +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as datetime); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as datetime); +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as datetime); +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as datetime); + +select column_get(column_create(1, 20010203 as unsigned int), 1 as datetime); +select column_get(column_create(1, 20010203 as int), 1 as datetime); +select column_get(column_create(1, 20010203), 1 as datetime); +select column_get(column_create(1, 20010203.0), 1 as datetime); +select column_get(column_create(1, 20010203.0 as double), 1 as datetime); +select column_get(column_create(1, "2001-02-03"), 1 as datetime); +select column_get(column_create(1, "20010203"), 1 as datetime); +select column_get(column_create(1, 0), 1 as datetime); +select column_get(column_create(1, "2001021"), 1 as datetime); + +select column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime); + +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime); +select column_get(column_create(1, "0000-00-000" AS CHAR), 1 as datetime); +select column_get(column_create(1, "2001-00-02" AS CHAR), 1 as datetime); +set @@sql_mode=""; + +-- echo # column get datetime truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as datetime); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as datetime); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime); +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime); +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime); +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as datetime); +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as datetime); +select column_get(column_create(1, "20010231"), 1 as datetime); +select column_get(column_create(1, "0" AS CHAR), 1 as datetime); + + +--echo # +--echo # column get date +--echo # +select column_get(column_create(1, 20010203101112.121314 as double), 1 as date); +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as date); +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as date); +select column_get(column_create(1, 20010203101112 as int), 1 as date); +select column_get(column_create(1, "20010203101112" as char), 1 as date); +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as date); +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as date); +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as date); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as date); +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as date); +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as date); + +select column_get(column_create(1, 20010203 as unsigned int), 1 as date); +select column_get(column_create(1, 20010203 as int), 1 as date); +select column_get(column_create(1, 20010203), 1 as date); +select column_get(column_create(1, 20010203.0), 1 as date); +select column_get(column_create(1, 20010203.0 as double), 1 as date); +select column_get(column_create(1, "2001-02-03"), 1 as date); +select column_get(column_create(1, "20010203"), 1 as date); +select column_get(column_create(1, 0), 1 as date); +select column_get(column_create(1, "2001021"), 1 as date); + +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as date); +select column_get(column_create(1, "0000-00-000" AS CHAR), 1 as date); +select column_get(column_create(1, "2001-00-02" AS CHAR), 1 as date); +set @@sql_mode=""; + +-- echo # column get date truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as date); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as date); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as date); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as date); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date); +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date); +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date); +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as date); +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as date); +select column_get(column_create(1, "20010231"), 1 as date); +select column_get(column_create(1, "0" AS CHAR), 1 as date); + +--echo # +--echo # column get time +--echo # +select column_get(column_create(1, 20010203101112.121314 as double), 1 as time); +select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as time); +select column_get(column_create(1, 20010203101112 as unsigned int), 1 as time); +select column_get(column_create(1, 20010203101112 as int), 1 as time); +select column_get(column_create(1, "20010203101112" as char), 1 as time); +select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as time); +select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as time); +select column_get(column_create(1, "2001-02-03 10:11:12.121314"), 1 as time); +select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as time); +select column_get(column_create(1, "2011-00-00 8:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "2011-00-01 8:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "830:46:06.23434" AS CHAR), 1 as time); +select cast("-830:46:06.23434" AS time); +select 1,cast("-830:46:06.23434" AS time); +select hex(column_create(1, "-830:46:06.23434" AS CHAR)); +select column_get(column_create(1, "-830:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "0" AS CHAR), 1 as time); +select column_get(column_create(1, "6" AS CHAR), 1 as time); +select column_get(column_create(1, "1:6" AS CHAR), 1 as time); +select column_get(column_create(1, "2:1:6" AS CHAR), 1 as time); + +select column_get(column_create(1, 0), 1 as time); +select column_get(column_create(1, "2001021"), 1 as time); + +set @@sql_mode="allow_invalid_dates"; +select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as time); +set @@sql_mode=""; + +-- echo # column get date truncation & warnings +select column_get(column_create(1, "1223.5aa" AS char), 1 as time); +select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as time); +select column_get(column_create(1, 9223372036854775807 AS int), 1 as time); +select column_get(column_create(1, -9223372036854775808 AS int), 1 as time); +select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time); +select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time); +select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "2011-02-30 8:46:06.23434" AS CHAR), 1 as time); +select column_get(column_create(1, "2001-02-03"), 1 as time); +select column_get(column_create(1, "20010203"), 1 as time); + + +-- echo # column add +select hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer)); +select hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer)); +select hex(column_add(column_create(1, 1212 as integer), 1, NULL as integer)); +select hex(column_add(column_create(1, 1212 as integer), 2, NULL as integer)); +select hex(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer)); +select column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 1 as integer); +select column_get(column_add(column_create(1, 1212 as integer), 2, 1212 as integer, 1, 11 as integer), 2 as integer); +select hex(column_add(column_create(1, 1212 as integer), 1, 1212 as integer, 2, 11 as integer)); +select hex(column_add(column_create(1, NULL as integer), 1, 1212 as integer, 2, 11 as integer)); +select hex(column_add(column_create(1, 1212 as integer, 2, 1212 as integer), 1, 11 as integer)); +select hex(column_add(column_create(1, 1), 1, null)); +select column_list(column_add(column_create(1, 1), 1, null)); +select column_list(column_add(column_create(1, 1), 1, "")); +select hex(column_add("", 1, 1)); + +-- echo # column delete +select hex(column_delete(column_create(1, 1212 as integer, 2, 1212 as integer), 1)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 3)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 4)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 1)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 2, 3)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3)); +select hex(column_delete(column_create(1, 1 as integer, 2, 2 as integer, 3, 3 as integer), 1, 2, 3, 10)); +select hex(column_delete(column_create(1, 1), 1)); +select hex(column_delete("", 1)); + +-- echo # column exists +select column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 1); +select column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 4); + +-- echo # column list +select column_list(column_create(1, 1212 as integer, 2, 1212 as integer)); +select column_list(column_create(1, 1212 as integer)); +select column_list(column_create(1, NULL as integer)); + +--echo # +--echo # check error handling +--echo # +--error ER_DYN_COL_DATA +select HEX(COLUMN_CREATE(1, 5, 1, 5)); +--error 1064 +select HEX(COLUMN_CREATE("", 1, 5, 1, 5)); +--error ER_DYN_COL_WRONG_FORMAT +select COLUMN_LIST("a"); +--error ER_DYN_COL_WRONG_FORMAT +select column_delete("a", 1); +select hex(column_delete("", 1)); +--error ER_DYN_COL_DATA +select hex(column_delete("", -1)); +--error ER_DYN_COL_DATA +select hex(column_create(-1, 1)); +--error ER_DYN_COL_DATA +select hex(column_create(65536, 1)); +--error ER_DYN_COL_DATA +select hex(column_add("", -1, 1)); +--error ER_DYN_COL_DATA +select hex(column_add("", 65536, 1)); +select hex(column_get("", -1 as int)); + +--echo # +--echo # Test with table +--echo # + +# create table with 'str' to hold a set of dynamic columns +create table t1 (id int primary key, str mediumblob); +insert into t1 values (1, ''), (2, ''), (3, ''), (4, ''), (5, null); + +# Selecting a non existing column +select id, str, column_get(str, 1 as int) from t1; + +# Add some dynamic columns. One and do it with create or add. +update t1 set str=column_create(1, id, 2, "a") where id < 3; +update t1 set str=column_add(str, 1, id, 2, "b") where id >= 4; + +# Show some data, if it exists +select id, column_get(str, 1 as int), column_get(str, 2 as char) from t1 where column_exists(str,1) or column_exists(str,2); + +# Add data to row 5 and 6 +update t1 set str=column_create(1, id, 10, "test") where id = 5; +insert into t1 values (6, column_create(10, "test2")); + +# Update some of the columns and add a new column 3 +update t1 set str=column_add(str, 2, 'c', 1, column_get(str, 1 as int) + 1, 3, 100) where id > 2; + +# Check data +select id, length(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1; + +# You can do anything with the columns, like SUM() or GROUP +select column_get(str, 2 as char), sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char); +select column_get(str, 2 as char), sum(column_get(str, 1 as int)) from t1 where column_exists(str, 2) <> 0 group by 1; +select sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char) order by sum(column_get(str, 1 as int)) desc; +select sum(column_get(str, 1 as int)) from t1 group by column_get(str, 2 as char) having sum(column_get(str, 1 as int)) > 2; +select sum(column_get(str, 1 as int)) from t1 where column_get(str, 3 as int) > 50 group by column_get(str, 2 as char); + +# Deleting of column +select id, column_list(str) from t1 where id= 5; +update t1 set str=column_delete(str, 3, 4, 2) where id= 5; + +select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1; + +update t1 set str=column_add(str, 4, 45 as char, 2, 'c') where id= 5; +select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1 where id = 5; + +# Check which column exists +select id, length(str), column_list(str), column_exists(str, 4) from t1; +select sum(column_get(str, 1 as int)), column_list(str) from t1 group by 2; +select id, hex(str) from t1; + +# Check with a bit larger strings + +update t1 set str=column_add(str, 4, repeat("a", 100000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("a", 100000); +select id from t1 where column_get(str,4 as char(100)) = repeat("a", 100); +update t1 set str=column_add(str, 4, repeat("b", 10000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("b", 10000); +update t1 set str=column_add(str, 4, repeat("c", 100)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("c", 100); +update t1 set str=column_add(str, 4, repeat("d", 10000)) where id=5; +select id from t1 where column_get(str,4 as char(100000)) = repeat("d", 10000); +update t1 set str=column_add(str, 4, repeat("e", 10), 5, repeat("f", 100000)) where id=5; +select id from t1 where column_get(str,5 as char(100000)) = repeat("f", 100000); +select id, column_list(str), length(str) from t1 where id=5; +update t1 set str=column_delete(str, 5) where id=5; +select id, column_list(str), length(str) from t1 where id=5; + +drop table t1; diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 5779ea97bc2..e4a93453aee 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -367,6 +367,8 @@ INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE)); --error 1292 INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE)); +--error 1292 +INSERT INTO t1 (col1) VALUES('2004-0-10'); # deactivated because of Bug#8294 # Bug#8294 Traditional: Misleading error message for invalid CAST to DATE |