List:Commits« Previous MessageNext Message »
From:Petr Chardin Date:December 13 2005 1:18pm
Subject:bk commit into 5.1 tree (petr:1.1963)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps 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.1963 05/12/13 16:18:29 petr@stripped +18 -0
  Some more post-review fixes for WL #1019

  sql/sql_class.h
    1.273 05/12/13 16:18:16 petr@stripped +9 -4
    inline small functions from LOGGER

  sql/mysqld.cc
    1.503 05/12/13 16:18:15 petr@stripped +32 -20
    do not compile-in log tables specific options, if CSV is not in

  sql/log.cc
    1.183 05/12/13 16:18:15 petr@stripped +9 -44
    post-review fixes: fix formatting, make small LOGGER functions inline

  sql/examples/ha_tina.h
    1.12 05/12/13 16:18:15 petr@stripped +1 -1
    cleanup

  sql/examples/ha_tina.cc
    1.26 05/12/13 16:18:15 petr@stripped +1 -1
    cleanup

  mysql-test/t/system_mysql_db_fix.test
    1.21 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/system_mysql_db.test
    1.9 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/show_check.test
    1.59 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/mysqlcheck.test
    1.2 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/log_tables.test
    1.6 05/12/13 16:18:15 petr@stripped +1 -1
    cleanup

  mysql-test/t/information_schema.test
    1.64 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/im_utils.imtest
    1.2 05/12/13 16:18:15 petr@stripped +7 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/im_options_unset.imtest
    1.2 05/12/13 16:18:15 petr@stripped +7 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/im_options_set.imtest
    1.2 05/12/13 16:18:15 petr@stripped +7 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/im_life_cycle.imtest
    1.3 05/12/13 16:18:15 petr@stripped +7 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/im_daemon_life_cycle.imtest
    1.2 05/12/13 16:18:15 petr@stripped +7 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/csv.test
    1.8 05/12/13 16:18:15 petr@stripped +1 -1
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

  mysql-test/t/connect.test
    1.20 05/12/13 16:18:15 petr@stripped +4 -0
    disable test if CSV engine is not in: result depends on the
    presence of CSV-based log tables 

# 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:	petr
# Host:	owlet.
# Root:	/home/cps/mysql/devel/mysql-5.1-logs-merge

--- 1.182/sql/log.cc	2005-12-12 11:46:06 +03:00
+++ 1.183/sql/log.cc	2005-12-13 16:18:15 +03:00
@@ -269,17 +269,11 @@
   /* set default value (which is CURRENT_TIMESTAMP) */
   table->field[0]->set_null();
 
-  table->field[1]->store(user_host,
-                         user_host_len,
-                         &my_charset_latin1);
+  table->field[1]->store(user_host, user_host_len, &my_charset_latin1);
   table->field[2]->store((longlong) thread_id);
   table->field[3]->store((longlong) server_id);
-  table->field[4]->store(command_type,
-                         command_type_len,
-                         &my_charset_latin1);
-  table->field[5]->store(sql_text,
-                         sql_text_len,
-                         &my_charset_latin1);
+  table->field[4]->store(command_type, command_type_len, &my_charset_latin1);
+  table->field[5]->store(sql_text, sql_text_len, &my_charset_latin1);
   table->file->write_row(table->record[0]);
   return FALSE;
 }
@@ -334,24 +328,21 @@
   */
   slow_log_thd->start_time= query_start_arg;
 
-
   /* set default value (which is CURRENT_TIMESTAMP) */
   table->field[0]->set_null();
 
   /* store the value */
-  table->field[1]->store(user_host,
-                         user_host_len,
-                         &my_charset_latin1);
+  table->field[1]->store(user_host, user_host_len, &my_charset_latin1);
 
   if (query_start_arg)
   {
-    /* query_time */
+    /* fill in query_time field */
     table->field[2]->store(query_time);
     /* lock_time */
     table->field[3]->store(lock_time);
     /* rows_sent */
     table->field[4]->store((longlong) thd->sent_row_count);
-    /* rows_sent rows_examined */
+    /* rows_examined */
     table->field[5]->store((longlong) thd->examined_row_count);
   }
   else
@@ -364,9 +355,7 @@
 
   if (thd->db)
     /* fill database field */
-    table->field[6]->store(thd->db,
-                           thd->db_length,
-                           &my_charset_latin1);
+    table->field[6]->store(thd->db, thd->db_length, &my_charset_latin1);
   else
     table->field[6]->set_null();
 
