Files
openbsd-ports/databases/mysql/patches/patch-sql_sql_parse_cc
brad f224072f1b * Fixed bug in privilege checking where, under some conditions, one
was able to grant privileges on the database, he has no privileges
  on. (Bug #3933)
2004-10-20 07:36:04 +00:00

34 lines
1.4 KiB
Plaintext

$OpenBSD: patch-sql_sql_parse_cc,v 1.2 2004/10/20 07:36:04 brad Exp $
--- sql/sql_parse.cc.orig Thu May 13 20:53:18 2004
+++ sql/sql_parse.cc Wed Oct 20 00:50:19 2004
@@ -2670,7 +2670,7 @@ check_access(THD *thd, ulong want_access
if (!(thd->master_access & SELECT_ACL) &&
(db && (!thd->db || strcmp(db,thd->db))))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
- thd->priv_user, db); /* purecov: inspected */
+ thd->priv_user, db, 0); /* purecov: inspected */
*save_priv=thd->master_access | db_access;
DBUG_RETURN(FALSE);
}
@@ -2690,7 +2690,7 @@ check_access(THD *thd, ulong want_access
if (db && (!thd->db || strcmp(db,thd->db)))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
- thd->priv_user, db); /* purecov: inspected */
+ thd->priv_user, db, 0); /* purecov: inspected */
else
db_access=thd->db_access;
// Remove SHOW attribute and access rights we already have
@@ -3155,7 +3155,10 @@ bool add_field_to_list(char *field_name,
break;
case FIELD_TYPE_DECIMAL:
if (!length)
- new_field->length= 10; // Default length for DECIMAL
+ if (new_field->length= new_field->decimals)
+ new_field->length++;
+ else
+ new_field->length=10; // Default length for DECIMAL
if (new_field->length < MAX_FIELD_WIDTH) // Skip wrong argument
{
new_field->length+=sign_len;