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
c34baab9
Commit
c34baab9
authored
Aug 07, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql_view.cc:
Memory leak fix sql/sql_view.cc: Memory leak fix
parent
c8673b09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
sql/sql_view.cc
sql/sql_view.cc
+13
-3
No files found.
sql/sql_view.cc
View file @
c34baab9
...
@@ -179,15 +179,23 @@ static bool
...
@@ -179,15 +179,23 @@ static bool
fill_defined_view_parts
(
THD
*
thd
,
TABLE_LIST
*
view
)
fill_defined_view_parts
(
THD
*
thd
,
TABLE_LIST
*
view
)
{
{
LEX
*
lex
=
thd
->
lex
;
LEX
*
lex
=
thd
->
lex
;
bool
not_used
;
bool
free_view
=
1
;
TABLE_LIST
decoy
;
TABLE_LIST
decoy
;
if
(
view
->
view
)
free_view
=
0
;
memcpy
(
&
decoy
,
view
,
sizeof
(
TABLE_LIST
));
memcpy
(
&
decoy
,
view
,
sizeof
(
TABLE_LIST
));
if
(
!
open_table
(
thd
,
&
decoy
,
thd
->
mem_root
,
&
not_used
,
0
)
&&
if
((
decoy
.
table
=
open_table
(
thd
,
&
decoy
,
thd
->
mem_root
,
NULL
,
0
)))
!
decoy
.
view
)
{
{
/* It's a table */
my_free
((
gptr
)
decoy
.
table
,
MYF
(
0
));
my_error
(
ER_WRONG_OBJECT
,
MYF
(
0
),
view
->
db
,
view
->
table_name
,
"VIEW"
);
return
TRUE
;
return
TRUE
;
}
}
if
(
!
decoy
.
view
)
/* An error while opening the view occurs, caller will handle it */
return
FALSE
;
if
(
!
lex
->
definer
)
if
(
!
lex
->
definer
)
{
{
view
->
definer
.
host
=
decoy
.
definer
.
host
;
view
->
definer
.
host
=
decoy
.
definer
.
host
;
...
@@ -199,6 +207,8 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
...
@@ -199,6 +207,8 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
if
(
lex
->
create_view_suid
==
VIEW_SUID_DEFAULT
)
if
(
lex
->
create_view_suid
==
VIEW_SUID_DEFAULT
)
lex
->
create_view_suid
=
decoy
.
view_suid
?
lex
->
create_view_suid
=
decoy
.
view_suid
?
VIEW_SUID_DEFINER
:
VIEW_SUID_INVOKER
;
VIEW_SUID_DEFINER
:
VIEW_SUID_INVOKER
;
if
(
free_view
)
delete
decoy
.
view
;
return
FALSE
;
return
FALSE
;
}
}
...
...
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