Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2021 05/10/25 17:05:15 gluh@stripped +14 -0
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
-added parameter to 'make_truncated_value_warning' function
-'make_truncated_value_warning' function change: issue more correct
message for incorrect date|datetime|time values
-issue correct message in case of too big numbers for decimal fields
sql/time.cc
1.58 05/10/25 17:03:41 gluh@stripped +13 -6
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
added parameter to 'make_truncated_value_warning' function
'make_truncated_value_warning' function change: issue more correct
message for incorrect date|datetime|time values
sql/share/errmsg.txt
1.51 05/10/25 17:03:41 gluh@stripped +2 -0
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
new error message
sql/mysql_priv.h
1.363 05/10/25 17:03:41 gluh@stripped +1 -1
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
added parameter to 'make_truncated_value_warning' function
sql/item_timefunc.cc
1.95 05/10/25 17:03:41 gluh@stripped +1 -1
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
added parameter to 'make_truncated_value_warning' function
sql/item.cc
1.191 05/10/25 17:03:41 gluh@stripped +1 -1
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
added parameter to 'make_truncated_value_warning' function
sql/field.cc
1.286 05/10/25 17:03:41 gluh@stripped +23 -11
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
issue correct message in case of too big numbers for decimal fields
added parameter to 'make_truncated_value_warning' function
mysql-test/t/type_newdecimal.test
1.30 05/10/25 17:03:41 gluh@stripped +5 -5
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
test case change
mysql-test/t/strict.test
1.20 05/10/25 17:03:41 gluh@stripped +11 -11
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
test case change
mysql-test/r/type_newdecimal.result
1.32 05/10/25 17:03:41 gluh@stripped +5 -5
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
mysql-test/r/timezone_grant.result
1.4 05/10/25 17:03:41 gluh@stripped +1 -1
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
mysql-test/r/strict.result
1.26 05/10/25 17:03:41 gluh@stripped +20 -20
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
mysql-test/r/func_time.result
1.47 05/10/25 17:03:40 gluh@stripped +15 -15
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
mysql-test/r/func_sapdb.result
1.14 05/10/25 17:03:40 gluh@stripped +3 -3
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
mysql-test/r/date_formats.result
1.18 05/10/25 17:03:40 gluh@stripped +2 -2
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
result change
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gluh
# Host: eagle.intranet.mysql.r18.ru
# Root: /home/gluh/MySQL/Bugs/5.0.8294
--- 1.285/sql/field.cc Fri Oct 14 02:04:47 2005
+++ 1.286/sql/field.cc Tue Oct 25 17:03:41 2005
@@ -2361,12 +2361,13 @@
bool Field_new_decimal::store_value(const my_decimal *decimal_value)
{
- int error= 0;
+ int error= 0, res_error;
+ char val_buff[DECIMAL_MAX_STR_LENGTH+1];
DBUG_ENTER("Field_new_decimal::store_value");
#ifndef DBUG_OFF
{
- char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
- DBUG_PRINT("enter", ("value: %s", dbug_decimal_as_string(dbug_buff, decimal_value)));
+ DBUG_PRINT("enter", ("value: %s", dbug_decimal_as_string(val_buff,
+ decimal_value)));
}
#endif
@@ -2374,21 +2375,23 @@
if (unsigned_flag && decimal_value->sign())
{
DBUG_PRINT("info", ("unsigned overflow"));
+ if (table->in_use->really_abort_on_warning())
+ goto err;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
error= 1;
decimal_value= &decimal_zero;
}
#ifndef DBUG_OFF
{
- char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
DBUG_PRINT("info", ("saving with precision %d, scale: %d, value %s",
(int)precision, (int)dec,
- dbug_decimal_as_string(dbug_buff, decimal_value)));
+ dbug_decimal_as_string(val_buff, decimal_value)));
}
#endif
-
- if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
- decimal_value, ptr, precision, dec)))
+ res_error= my_decimal2binary(0, decimal_value, ptr, precision, dec);
+ if (res_error == E_DEC_OVERFLOW &&
table->in_use->really_abort_on_warning())
+ goto err;
+ if (warn_if_overflow(res_error))
{
my_decimal buff;
DBUG_PRINT("info", ("overflow"));
@@ -2398,6 +2401,15 @@
}
DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr, bin_size););
DBUG_RETURN(error);
+
+err:
+ dbug_decimal_as_string(val_buff, decimal_value);
+ push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
+ ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
+ "decimal", val_buff, field_name,
+ (ulong) table->in_use->row_count);
+ DBUG_RETURN(1);
}
@@ -8680,7 +8692,7 @@
if (table->in_use->really_abort_on_warning() ||
set_warning(level, code, cuted_increment))
make_truncated_value_warning(table->in_use, str, str_length, ts_type,
- field_name);
+ field_name, FALSE);
}
@@ -8713,7 +8725,7 @@
char *str_end= longlong10_to_str(nr, str_nr, -10);
make_truncated_value_warning(table->in_use, str_nr,
(uint) (str_end - str_nr),
- ts_type, field_name);
+ ts_type, field_name, FALSE);
}
}
@@ -8745,6 +8757,6 @@
char str_nr[DBL_DIG + 8];
uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr));
make_truncated_value_warning(table->in_use, str_nr, str_len, ts_type,
- field_name);
+ field_name, FALSE);
}
}
--- 1.190/sql/item.cc Thu Oct 13 21:49:40 2005
+++ 1.191/sql/item.cc Tue Oct 25 17:03:41 2005
@@ -2173,7 +2173,7 @@
{
char buff[MAX_DATE_STRING_REP_LENGTH];
uint length= my_TIME_to_str(&value.time, buff);
- make_truncated_value_warning(current_thd, buff, length, type, 0);
+ make_truncated_value_warning(current_thd, buff, length, type, 0, FALSE);
set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR);
}
--- 1.94/sql/item_timefunc.cc Wed Sep 14 21:24:30 2005
+++ 1.95/sql/item_timefunc.cc Tue Oct 25 17:03:41 2005
@@ -470,7 +470,7 @@
if (!my_isspace(&my_charset_latin1,*val))
{
make_truncated_value_warning(current_thd, val_begin, length,
- cached_timestamp_type, NullS);
+ cached_timestamp_type, NullS, TRUE);
break;
}
} while (++val != val_end);
--- 1.362/sql/mysql_priv.h Wed Oct 19 02:43:13 2005
+++ 1.363/sql/mysql_priv.h Tue Oct 25 17:03:41 2005
@@ -1312,7 +1312,7 @@
void make_truncated_value_warning(THD *thd, const char *str_val,
uint str_length, timestamp_type time_type,
- const char *field_name);
+ const char *field_name, bool was_cut);
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
const char *format_str,
uint format_length);
--- 1.57/sql/time.cc Sun Jul 31 14:49:47 2005
+++ 1.58/sql/time.cc Tue Oct 25 17:03:41 2005
@@ -201,7 +201,8 @@
MODE_NO_ZERO_DATE))),
&was_cut);
if (was_cut || ts_type <= MYSQL_TIMESTAMP_ERROR)
- make_truncated_value_warning(current_thd, str, length, ts_type, NullS);
+ make_truncated_value_warning(current_thd, str, length,
+ ts_type, NullS, was_cut);
return ts_type;
}
@@ -258,7 +259,7 @@
bool ret_val= str_to_time(str, length, l_time, &was_cut);
if (was_cut)
make_truncated_value_warning(current_thd, str, length,
- MYSQL_TIMESTAMP_TIME, NullS);
+ MYSQL_TIMESTAMP_TIME, NullS, was_cut);
return ret_val;
}
@@ -684,7 +685,7 @@
void make_truncated_value_warning(THD *thd, const char *str_val,
uint str_length, timestamp_type time_type,
- const char *field_name)
+ const char *field_name, bool was_cut)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
const char *type_str;
@@ -711,9 +712,15 @@
type_str, str.c_ptr(), field_name,
(ulong) thd->row_count);
else
- cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
- ER(ER_TRUNCATED_WRONG_VALUE),
- type_str, str.c_ptr());
+ {
+ if (was_cut && time_type > MYSQL_TIMESTAMP_ERROR)
+ cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
+ ER(ER_TRUNCATED_WRONG_VALUE),
+ type_str, str.c_ptr());
+ else
+ cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
+ ER(ER_WRONG_VALUE), type_str, str.c_ptr());
+ }
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE, warn_buff);
}
--- 1.50/sql/share/errmsg.txt Tue Oct 11 18:01:31 2005
+++ 1.51/sql/share/errmsg.txt Tue Oct 25 17:03:41 2005
@@ -5422,3 +5422,5 @@
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
ER_SP_BAD_VAR_SHADOW 42000
eng "Variable '%-.64s' must be quoted with `...`, or renamed"
+ER_WRONG_VALUE
+ eng "Incorrect %-.32s value: '%-.128s'"
--- 1.17/mysql-test/r/date_formats.result Wed Jul 20 07:53:52 2005
+++ 1.18/mysql-test/r/date_formats.result Tue Oct 25 17:03:40 2005
@@ -401,14 +401,14 @@
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
--- 1.13/mysql-test/r/func_sapdb.result Mon Apr 18 16:58:53 2005
+++ 1.14/mysql-test/r/func_sapdb.result Tue Oct 25 17:03:40 2005
@@ -68,7 +68,7 @@
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 @@
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 @@
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
--- 1.31/mysql-test/r/type_newdecimal.result Fri Sep 30 15:01:26 2005
+++ 1.32/mysql-test/r/type_newdecimal.result Tue Oct 25 17:03:41 2005
@@ -816,9 +816,9 @@
Note 1265 Data truncated for column 'col1' at row 1
INSERT INTO Sow6_2f VALUES (11);
INSERT INTO Sow6_2f VALUES (101.55);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '101.55' for column 'col1' at row 1
UPDATE Sow6_2f SET col1 = col1 * 50 WHERE col1 = 11;
-ERROR 22003: Out of range value adjusted for column 'col1' at row 5
+ERROR HY000: Incorrect decimal value: '550.00' for column 'col1' at row 5
UPDATE Sow6_2f SET col1 = col1 / 0 WHERE col1 > 0;
ERROR 22012: Division by 0
SELECT MOD(col1,0) FROM Sow6_2f;
@@ -883,13 +883,13 @@
set @@sql_mode='traditional';
create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22)
unsigned);
insert into t1 values(1,-1,-1);
-ERROR 22003: Out of range value adjusted for column 'd2' at row 1
+ERROR HY000: Incorrect decimal value: '-1' for column 'd2' at row 1
drop table t1;
create table t1 (col1 decimal(5,2), col2 numeric(5,2));
insert into t1 values (999.999,999.999);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '999.999' for column 'col1' at row 1
insert into t1 values (-999.999,-999.999);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '-999.999' for column 'col1' at row 1
select * from t1;
col1 col2
drop table t1;
--- 1.29/mysql-test/t/type_newdecimal.test Wed Sep 14 08:25:21 2005
+++ 1.30/mysql-test/t/type_newdecimal.test Tue Oct 25 17:03:41 2005
@@ -849,10 +849,10 @@
#-- should return OK
INSERT INTO Sow6_2f VALUES (11);
#-- should return OK
--- error 1264
+-- error 1366
INSERT INTO Sow6_2f VALUES (101.55);
#-- should return SQLSTATE 22003 numeric value out of range
--- error 1264
+-- error 1366
UPDATE Sow6_2f SET col1 = col1 * 50 WHERE col1 = 11;
#-- should return SQLSTATE 22003 numeric value out of range
-- error 1365
@@ -919,13 +919,13 @@
#
set @@sql_mode='traditional';
create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22)
unsigned);
---error 1264
+--error 1366
insert into t1 values(1,-1,-1);
drop table t1;
create table t1 (col1 decimal(5,2), col2 numeric(5,2));
---error 1264
+--error 1366
insert into t1 values (999.999,999.999);
---error 1264
+--error 1366
insert into t1 values (-999.999,-999.999);
select * from t1;
drop table t1;
--- 1.3/mysql-test/r/timezone_grant.result Tue Jul 19 01:49:14 2005
+++ 1.4/mysql-test/r/timezone_grant.result Tue Oct 25 17:03:41 2005
@@ -38,7 +38,7 @@
convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC')
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2004-11-31 12:00:00'
+Warning 1292 Incorrect datetime value: '2004-11-31 12:00:00'
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
convert_tz(b, 'Europe/Moscow', 'UTC')
update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
--- 1.46/mysql-test/r/func_time.result Wed Sep 14 21:24:30 2005
+++ 1.47/mysql-test/r/func_time.result Tue Oct 25 17:03:40 2005
@@ -311,7 +311,7 @@
date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND)
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 00:00:00'
+Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
select date_add('1998-01-30',Interval 1 month);
date_add('1998-01-30',Interval 1 month)
1998-02-28
@@ -428,12 +428,12 @@
month(updated)
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: ''
+Warning 1292 Incorrect datetime value: ''
SELECT year(updated) from t1;
year(updated)
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: ''
+Warning 1292 Incorrect datetime value: ''
drop table t1;
create table t1 (d date, dt datetime, t timestamp, c char(10));
insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
@@ -441,8 +441,8 @@
dayofyear("0000-00-00") dayofyear(d) dayofyear(dt) dayofyear(t) dayofyear(c)
NULL NULL NULL NULL NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c)
from t1;
dayofmonth("0000-00-00") dayofmonth(d) dayofmonth(dt) dayofmonth(t) dayofmonth(c)
0 0 0 0 0
@@ -456,8 +456,8 @@
week("0000-00-00") week(d) week(dt) week(t) week(c)
NULL NULL NULL NULL NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1;
year("0000-00-00") year(d) year(dt) year(t) year(c)
0 0 0 0 0
@@ -465,14 +465,14 @@
yearweek("0000-00-00") yearweek(d) yearweek(dt) yearweek(t) yearweek(c)
NULL NULL NULL NULL NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t1;
to_days("0000-00-00") to_days(d) to_days(dt) to_days(t) to_days(c)
NULL NULL NULL NULL NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM
dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1;
extract(MONTH FROM "0000-00-00") extract(MONTH FROM d) extract(MONTH FROM
dt) extract(MONTH FROM t) extract(MONTH FROM c)
0 0 0 0 0
@@ -637,7 +637,7 @@
f1 f2 f3 f4 f5 last_day(NULL) last_day('2001-02-12')
2000-02-29 2002-12-31 NULL 2003-04-30 2001-01-31 NULL 2001-02-28
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2003-03-32'
+Warning 1292 Incorrect datetime value: '2003-03-32'
create table t1 select last_day('2000-02-05') as a,
from_days(to_days("960101")) as b;
describe t1;
@@ -706,17 +706,17 @@
last_day('2005-00-00')
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2005-00-00'
+Warning 1292 Incorrect datetime value: '2005-00-00'
select last_day('2005-00-01');
last_day('2005-00-01')
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2005-00-01'
+Warning 1292 Incorrect datetime value: '2005-00-01'
select last_day('2005-01-00');
last_day('2005-01-00')
NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2005-01-00'
+Warning 1292 Incorrect datetime value: '2005-01-00'
select time_format('100:00:00', '%H %k %h %I %l');
time_format('100:00:00', '%H %k %h %I %l')
100 100 04 04 4
--- 1.25/mysql-test/r/strict.result Wed Sep 14 03:41:37 2005
+++ 1.26/mysql-test/r/strict.result Tue Oct 25 17:03:41 2005
@@ -260,14 +260,14 @@
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
INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+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
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
INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+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));
@@ -275,7 +275,7 @@
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
INSERT INTO t1 (col3) VALUES(CAST('0000-00-00' AS DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+ERROR 22007: Incorrect datetime value: '0000-00-00'
drop table t1;
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE));
@@ -287,14 +287,14 @@
INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+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
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
INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+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));
@@ -302,7 +302,7 @@
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
INSERT INTO t1 (col3) VALUES(CONVERT('0000-00-00',DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+ERROR 22007: Incorrect datetime value: '0000-00-00'
drop table t1;
CREATE TABLE t1(col1 TINYINT, col2 TINYINT UNSIGNED);
INSERT INTO t1
VALUES(-128,0),(0,0),(127,255),('-128','0'),('0','0'),('127','255'),(-128.0,0.0),(0.0,0.0),(127.0,255.0);
@@ -752,29 +752,29 @@
Note 1265 Data truncated for column 'col1' at row 2
Note 1265 Data truncated for column 'col1' at row 4
INSERT INTO t1 VALUES (101.55);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '101.55' for column 'col1' at row 1
INSERT INTO t1 VALUES (101);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '101' for column 'col1' at row 1
INSERT INTO t1 VALUES (-101.55);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '-101.55' for column 'col1' at row 1
INSERT INTO t1 VALUES (1010.55);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '1010.55' for column 'col1' at row 1
INSERT INTO t1 VALUES (1010);
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '1010' for column 'col1' at row 1
INSERT INTO t1 VALUES ('101.55');
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '101.55' for column 'col1' at row 1
INSERT INTO t1 VALUES ('101');
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '101' for column 'col1' at row 1
INSERT INTO t1 VALUES ('-101.55');
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '-101.55' for column 'col1' at row 1
INSERT INTO t1 VALUES ('-1010.55');
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '-1010.55' for column 'col1' at row 1
INSERT INTO t1 VALUES ('-100E+1');
-ERROR 22003: Out of range value adjusted for column 'col1' at row 1
+ERROR HY000: Incorrect decimal value: '-1000' for column 'col1' at row 1
INSERT INTO t1 VALUES ('-100E');
ERROR HY000: 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 adjusted for column 'col1' at row 6
+ERROR HY000: Incorrect decimal value: '550000.00' for column 'col1' at row 6
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
@@ -1133,9 +1133,9 @@
insert into t1 values (0.0,0.0,0.0);
ERROR 22007: Incorrect date value: '0' for column 'col1' at row 1
insert into t1 (col1) values (convert('0000-00-00',date));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+ERROR 22007: Incorrect datetime value: '0000-00-00'
insert into t1 (col1) values (cast('0000-00-00' as date));
-ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
+ERROR 22007: Incorrect datetime value: '0000-00-00'
set sql_mode='no_zero_date';
insert into t1 values (0,0,0);
Warnings:
@@ -1160,7 +1160,7 @@
Warning 1265 Data truncated for column 'col1' at row 1
insert ignore into t1 (col1) values (cast('0000-00-00' as date));
Warnings:
-Warning 1292 Truncated incorrect datetime value: '0000-00-00'
+Warning 1292 Incorrect datetime value: '0000-00-00'
insert into t1 select * from t1;
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
alter table t1 modify col1 datetime;
--- 1.19/mysql-test/t/strict.test Wed Sep 14 03:41:37 2005
+++ 1.20/mysql-test/t/strict.test Tue Oct 25 17:03:41 2005
@@ -720,31 +720,31 @@
-- The 2 following inserts should generate a warning, but doesn't yet
-- because NUMERIC works like DECIMAL
---error 1264
+--error 1366
INSERT INTO t1 VALUES (101.55);
---error 1264
+--error 1366
INSERT INTO t1 VALUES (101);
---error 1264
+--error 1366
INSERT INTO t1 VALUES (-101.55);
---error 1264
+--error 1366
INSERT INTO t1 VALUES (1010.55);
---error 1264
+--error 1366
INSERT INTO t1 VALUES (1010);
-- The 2 following inserts should generate a warning, but doesn't yet
-- because NUMERIC works like DECIMAL
---error 1264
+--error 1366
INSERT INTO t1 VALUES ('101.55');
---error 1264
+--error 1366
INSERT INTO t1 VALUES ('101');
---error 1264
+--error 1366
INSERT INTO t1 VALUES ('-101.55');
---error 1264
+--error 1366
INSERT INTO t1 VALUES ('-1010.55');
---error 1264
+--error 1366
INSERT INTO t1 VALUES ('-100E+1');
--error 1366
INSERT INTO t1 VALUES ('-100E');
---error 1264
+--error 1366
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
--error 1365
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
| Thread |
|---|
| • bk commit into 5.0 tree (gluh:1.2021) BUG#8294 | gluh | 25 Oct |