@@ -429,29 +418,6 @@
                          sql_text, sql_text_len);
 }
 
-void LOGGER::init_pthread_objects()
-{
-  DBUG_ASSERT(inited == 0);
-  inited= 1;
-  (void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW);
-}
-
-void LOGGER::lock()
-{
-  (void) pthread_mutex_lock(&LOCK_logger);
-}
-
-void LOGGER::unlock()
-{
-  (void) pthread_mutex_unlock(&LOCK_logger);
-}
-
-void LOGGER::cleanup()
-{
-  (void) pthread_mutex_destroy(&LOCK_logger);
-}
-
-
 /*
   Log error with all enabled log event handlers
 
@@ -696,14 +662,13 @@
 
   init_error_log(error_log_printer);
 
-  if (slow_log_printer >= CSV ||
-      general_log_printer >= CSV)
+  if (slow_log_printer >= CSV || general_log_printer >= CSV)
   {
     if (!general_log_thd)
     {
       general_log_thd= new THD;
       /* logger thread always works with mysql database */
-      general_log_thd->db= my_strdup("mysql", MYF(0));;
+      general_log_thd->db= my_strdup("mysql", MYF(0));
       general_log_thd->db_length= 5;
     }
 

--- 1.502/sql/mysqld.cc	2005-12-12 11:46:06 +03:00
+++ 1.503/sql/mysqld.cc	2005-12-13 16:18:15 +03:00
@@ -329,7 +329,10 @@
 /* Global variables */
 
 bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
-bool opt_error_log= IF_WIN(1,0), opt_old_log_format, opt_both_log_formats;
+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;
@@ -2993,31 +2996,34 @@
     }
   }
 
