1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

post-review changes 1

include/my_time.h:
  remove duplicate defines.
  cast to ulonglong to avoid overflow
sql/field.cc:
  perform sign extension when reading packed TIME values
sql/item_cmpfunc.cc:
  when converting a string to a date for the purpose of comparing it with another date,
  we should ignore strict sql mode.
sql/item_timefunc.cc:
  better error message
sql/item_timefunc.h:
  limit decimals appropriately
sql/share/errmsg.txt:
  don't refer to an object as a "column" in error messages that are used not only for columns.
This commit is contained in:
Sergei Golubchik
2011-05-19 19:01:46 +02:00
parent 5346cb8d27
commit 8ddcd0cda8
32 changed files with 378 additions and 107 deletions

View File

@ -4105,6 +4105,11 @@ str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6'
1
Warnings:
Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT-6'
select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6';
str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'
0
Warnings:
Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6'
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6';
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'
1
@ -4168,14 +4173,10 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
set SQL_MODE=TRADITIONAL;
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
1
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
0
@ -4219,14 +4220,23 @@ str_to_date('','%Y-%m-%d') = ''
1
Warnings:
Warning 1292 Truncated incorrect date value: ''
select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL;
str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL
select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01';
str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01'
1
select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and NULL;
str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and NULL
NULL
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00';
str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'
select str_to_date('2000-01-01','%Y-%m-%d') between NULL and '2001-01-01';
str_to_date('2000-01-01','%Y-%m-%d') between NULL and '2001-01-01'
NULL
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL
select str_to_date('2000-01-01','%Y-%m-%d') between '2001-01-01' and NULL;
str_to_date('2000-01-01','%Y-%m-%d') between '2001-01-01' and NULL
0
select str_to_date('2000-01-01','%Y-%m-%d') between NULL and '1000-01-01';
str_to_date('2000-01-01','%Y-%m-%d') between NULL and '1000-01-01'
0
select str_to_date('2000-01-01','%Y-%m-%d') between NULL and NULL;
str_to_date('2000-01-01','%Y-%m-%d') between NULL and NULL
NULL
CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL,