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
04451f0f
Commit
04451f0f
authored
Dec 26, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14765 Server crashes in Sys_var_vers_asof::update
parent
11c68827
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
mysql-test/suite/versioning/r/sysvars.result
mysql-test/suite/versioning/r/sysvars.result
+19
-0
mysql-test/suite/versioning/t/sysvars.test
mysql-test/suite/versioning/t/sysvars.test
+13
-2
sql/sys_vars.ic
sql/sys_vars.ic
+9
-1
No files found.
mysql-test/suite/versioning/r/sysvars.result
View file @
04451f0f
...
...
@@ -39,6 +39,7 @@ 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'
# GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
...
...
@@ -61,6 +62,11 @@ set global system_versioning_asof= @ts;
show global variables like 'system_versioning_asof';
Variable_name Value
system_versioning_asof 1900-01-01 00:00:00.000000
set global system_versioning_asof= default;
select @@global.system_versioning_asof;
@@global.system_versioning_asof
DEFAULT
# SESSION @@system_versioning_asof
set system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
...
...
@@ -83,8 +89,21 @@ set system_versioning_asof= @ts;
show variables like 'system_versioning_asof';
Variable_name Value
system_versioning_asof 1900-01-01 00:00:00.000000
# DEFAULT: value is copied from GLOBAL to SESSION
set global system_versioning_asof= timestamp'1911-11-11 11:11:11.111111';
set system_versioning_asof= '1900-01-01 00:00:00';
select @@global.system_versioning_asof != @@system_versioning_asof as different;
different
1
set system_versioning_asof= default;
select @@global.system_versioning_asof = @@system_versioning_asof as equal;
equal
1
set global system_versioning_asof= DEFAULT;
set system_versioning_asof= DEFAULT;
select @@global.system_versioning_asof, @@system_versioning_asof;
@@global.system_versioning_asof @@system_versioning_asof
DEFAULT DEFAULT
show variables where variable_name = "system_versioning_hide";
Variable_name Value
system_versioning_hide IMPLICIT
...
...
mysql-test/suite/versioning/t/sysvars.test
View file @
04451f0f
...
...
@@ -34,7 +34,7 @@ set system_versioning_asof= 1;
--
error
ER_WRONG_TYPE_FOR_VAR
set
system_versioning_asof
=
1.1
;
# global
--
echo
# GLOBAL @@system_versioning_asof
set
global
system_versioning_asof
=
'1911-11-11 11:11:11.1111119'
;
show
global
variables
like
'system_versioning_asof'
;
...
...
@@ -48,7 +48,10 @@ set @ts= timestamp'1900-01-01 00:00:00';
set
global
system_versioning_asof
=
@
ts
;
show
global
variables
like
'system_versioning_asof'
;
# session
set
global
system_versioning_asof
=
default
;
select
@@
global
.
system_versioning_asof
;
--
echo
# SESSION @@system_versioning_asof
set
system_versioning_asof
=
'1911-11-11 11:11:11.1111119'
;
show
variables
like
'system_versioning_asof'
;
...
...
@@ -62,8 +65,16 @@ set @ts= timestamp'1900-01-01 00:00:00';
set
system_versioning_asof
=
@
ts
;
show
variables
like
'system_versioning_asof'
;
--
echo
# DEFAULT: value is copied from GLOBAL to SESSION
set
global
system_versioning_asof
=
timestamp
'1911-11-11 11:11:11.111111'
;
set
system_versioning_asof
=
'1900-01-01 00:00:00'
;
select
@@
global
.
system_versioning_asof
!=
@@
system_versioning_asof
as
different
;
set
system_versioning_asof
=
default
;
select
@@
global
.
system_versioning_asof
=
@@
system_versioning_asof
as
equal
;
set
global
system_versioning_asof
=
DEFAULT
;
set
system_versioning_asof
=
DEFAULT
;
select
@@
global
.
system_versioning_asof
,
@@
system_versioning_asof
;
show
variables
where
variable_name
=
"system_versioning_hide"
;
select
*
from
t
for
system_time
all
;
...
...
sql/sys_vars.ic
View file @
04451f0f
...
...
@@ -2640,7 +2640,15 @@ private:
out.type= static_cast<enum_var_type>(var->save_result.ulonglong_value);
if (out.type == SYSTEM_TIME_AS_OF)
{
res= var->value->get_date(&out.ltime, 0);
if (var->value)
{
res= var->value->get_date(&out.ltime, 0);
}
else // set DEFAULT from global var
{
out= global_var(vers_asof_timestamp_t);
res= false;
}
}
return res;
}
...
...
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