Commit ca34f415 authored by unknown's avatar unknown
Browse files

Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE

  -issue more correct message for incorrect date|datetime|time values
  -ER_WARN_DATA_OUT_OF_RANGE message is changed
  -added new error message


mysql-test/r/auto_increment.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/bigint.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ctype_ucs.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/date_formats.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/func_sapdb.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/func_str.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/func_time.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/insert.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/loaddata.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/mysqldump.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_2myisam.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_3innodb.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_4heap.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_5merge.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_6bdb.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/ps_7ndb.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/rpl_rewrite_db.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/sp.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/strict.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/timezone2.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/timezone_grant.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_bit.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_bit_innodb.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_date.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_datetime.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_decimal.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_float.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_newdecimal.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_ranges.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_time.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/type_uint.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/view.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
mysql-test/r/warnings.result:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    result change
sql/share/errmsg.txt:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    -ER_WARN_DATA_OUT_OF_RANGE message is changed
    -added new error message
sql/time.cc:
  Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
    issue more correct message for incorrect date|datetime|time values
parent 44523ebc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ last_insert_id()
255
insert into t1 set i = null;
Warnings:
Warning	1264	Out of range value adjusted for column 'i' at row 1
Warning	1264	Out of range value for column 'i' at row 1
select last_insert_id();
last_insert_id()
255
+7 −7
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ drop table t1;
create table t1 ( a int not null default 1, big bigint );
insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
Warnings:
Warning	1264	Out of range value adjusted for column 'big' at row 4
Warning	1264	Out of range value for column 'big' at row 4
select * from t1;
a	big
1	-1
@@ -62,7 +62,7 @@ min(big) max(big) max(big)-1
-1	9223372036854775807	9223372036854775806
alter table t1 modify big bigint unsigned not null;
Warnings:
Warning	1264	Out of range value adjusted for column 'big' at row 1
Warning	1264	Out of range value for column 'big' at row 1
select min(big),max(big),max(big)-1 from t1;
min(big)	max(big)	max(big)-1
0	9223372036854775807	9223372036854775806
@@ -92,7 +92,7 @@ min(big) max(big) max(big)-1
0	18446744073709551615	18446744073709551614
alter table t1 modify big bigint not null;
Warnings:
Warning	1264	Out of range value adjusted for column 'big' at row 5
Warning	1264	Out of range value for column 'big' at row 5
select * from t1;
a	big
1	0
@@ -204,10 +204,10 @@ drop table t1;
create table t1 ( quantity decimal(2) unsigned);
insert into t1 values (500), (-500), (~0), (-1);
Warnings:
Warning	1264	Out of range value adjusted for column 'quantity' at row 1
Warning	1264	Out of range value adjusted for column 'quantity' at row 2
Warning	1264	Out of range value adjusted for column 'quantity' at row 3
Warning	1264	Out of range value adjusted for column 'quantity' at row 4
Warning	1264	Out of range value for column 'quantity' at row 1
Warning	1264	Out of range value for column 'quantity' at row 2
Warning	1264	Out of range value for column 'quantity' at row 3
Warning	1264	Out of range value for column 'quantity' at row 4
select * from t1;
quantity
99
+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ DROP TABLE t1;
CREATE TABLE t1 (Field1 int(10) unsigned default '0');
INSERT INTO t1 VALUES ('-1');
Warnings:
Warning	1264	Out of range value adjusted for column 'Field1' at row 1
Warning	1264	Out of range value for column 'Field1' at row 1
DROP TABLE t1;
SET NAMES latin1;
CREATE TABLE t1 (
+2 −2
Original line number Diff line number Diff line
@@ -401,14 +401,14 @@ date format str_to_date
2003-01-02 10:11:12	%Y-%m-%d %h:%i:%S	2003-01-02 10:11:12
03-01-02 10:11:12 PM	%Y-%m-%d %h:%i:%S %p	0003-01-02 22:11:12
Warnings:
Warning	1292	Truncated incorrect datetime value: '10:20:10AM'
Warning	1292	Incorrect datetime value: '10:20:10AM'
select date,format,concat(str_to_date(date, format),'') as con from t1;
date	format	con
10:20:10AM	%h:%i:%s	0000-00-00 10:20:10
2003-01-02 10:11:12	%Y-%m-%d %h:%i:%S	2003-01-02 10:11:12
03-01-02 10:11:12 PM	%Y-%m-%d %h:%i:%S %p	0003-01-02 22:11:12
Warnings:
Warning	1292	Truncated incorrect datetime value: '10:20:10AM'
Warning	1292	Incorrect datetime value: '10:20:10AM'
drop table t1;
select get_format(DATE, 'USA') as a;
a
+3 −3
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ select datediff("1997-11-31 23:59:59.000001","1997-12-31");
datediff("1997-11-31 23:59:59.000001","1997-12-31")
NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1997-11-31 23:59:59.000001'
Warning	1292	Incorrect datetime value: '1997-11-31 23:59:59.000001'
select datediff("1997-11-30 23:59:59.000001",null);
datediff("1997-11-30 23:59:59.000001",null)
NULL
@@ -133,7 +133,7 @@ select timestamp("2001-13-01", "01:01:01.000001");
timestamp("2001-13-01", "01:01:01.000001")
NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '2001-13-01'
Warning	1292	Incorrect datetime value: '2001-13-01'
select timestamp("2001-12-01", "25:01:01");
timestamp("2001-12-01", "25:01:01")
2001-12-02 01:01:01
@@ -153,7 +153,7 @@ select date("1997-13-31 23:59:59.000001");
date("1997-13-31 23:59:59.000001")
NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1997-13-31 23:59:59.000001'
Warning	1292	Incorrect datetime value: '1997-13-31 23:59:59.000001'
select time("1997-12-31 23:59:59.000001");
time("1997-12-31 23:59:59.000001")
23:59:59.000001
Loading