mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-17798 System variable system_versioning_asof accepts wrong values
This commit is contained in:
parent
14e6f0251c
commit
006f6f97b1
3 changed files with 34 additions and 2 deletions
|
@ -31,6 +31,14 @@ set global system_versioning_asof= 1;
|
|||
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
|
||||
set global system_versioning_asof= 1.1;
|
||||
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
|
||||
set global system_versioning_asof= '2011-02-29 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
|
||||
set global system_versioning_asof= '2011-02-28 24:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
|
||||
set global system_versioning_asof= '2011-00-28 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
|
||||
set global system_versioning_asof= '0000-00-00 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
|
||||
set system_versioning_asof= 'alley';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
|
||||
set system_versioning_asof= null;
|
||||
|
@ -39,6 +47,14 @@ set system_versioning_asof= 1;
|
|||
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
|
||||
set system_versioning_asof= 1.1;
|
||||
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
|
||||
set system_versioning_asof= '2011-02-29 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
|
||||
set system_versioning_asof= '2011-02-28 24:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
|
||||
set system_versioning_asof= '2011-00-28 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
|
||||
set system_versioning_asof= '0000-00-00 00:00';
|
||||
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
|
||||
# GLOBAL @@system_versioning_asof
|
||||
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
|
||||
Warnings:
|
||||
|
|
|
@ -23,6 +23,14 @@ set global system_versioning_asof= null;
|
|||
set global system_versioning_asof= 1;
|
||||
--error ER_WRONG_TYPE_FOR_VAR
|
||||
set global system_versioning_asof= 1.1;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global system_versioning_asof= '2011-02-29 00:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global system_versioning_asof= '2011-02-28 24:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global system_versioning_asof= '2011-00-28 00:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global system_versioning_asof= '0000-00-00 00:00';
|
||||
|
||||
# session
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
|
@ -33,6 +41,14 @@ set system_versioning_asof= null;
|
|||
set system_versioning_asof= 1;
|
||||
--error ER_WRONG_TYPE_FOR_VAR
|
||||
set system_versioning_asof= 1.1;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set system_versioning_asof= '2011-02-29 00:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set system_versioning_asof= '2011-02-28 24:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set system_versioning_asof= '2011-00-28 00:00';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set system_versioning_asof= '0000-00-00 00:00';
|
||||
|
||||
--echo # GLOBAL @@system_versioning_asof
|
||||
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
|
||||
|
|
|
@ -2634,7 +2634,7 @@ public:
|
|||
if (!Sys_var_enum::do_check(thd, var))
|
||||
return false;
|
||||
MYSQL_TIME ltime;
|
||||
bool res= var->value->get_date(<ime, 0);
|
||||
bool res= var->value->get_date(<ime, TIME_NO_ZERO_IN_DATE|TIME_NO_ZERO_DATE);
|
||||
if (!res)
|
||||
{
|
||||
var->save_result.ulonglong_value= SYSTEM_TIME_AS_OF;
|
||||
|
@ -2651,7 +2651,7 @@ private:
|
|||
{
|
||||
if (var->value)
|
||||
{
|
||||
res= var->value->get_date(&out.ltime, 0);
|
||||
res= var->value->get_date(&out.ltime, TIME_NO_ZERO_IN_DATE|TIME_NO_ZERO_DATE);
|
||||
}
|
||||
else // set DEFAULT from global var
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue