diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 39f0cf9ca55cf71de30172d5f02e40a63391e075..3abd39c3d8c689a4e131bae20aecd4c3ca198996 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -8,7 +8,7 @@ show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) 
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
 drop table t1;
 create table t1 (a int)
 engine = innodb
@@ -21,7 +21,7 @@ show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
 drop table t1;
 partition by list (a)
 partitions 3
diff --git a/sql/log.cc b/sql/log.cc
index b6b1eb721bb2f87fb75be3d2fbd28525efdd6a00..9fe529f145699e130fd85ce49a37874ef55025de 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -936,7 +936,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type)
       if ((res= reopen_log_table(log_type)))
         goto err;
       file_log_handler->get_mysql_slow_log()->
-        open_query_log(sys_var_slow_log_path.value);
+        open_slow_log(sys_var_slow_log_path.value);
       init_slow_log(log_output_options);
       opt_slow_log= TRUE;
     }
diff --git a/sql/log.h b/sql/log.h
index 80992a7910a7205320f3446fc61030a6a813cfe5..b4818a370d7edf29fd3d28f994fef8feba7de263 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -467,8 +467,8 @@ public:
                            CHARSET_INFO *client_cs);
   void flush();
   void init_pthread_objects();
-  MYSQL_LOG *get_mysql_slow_log() { return &mysql_slow_log; }
-  MYSQL_LOG *get_mysql_log() { return &mysql_log; }
+  MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; }
+  MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; }
 };
 
 
@@ -543,13 +543,13 @@ public:
   void init_general_log(uint general_log_printer);
   void deactivate_log_handler(THD* thd, uint log_type);
   bool activate_log_handler(THD* thd, uint log_type);
-  MYSQL_LOG *get_slow_log_file_handler()
+  MYSQL_QUERY_LOG *get_slow_log_file_handler()
   { 
     if (file_log_handler)
       return file_log_handler->get_mysql_slow_log();
     return NULL;
   }
-  MYSQL_LOG *get_log_file_handler()
+  MYSQL_QUERY_LOG *get_log_file_handler()
   { 
     if (file_log_handler)
       return file_log_handler->get_mysql_log();
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 33bff8cc1f1b8e8e0ce975755e896664d1d213cf..ce4994d270650cc04c6c82d916307c7f79f75133 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -2602,7 +2602,7 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
 			     set_var *var, const char *log_ext,
 			     bool log_state, uint log_type)
 {
-  MYSQL_LOG *file_log;
+  MYSQL_QUERY_LOG *file_log;
   char buff[FN_REFLEN];
   char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
   bool result= 0;
@@ -2640,7 +2640,18 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
   var_str->value_length= str_length;
   my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
   if (file_log && log_state)
-    file_log->open_query_log(sys_var_general_log_path.value);
+  {
+    switch (log_type) {
+    case QUERY_LOG_SLOW:
+      file_log->open_slow_log(sys_var_general_log_path.value);
+      break;
+    case QUERY_LOG_GENERAL:
+      file_log->open_query_log(sys_var_general_log_path.value);
+      break;
+    default:
+      DBUG_ASSERT(0);
+    }
+  }
 
   logger.unlock();
   pthread_mutex_unlock(&LOCK_global_system_variables);