List:Commits« Previous MessageNext Message »
From:bar Date:January 19 2006 6:58am
Subject:bk commit into 5.1 tree (bar:1.2077)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of bar. When bar 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.2077 06/01/19 10:58:49 bar@stripped +1 -0
  Merge abarkov@stripped:/home/bk/mysql-5.1-new
  into  mysql.com:/usr/home/bar/mysql-5.1-new.12448

  sql/mysqld.cc
    1.521 06/01/19 10:58:39 bar@stripped +0 -0
    Auto merged

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.1-new.12448/RESYNC

--- 1.520/sql/mysqld.cc	2006-01-18 12:44:52 +04:00
+++ 1.521/sql/mysqld.cc	2006-01-19 10:58:39 +04:00
@@ -332,6 +332,9 @@
 
 bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
 bool opt_error_log= IF_WIN(1,0);
+#ifdef WITH_CSV_STORAGE_ENGINE
+bool opt_old_log_format, opt_both_log_formats;
+#endif
 bool opt_disable_networking=0, opt_skip_show_db=0;
 my_bool opt_character_set_client_handshake= 1;
 bool server_id_supplied = 0;
@@ -605,6 +608,7 @@
 my_bool master_ssl;
 char *master_ssl_key, *master_ssl_cert;
 char *master_ssl_ca, *master_ssl_capath, *master_ssl_cipher;
+char *opt_logname, *opt_slow_logname;
 
 /* Static variables */
 
@@ -612,8 +616,8 @@
 static my_bool opt_do_pstack, opt_bootstrap, opt_myisam_log;
 static int cleanup_done;
 static ulong opt_specialflag, opt_myisam_block_size;
-static char *opt_logname, *opt_update_logname, *opt_binlog_index_name;
-static char *opt_slow_logname, *opt_tc_heuristic_recover;
+static char *opt_update_logname, *opt_binlog_index_name;
+static char *opt_tc_heuristic_recover;
 static char *mysql_home_ptr, *pidfile_name_ptr;
 static char **defaults_argv;
 static char *opt_bin_logname;
@@ -1140,8 +1144,7 @@
   if (cleanup_done++)
     return; /* purecov: inspected */
 
-  mysql_log.cleanup();
-  mysql_slow_log.cleanup();
+  logger.cleanup();
   /*
     make sure that handlers finish up
     what they have that is dependent on the binlog
@@ -2391,6 +2394,9 @@
 #ifdef EXTRA_DEBUG
       sql_print_information("Got signal %d to shutdown mysqld",sig);
 #endif
+      /* switch to the old log message processing */
+      logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE,
+                          opt_log ? LEGACY:NONE);
       DBUG_PRINT("info",("Got signal: %d  abort_loop: %d",sig,abort_loop));
       if (!abort_loop)
       {
@@ -2418,6 +2424,9 @@
 			      REFRESH_THREADS | REFRESH_HOSTS),
 			     (TABLE_LIST*) 0, &not_used); // Flush logs
       }
+      /* reenable logs after the options were reloaded */
+      logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE,
+                          opt_log ? CSV:NONE);
       break;
 #ifdef USE_ONE_SIGNAL_HAND
     case THR_SERVER_ALARM:
@@ -2682,8 +2691,6 @@
     global MYSQL_LOGs in their constructors, because then they would be inited
     before MY_INIT(). So we do it here.
   */
-  mysql_log.init_pthread_objects();
-  mysql_slow_log.init_pthread_objects();
   mysql_bin_log.init_pthread_objects();
 
   if (gethostname(glob_hostname,sizeof(glob_hostname)-4) < 0)
@@ -3055,9 +3062,48 @@
 #ifdef HAVE_REPLICATION
   init_slave_list();
 #endif
