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
b1efff46
Commit
b1efff46
authored
Feb 26, 2018
by
Aleksey Midenkov
Committed by
Sergei Golubchik
Jun 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vers cleanups
* Always-false vers_select_conds_t::from_query * Debug helpers Closes #684
parent
486682b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
19 deletions
+10
-19
mysql-test/suite/versioning/r/replace.result
mysql-test/suite/versioning/r/replace.result
+2
-4
mysql-test/suite/versioning/t/replace.test
mysql-test/suite/versioning/t/replace.test
+2
-4
sql/sql_select.cc
sql/sql_select.cc
+1
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-2
sql/table.h
sql/table.h
+2
-7
No files found.
mysql-test/suite/versioning/r/replace.result
View file @
b1efff46
...
@@ -7,8 +7,7 @@ period for system_time (row_start, row_end)
...
@@ -7,8 +7,7 @@ period for system_time (row_start, row_end)
) with system versioning;
) with system versioning;
insert t values (1, 2);
insert t values (1, 2);
replace t values (1, 3);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
select *, current_row(row_end) as current from t for system_time all order by x;
order by x;
id x current
id x current
1 2 0
1 2 0
1 3 1
1 3 1
...
@@ -22,8 +21,7 @@ period for system_time (row_start, row_end)
...
@@ -22,8 +21,7 @@ period for system_time (row_start, row_end)
) with system versioning;
) with system versioning;
insert t values (1, 2);
insert t values (1, 2);
replace t values (1, 3);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
select *, current_row(row_end) as current from t for system_time all order by x;
order by x;
id x current
id x current
1 2 0
1 2 0
1 3 1
1 3 1
...
...
mysql-test/suite/versioning/t/replace.test
View file @
b1efff46
...
@@ -12,8 +12,7 @@ eval create table t (
...
@@ -12,8 +12,7 @@ eval create table t (
insert
t
values
(
1
,
2
);
insert
t
values
(
1
,
2
);
replace
t
values
(
1
,
3
);
replace
t
values
(
1
,
3
);
select
*
,
row_end
>
TIMESTAMP
'2038-01-01 00:00:00'
as
current
from
t
for
system_time
all
select
*
,
current_row
(
row_end
)
as
current
from
t
for
system_time
all
order
by
x
;
order
by
x
;
drop
table
t
;
drop
table
t
;
--
replace_result
$sys_datatype_expl
SYS_DATATYPE
--
replace_result
$sys_datatype_expl
SYS_DATATYPE
...
@@ -27,8 +26,7 @@ eval create table t (
...
@@ -27,8 +26,7 @@ eval create table t (
insert
t
values
(
1
,
2
);
insert
t
values
(
1
,
2
);
replace
t
values
(
1
,
3
);
replace
t
values
(
1
,
3
);
select
*
,
row_end
>
TIMESTAMP
'2038-01-01 00:00:00'
as
current
from
t
for
system_time
all
select
*
,
current_row
(
row_end
)
as
current
from
t
for
system_time
all
order
by
x
;
order
by
x
;
drop
table
t
;
drop
table
t
;
--
source
suite
/
versioning
/
common_finish
.
inc
--
source
suite
/
versioning
/
common_finish
.
inc
sql/sql_select.cc
View file @
b1efff46
...
@@ -678,7 +678,6 @@ bool vers_select_conds_t::init_from_sysvar(THD *thd)
...
@@ -678,7 +678,6 @@ bool vers_select_conds_t::init_from_sysvar(THD *thd)
vers_asof_timestamp_t
&
in
=
thd
->
variables
.
vers_asof_timestamp
;
vers_asof_timestamp_t
&
in
=
thd
->
variables
.
vers_asof_timestamp
;
type
=
(
vers_system_time_t
)
in
.
type
;
type
=
(
vers_system_time_t
)
in
.
type
;
start
.
unit
=
VERS_TIMESTAMP
;
start
.
unit
=
VERS_TIMESTAMP
;
from_query
=
false
;
if
(
type
!=
SYSTEM_TIME_UNSPECIFIED
&&
type
!=
SYSTEM_TIME_ALL
)
if
(
type
!=
SYSTEM_TIME_UNSPECIFIED
&&
type
!=
SYSTEM_TIME_ALL
)
{
{
DBUG_ASSERT
(
type
==
SYSTEM_TIME_AS_OF
);
DBUG_ASSERT
(
type
==
SYSTEM_TIME_AS_OF
);
...
@@ -741,7 +740,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
...
@@ -741,7 +740,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
{
{
if
(
table
->
table
&&
table
->
table
->
versioned
())
if
(
table
->
table
&&
table
->
table
->
versioned
())
versioned_tables
++
;
versioned_tables
++
;
else
if
(
table
->
vers_conditions
.
user_defined
()
&&
else
if
(
table
->
vers_conditions
.
is_set
()
&&
(
table
->
is_non_derived
()
||
!
table
->
vers_conditions
.
used
))
(
table
->
is_non_derived
()
||
!
table
->
vers_conditions
.
used
))
{
{
my_error
(
ER_VERS_NOT_VERSIONED
,
MYF
(
0
),
table
->
alias
.
str
);
my_error
(
ER_VERS_NOT_VERSIONED
,
MYF
(
0
),
table
->
alias
.
str
);
...
...
sql/sql_yacc.yy
View file @
b1efff46
...
@@ -11788,9 +11788,10 @@ table_primary_ident:
...
@@ -11788,9 +11788,10 @@ table_primary_ident:
pop_index_hints(),
pop_index_hints(),
$3))))
$3))))
MYSQL_YYABORT;
MYSQL_YYABORT;
Select->add_joined_table($$);
TABLE_LIST *tl= $$;
Select->add_joined_table(tl);
if ($4)
if ($4)
$$
->vers_conditions= Lex->vers_conditions;
tl
->vers_conditions= Lex->vers_conditions;
}
}
;
;
...
...
sql/table.h
View file @
b1efff46
...
@@ -1848,7 +1848,6 @@ class Vers_history_point : public vers_history_point_t
...
@@ -1848,7 +1848,6 @@ class Vers_history_point : public vers_history_point_t
struct
vers_select_conds_t
struct
vers_select_conds_t
{
{
vers_system_time_t
type
;
vers_system_time_t
type
;
bool
from_query
:
1
;
bool
used
:
1
;
bool
used
:
1
;
Vers_history_point
start
;
Vers_history_point
start
;
Vers_history_point
end
;
Vers_history_point
end
;
...
@@ -1856,7 +1855,7 @@ struct vers_select_conds_t
...
@@ -1856,7 +1855,7 @@ struct vers_select_conds_t
void
empty
()
void
empty
()
{
{
type
=
SYSTEM_TIME_UNSPECIFIED
;
type
=
SYSTEM_TIME_UNSPECIFIED
;
used
=
f
rom_query
=
f
alse
;
used
=
false
;
start
.
empty
();
start
.
empty
();
end
.
empty
();
end
.
empty
();
}
}
...
@@ -1866,7 +1865,7 @@ struct vers_select_conds_t
...
@@ -1866,7 +1865,7 @@ struct vers_select_conds_t
Vers_history_point
_end
=
Vers_history_point
())
Vers_history_point
_end
=
Vers_history_point
())
{
{
type
=
_type
;
type
=
_type
;
used
=
f
rom_query
=
f
alse
;
used
=
false
;
start
=
_start
;
start
=
_start
;
end
=
_end
;
end
=
_end
;
}
}
...
@@ -1880,10 +1879,6 @@ struct vers_select_conds_t
...
@@ -1880,10 +1879,6 @@ struct vers_select_conds_t
return
type
!=
SYSTEM_TIME_UNSPECIFIED
;
return
type
!=
SYSTEM_TIME_UNSPECIFIED
;
}
}
bool
resolve_units
(
THD
*
thd
);
bool
resolve_units
(
THD
*
thd
);
bool
user_defined
()
const
{
return
!
from_query
&&
type
!=
SYSTEM_TIME_UNSPECIFIED
;
}
bool
eq
(
const
vers_select_conds_t
&
conds
)
const
;
bool
eq
(
const
vers_select_conds_t
&
conds
)
const
;
};
};
...
...
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