-  if (opt_old_log_format || opt_both_log_formats ||
-      (have_csv_db != SHOW_OPTION_YES))
-  {
-    /* enable old-fashioned slow log */
-    if (opt_slow_log)
-      mysql_slow_log.open_slow_log(opt_slow_logname);
-
-
-    /* enable old-fashioned general log */
-    if (opt_log)
-      mysql_log.open_query_log(opt_logname);
+  /* open old-fashioned slow log */
+  if (opt_slow_log)
+    mysql_slow_log.open_slow_log(opt_slow_logname);
+
+  /* open old-fashioned general log */
+  if (opt_log)
+    mysql_log.open_query_log(opt_logname);
 
+#ifdef WITH_CSV_STORAGE_ENGINE
+  if (opt_old_log_format || (have_csv_db != SHOW_OPTION_YES))
+    logger.init(opt_error_log ? LEGACY:NONE,
+                opt_slow_log ? LEGACY:NONE,
+                opt_log ? LEGACY:NONE);
+  else
     if (opt_both_log_formats)
       logger.init(opt_error_log ? LEGACY:NONE,
                   opt_slow_log ? LEGACY_AND_CSV:NONE,
                   opt_log ? LEGACY_AND_CSV:NONE);
-    else /* if --old-log-format or no CSV compiled in */
+    else
+      /* the default is CSV log tables */
       logger.init(opt_error_log ? LEGACY:NONE,
-                  opt_slow_log ? LEGACY:NONE,
-                  opt_log ? LEGACY:NONE);
-  }
-  else
-    logger.init(opt_error_log ? LEGACY:NONE,
-                opt_slow_log ? CSV:NONE,
-                opt_log ? CSV:NONE);
+                  opt_slow_log ? CSV:NONE,
+                  opt_log ? CSV:NONE);
+#else
+  logger.init(opt_error_log ? LEGACY:NONE,
+              opt_slow_log ? LEGACY:NONE,
+              opt_log ? LEGACY:NONE);
+#endif
 
   if (opt_update_log)
   {
@@ -5046,6 +5052,7 @@
     "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,
@@ -5054,6 +5061,7 @@
    "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)",
@@ -6380,8 +6388,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;
@@ -6765,12 +6775,14 @@
   case (int) OPT_SLOW_QUERY_LOG:
     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;

--- 1.272/sql/sql_class.h	2005-12-06 23:57:11 +03:00
+++ 1.273/sql/sql_class.h	2005-12-13 16:18:16 +03:00
@@ -221,10 +221,15 @@
 
   LOGGER() : inited(0), is_log_tables_initialized(FALSE)
   {}
-  void lock();
-  void unlock();
-  void init_pthread_objects();
-  void cleanup();
+  void lock() { (void) pthread_mutex_lock(&LOCK_logger); }
+  void unlock() { (void) pthread_mutex_unlock(&LOCK_logger); }
+  void init_pthread_objects()
+  {
+    DBUG_ASSERT(inited == 0);
+    inited= 1;
+    (void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW);
+  }
+  void cleanup() { (void) pthread_mutex_destroy(&LOCK_logger); }
   bool error_log_print(enum loglevel level, const char *format,
                       va_list args);
   bool slow_log_print(THD *thd, const char *query, uint query_length,

--- 1.1/mysql-test/t/im_daemon_life_cycle.imtest	2005-10-01 01:14:38 +04:00
+++ 1.2/mysql-test/t/im_daemon_life_cycle.imtest	2005-12-13 16:18:15 +03:00
@@ -6,6 +6,13 @@
 #
 ###########################################################################
 
+# check that CSV engine was compiled in, as IM the test suite uses
+# logs tables-specific option and the option is not present if CSV
+# (and => the log tables) are not in.
+# NOTE: In future we should remove this check and make the test suite
+# to pass correct opyions to IM depending on the CSV presence
+--source include/have_csv.inc
+
 --source include/im_check_os.inc
 
 ###########################################################################

--- 1.2/mysql-test/t/im_life_cycle.imtest	2005-10-18 00:48:22 +04:00
+++ 1.3/mysql-test/t/im_life_cycle.imtest	2005-12-13 16:18:15 +03:00
@@ -6,6 +6,13 @@
 #
 ###########################################################################
 
+# check that CSV engine was compiled in, as IM the test suite uses
+# logs tables-specific option and the option is not present if CSV
+# (and => the log tables) are not in.
+# NOTE: In future we should remove this check and make the test suite
+# to pass correct opyions to IM depending on the CSV presence
+--source include/have_csv.inc
+
 --source include/im_check_os.inc
 
 ###########################################################################

--- 1.1/mysql-test/t/im_options_set.imtest	2005-10-01 01:14:39 +04:00
+++ 1.2/mysql-test/t/im_options_set.imtest	2005-12-13 16:18:15 +03:00
@@ -38,6 +38,13 @@
 
 ###########################################################################
 
+# check that CSV engine was compiled in, as IM the test suite uses
+# logs tables-specific option and the option is not present if CSV
+# (and => the log tables) are not in.
+# NOTE: In future we should remove this check and make the test suite
+# to pass correct opyions to IM depending on the CSV presence
+--source include/have_csv.inc
+
 --source include/im_check_os.inc
 
 ###########################################################################

--- 1.1/mysql-test/t/im_options_unset.imtest	2005-10-01 01:14:39 +04:00
+++ 1.2/mysql-test/t/im_options_unset.imtest	2005-12-13 16:18:15 +03:00
@@ -45,6 +45,13 @@
 
 ###########################################################################
 
+# check that CSV engine was compiled in, as IM the test suite uses
+# logs tables-specific option and the option is not present if CSV
+# (and => the log tables) are not in.
+# NOTE: In future we should remove this check and make the test suite
+# to pass correct opyions to IM depending on the CSV presence
+--source include/have_csv.inc
+
 --source include/im_check_os.inc
 
 ###########################################################################

--- 1.1/mysql-test/t/im_utils.imtest	2005-10-01 01:14:39 +04:00
+++ 1.2/mysql-test/t/im_utils.imtest	2005-12-13 16:18:15 +03:00
@@ -6,6 +6,13 @@
 #
 ###########################################################################
 
+# check that CSV engine was compiled in, as IM the test suite uses
+# logs tables-specific option and the option is not present if CSV
+# (and => the log tables) are not in.
+# NOTE: In future we should remove this check and make the test suite
+# to pass correct opyions to IM depending on the CSV presence
+--source include/have_csv.inc
+
 --source include/im_check_os.inc
 
 ###########################################################################

--- 1.7/mysql-test/t/csv.test	2005-12-06 15:50:36 +03:00
+++ 1.8/mysql-test/t/csv.test	2005-12-13 16:18:15 +03:00
@@ -2,7 +2,7 @@
 # Test for the CSV engine
 #
 
--- source include/have_csv.inc
+--source include/have_csv.inc
 
 #
 # Simple select test

--- 1.25/sql/examples/ha_tina.cc	2005-12-12 11:46:06 +03:00
+++ 1.26/sql/examples/ha_tina.cc	2005-12-13 16:18:15 +03:00
@@ -510,7 +510,7 @@
   tina->update_status();
 }
 
-/* this should exist and and return 0 for concurrent insert to work */
+/* this should exist and return 0 for concurrent insert to work */
 my_bool tina_check_status(void* param)
 {
   return 0;

--- 1.11/sql/examples/ha_tina.h	2005-12-12 11:46:06 +03:00
+++ 1.12/sql/examples/ha_tina.h	2005-12-13 16:18:15 +03:00
@@ -28,7 +28,7 @@
     Below flag is needed to make log tables work with concurrent insert.
     For more details see comment to ha_tina::update_status.
   */
-  uint is_log_table;
+  my_bool is_log_table;
   MY_STAT file_stat;                /* Stat information for the data file */
   File data_file;                   /* Current open data file */
   /*

--- 1.63/mysql-test/t/information_schema.test	2005-12-01 09:59:16 +03:00
+++ 1.64/mysql-test/t/information_schema.test	2005-12-13 16:18:15 +03:00
@@ -1,6 +1,10 @@
 # This test  uses grants, which can't get tested for embedded server
 -- source include/not_embedded.inc
 
+# check that CSV engine was compiled in, as the result of the test
+# depends on the presence of the log tables (which are CSV-based).
+--source include/have_csv.inc
+
 # Test for information_schema.schemata &
 # show databases
 

--- 1.1/mysql-test/t/mysqlcheck.test	2005-10-18 13:24:54 +04:00
+++ 1.2/mysql-test/t/mysqlcheck.test	2005-12-13 16:18:15 +03:00
@@ -1,6 +1,10 @@
 # Embedded server doesn't support external clients
 --source include/not_embedded.inc
 
+# check that CSV engine was compiled in, as the result of the test
+# depends on the presence of the log tables (which are CSV-based).
+--source include/have_csv.inc
+
 #
 # Bug #13783  mysqlcheck tries to optimize and analyze information_schema
 #

--- 1.58/mysql-test/t/show_check.test	2005-12-01 12:02:45 +03:00
+++ 1.59/mysql-test/t/show_check.test	2005-12-13 16:18:15 +03:00
@@ -2,6 +2,10 @@
 # embedded server testing
 -- source include/not_embedded.inc
 
+# check that CSV engine was compiled in, as the result of the test
+# depends on the presence of the log tables (which are CSV-based).
+--source include/have_csv.inc
+
 #
 # Test of some show commands
 #

--- 1.19/mysql-test/t/connect.test	2005-11-08 00:30:38 +03:00
+++ 1.20/mysql-test/t/connect.test	2005-12-13 16:18:15 +03:00
@@ -5,6 +5,10 @@
 # This test makes no sense with the embedded server
 --source include/not_embedded.inc
 
+# check that CSV engine was compiled in, as the test relies on the presence
+# of the log tables (which are CSV-based). By connect mysql; show tables;
+--source include/have_csv.inc
+
 --disable_warnings
 drop table if exists t1,t2;
 --enable_warnings

--- 1.5/mysql-test/t/log_tables.test	2005-12-12 11:46:06 +03:00
+++ 1.6/mysql-test/t/log_tables.test	2005-12-13 16:18:15 +03:00
@@ -3,7 +3,7 @@
 #
 
 # check that CSV engine was compiled in
--- source include/have_csv.inc
+--source include/have_csv.inc
 
 use mysql;
 

--- 1.8/mysql-test/t/system_mysql_db.test	2005-09-15 23:17:37 +04:00
+++ 1.9/mysql-test/t/system_mysql_db.test	2005-12-13 16:18:15 +03:00
@@ -2,6 +2,10 @@
 # This test must examine integrity of system database "mysql"
 #
 
+# check that CSV engine was compiled in, as the result of the test
+# depends on the presence of the log tables (which are CSV-based).
+--source include/have_csv.inc
+
 # First delete some tables maybe left over from previous tests
 --disable_warnings
 drop table if exists t1,t1aa,t2aa;

--- 1.20/mysql-test/t/system_mysql_db_fix.test	2005-11-15 13:52:25 +03:00
+++ 1.21/mysql-test/t/system_mysql_db_fix.test	2005-12-13 16:18:15 +03:00
@@ -1,6 +1,10 @@
 # Embedded server doesn't support external clients
 --source include/not_embedded.inc
 
+# check that CSV engine was compiled in, as the test relies on the presence
+# of the log tables (which are CSV-based)
+--source include/have_csv.inc
+
 #
 # This is the test for mysql_fix_privilege_tables
 #
Thread
bk commit into 5.1 tree (petr:1.1963)Petr Chardin13 Dec