-  /* Setup log files */
-  if (opt_log)
-    mysql_log.open_query_log(opt_logname);
+  /* Setup logs */
+
+  /* enable old-fashioned error log */
+  if (opt_error_log)
+  {
+    if (!log_error_file_ptr[0])
+      fn_format(log_error_file, glob_hostname, mysql_data_home, ".err",
+                MY_REPLACE_EXT); /* replace '.<domain>' by '.err', bug#4997 */
+    else
+      fn_format(log_error_file, log_error_file_ptr, mysql_data_home, ".err",
+                MY_UNPACK_FILENAME | MY_SAFE_PATH);
+    if (!log_error_file[0])
+      opt_error_log= 1;				// Too long file name
+    else
+    {
+#ifndef EMBEDDED_LIBRARY
+      if (freopen(log_error_file, "a+", stdout))
+#endif
+        freopen(log_error_file, "a+", stderr);
+    }
+  }
+
+#ifdef WITH_CSV_STORAGE_ENGINE
+  logger.init_log_tables();
+
+  if (opt_old_log_format || (have_csv_db != SHOW_OPTION_YES))
+    logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE,
+                        opt_log ? LEGACY:NONE);
+  else
+    if (opt_both_log_formats)
+      logger.set_handlers(LEGACY,
+                          opt_slow_log ? LEGACY_AND_CSV:NONE,
+                          opt_log ? LEGACY_AND_CSV:NONE);
+    else
+      /* the default is CSV log tables */
+      logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE,
+                          opt_log ? CSV:NONE);
+#else
+  logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE,
+                      opt_log ? LEGACY:NONE);
+#endif
+
   if (opt_update_log)
   {
     /*
@@ -3154,9 +3200,6 @@
               array_elements(binlog_format_names)-1);
   opt_binlog_format= binlog_format_names[opt_binlog_format_id];
 
-  if (opt_slow_log)
-    mysql_slow_log.open_slow_log(opt_slow_logname);
-
 #ifdef HAVE_REPLICATION
   if (opt_log_slave_updates && replicate_same_server_id)
   {
@@ -3168,25 +3211,6 @@
   }
 #endif
 
-  if (opt_error_log)
-  {
-    if (!log_error_file_ptr[0])
-      fn_format(log_error_file, glob_hostname, mysql_data_home, ".err",
-                MY_REPLACE_EXT); /* replace '.<domain>' by '.err', bug#4997 */
-    else
-      fn_format(log_error_file, log_error_file_ptr, mysql_data_home, ".err",
-		MY_UNPACK_FILENAME | MY_SAFE_PATH);
-    if (!log_error_file[0])
-      opt_error_log= 1;				// Too long file name
-    else
-    {
-#ifndef EMBEDDED_LIBRARY
-      if (freopen(log_error_file, "a+", stdout))
-#endif
-	stderror_file= freopen(log_error_file, "a+", stderr);
-    }
-  }
-
   if (opt_bin_log)
   {
     char buf[FN_REFLEN];
@@ -3440,6 +3464,12 @@
 
   MY_INIT(argv[0]);		// init my_sys library & pthreads
 
+  /*
+    Perform basic logger initialization logger. Should be called after
+    MY_INIT, as it initializes mutexes. Log tables are inited later.
+  */
+  logger.init_base();
+
 #ifdef _CUSTOMSTARTUPCONFIG_
   if (_cust_check_startup())
   {
@@ -3585,6 +3615,7 @@
   */
   error_handler_hook= my_message_sql;
   start_signal_handler();				// Creates pidfile
+
   if (acl_init(opt_noacl) ||
       my_tz_init((THD *)0, default_tz_name, opt_bootstrap))
   {
@@ -3709,7 +3740,7 @@
   clean_up_mutexes();
   shutdown_events();
   my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
- 
+
   exit(0);
   return(0);					/* purecov: deadcode */
 }
@@ -4647,7 +4678,7 @@
   OPT_REPLICATE_IGNORE_TABLE,  OPT_REPLICATE_WILD_DO_TABLE,
   OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID,
   OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER,
-  OPT_ABORT_SLAVE_EVENT_COUNT,
+  OPT_ABORT_SLAVE_EVENT_COUNT, OPT_OLD_LOG_FORMAT, OPT_BOTH_LOG_FORMATS,
   OPT_INNODB_DATA_HOME_DIR,
   OPT_INNODB_DATA_FILE_PATH,
   OPT_INNODB_LOG_GROUP_HOME_DIR,
@@ -5209,6 +5240,16 @@
     "Log slow queries to this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.",
    (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
    0, 0, 0, 0, 0, 0},
+#ifdef WITH_CSV_STORAGE_ENGINE
+  {"old-log-format", OPT_OLD_LOG_FORMAT,
+   "Enable old log file format. (No SELECT * FROM logs)",
+   (gptr*) &opt_old_log_format, 0, 0, GET_BOOL, OPT_ARG,
+   0, 0, 0, 0, 0, 0},
+  {"both-log-formats", OPT_BOTH_LOG_FORMATS,
+   "Enable old log file format along with log tables",
+   (gptr*) &opt_both_log_formats, 0, 0, GET_BOOL, OPT_ARG,
+   0, 0, 0, 0, 0, 0},
+#endif
   {"log-tc", OPT_LOG_TC,
    "Path to transaction coordinator log (used for transactions that affect "
    "more than one storage engine, when binary log is disabled)",
@@ -6900,6 +6941,10 @@
   opt_skip_slave_start= opt_reckless_slave = 0;
   mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
   opt_log= opt_update_log= opt_slow_log= 0;
+#ifdef WITH_CSV_STORAGE_ENGINE
+  opt_old_log_format= 0;
+  opt_both_log_formats= 0;
+#endif
   opt_bin_log= 0;
   opt_disable_networking= opt_skip_show_db=0;
   opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
@@ -7310,8 +7355,16 @@
   }
 #endif /* HAVE_REPLICATION */
   case (int) OPT_SLOW_QUERY_LOG:
-    opt_slow_log=1;
+    opt_slow_log= 1;
     break;
+#ifdef WITH_CSV_STORAGE_ENGINE
+  case (int) OPT_OLD_LOG_FORMAT:
+    opt_old_log_format= 1;
+    break;
+  case (int) OPT_BOTH_LOG_FORMATS:
+    opt_both_log_formats= 1;
+    break;
+#endif
   case (int) OPT_SKIP_NEW:
     opt_specialflag|= SPECIAL_NO_NEW_FUNC;
     delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
Thread
bk commit into 5.1 tree (bar:1.2077)bar19 Jan