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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e5daa094
Commit
e5daa094
authored
Jun 02, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
5.3 merge
parents
759fa196
a1975dd2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
462 additions
and
11 deletions
+462
-11
mysql-test/r/view.result
mysql-test/r/view.result
+218
-2
mysql-test/t/view.test
mysql-test/t/view.test
+227
-2
sql/sql_derived.cc
sql/sql_derived.cc
+11
-6
sql/table.cc
sql/table.cc
+5
-0
sql/table.h
sql/table.h
+1
-1
No files found.
mysql-test/r/view.result
View file @
e5daa094
This diff is collapsed.
Click to expand it.
mysql-test/t/view.test
View file @
e5daa094
This diff is collapsed.
Click to expand it.
sql/sql_derived.cc
View file @
e5daa094
...
...
@@ -392,17 +392,13 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
if
(
parent_lex
->
get_free_table_map
(
&
map
,
&
tablenr
))
{
/* There is no enough table bits, fall back to materialization. */
derived
->
change_refs_to_fields
();
derived
->
set_materialized_derived
();
goto
exit_merge
;
goto
unconditional_materialization
;
}
if
(
dt_select
->
leaf_tables
.
elements
+
tablenr
>
MAX_TABLES
)
{
/* There is no enough table bits, fall back to materialization. */
derived
->
change_refs_to_fields
();
derived
->
set_materialized_derived
();
goto
exit_merge
;
goto
unconditional_materialization
;
}
if
(
dt_select
->
options
&
OPTION_SCHEMA_TABLE
)
...
...
@@ -473,6 +469,15 @@ exit_merge:
if
(
arena
)
thd
->
restore_active_arena
(
arena
,
&
backup
);
DBUG_RETURN
(
res
);
unconditional_materialization:
derived
->
change_refs_to_fields
();
derived
->
set_materialized_derived
();
if
(
!
derived
->
table
||
!
derived
->
table
->
created
)
res
=
mysql_derived_create
(
thd
,
lex
,
derived
);
if
(
!
res
)
res
=
mysql_derived_fill
(
thd
,
lex
,
derived
);
goto
exit_merge
;
}
...
...
sql/table.cc
View file @
e5daa094
...
...
@@ -4975,6 +4975,10 @@ void TABLE_LIST::set_check_merged()
void
TABLE_LIST
::
set_check_materialized
()
{
DBUG_ENTER
(
"TABLE_LIST::set_check_materialized"
);
SELECT_LEX_UNIT
*
derived
=
this
->
derived
;
if
(
view
)
derived
=
&
view
->
unit
;
DBUG_ASSERT
(
derived
);
if
(
!
derived
->
first_select
()
->
exclude_from_table_unique_test
)
derived
->
set_unique_exclude
();
...
...
@@ -4987,6 +4991,7 @@ void TABLE_LIST::set_check_materialized()
derived
->
first_select
()
->
first_inner_unit
()
->
first_select
()
->
exclude_from_table_unique_test
);
}
DBUG_VOID_RETURN
;
}
TABLE
*
TABLE_LIST
::
get_real_join_table
()
...
...
sql/table.h
View file @
e5daa094
...
...
@@ -2096,7 +2096,7 @@ struct TABLE_LIST
void
set_materialized_derived
()
{
DBUG_ENTER
(
"set_materialized_derived"
);
derived_type
=
((
derived_type
&
DTYPE_MASK
)
|
derived_type
=
((
derived_type
&
(
derived
?
DTYPE_MASK
:
DTYPE_VIEW
)
)
|
DTYPE_TABLE
|
DTYPE_MATERIALIZE
);
set_check_materialized
();
DBUG_VOID_RETURN
;
...
...
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