List:Commits« Previous MessageNext Message »
From:Tatjana Azundris Nuernberg Date:August 18 2011 1:54pm
Subject:bzr push into mysql-trunk branch (tatjana.nuernberg:3268 to 3269) WL#5706
View as plain text  
 3269 Tatjana Azundris Nuernberg	2011-08-18
      post-pushbuild fixes for WL#5706
     @ mysql-test/r/rewrite.result
        be nicer to embedded.
     @ mysql-test/t/rewrite.test
        be nicer to embedded.
     @ sql/sql_acl.cc
        make helper functions available to sql_rewrite.cc even with
        NO_EMBEDDED_ACCESS_CHECK
     @ sql/sql_parse.cc
        unbreak a corner case with slow query logging and prepared
        statements when needing to log a slow query immediately after
        a rewritten one
     @ sql/sql_rewrite.cc
        rewriting: now also available in embedded, even when access
        checks are off. we might need this later.

    modified:
      mysql-test/r/rewrite.result
      mysql-test/t/rewrite.test
      sql/sql_acl.cc
      sql/sql_parse.cc
      sql/sql_rewrite.cc
 3268 horst.hunger@stripped	2011-08-17
      WL#3771:Merge from 5.5-stage to trunk-stage

    added:
      mysql-test/r/audit_plugin.result
      mysql-test/t/audit_plugin-master.opt
      mysql-test/t/audit_plugin.test
    modified:
      mysql-test/include/plugin.defs
=== modified file 'mysql-test/r/rewrite.result'
--- a/mysql-test/r/rewrite.result	2011-08-17 14:07:07 +0000
+++ b/mysql-test/r/rewrite.result	2011-08-18 13:53:05 +0000
@@ -86,7 +86,6 @@ MASTER_SSL_CAPATH = '',
 MASTER_SSL_CERT = '', MASTER_SSL_KEY = '',
 MASTER_SSL_CIPHER = '', MASTER_SSL_VERIFY_SERVER_CERT = 0,
 IGNORE_SERVER_IDS = ( );
-SET GLOBAL RELAY_LOG_PURGE = 1;
 CREATE USER 'test_user4'@'localhost';
 SET PASSWORD FOR 'test_user4'@'localhost' = PASSWORD('azundris4');
 SET SESSION long_query_time=  @old_long_query_time;

=== modified file 'mysql-test/t/rewrite.test'
--- a/mysql-test/t/rewrite.test	2011-08-17 14:07:07 +0000
+++ b/mysql-test/t/rewrite.test	2011-08-18 13:53:05 +0000
@@ -108,6 +108,7 @@ GRANT ALL on *.* TO test_user1 IDENTIFIE
 CREATE USER test_user2 IDENTIFIED BY 'azundris2';
 
 # 1.1.1.3
+--disable_warnings
 CHANGE MASTER TO MASTER_PASSWORD='azundris3';
 CHANGE MASTER TO MASTER_CONNECT_RETRY = 1, MASTER_HEARTBEAT_PERIOD = 1.01,
   MASTER_LOG_FILE = 'master_log_name', MASTER_LOG_POS = 0,
@@ -124,7 +125,7 @@ CHANGE MASTER TO MASTER_CONNECT_RETRY = 
   MASTER_SSL_CERT = '', MASTER_SSL_KEY = '',
   MASTER_SSL_CIPHER = '', MASTER_SSL_VERIFY_SERVER_CERT = 0,
   IGNORE_SERVER_IDS = ( );
-SET GLOBAL RELAY_LOG_PURGE = 1;
+--enable_warnings
 
 # 1.1.1.4
 CREATE USER 'test_user4'@'localhost';

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2011-08-17 14:07:07 +0000
+++ b/sql/sql_acl.cc	2011-08-18 13:53:05 +0000
@@ -5199,6 +5199,8 @@ static void add_user_option(String *gran
   }
 }
 
+#endif /*NO_EMBEDDED_ACCESS_CHECKS */
+
 const char *command_array[]=
 {
   "SELECT", "INSERT", "UPDATE", "DELETE", "CREATE", "DROP", "RELOAD",
@@ -5228,6 +5230,7 @@ void append_int(String *str, const char 
   }
 }
 
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
 
 static int show_routine_grants(THD *thd, LEX_USER *lex_user, HASH *hash,
                                const char *type, int typelen,
@@ -6440,6 +6443,8 @@ static int handle_grant_data(TABLE_LIST 
   DBUG_RETURN(result);
 }
 
+#endif /*NO_EMBEDDED_ACCESS_CHECKS */
+
 /**
   Auxiliary function for constructing a  user list string.
   @param str     A String to store the user list.
@@ -6489,6 +6494,7 @@ void append_user(String *str, LEX_USER *
   }
 }
 
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
 
 /*
   Create a list of users.

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-08-17 14:07:07 +0000
+++ b/sql/sql_parse.cc	2011-08-18 13:53:05 +0000
@@ -1632,7 +1632,7 @@ void log_slow_statement(THD *thd)
          ((thd->server_status &
            (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
           opt_log_queries_not_using_indexes &&
-           !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
+          !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
         thd->get_examined_row_count() >= thd->variables.min_examined_row_limit)
     {
       THD_STAGE_INFO(thd, stage_logging_slow_query);
@@ -1823,6 +1823,7 @@ bool alloc_query(THD *thd, const char *p
       return TRUE;
   query[packet_length]= '\0';
   thd->set_query(query, packet_length);
+  thd->rewritten_query.free();                 // free here lest PS break
 
   /* Reclaim some memory */
   thd->packet.shrink(thd->variables.net_buffer_length);

=== modified file 'sql/sql_rewrite.cc'
--- a/sql/sql_rewrite.cc	2011-08-17 14:07:07 +0000
+++ b/sql/sql_rewrite.cc	2011-08-18 13:53:05 +0000
@@ -22,7 +22,6 @@
 #include "sp_head.h"    // TYPE_ENUM_(FUNCTION|PROCEDURE)
 
 
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
 
 static void mysql_rewrite_grant(THD *thd, String *rlb)
 {
@@ -352,7 +351,6 @@ static void mysql_rewrite_change_master(
     }
   }
 }
-#endif
 
 
 /**
@@ -364,16 +362,12 @@ void mysql_rewrite_query(THD *thd)
 {
   String *rlb= &thd->rewritten_query;
 
-  rlb->free();
-
   switch(thd->lex->sql_command)
   {
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
   case SQLCOM_GRANT:         mysql_rewrite_grant(thd, rlb);         break;
   case SQLCOM_SET_OPTION:    mysql_rewrite_set(thd, rlb);           break;
   case SQLCOM_CREATE_USER:   mysql_rewrite_create_user(thd, rlb);   break;
   case SQLCOM_CHANGE_MASTER: mysql_rewrite_change_master(thd, rlb); break;
-#endif
   default:                   /* unhandled query types are legal. */ break;
   }
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tatjana.nuernberg:3268 to 3269) WL#5706Tatjana Azundris Nuernberg22 Aug