Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b615d275
Commit
b615d275
authored
Feb 02, 2020
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17798 System variable system_versioning_asof accepts wrong values (10.4)
parent
5a6023cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
mysql-test/suite/versioning/r/sysvars.result
mysql-test/suite/versioning/r/sysvars.result
+16
-0
mysql-test/suite/versioning/t/sysvars.test
mysql-test/suite/versioning/t/sysvars.test
+16
-0
sql/sys_vars.ic
sql/sys_vars.ic
+7
-2
No files found.
mysql-test/suite/versioning/r/sysvars.result
View file @
b615d275
...
...
@@ -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:
...
...
mysql-test/suite/versioning/t/sysvars.test
View file @
b615d275
...
...
@@ -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'
;
...
...
sql/sys_vars.ic
View file @
b615d275
...
...
@@ -2634,7 +2634,10 @@ public:
if (!Sys_var_enum::do_check(thd, var))
return false;
MYSQL_TIME ltime;
Datetime::Options opt(TIME_CONV_NONE, thd);
// FIXME: please resolve both conflicts to "old" and remove this comment
Datetime::Options opt(TIME_CONV_NONE |
TIME_NO_ZERO_IN_DATE |
TIME_NO_ZERO_DATE, thd);
bool res= var->value->get_date(thd, <ime, opt);
if (!res)
{
...
...
@@ -2653,7 +2656,9 @@ private:
if (var->value)
{
THD *thd= current_thd;
Datetime::Options opt(TIME_CONV_NONE, thd);
Datetime::Options opt(TIME_CONV_NONE |
TIME_NO_ZERO_IN_DATE |
TIME_NO_ZERO_DATE, thd);
res= var->value->get_date(thd, &out.ltime, opt);
}
else // set DEFAULT from global var
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment