summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-04-28 16:00:09 +0300
committerunknown <monty@mysql.com>2005-04-28 16:00:09 +0300
commit2a69f0049b3fd6e765e2f58a81ea7b5e3d5dcd1c (patch)
treec7425686b577ece4c12adbae4346746790ed8ad2 /sql
parentdf0a4ed64e255c1ae3aa9bf4202f2b5e1f41e940 (diff)
parentb411128fa541123f5a2663448c9c6ce6b6091df1 (diff)
downloadmariadb-git-2a69f0049b3fd6e765e2f58a81ea7b5e3d5dcd1c.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
Diffstat (limited to 'sql')
-rw-r--r--sql/examples/ha_archive.cc24
-rw-r--r--sql/examples/ha_archive.h1
-rw-r--r--sql/handler.cc14
3 files changed, 9 insertions, 30 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index 0e1df45a70b..bc4af0c7dc7 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -427,30 +427,6 @@ const char **ha_archive::bas_ext() const
{ static const char *ext[]= { ARZ, ARN, ARM, NullS }; return ext; }
-/*
- Rename all files that this handler defines in bas_ext list
-
- NOTE Don't care if the .arn file is missing
-*/
-int ha_archive::rename_table(const char * from, const char * to)
-{
- DBUG_ENTER("ha_archive::rename_table");
- for (const char **ext=bas_ext(); *ext ; ext++)
- {
- if (rename_file_ext(from,to,*ext))
- {
- if (my_errno == ENOENT &&
- !my_strcasecmp(system_charset_info, *ext, ARN))
- continue;
-
- DBUG_RETURN(my_errno);
- }
-
- }
- DBUG_RETURN(0);
-}
-
-
/*
When opening a file we:
Create/get our shared structure.
diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h
index 1d3365aca67..855d756368d 100644
--- a/sql/examples/ha_archive.h
+++ b/sql/examples/ha_archive.h
@@ -124,7 +124,6 @@ public:
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
- int rename_table(const char * from, const char * to);
};
bool archive_db_init(void);
diff --git a/sql/handler.cc b/sql/handler.cc
index 7c369a72392..f174f51514e 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1255,13 +1255,17 @@ int handler::delete_table(const char *name)
int handler::rename_table(const char * from, const char * to)
{
- DBUG_ENTER("handler::rename_table");
- for (const char **ext=bas_ext(); *ext ; ext++)
+ int error= 0;
+ for (const char **ext= bas_ext(); *ext ; ext++)
{
- if (rename_file_ext(from,to,*ext))
- DBUG_RETURN(my_errno);
+ if (rename_file_ext(from, to, *ext))
+ {
+ if ((error=my_errno) != ENOENT)
+ break;
+ error= 0;
+ }
}
- DBUG_RETURN(0);
+ return error;
}
/*