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
2ae2876a
Commit
2ae2876a
authored
Dec 14, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14652 NATURAL JOIN crash in mark_common_columns() [fixes #405]
SQL: reverted NATURAL JOIN fix #161 (deprecated by #383)
parent
4be2173e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
mysql-test/suite/versioning/r/select.result
mysql-test/suite/versioning/r/select.result
+6
-0
mysql-test/suite/versioning/t/select.test
mysql-test/suite/versioning/t/select.test
+6
-0
sql/sql_base.cc
sql/sql_base.cc
+0
-9
No files found.
mysql-test/suite/versioning/r/select.result
View file @
2ae2876a
...
...
@@ -362,6 +362,12 @@ select * from t1 for system_time as of current_timestamp;
x
select * from t1 for system_time as of now;
ERROR 42S22: Unknown column 'now' in 'where clause'
### Issue #405, NATURAL JOIN failure
create or replace table t1 (a int) with system versioning;
create or replace table t2 (b int);
create or replace view v1 as select a, sys_trx_start, sys_trx_end from t1 where a > round(rand()*1000);
select * from v1 natural join t2;
a b
drop view v1;
drop table t1, t2;
call innodb_verify_vtq(32);
...
...
mysql-test/suite/versioning/t/select.test
View file @
2ae2876a
...
...
@@ -248,6 +248,12 @@ select * from t1 for system_time as of current_timestamp;
--
error
ER_BAD_FIELD_ERROR
select
*
from
t1
for
system_time
as
of
now
;
--
echo
### Issue #405, NATURAL JOIN failure
create
or
replace
table
t1
(
a
int
)
with
system
versioning
;
create
or
replace
table
t2
(
b
int
);
create
or
replace
view
v1
as
select
a
,
sys_trx_start
,
sys_trx_end
from
t1
where
a
>
round
(
rand
()
*
1000
);
select
*
from
v1
natural
join
t2
;
drop
view
v1
;
drop
table
t1
,
t2
;
...
...
sql/sql_base.cc
View file @
2ae2876a
...
...
@@ -6420,15 +6420,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
if
(
nj_col_1
->
field
()
&&
nj_col_1
->
field
()
->
vers_sys_field
())
continue
;
if
(
table_ref_1
->
is_view
()
&&
table_ref_1
->
table
->
versioned
())
{
Item
*
item
=
nj_col_1
->
view_field
->
item
;
DBUG_ASSERT
(
item
->
type
()
==
Item
::
FIELD_ITEM
);
Item_field
*
item_field
=
(
Item_field
*
)
item
;
if
(
item_field
->
field
->
vers_sys_field
())
continue
;
}
field_name_1
=
nj_col_1
->
name
();
is_using_column_1
=
using_fields
&&
test_if_string_in_list
(
field_name_1
->
str
,
using_fields
);
...
...
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