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
eeae3fc3
Commit
eeae3fc3
authored
Sep 30, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/dlenev/src/mysql-5.0-bg13629
into mysql.com:/home/dlenev/src/mysql-5.0-merges
parents
7d3c939e
246bd8ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
sql/sql_view.cc
sql/sql_view.cc
+16
-13
No files found.
sql/sql_view.cc
View file @
eeae3fc3
...
@@ -482,8 +482,6 @@ err:
...
@@ -482,8 +482,6 @@ err:
/* index of revision number in following table */
/* index of revision number in following table */
static
const
int
revision_number_position
=
8
;
static
const
int
revision_number_position
=
8
;
/* index of source */
static
const
int
source_number_position
=
11
;
/* index of last required parameter for making view */
/* index of last required parameter for making view */
static
const
int
required_view_parameters
=
10
;
static
const
int
required_view_parameters
=
10
;
/* number of backups */
/* number of backups */
...
@@ -1414,17 +1412,27 @@ mysql_rename_view(THD *thd,
...
@@ -1414,17 +1412,27 @@ mysql_rename_view(THD *thd,
if
((
parser
=
sql_parse_prepare
(
&
pathstr
,
thd
->
mem_root
,
1
))
&&
if
((
parser
=
sql_parse_prepare
(
&
pathstr
,
thd
->
mem_root
,
1
))
&&
is_equal
(
&
view_type
,
parser
->
type
()))
is_equal
(
&
view_type
,
parser
->
type
()))
{
{
TABLE_LIST
view_def
;
char
dir_buff
[
FN_REFLEN
],
file_buff
[
FN_REFLEN
];
char
dir_buff
[
FN_REFLEN
],
file_buff
[
FN_REFLEN
];
/*
To be PS-friendly we should either to restore state of
TABLE_LIST object pointed by 'view' after using it for
view definition parsing or use temporary 'view_def'
object for it.
*/
bzero
(
&
view_def
,
sizeof
(
view_def
));
view_def
.
timestamp
.
str
=
view_def
.
timestamp_buffer
;
view_def
.
view_suid
=
TRUE
;
/* get view definition and source */
/* get view definition and source */
if
(
mysql_make_view
(
parser
,
view
)
||
if
(
parser
->
parse
((
gptr
)
&
view_def
,
thd
->
mem_root
,
view_parameters
,
parser
->
parse
((
gptr
)
view
,
thd
->
mem_root
,
sizeof
(
view_parameters
)
/
sizeof
(
view_parameters
[
0
])
-
1
))
view_parameters
+
source_number_position
,
1
))
goto
err
;
goto
err
;
/* rename view and it's backups */
/* rename view and it's backups */
if
(
rename_in_schema_file
(
view
->
db
,
view
->
table_name
,
new_name
,
if
(
rename_in_schema_file
(
view
->
db
,
view
->
table_name
,
new_name
,
view
->
revision
-
1
,
num_view_backups
))
view
_def
.
revision
-
1
,
num_view_backups
))
goto
err
;
goto
err
;
strxnmov
(
dir_buff
,
FN_REFLEN
,
mysql_data_home
,
"/"
,
view
->
db
,
"/"
,
NullS
);
strxnmov
(
dir_buff
,
FN_REFLEN
,
mysql_data_home
,
"/"
,
view
->
db
,
"/"
,
NullS
);
...
@@ -1438,12 +1446,12 @@ mysql_rename_view(THD *thd,
...
@@ -1438,12 +1446,12 @@ mysql_rename_view(THD *thd,
-
file_buff
);
-
file_buff
);
if
(
sql_create_definition_file
(
&
pathstr
,
&
file
,
view_file_type
,
if
(
sql_create_definition_file
(
&
pathstr
,
&
file
,
view_file_type
,
(
gptr
)
view
,
view_parameters
,
(
gptr
)
&
view_def
,
view_parameters
,
num_view_backups
))
num_view_backups
))
{
{
/* restore renamed view in case of error */
/* restore renamed view in case of error */
rename_in_schema_file
(
view
->
db
,
new_name
,
view
->
table_name
,
rename_in_schema_file
(
view
->
db
,
new_name
,
view
->
table_name
,
view
->
revision
-
1
,
num_view_backups
);
view_def
.
revision
-
1
,
num_view_backups
);
goto
err
;
goto
err
;
}
}
}
else
}
else
...
@@ -1455,10 +1463,5 @@ mysql_rename_view(THD *thd,
...
@@ -1455,10 +1463,5 @@ mysql_rename_view(THD *thd,
error
=
FALSE
;
error
=
FALSE
;
err:
err:
/*
We have to explicitly call destructor for view's LEX since it won't
be called otherwise.
*/
delete
view
->
view
;
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
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