Commit dc46db58 authored by unknown's avatar unknown

Aesthetic changes only.


client/mysql.cc:
  Cleaned up some of the struct formatting.
  Fixed up the usage information.
  Changed the "current database" to "*** NONE ***" if there is no db.
  It used to be "*** NO ONE ***" which only makes sense to Finns. :)
myisam/myisampack.c:
  Fixed the License header.
  Monty verified in Monterey that myisampack's info was wrong.
  Fixed the Usage/Copyright info header.  myisampack *is* free now.
  Fixed up the Usage info to real english.
parent f6e57cb4
...@@ -159,45 +159,45 @@ typedef struct { ...@@ -159,45 +159,45 @@ typedef struct {
} COMMANDS; } COMMANDS;
static COMMANDS commands[] = { static COMMANDS commands[] = {
{ "help", 'h',com_help, 0,"Display this text" }, { "help", 'h', com_help, 0, "Display this text" },
{ "?", 'h',com_help, 0,"Synonym for `help'" }, { "?", 'h', com_help, 0, "Synonym for `help'" },
{ "clear",'c',com_clear,0,"Clear command"}, { "clear", 'c', com_clear, 0, "Clear command"},
{ "connect",'r',com_connect,1, { "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host" }, "Reconnect to the server. Optional arguments are db and host" },
{ "edit", 'e',com_edit, 0,"Edit command with $EDITOR"}, { "edit", 'e', com_edit, 0, "Edit command with $EDITOR"},
{ "exit", 'q', com_quit, 0,"Exit mysql. Same as quit"}, { "exit", 'q', com_quit, 0, "Exit mysql. Same as quit"},
{ "go", 'g',com_go, 0,"Send command to mysql server" }, { "go", 'g', com_go, 0, "Send command to mysql server" },
{ "ego", 'G',com_ego, 0, { "ego", 'G', com_ego, 0,
"Send command to mysql server; Display result vertically"}, "Send command to mysql server; Display result vertically"},
{ "print",'p',com_print,0,"Print current command" }, { "print", 'p', com_print, 0, "Print current command" },
{ "quit", 'q',com_quit, 0,"Quit mysql" }, { "quit", 'q', com_quit, 0, "Quit mysql" },
{ "rehash", '#', com_rehash, 0, "Rebuild completion hash" }, { "rehash", '#', com_rehash, 0, "Rebuild completion hash" },
{ "source", '.', com_source, 1, { "source", '.', com_source, 1,
"Execute a SQL script file. Takes a file name as an argument"}, "Execute a SQL script file. Takes a file name as an argument"},
{ "status", 's', com_status, 0, "Get status information from the server"},
{ "status",'s',com_status,0,"Get status information from the server"}, { "use", 'u', com_use, 1,
{ "use",'u',com_use,1,
"Use another database. Takes database name as argument" }, "Use another database. Takes database name as argument" },
{ "create table",0,0,0,""}, /* Get bash expansion for some commmands */ /* Get bash-like expansion for some commmands */
{ "create database",0,0,0,""}, { "create table", 0, 0, 0, ""},
{ "drop",0,0,0,""}, { "create database", 0, 0, 0, ""},
{ "select",0,0,0,""}, { "drop", 0, 0, 0, ""},
{ "insert",0,0,0,""}, { "select", 0, 0, 0, ""},
{ "replace",0,0,0,""}, { "insert", 0, 0, 0, ""},
{ "update",0,0,0,""}, { "replace", 0, 0, 0, ""},
{ "delete",0,0,0,""}, { "update", 0, 0, 0, ""},
{ "explain",0,0,0,""}, { "delete", 0, 0, 0, ""},
{ "show databases",0,0,0,""}, { "explain", 0, 0, 0, ""},
{ "show fields from",0,0,0,""}, { "show databases", 0, 0, 0, ""},
{ "show keys from",0,0,0,""}, { "show fields from", 0, 0, 0, ""},
{ "show tables",0,0,0,""}, { "show keys from", 0, 0, 0, ""},
{ "load data from",0,0,0,""}, { "show tables", 0, 0, 0, ""},
{ "alter table",0,0,0,""}, { "load data from", 0, 0, 0, ""},
{ "set option",0,0,0,""}, { "alter table", 0, 0, 0, ""},
{ "lock tables",0,0,0,""}, { "set option", 0, 0, 0, ""},
{ "unlock tables",0,0,0,""}, { "lock tables", 0, 0, 0, ""},
{ (char *)NULL, 0,0,0,""}, { "unlock tables", 0, 0, 0, ""},
{ (char *)NULL, 0, 0, 0, ""}
}; };
static const char *load_default_groups[]= { "mysql","client",0 }; static const char *load_default_groups[]= { "mysql","client",0 };
...@@ -409,36 +409,36 @@ static void usage(int version) ...@@ -409,36 +409,36 @@ static void usage(int version)
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n"); puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
printf("Usage: %s [OPTIONS] [database]\n", my_progname); printf("Usage: %s [OPTIONS] [database]\n", my_progname);
printf("\n\ printf("\n\
-?, --help Display this help and exit\n\ -?, --help Display this help and exit.\n\
-A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to\n\ -A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to\n\
get table and field completion. This gives a quicker\n\ get table and field completion. This gives a quicker\n\
start of mysql and disables rehashing on reconnect.\n\ start of mysql and disables rehashing on reconnect.\n\
-B, --batch Print results with a tab as separator, each row on\n\ -B, --batch Print results with a tab as separator, each row on\n\
a new line. Doesn't use history file\n\ a new line. Doesn't use history file.\n\
--character-sets-dir=...\n\ --character-sets-dir=...\n\
Directory where character sets are\n\ Directory where character sets are located.\n\
-C, --compress Use compression in server/client protocol\n"); -C, --compress Use compression in server/client protocol.\n");
#ifndef DBUG_OFF #ifndef DBUG_OFF
printf("\ printf("\
-#, --debug[=...] Debug log. Default is '%s'\n",default_dbug_option); -#, --debug[=...] Debug log. Default is '%s'.\n",default_dbug_option);
#endif #endif
printf("\ printf("\
-D, --database=.. Database to use\n\ -D, --database=.. Database to use.\n\
--default-character-set=...\n\ --default-character-set=...\n\
Set the default character set\n\ Set the default character set.\n\
-e, --execute=... Execute command and quit.(Output like with --batch)\n\ -e, --execute=... Execute command and quit. (Output like with --batch)\n\
-E, --vertical Print the output of a query (rows) vertically\n\ -E, --vertical Print the output of a query (rows) vertically.\n\
-f, --force Continue even if we get an sql error.\n\ -f, --force Continue even if we get an sql error.\n\
-g, --no-named-commands\n\ -g, --no-named-commands\n\
Named commands are disabled. Use \\* form only\n\ Named commands are disabled. Use \\* form only.\n\
-i, --ignore-space Ignore space after function names\n\ -i, --ignore-space Ignore space after function names.\n\
-h, --host=... Connect to host\n\ -h, --host=... Connect to host.\n\
-H, --html Produce HTML output\n\ -H, --html Produce HTML output.\n\
-L, --skip-line-numbers Don't write line number for errors\n\ -L, --skip-line-numbers Don't write line number for errors.\n\
-n, --unbuffered Flush buffer after each query\n\ -n, --unbuffered Flush buffer after each query.\n\
-N, --skip-column-names Don't write column names in results\n\ -N, --skip-column-names Don't write column names in results.\n\
-O, --set-variable var=option\n\ -O, --set-variable var=option\n\
Give a variable an value. --help lists variables\n\ Give a variable an value. --help lists variables.\n\
-o, --one-database Only update the default database. This is useful\n\ -o, --one-database Only update the default database. This is useful\n\
for skipping updates to other database in the update\n\ for skipping updates to other database in the update\n\
log.\n\ log.\n\
...@@ -449,27 +449,27 @@ static void usage(int version) ...@@ -449,27 +449,27 @@ static void usage(int version)
puts(" -W, --pipe Use named pipes to connect to server"); puts(" -W, --pipe Use named pipes to connect to server");
#endif #endif
printf("\n\ printf("\n\
-P --port=... Port number to use for connection\n\ -P --port=... Port number to use for connection.\n\
-q, --quick Don't cache result, print it row by row. This may\n\ -q, --quick Don't cache result, print it row by row. This may\n\
slow down the server if the output is suspended.\n\ slow down the server if the output is suspended.\n\
Doesn't use history file\n\ Doesn't use history file.\n\
-r, --raw Write fields without conversion. Used with --batch\n\ -r, --raw Write fields without conversion. Used with --batch\n\
-s, --silent Be more silent.\n\ -s, --silent Be more silent.\n\
-S --socket=... Socket file to use for connection\n"); -S --socket=... Socket file to use for connection.\n");
#include "sslopt-usage.h" #include "sslopt-usage.h"
printf("\ printf("\
-t --table Output in table format\n\ -t --table Output in table format.\n\
-T, --debug-info Print some debug info at exit\n"); -T, --debug-info Print some debug info at exit.\n");
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
printf("\ printf("\
-u, --user=# User for login if not current user\n"); -u, --user=# User for login if not current user.\n");
#endif #endif
printf("\ printf("\
-U, --safe-updates[=#], --i-am-a-dummy[=#]\n\ -U, --safe-updates[=#], --i-am-a-dummy[=#]\n\
Only allow UPDATE and DELETE that uses keys\n\ Only allow UPDATE and DELETE that uses keys.\n\
-v, --verbose Write more (-v -v -v gives the table output format)\n\ -v, --verbose Write more. (-v -v -v gives the table output format)\n\
-V, --version Output version information and exit\n\ -V, --version Output version information and exit.\n\
-w, --wait Wait and retry if connection is down\n"); -w, --wait Wait and retry if connection is down.\n");
print_defaults("my",load_default_groups); print_defaults("my",load_default_groups);
printf("\nPossible variables for option --set-variable (-O) are:\n"); printf("\nPossible variables for option --set-variable (-O) are:\n");
...@@ -1618,7 +1618,7 @@ com_connect(String *buffer, char *line) ...@@ -1618,7 +1618,7 @@ com_connect(String *buffer, char *line)
strnmov(buff,line,sizeof(buff)-1); // Don't destroy history strnmov(buff,line,sizeof(buff)-1); // Don't destroy history
if (buff[0] == '\\') // Short command if (buff[0] == '\\') // Short command
buff[1]=' '; buff[1]=' ';
tmp=(char *) strtok(buff," \t"); // Skipp connect command tmp=(char *) strtok(buff," \t"); // Skip connect command
if (tmp && (tmp=(char *) strtok(NullS," \t;"))) if (tmp && (tmp=(char *) strtok(NullS," \t;")))
{ {
my_free(current_db,MYF(MY_ALLOW_ZERO_PTR)); my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
...@@ -1643,7 +1643,7 @@ com_connect(String *buffer, char *line) ...@@ -1643,7 +1643,7 @@ com_connect(String *buffer, char *line)
sprintf(buff,"Connection id: %ld",mysql_thread_id(&mysql)); sprintf(buff,"Connection id: %ld",mysql_thread_id(&mysql));
put_info(buff,INFO_INFO); put_info(buff,INFO_INFO);
sprintf(buff,"Current database: %s\n", sprintf(buff,"Current database: %s\n",
current_db ? current_db : "*** NO ONE ***"); current_db ? current_db : "*** NONE ***");
put_info(buff,INFO_INFO); put_info(buff,INFO_INFO);
} }
return error; return error;
......
/* Copyright (C) 1999 Monty Program KB /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software is distributed with NO WARRANTY OF ANY KIND. No author or This program is free software; you can redistribute it and/or modify
distributor accepts any responsibility for the consequences of using it, or it under the terms of the GNU General Public License as published by
for whether it serves any particular purpose or works at all, unless he or the Free Software Foundation; either version 2 of the License, or
she says so in writing. Refer to the Free Public License (the "License") (at your option) any later version.
for full details.
Every copy of this file must include a copy of the License, normally in a This program is distributed in the hope that it will be useful,
plain ASCII text file named PUBLIC. The License grants you the right to but WITHOUT ANY WARRANTY; without even the implied warranty of
copy, modify and redistribute this file, but only under certain conditions MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
described in the License. Among other things, the License requires that GNU General Public License for more details.
the copyright notice and this notice be preserved on all copies. */
You should have received a copy of the GNU General Public License
/* Pack isam file*/ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Pack MyISAM file */
#ifndef USE_MY_FUNC #ifndef USE_MY_FUNC
#define USE_MY_FUNC /* We nead at least my_malloc */ #define USE_MY_FUNC /* We need at least my_malloc */
#endif #endif
#include "myisamdef.h" #include "myisamdef.h"
...@@ -25,7 +28,7 @@ ...@@ -25,7 +28,7 @@
#include <io.h> #include <io.h>
#endif #endif
#ifndef __GNU_LIBRARY__ #ifndef __GNU_LIBRARY__
#define __GNU_LIBRARY__ /* Skipp warnings in getopt.h */ #define __GNU_LIBRARY__ /* Skip warnings in getopt.h */
#endif #endif
#include <getopt.h> #include <getopt.h>
...@@ -252,29 +255,31 @@ static void print_version(void) ...@@ -252,29 +255,31 @@ static void print_version(void)
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
puts("Copyright (C) 1999-2000 Monty Program KB."); puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
puts("This is not free software. You must have a licence to use this program"); puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("This software comes with ABSOLUTELY NO WARRANTY\n"); puts("and you are welcome to modify and redistribute it under the GPL license\n");
puts("Pack a MyISAM-table to take much smaller space");
puts("Keys are not updated, one must run myisamchk -rq on datafile afterwards"); puts("Pack a MyISAM-table to take much less space.");
puts("You should give the .MSI file as the filename argument"); puts("Keys are not updated, you must run myisamchk -rq on the datafile");
puts("afterwards to update the keys.");
puts("You should give the .MSI file as the filename argument.");
printf("\nUsage: %s [OPTIONS] filename...\n", my_progname); printf("\nUsage: %s [OPTIONS] filename...\n", my_progname);
puts("\n\ puts("\n\
-b, --backup Make a backup of the table as table_name.OLD\n\ -b, --backup Make a backup of the table as table_name.OLD\n\
-f, --force Force packing of table even if it's gets bigger or\n\ -f, --force Force packing of table even if it gets bigger or if\n\
tempfile exists.\n\ tempfile exists.\n\
-j, --join='new_table_name'\n\ -j, --join='new_table_name'\n\
Join all given tables into 'new_table_name'.\n\ Join all given tables into 'new_table_name'.\n\
All tables MUST have the identical layout.\n\ All tables MUST have identical layouts.\n\
-s, --silent Be more silent.\n\ -s, --silent Be more silent.\n\
-t, --test Don't pack table, only test packing it\n\ -t, --test Don't pack table, only test packing it.\n\
-v, --verbose Write info about progress and packing result\n\ -v, --verbose Write info about progress and packing result.\n\
-w, --wait Wait and retry if table is in use\n\ -w, --wait Wait and retry if table is in use.\n\
-T, --tmpdir=# Use temporary directory to store temporary table\n\ -T, --tmpdir=... Use temporary directory to store temporary table.\n\
-#, --debug=... output debug log. Often this is 'd:t:o,filename`\n\ -#, --debug=... Output debug log. Often this is 'd:t:o,filename`\n\
-?, --help display this help and exit\n\ -?, --help Display this help and exit.\n\
-V, --version output version information and exit"); -V, --version Output version information and exit.");
print_defaults("my",load_default_groups); print_defaults("my",load_default_groups);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment