List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:March 23 2011 2:11pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4268)
View as plain text  
#At file:///data0/magnus/mysql/7.0-dist-priv/ based on revid:magnus.blaudd@strippedzqw

 4268 Magnus Blåudd	2011-03-23
      ndb dist priv
       - remove mystery "don't restore if count users is 0"

    modified:
      storage/ndb/tools/ndb_dist_priv.sql
=== modified file 'storage/ndb/tools/ndb_dist_priv.sql'
--- a/storage/ndb/tools/ndb_dist_priv.sql	2011-03-23 13:56:39 +0000
+++ b/storage/ndb/tools/ndb_dist_priv.sql	2011-03-23 14:10:51 +0000
@@ -139,66 +139,58 @@ end|
 
 create procedure mysql.mysql_cluster_restore_privileges_from_local()
 begin
- declare no_users integer;
  declare local_backup bool default 0;
  select 1 into local_backup
    from information_schema.tables
     where table_schema = "mysql" and table_name = "user_backup";
  if local_backup = 1 then
-   select count(*) into no_users from user_backup;
-   if no_users != 0 then
-     create table if not exists user like user_backup;
-     create table if not exists db like db_backup;
-     create table if not exists tables_priv like tables_priv_backup;
-     create table if not exists columns_priv like columns_priv_backup;
-     create table if not exists procs_priv like procs_priv_backup;
-     create table if not exists host like host_backup;
-     delete from user;
-     insert into user select * from user_backup;
-     delete from db;
-     insert into db select * from db_backup;
-     delete from tables_priv;
-     insert into tables_priv select * from tables_priv_backup;
-     delete from columns_priv;
-     insert into columns_priv select * from columns_priv_backup;
-     delete from procs_priv;
-     insert into procs_priv select * from procs_priv_backup;
-     delete from host;
-     insert into host select * from host_backup;
-   end if;
+   create table if not exists user like user_backup;
+   create table if not exists db like db_backup;
+   create table if not exists tables_priv like tables_priv_backup;
+   create table if not exists columns_priv like columns_priv_backup;
+   create table if not exists procs_priv like procs_priv_backup;
+    create table if not exists host like host_backup;
+   delete from user;
+   insert into user select * from user_backup;
+   delete from db;
+   insert into db select * from db_backup;
+   delete from tables_priv;
+   insert into tables_priv select * from tables_priv_backup;
+   delete from columns_priv;
+   insert into columns_priv select * from columns_priv_backup;
+   delete from procs_priv;
+   insert into procs_priv select * from procs_priv_backup;
+   delete from host;
+   insert into host select * from host_backup;
  end if;
 end|
 
 create procedure mysql.mysql_cluster_restore_privileges()
 begin
- declare no_users integer;
  declare distributed_backup bool default 0;
  select 1 into distributed_backup
    from information_schema.tables
      where table_schema = "mysql" and table_name = "ndb_user_backup";
  if distributed_backup = 1 then
-   select count(*) into no_users from ndb_user_backup;
-   if no_users != 0 then
-     flush tables;
-     create table if not exists user like ndb_user_backup;
-     create table if not exists db like ndb_db_backup;
-     create table if not exists tables_priv like ndb_tables_priv_backup;
-     create table if not exists columns_priv like ndb_columns_priv_backup;
-     create table if not exists procs_priv like ndb_procs_priv_backup;
-     create table if not exists host like ndb_host_backup;
-     delete from user;
-     insert into user select * from ndb_user_backup;
-     delete from db;
-     insert into db select * from ndb_db_backup;
-     delete from tables_priv;
-     insert into tables_priv select * from ndb_tables_priv_backup;
-     delete from columns_priv;
-     insert into columns_priv select * from ndb_columns_priv_backup;
-     delete from procs_priv;
-     insert into procs_priv select * from ndb_procs_priv_backup;
-     delete from host;
-     insert into host select * from ndb_host_backup;
-   end if;
+   flush tables;
+   create table if not exists user like ndb_user_backup;
+   create table if not exists db like ndb_db_backup;
+   create table if not exists tables_priv like ndb_tables_priv_backup;
+   create table if not exists columns_priv like ndb_columns_priv_backup;
+   create table if not exists procs_priv like ndb_procs_priv_backup;
+   create table if not exists host like ndb_host_backup;
+   delete from user;
+   insert into user select * from ndb_user_backup;
+   delete from db;
+   insert into db select * from ndb_db_backup;
+   delete from tables_priv;
+   insert into tables_priv select * from ndb_tables_priv_backup;
+   delete from columns_priv;
+   insert into columns_priv select * from ndb_columns_priv_backup;
+   delete from procs_priv;
+   insert into procs_priv select * from ndb_procs_priv_backup;
+   -- delete from host;
+   -- insert into host select * from ndb_host_backup;
  else
    call mysql_cluster_restore_privileges_from_local();
  end if;

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110323141051-7gl38x5oz2yh3swv.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4268) Magnus Blåudd23 Mar