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
5a5410e4
Commit
5a5410e4
authored
Jun 01, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-merge fix.
parent
4bc1738b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
102 deletions
+7
-102
sql/sql_view.cc
sql/sql_view.cc
+7
-102
No files found.
sql/sql_view.cc
View file @
5a5410e4
...
...
@@ -709,7 +709,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view
->
query
.
str
=
str
.
c_ptr_safe
();
view
->
query
.
length
=
str
.
length
();
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
view
->
source
.
length
=
skip_rear_comments
((
char
*
)
view
->
source
.
str
,
view
->
source
.
length
=
(
char
*
)
skip_rear_comments
(
thd
->
charset
(),
(
char
*
)
view
->
source
.
str
,
(
char
*
)
thd
->
query
+
thd
->
query_length
)
-
view
->
source
.
str
;
...
...
@@ -824,103 +825,7 @@ loop_out:
}
}
}
/* fill structure */
view
->
query
.
str
=
(
char
*
)
str
.
ptr
();
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
view
->
source
.
length
=
(
char
*
)
skip_rear_comments
((
char
*
)
view
->
source
.
str
,
(
char
*
)
thd
->
query
+
thd
->
query_length
)
-
view
->
source
.
str
;
view
->
file_version
=
1
;
view
->
calc_md5
(
md5
);
view
->
md5
.
str
=
md5
;
view
->
md5
.
length
=
32
;
can_be_merged
=
lex
->
can_be_merged
();
if
(
lex
->
create_view_algorithm
==
VIEW_ALGORITHM_MERGE
&&
!
lex
->
can_be_merged
())
{
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_VIEW_MERGE
,
ER
(
ER_WARN_VIEW_MERGE
));
lex
->
create_view_algorithm
=
VIEW_ALGORITHM_UNDEFINED
;
}
view
->
algorithm
=
lex
->
create_view_algorithm
;
view
->
definer
.
user
=
lex
->
definer
->
user
;
view
->
definer
.
host
=
lex
->
definer
->
host
;
view
->
view_suid
=
lex
->
create_view_suid
;
view
->
with_check
=
lex
->
create_view_check
;
if
((
view
->
updatable_view
=
(
can_be_merged
&&
view
->
algorithm
!=
VIEW_ALGORITHM_TMPTABLE
)))
{
/* TODO: change here when we will support UNIONs */
for
(
TABLE_LIST
*
tbl
=
(
TABLE_LIST
*
)
lex
->
select_lex
.
table_list
.
first
;
tbl
;
tbl
=
tbl
->
next_local
)
{
if
((
tbl
->
view
&&
!
tbl
->
updatable_view
)
||
tbl
->
schema_table
)
{
view
->
updatable_view
=
0
;
break
;
}
for
(
TABLE_LIST
*
up
=
tbl
;
up
;
up
=
up
->
embedding
)
{
if
(
up
->
outer_join
)
{
view
->
updatable_view
=
0
;
goto
loop_out
;
}
}
}
}
/* fill structure */
view
->
query
.
str
=
(
char
*
)
str
.
ptr
();
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
view
->
source
.
length
=
(
char
*
)
skip_rear_comments
(
thd
->
charset
(),
(
char
*
)
view
->
source
.
str
,
(
char
*
)
thd
->
query
+
thd
->
query_length
)
-
view
->
source
.
str
;
view
->
file_version
=
1
;
view
->
calc_md5
(
md5
);
view
->
md5
.
str
=
md5
;
view
->
md5
.
length
=
32
;
can_be_merged
=
lex
->
can_be_merged
();
if
(
lex
->
create_view_algorithm
==
VIEW_ALGORITHM_MERGE
&&
!
lex
->
can_be_merged
())
{
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_VIEW_MERGE
,
ER
(
ER_WARN_VIEW_MERGE
));
lex
->
create_view_algorithm
=
VIEW_ALGORITHM_UNDEFINED
;
}
view
->
algorithm
=
lex
->
create_view_algorithm
;
view
->
definer
.
user
=
lex
->
definer
->
user
;
view
->
definer
.
host
=
lex
->
definer
->
host
;
view
->
view_suid
=
lex
->
create_view_suid
;
view
->
with_check
=
lex
->
create_view_check
;
if
((
view
->
updatable_view
=
(
can_be_merged
&&
view
->
algorithm
!=
VIEW_ALGORITHM_TMPTABLE
)))
{
/* TODO: change here when we will support UNIONs */
for
(
TABLE_LIST
*
tbl
=
(
TABLE_LIST
*
)
lex
->
select_lex
.
table_list
.
first
;
tbl
;
tbl
=
tbl
->
next_local
)
{
if
((
tbl
->
view
&&
!
tbl
->
updatable_view
)
||
tbl
->
schema_table
)
{
view
->
updatable_view
=
0
;
break
;
}
for
(
TABLE_LIST
*
up
=
tbl
;
up
;
up
=
up
->
embedding
)
{
if
(
up
->
outer_join
)
{
view
->
updatable_view
=
0
;
goto
loop_out
;
}
}
}
}
/*
Check that table of main select do not used in subqueries.
...
...
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