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
bbe121c0
Commit
bbe121c0
authored
Jul 16, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memory leak removing
parent
6952941d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
.bzrignore
.bzrignore
+1
-0
sql/sql_lex.h
sql/sql_lex.h
+12
-0
sql/sql_view.cc
sql/sql_view.cc
+15
-2
No files found.
.bzrignore
View file @
bbe121c0
...
@@ -799,3 +799,4 @@ vio/test-ssl
...
@@ -799,3 +799,4 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
libmysqld/sql_view.cc
sql/sql_lex.h
View file @
bbe121c0
...
@@ -750,6 +750,18 @@ typedef struct st_lex
...
@@ -750,6 +750,18 @@ typedef struct st_lex
bool
only_view_structure
();
bool
only_view_structure
();
}
LEX
;
}
LEX
;
struct
st_lex_local
:
public
st_lex
{
static
void
*
operator
new
(
size_t
size
)
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
{}
};
void
lex_init
(
void
);
void
lex_init
(
void
);
void
lex_free
(
void
);
void
lex_free
(
void
);
...
...
sql/sql_view.cc
View file @
bbe121c0
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "sql_acl.h"
#include "sql_acl.h"
#include "sql_select.h"
#include "sql_select.h"
#include "parse_file.h"
#include "parse_file.h"
#include "sp.h"
static
int
mysql_register_view
(
THD
*
thd
,
TABLE_LIST
*
view
,
static
int
mysql_register_view
(
THD
*
thd
,
TABLE_LIST
*
view
,
enum_view_create_mode
mode
);
enum_view_create_mode
mode
);
...
@@ -523,9 +524,15 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
...
@@ -523,9 +524,15 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
table
->
view_name
.
str
=
table
->
real_name
;
table
->
view_name
.
str
=
table
->
real_name
;
table
->
view_name
.
length
=
table
->
real_name_length
;
table
->
view_name
.
length
=
table
->
real_name_length
;
/
/TODO: md5 test here and warning if it is differ
/
*TODO: md5 test here and warning if it is differ */
table
->
view
=
lex
=
thd
->
lex
=
new
st_lex
;
/*
TODO: TABLE mem root should be used here when VIEW will be stored in
TABLE cache
now Lex placed in statement memory
*/
table
->
view
=
lex
=
thd
->
lex
=
(
LEX
*
)
new
(
&
thd
->
mem_root
)
st_lex_local
;
lex_start
(
thd
,
(
uchar
*
)
table
->
query
.
str
,
table
->
query
.
length
);
lex_start
(
thd
,
(
uchar
*
)
table
->
query
.
str
,
table
->
query
.
length
);
mysql_init_query
(
thd
,
true
);
mysql_init_query
(
thd
,
true
);
lex
->
select_lex
.
select_number
=
++
thd
->
select_number
;
lex
->
select_lex
.
select_number
=
++
thd
->
select_number
;
...
@@ -563,6 +570,12 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
...
@@ -563,6 +570,12 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
}
}
if
(
!
res
&&
!
thd
->
is_fatal_error
)
if
(
!
res
&&
!
thd
->
is_fatal_error
)
{
{
/* move SP to main LEX */
sp_merge_funs
(
old_lex
,
lex
);
if
(
lex
->
spfuns
.
array
.
buffer
)
hash_free
(
&
lex
->
spfuns
);
old_next
=
table
->
next_global
;
old_next
=
table
->
next_global
;
if
((
table
->
next_global
=
lex
->
query_tables
))
if
((
table
->
next_global
=
lex
->
query_tables
))
table
->
next_global
->
prev_global
=
&
table
->
next_global
;
table
->
next_global
->
prev_global
=
&
table
->
next_global
;
...
...
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