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
dc95a025
Commit
dc95a025
authored
Nov 25, 2003
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fil0fil.h, fil0fil.c:
ibbackup --apply-log must be able to rename a table based only on the space id
parent
42c4e5ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
15 deletions
+30
-15
innobase/fil/fil0fil.c
innobase/fil/fil0fil.c
+27
-14
innobase/include/fil0fil.h
innobase/include/fil0fil.h
+3
-1
No files found.
innobase/fil/fil0fil.c
View file @
dc95a025
...
...
@@ -84,7 +84,8 @@ completes, we decrement the count and return the file node to the LRU-list if
the count drops to zero. */
/* When mysqld is run, the default directory "." is the mysqld datadir,
but in ibbackup we must set it explicitly */
but in the MySQL Embedded Server Library and ibbackup it is not the default
directory, and we must set the base file path explicitly */
char
*
fil_path_to_mysql_datadir
=
(
char
*
)
"."
;
ulint
fil_n_pending_log_flushes
=
0
;
...
...
@@ -1576,7 +1577,8 @@ fil_op_write_log(
mlog_close
(
mtr
,
log_ptr
);
mlog_catenate_string
(
mtr
,
(
byte
*
)
new_name
,
ut_strlen
(
new_name
)
+
1
);
mlog_catenate_string
(
mtr
,
(
byte
*
)
new_name
,
ut_strlen
(
new_name
)
+
1
);
}
}
#endif
...
...
@@ -1696,7 +1698,9 @@ fil_op_log_parse_or_replay(
if
(
fil_get_space_id_for_table
(
new_name
)
==
ULINT_UNDEFINED
)
{
ut_a
(
fil_rename_tablespace
(
name
,
space_id
,
/* We do not care of the old name, that is
why we pass NULL as the first argument */
ut_a
(
fil_rename_tablespace
(
NULL
,
space_id
,
new_name
));
}
}
...
...
@@ -1956,7 +1960,9 @@ fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char
*
old_name
,
/* in: old table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
ulint
id
,
/* in: space id */
char
*
new_name
)
/* in: new table name in the standard
databasename/tablename format of InnoDB */
...
...
@@ -1967,9 +1973,15 @@ fil_rename_tablespace(
fil_node_t
*
node
;
ulint
count
=
0
;
char
*
path
=
NULL
;
ibool
old_name_was_specified
=
TRUE
;
char
old_path
[
OS_FILE_MAX_PATH
];
ut_a
(
id
!=
0
);
if
(
old_name
==
NULL
)
{
old_name
=
(
char
*
)
"(name not specified)"
;
old_name_was_specified
=
FALSE
;
}
retry:
count
++
;
...
...
@@ -2039,15 +2051,18 @@ retry:
/* Check that the old name in the space is right */
if
(
old_name_was_specified
)
{
ut_a
(
strlen
(
old_name
)
+
strlen
(
fil_path_to_mysql_datadir
)
<
OS_FILE_MAX_PATH
-
10
);
sprintf
(
old_path
,
"%s/%s.ibd"
,
fil_path_to_mysql_datadir
,
old_name
);
sprintf
(
old_path
,
"%s/%s.ibd"
,
fil_path_to_mysql_datadir
,
old_name
);
srv_normalize_path_for_win
(
old_path
);
ut_a
(
strcmp
(
space
->
name
,
old_path
)
==
0
);
ut_a
(
strcmp
(
node
->
name
,
old_path
)
==
0
);
}
else
{
sprintf
(
old_path
,
"%s"
,
space
->
name
);
}
/* Rename the tablespace and the node in the memory cache */
...
...
@@ -2066,8 +2081,6 @@ retry:
goto
func_exit
;
}
/* printf("Renaming tablespace %s to %s id %lu\n", path, old_path, id);
*/
success
=
os_file_rename
(
old_path
,
path
);
if
(
!
success
)
{
...
...
innobase/include/fil0fil.h
View file @
dc95a025
...
...
@@ -329,7 +329,9 @@ fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char
*
old_name
,
/* in: old table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
ulint
id
,
/* in: space id */
char
*
new_name
);
/* in: new table name in the standard
databasename/tablename format of InnoDB */
...
...
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