summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2006-08-17 12:17:52 -0400
committerunknown <cmiller@zippy.cornsilk.net>2006-08-17 12:17:52 -0400
commitb8930cbc55e1f054682d070fb615a513e6d086cc (patch)
tree61c7dffec75cc4a3395f97dd3a322abd6998bc90 /sql
parentb32b2ce7afa830257a1052f70b57eb3f3a38710f (diff)
parent5c8c2ab43b73984889fd6c337523b657861793ea (diff)
downloadmariadb-git-b8930cbc55e1f054682d070fb615a513e6d086cc.tar.gz
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
into zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.1 BitKeeper/deleted/.del-openssl.m4~41cebd0ba8281769: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/mysql.test: Auto merged mysql-test/t/mysql_client_test.test: Auto merged server-tools/instance-manager/listener.cc: Auto merged server-tools/instance-manager/portability.h: Auto merged sql/item_timefunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged tests/mysql_client_test.c: Auto merged client/mysql.cc: Manual merge mysql-test/mysql-test-run.pl: Manual merge mysql-test/t/func_time.test: Manual merge
Diffstat (limited to 'sql')
-rw-r--r--sql/item_timefunc.cc6
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_acl.cc40
3 files changed, 42 insertions, 6 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index e0c80087c05..f603cafd89d 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1680,14 +1680,12 @@ uint Item_func_date_format::format_length(const String *format)
case 'u': /* week (00..52), where week starts with Monday */
case 'V': /* week 1..53 used with 'x' */
case 'v': /* week 1..53 used with 'x', where week starts with Monday */
- case 'H': /* hour (00..23) */
case 'y': /* year, numeric, 2 digits */
case 'm': /* month, numeric */
case 'd': /* day (of the month), numeric */
case 'h': /* hour (01..12) */
case 'I': /* --||-- */
case 'i': /* minutes, numeric */
- case 'k': /* hour ( 0..23) */
case 'l': /* hour ( 1..12) */
case 'p': /* locale's AM or PM */
case 'S': /* second (00..61) */
@@ -1696,6 +1694,10 @@ uint Item_func_date_format::format_length(const String *format)
case 'e': /* day (0..31) */
size += 2;
break;
+ case 'k': /* hour ( 0..23) */
+ case 'H': /* hour (00..23; value > 23 OK, padding always 2-digit) */
+ size += 7; /* docs allow > 23, range depends on sizeof(unsigned int) */
+ break;
case 'r': /* time, 12-hour (hh:mm:ss [AP]M) */
size += 11;
break;
diff --git a/sql/slave.cc b/sql/slave.cc
index 84d97242bf3..f9645fc83e3 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3051,7 +3051,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
rli->is_until_satisfied())
{
char buf[22];
- sql_print_error("Slave SQL thread stopped because it reached its"
+ sql_print_information("Slave SQL thread stopped because it reached its"
" UNTIL position %s", llstr(rli->until_pos(), buf));
/*
Setting abort_slave flag because we do not want additional message about
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index af2de0ca779..c36302c8d26 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -4838,6 +4838,32 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
DBUG_RETURN(0);
}
+ACL_USER *check_acl_user(LEX_USER *user_name,
+ uint *acl_acl_userdx)
+{
+ ACL_USER *acl_user= 0;
+ uint counter;
+
+ safe_mutex_assert_owner(&acl_cache->lock);
+
+ for (counter= 0 ; counter < acl_users.elements ; counter++)
+ {
+ const char *user,*host;
+ acl_user= dynamic_element(&acl_users, counter, ACL_USER*);
+ if (!(user=acl_user->user))
+ user= "";
+ if (!(host=acl_user->host.hostname))
+ host= "";
+ if (!strcmp(user_name->user.str,user) &&
+ !my_strcasecmp(system_charset_info, user_name->host.str, host))
+ break;
+ }
+ if (counter == acl_users.elements)
+ return 0;
+
+ *acl_acl_userdx= counter;
+ return acl_user;
+}
/*
Modify a privilege table.
@@ -4886,7 +4912,6 @@ static int modify_grant_table(TABLE *table, Field *host_field,
DBUG_RETURN(error);
}
-
/*
Handle a privilege table.
@@ -5382,7 +5407,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
{
result= TRUE;
continue;
- }
+ }
+
+ if (user_name->host.length > HOSTNAME_LENGTH ||
+ user_name->user.length > USERNAME_LENGTH)
+ {
+ append_user(&wrong_users, user_name);
+ result= TRUE;
+ continue;
+ }
+
/*
Search all in-memory structures and grant tables
for a mention of the new user name.
@@ -5523,7 +5557,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
result= TRUE;
}
}
-
+
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
rebuild_check_host();