mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
number to time comparison
This commit is contained in:
parent
5ff5c4b8a3
commit
db9c46de40
3 changed files with 28 additions and 2 deletions
|
@ -1358,6 +1358,21 @@ Warning 1292 Truncated incorrect time value: ''
|
|||
Warning 1292 Truncated incorrect time value: ''
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
select time('10:10:10') > 10;
|
||||
time('10:10:10') > 10
|
||||
1
|
||||
select time('10:10:10') > 1010;
|
||||
time('10:10:10') > 1010
|
||||
1
|
||||
select time('10:10:09') > 101010;
|
||||
time('10:10:09') > 101010
|
||||
0
|
||||
select time('10:10:10') > 101010;
|
||||
time('10:10:10') > 101010
|
||||
0
|
||||
select time('10:10:11') > 101010;
|
||||
time('10:10:11') > 101010
|
||||
1
|
||||
select time(' 1 02:03:04') + interval 9 microsecond;
|
||||
time(' 1 02:03:04') + interval 9 microsecond
|
||||
26:03:04.000009
|
||||
|
|
|
@ -861,6 +861,12 @@ DROP TABLE t1;
|
|||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
select time('10:10:10') > 10;
|
||||
select time('10:10:10') > 1010;
|
||||
select time('10:10:09') > 101010;
|
||||
select time('10:10:10') > 101010;
|
||||
select time('10:10:11') > 101010;
|
||||
|
||||
select time(' 1 02:03:04') + interval 9 microsecond;
|
||||
select time(' 1 02:03:04') - interval 9 microsecond;
|
||||
select time('-1 02:03:04') + interval 9 microsecond;
|
||||
|
|
|
@ -870,9 +870,14 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
|
|||
{
|
||||
MYSQL_TIME buf;
|
||||
int was_cut;
|
||||
longlong res;
|
||||
|
||||
if (number_to_datetime(value, &buf, TIME_INVALID_DATES|TIME_FUZZY_DATE,
|
||||
&was_cut) == -1)
|
||||
if (t_type == MYSQL_TIMESTAMP_TIME)
|
||||
res= number_to_time(value, &buf, &was_cut);
|
||||
else
|
||||
res= number_to_datetime(value, &buf, TIME_INVALID_DATES|TIME_FUZZY_DATE,
|
||||
&was_cut);
|
||||
if (res == -1)
|
||||
{
|
||||
const Lazy_string_num str(value);
|
||||
make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
|
|
Loading…
Add table
Reference in a new issue