List:Internals« Previous MessageNext Message »
From:sergeyv Date:August 24 2005 3:58pm
Subject:bk commit into 5.0 tree (SergeyV:1.1920)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of sergeyv. When sergeyv 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.1920 05/08/24 17:58:33 SergeyV@selena. +1 -0
  Merge selena.:H:/MYSQL/bkt/mysql-5.0
  into  selena.:H:/MYSQL/src/mysql-5.0-dev3

  sql/mysqld.cc
    1.486 05/08/24 17:58:22 SergeyV@selena. +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:	SergeyV
# Host:	selena.
# Root:	H:/MYSQL/src/mysql-5.0-dev3/RESYNC

--- 1.485/sql/mysqld.cc	2005-08-22 17:05:53 +04:00
+++ 1.486/sql/mysqld.cc	2005-08-24 17:58:22 +04:00
@@ -586,6 +586,8 @@
 static void start_signal_handler(void);
 static pthread_handler_decl(signal_hand, arg);
 static void mysql_init_variables(void);
+static void check_help(int argc, char **argv);
+static void usage();
 static void get_options(int argc,char **argv);
 static void set_server_version(void);
 static int init_thread_environment();
@@ -2553,8 +2555,12 @@
   strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
   strmov(fn_ext(pidfile_name),".pid");		// Add proper extension
 
-  load_defaults(conf_file_name, groups, &argc, &argv);
-  defaults_argv=argv;
+  check_help(argc, argv);
+  if (!opt_help)
+  {
+    load_defaults(conf_file_name, groups, &argc, &argv);
+    defaults_argv=argv;
+  }
   get_options(argc,argv);
   set_server_version();
 
@@ -3473,6 +3479,8 @@
   /* Must be initialized early for comparison of service name */
   system_charset_info= &my_charset_utf8_general_ci;
 
+  check_help(argc, argv);
+
   if (Service.GetOS())	/* true NT family */
   {
     char file_path[FN_REFLEN];
@@ -6777,6 +6785,42 @@
   }
   return 0;
 }
+
+
+/* Overrides default help option processing */
+static void check_help(int argc, char **argv)
+{
+  static int checked= 0;
+  int i, hpos= 0, vpos= 0, err= 0;
+
+  if (checked)
+    return;
+
+  checked= 1;
+
+  for (i= 1; i < argc; i++)
+  {
+    if (!strcmp(argv[i], "--help"))
+      opt_help= (hpos= i) > 0;
+    if (!strcmp(argv[i], "-?"))
+      opt_help= (hpos= i) > 0;
+    if (!strcmp(argv[i], "--verbose"))
+      opt_verbose= (vpos= i) > 0;
+  }
+
+  err= err || (hpos > 2);
+  err= err || (vpos > 2);
+  err= err || ((hpos == 2) && (vpos != 1));
+  err= err || ((vpos == 2) && (hpos != 1));
+  err= err || ((vpos == 1) && (hpos != 2));
+
+  if (err)
+  {
+    puts("ERROR: --help and --verbose options should be the first in the list of
arguments");
+    exit(1);
+  }
+}
+
 	/* Initiates DEBUG - but no debugging here ! */
 
 static gptr *
@@ -6827,8 +6871,14 @@
   my_getopt_error_reporter= option_error_reporter;
   if ((ho_error= handle_options(&argc, &argv, my_long_options,
                                 get_one_option)))
+  {
+    if (opt_help)
+    {
+      usage();
+      exit(0);
+    }
     exit(ho_error);
-
+  }
 #ifndef HAVE_NDBCLUSTER_DB
   if (opt_ndbcluster)
     sql_print_warning("this binary does not contain NDBCLUSTER storage engine");
Thread
bk commit into 5.0 tree (SergeyV:1.1920)sergeyv24 Aug