--- path.module	2008-11-22 19:49:15.000000000 +0900
+++ path_new.module	2009-02-06 17:20:13.000000000 +0900
@@ -105,7 +105,7 @@ function path_set_alias($path = NULL, $a
     if ($alias == drupal_get_path_alias($path, $language)) {
       // There is already such an alias, neutral or in this language.
       // Update the alias based on alias; setting the language if not yet done.
-      db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE dst = '%s'", $path, $alias, $language, $alias);
+      db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE dst = '%s' AND src='%s'", $path, $alias, $language, $alias, $path);
     }
     else {
       // A new alias. Add it to the database.
