summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-10-02 13:56:17 +0300
committerunknown <monty@hundin.mysql.fi>2002-10-02 13:56:17 +0300
commitff8f00774a6ad48b1b06ab498e415676d3fb707f (patch)
treedb82378be1bc2cf5484e34071c056809f00da2d0
parentd3664b024c10f06cba8570b6db552f71e9e4ff0f (diff)
parent9ffa49c95df291f5da665a0dc9b731348b4c6436 (diff)
downloadmariadb-git-ff8f00774a6ad48b1b06ab498e415676d3fb707f.tar.gz
merge
configure.in: Auto merged
-rw-r--r--Docs/manual.texi5
-rw-r--r--sql/sql_parse.cc6
2 files changed, 8 insertions, 3 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index fc6554a4d9f..6c41b2f68fe 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -35217,6 +35217,9 @@ 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
you could do this, but that was a bug that has been corrected.
+To be able to use @code{REPLACE} you must have @code{INSERT} and
+@code{DELETE} privileges for the table.
+
When you use a @code{REPLACE} command, @code{mysql_affected_rows()}
will return 2 if the new row replaced an old row. This is because
one row was inserted and then the duplicate was deleted.
@@ -50830,6 +50833,8 @@ Fixed some @code{ORDER BY ... DESC} problems with InnoDB.
Fixed an inadvertently changed option (@code{--ignore-space}) back to the
original @code{--ignore-spaces} in @code{mysqlclient}. (Both syntaxes will
work).
+@item
+Don't require @code{UPDATE} privilege when using @code{REPLACE}.
@end itemize
@node News-4.0.4, News-4.0.3, News-4.0.5, News-4.0.x
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 9e834e3cab9..d6e40889eed 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1878,10 +1878,10 @@ mysql_execute_command(void)
lex->lock_option);
break;
case SQLCOM_REPLACE:
- if (check_access(thd,INSERT_ACL | UPDATE_ACL | DELETE_ACL,
+ if (check_access(thd,INSERT_ACL | DELETE_ACL,
tables->db,&tables->grant.privilege))
goto error; /* purecov: inspected */
- if (grant_option && check_grant(thd,INSERT_ACL | UPDATE_ACL | DELETE_ACL,
+ if (grant_option && check_grant(thd,INSERT_ACL | DELETE_ACL,
tables))
goto error;
@@ -1899,7 +1899,7 @@ mysql_execute_command(void)
*/
{
ulong privilege= (lex->sql_command == SQLCOM_INSERT_SELECT ?
- INSERT_ACL : INSERT_ACL | UPDATE_ACL | DELETE_ACL);
+ INSERT_ACL : INSERT_ACL | DELETE_ACL);
TABLE_LIST *save_next=tables->next;
tables->next=0;
if (check_access(thd, privilege,