Below is the list of changes that have just been committed into a
4.0 repository of arjen. When arjen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1036 02/06/20 09:28:50 arjen@xxxxxxxxxxxxxxxx +1 -0
Clarified REPLACE command a bit.
Docs/manual.texi
1.1001 02/06/20 09:28:46 arjen@xxxxxxxxxxxxxxxx +8 -3
Clarified REPLACE command a bit.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: arjen
# Host: fred.bitbike.com
# Root: /home/arjen/mysql-4.0
--- 1.1000/Docs/manual.texi Thu Jun 20 08:46:40 2002
+++ 1.1001/Docs/manual.texi Thu Jun 20 09:28:46 2002
@@ -34520,9 +34520,10 @@
@end example
@code{REPLACE} works exactly like @code{INSERT}, except that if an old
-record in the table has the same value as a new record on a unique index,
-the old record is deleted before the new record is inserted.
-@xref{INSERT, , @code{INSERT}}.
+record in the table has the same value as a new record on a @code{UNIQUE}
+index or @code{PRIMARY KEY}, the old record is deleted before the new
+record is inserted.
+@xref{INSERT, ,@code{INSERT}}.
In other words, you can't access the values of the old row from a
@code{REPLACE} statement. In some old MySQL versions it appeared that
@@ -34535,6 +34536,10 @@
This fact makes it easy to determine whether @code{REPLACE} added
or replaced a row: check whether the affected-rows value is 1 (added)
or 2 (replaced).
+
+Note that unless you use a @code{UNIQUE} index or @code{PRIMARY KEY},
+using a @code{REPLACE} command makes no sense, since it would just do
+an @code{INSERT}.
@node LOAD DATA, DO, REPLACE, Data Manipulation
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail internals-thread3903@xxxxxxxxxxxxxxx
To unsubscribe, e-mail <internals-unsubscribe@xxxxxxxxxxxxxxx>
|