diff options
author | unknown <monty@mysql.com> | 2005-03-30 16:00:31 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-03-30 16:00:31 +0300 |
commit | a5b1b9d92474e4e1e30e7b1a3570cf4531533b03 (patch) | |
tree | 805fffb7b7262d7e59f1fd8969a0c1670de80a88 /mysql-test/r/date_formats.result | |
parent | a391ef8dda3326a421f804bb34b4be48782a2848 (diff) | |
download | mariadb-git-a5b1b9d92474e4e1e30e7b1a3570cf4531533b03.tar.gz |
Give warnings if wrong date/time/datetime argument for STR_TO_DATE
Small fixes while doing review of new pushed code
More test cases for decimal
mysql-test/r/date_formats.result:
Warnings added for STR_TO_DATE()
mysql-test/r/ps_1general.result:
Better description for BLACKHOLE
mysql-test/r/strict.result:
Added tests for STR_TO_DATE
mysql-test/r/type_decimal.result:
Test to test ranges of DECIMAL
mysql-test/t/date_formats.test:
More tests
mysql-test/t/strict.test:
Added tests for STR_TO_DATE
mysql-test/t/type_decimal.test:
Test to test ranges of DECIMAL
sql/field.cc:
Simple optimization
sql/handler.cc:
Better description for BLACKHOLE
sql/item_timefunc.cc:
Give warnings if wrong date/time/datetime argument for STR_TO_DATE
sql/log_event.cc:
Indentation fixes
sql/log_event.h:
#ifdef-ed not used code
sql/share/errmsg.txt:
New error message
sql/sql_show.cc:
Ensure that we do a proper restore in case of error
Diffstat (limited to 'mysql-test/r/date_formats.result')
-rw-r--r-- | mysql-test/r/date_formats.result | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 2db014c4a52..8217a0e7ba6 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -79,6 +79,11 @@ concat('%d-%m-%Y',' ','%H:%i:%s.%f')); str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')) 2001-01-15 02:59:58.999000 +select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T'); +STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T') +NULL +Warnings: +Error 1411 Incorrect time value: '22.30.61' for function str_to_time create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), @@ -335,6 +340,22 @@ Tuesday 52 2001 %W %V %Y NULL Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL +Warnings: +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL @@ -353,6 +374,22 @@ Tuesday 52 2001 %W %V %Y NULL Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL +Warnings: +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time truncate table t1; insert into t1 values ('10:20:10AM', '%h:%i:%s'), @@ -391,6 +428,8 @@ NULL select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) NULL +Warnings: +Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_time explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used |