Commit bef1d7d3 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fix for building shared libraries with a patched glibc

Don't require UPDATE_ACL for REPLACE
parent 39c55409
...@@ -35217,6 +35217,9 @@ In other words, you can't access the values of the old row from a ...@@ -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 @code{REPLACE} statement. In some old MySQL versions it appeared that
you could do this, but that was a bug that has been corrected. 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()} 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 will return 2 if the new row replaced an old row. This is because
one row was inserted and then the duplicate was deleted. one row was inserted and then the duplicate was deleted.
...@@ -50237,6 +50240,8 @@ each individual 4.0.x release. ...@@ -50237,6 +50240,8 @@ each individual 4.0.x release.
@item @item
Give error if one has more than 2 ^ 32 rows in a MyISAM MERGE file and one Give error if one has more than 2 ^ 32 rows in a MyISAM MERGE file and one
has not compiled MySQL with @code{-DBIG_TABLES}. has not compiled MySQL with @code{-DBIG_TABLES}.
@item
Don't require @code{UPDATE} privilege when using @code{REPLACE}.
@end itemize @end itemize
@node News-4.0.4, News-4.0.3, News-4.0.5, News-4.0.x @node News-4.0.4, News-4.0.3, News-4.0.5, News-4.0.x
...@@ -481,7 +481,7 @@ AC_ARG_WITH(other-libc, ...@@ -481,7 +481,7 @@ AC_ARG_WITH(other-libc,
# we need special flags, but we will have to add those later # we need special flags, but we will have to add those later
STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS" STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
OTHER_LIBC_LIB="-L$other_libc_lib" OTHER_LIBC_LIB="-static -L$other_libc_lib"
static_nss=1 static_nss=1
else else
# this is a dirty hack. We if we detect static nss glibc in the special # this is a dirty hack. We if we detect static nss glibc in the special
...@@ -2241,10 +2241,7 @@ then ...@@ -2241,10 +2241,7 @@ then
AC_DEFINE(THREAD_SAFE_CLIENT) AC_DEFINE(THREAD_SAFE_CLIENT)
fi fi
if test "$static_nss" = "1" CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS"
then
CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS"
fi
AC_SUBST(CLIENT_LIBS) AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs) AC_SUBST(sql_client_dirs)
...@@ -2391,11 +2388,8 @@ fi ...@@ -2391,11 +2388,8 @@ fi
# I know to add the static NSS magic if we have static NSS libraries with # I know to add the static NSS magic if we have static NSS libraries with
# glibc - Sasha # glibc - Sasha
if test "$static_nss" = "1" LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB"
then LIBS="$LIBS $STATIC_NSS_FLAGS"
LDFLAGS="$LDFLAGS -static $OTHER_LIBC_LIB"
LIBS="$LIBS $STATIC_NSS_FLAGS"
fi
AC_SUBST(sql_server_dirs) AC_SUBST(sql_server_dirs)
AC_SUBST(thread_dirs) AC_SUBST(thread_dirs)
......
...@@ -1878,10 +1878,10 @@ mysql_execute_command(void) ...@@ -1878,10 +1878,10 @@ mysql_execute_command(void)
lex->lock_option); lex->lock_option);
break; break;
case SQLCOM_REPLACE: 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)) tables->db,&tables->grant.privilege))
goto error; /* purecov: inspected */ 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)) tables))
goto error; goto error;
...@@ -1899,7 +1899,7 @@ mysql_execute_command(void) ...@@ -1899,7 +1899,7 @@ mysql_execute_command(void)
*/ */
{ {
ulong privilege= (lex->sql_command == SQLCOM_INSERT_SELECT ? 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; TABLE_LIST *save_next=tables->next;
tables->next=0; tables->next=0;
if (check_access(thd, privilege, if (check_access(thd, privilege,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment