MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:March 4 2005 1:44am
Subject:bk commit into 5.0 tree (jimw:1.1792) BUG#3309
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1792 05/03/03 17:44:28 jimw@stripped +3 -0
  Clean up merge of fix for Bug #3309.

  sql/sql_acl.cc
    1.138 05/03/03 17:44:25 jimw@stripped +17 -13
    Fixes to merge

  mysql-test/t/grant2.test
    1.16 05/03/03 17:44:25 jimw@stripped +1 -0
    Reset sql_mode before test.

  mysql-test/r/grant2.result
    1.18 05/03/03 17:44:25 jimw@stripped +1 -0
    Update results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-clean

--- 1.137/sql/sql_acl.cc	2005-03-03 15:01:43 -08:00
+++ 1.138/sql/sql_acl.cc	2005-03-03 17:44:25 -08:00
@@ -2122,12 +2122,12 @@
   {
     if (exact)
     {
-      if (compare_hostname(&grant_table->host, host, ip))
+      if (compare_hostname(&grant_name->host, host, ip))
 	return grant_name;
     }
     else
     {
-      if (compare_hostname(&grant_table->host, host, ip) &&
+      if (compare_hostname(&grant_name->host, host, ip) &&
           (!found || found->sort < grant_name->sort))
 	found=grant_name;					// Host ok
     }
@@ -3178,7 +3178,7 @@
 
       if (check_no_resolve)
       {
-	if (hostname_requires_resolving(mem_check->host))
+	if (hostname_requires_resolving(mem_check->host.hostname))
 	{
           sql_print_warning("'tables_priv' entry '%s %s@%s' "
                             "ignored in --skip-name-resolve mode.",
@@ -4057,7 +4057,7 @@
 
     if (!strcmp(lex_user->user.str,user) &&
 	!my_strcasecmp(system_charset_info, lex_user->host.str,
-                       grant_proc->orig_host))
+                       grant_proc->host.hostname))
     {
       ulong proc_access= grant_proc->privs;
       if (proc_access != 0)
@@ -4543,19 +4543,22 @@
     case 1:
       acl_db= dynamic_element(&acl_dbs, idx, ACL_DB*);
       user= acl_db->user;
-      host= acl_db->host.hostname;
+      if (!(host= acl_db->host.hostname))
+        host= "%";
       break;
 
     case 2:
       grant_name= (GRANT_NAME*) hash_element(&column_priv_hash, idx);
       user= grant_name->user;
-      host= grant_name->host;
+      if (!(host= grant_name->host.hostname))
+        host= "%";
       break;
 
     case 3:
       grant_name= (GRANT_NAME*) hash_element(&proc_priv_hash, idx);
       user= grant_name->user;
-      host= grant_name->host;
+      if (!(host= grant_name->host.hostname))
+        host= "%";
       break;
     }
     if (! user)
@@ -4610,7 +4613,8 @@
       case 2:
       case 3:
         grant_name->user= strdup_root(&mem, user_to->user.str);
-        grant_name->host= strdup_root(&mem, user_to->host.str);
+        update_hostname(&grant_name->host,
+                        strdup_root(&mem, user_to->host.str));
 	break;
       }
     }
@@ -5067,7 +5071,7 @@
 							   counter);
 	if (!(user=grant_proc->user))
 	  user= "";
-	if (!(host=grant_proc->host))
+	if (!(host=grant_proc->host.hostname))
 	  host= "";
 
 	if (!strcmp(lex_user->user.str,user) &&
@@ -5139,8 +5143,8 @@
         LEX_USER lex_user;
 	lex_user.user.str= grant_proc->user;
 	lex_user.user.length= strlen(grant_proc->user);
-	lex_user.host.str= grant_proc->host;
-	lex_user.host.length= strlen(grant_proc->host);
+	lex_user.host.str= grant_proc->host.hostname;
+	lex_user.host.length= strlen(grant_proc->host.hostname);
 	if (!replace_proc_table(thd,grant_proc,tables[4].table,lex_user,
 				grant_proc->db, grant_proc->tname, ~0, 1))
 	{
@@ -5424,7 +5428,7 @@
       if (!(table_access & GRANT_ACL))
         is_grantable= "NO";
 
-      strxmov(buff,"'",user,"'@'",grant_table->orig_host,"'",NullS);
+      strxmov(buff,"'",user,"'@'",grant_table->host.hostname,"'",NullS);
       if (!test_access)
         update_schema_privilege(table, buff, grant_table->db, grant_table->tname,
                                 0, 0, "USAGE", 5, is_grantable);
@@ -5471,7 +5475,7 @@
         is_grantable= "NO";
 
       ulong test_access= table_access & ~GRANT_ACL;
-      strxmov(buff,"'",user,"'@'",grant_table->orig_host,"'",NullS);
+      strxmov(buff,"'",user,"'@'",grant_table->host.hostname,"'",NullS);
       if (!test_access)
         continue;
       else

--- 1.17/mysql-test/r/grant2.result	2005-03-03 15:01:43 -08:00
+++ 1.18/mysql-test/r/grant2.result	2005-03-03 17:44:25 -08:00
@@ -233,6 +233,7 @@
 ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysql'
 drop user mysqltest_B@'%';
 drop user mysqltest_3@localhost;
+set @@sql_mode='';
 create database mysqltest_1;
 create table mysqltest_1.t1 (i int);
 insert into mysqltest_1.t1 values (1),(2),(3);

--- 1.15/mysql-test/t/grant2.test	2005-03-03 15:01:43 -08:00
+++ 1.16/mysql-test/t/grant2.test	2005-03-03 17:44:25 -08:00
@@ -247,6 +247,7 @@
 drop user mysqltest_3@localhost;
 #
 # Bug #3309: Test IP addresses with netmask
+set @@sql_mode='';
 create database mysqltest_1;
 create table mysqltest_1.t1 (i int);
 insert into mysqltest_1.t1 values (1),(2),(3);
Thread
bk commit into 5.0 tree (jimw:1.1792) BUG#3309Jim Winstead4 Mar