mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
09a53f28a7
Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map() BUILD/compile-solaris-sparc-forte: Updated script to current Solaris installations Now we compile by default for 64 bits client/mysql.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) client/mysql_upgrade.c: Fixed compiler warning (on Forte) client/mysqladmin.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) client/mysqlcheck.c: Fixed compiler warning (on Forte) client/mysqldump.c: Fixed compiler warning (on Forte) client/mysqlslap.c: Fixed compiler warning (on Forte) client/mysqltest.c: Fixed compiler warning (on Forte) client/sql_string.cc: Avoid compiler warnings when using C function pointers in C++ configure.in: Added detection of mtmalloc and ieeefp.h extra/replace.c: Fixed compiler warning (on Forte) include/m_ctype.h: Added some typedef's to make it easy to use C function pointers in C++ include/my_sys.h: Added my_file_total_opened (counter for calls to my_open()) include/myisam.h: Fixed compiler warning (on Forte) libmysql/libmysql.c: Fixed compiler warning (on Forte) by adding casts and change types libmysql/manager.c: Fixed compiler warning (on Forte) by adding casts and change types mysql-test/r/ctype_cp932_binlog_stm.result: Updated positions (Needed because we didn't before correctly restore collation_database after running stored procedure mysys/my_fopen.c: Count number of opened files mysys/my_open.c: Count number of opened files mysys/my_static.c: Count number of opened files mysys/thr_alarm.c: Optimization to do less alarm() and pthread_sigmask() calls. Idea is to remember time for next pending alarm and not reschedule a new alarm if it's after the current one. Before we only did this if there was other pending alarms. We don't have to use pthread_sigmask() in case of 'USE_ONE_SIGNAL_HAND' as the alarm() signal will be blocked for the calling thread anyway and no other thread will have the alarm() signal enabled to call process_alarm() regex/regcomp.c: Fixed compiler warning (on Forte) by adding casts and change types scripts/mysql_install_db.sh: Added option --source-install to allow one to create a mysql database from the source tree without installing MySQL Don't give (unnecessary) warnings server-tools/instance-manager/angel.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) server-tools/instance-manager/thread_registry.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/event_db_repository.cc: index_read() -> index_read_map() sql/event_queue.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/field.cc: Fixed compiler warnings about hidden fields sql/ha_partition.cc: Fixed compiler warnings about hidden fields index_read() -> index_read_map() sql/ha_partition.h: index_read() -> index_read_map() sql/handler.cc: Added PAGE option to row types (to prepare for future) index_read() -> index_read_map() sql/handler.h: Added ROW_TYPE_PAGE (for future) Added flag to signal if table was to be created transactionally I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map() sql/item.cc: Fixed indentation Renamed local variable to avoid hiding class variable sql/item_cmpfunc.cc: Renamed local variable to avoid hiding class variable sql/item_cmpfunc.h: Removed not used variable sql/item_func.cc: Renamed local variable to avoid hiding class variable sql/item_strfunc.cc: Moved functions from Item_strfunc.cc sql/item_strfunc.h: Move functions to item_strfunc.cc Use C function pointer type to avoid compiler warnings (with Forte) sql/item_subselect.cc: index_read() -> index_read_map() sql/item_xmlfunc.cc: Renamed local variable to avoid hiding class variable Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/key.cc: Fixed indentation sql/log.cc: Renamed local variable to avoid hiding class variable sql/log_event.cc: Removed call to my_time() when creating class instance of Log_event() as this may have static instances. (One can't call my_time() before my_init()) index_read() -> index_read_map() Renamed local variable to avoid hiding class variable sql/log_event_old.cc: Renamed local variable to avoid hiding class variable sql/mysql_priv.h: Made all create_backup_ctx() declarations identical. This lifted up a bug where wrong create_backup_ctx() was called in some cases. Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/mysqld.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) Fixed indentation Don't call end_thr_alarm() when calling unireg_abort() as unireg_abort() already calls end_thr_alarm() Added variable 'Opened_files' (number of calls to my_open() or my_fopen()) Don't print 'loose' warnings when using --bootstrap (to avoid warnings when running mysql_install_db) Fixed compiler warnings sql/opt_range.cc: index_read() -> index_read_map() sql/opt_sum.cc: index_read() -> index_read_map() sql/partition_info.cc: Renamed local variable to avoid hiding class variable sql/rpl_filter.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/set_var.cc: Renamed local variable to avoid hiding class variable Added 'process_key_cache_t' type to avoid compiler warning (on Forte) sql/set_var.h: Added 'process_key_cache_t' type to avoid compiler warning (on Forte) sql/sp.cc: More debugging index_read() -> index_read_map() sql/sp_cache.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/sp_head.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) Moved 'saved_creation_ctx' higher up to be able to free objects allocated by create_backup_ctx() sql/sql_acl.cc: index_read() -> index_read_map() sql/sql_class.cc: Renamed local variable to avoid hiding class variable Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/sql_class.h: Renamed local variable to avoid hiding class variable sql/sql_db.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) sql/sql_delete.cc: Renamed local variable to avoid hiding class variable sql/sql_handler.cc: index_read() -> index_read_map() sql/sql_help.cc: index_read() -> index_read_map() sql/sql_insert.cc: index_read() -> index_read_map() Renamed local variable to avoid hiding class variable sql/sql_lex.cc: Renamed local variable to avoid hiding class variable sql/sql_plugin.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) index_read() -> index_read_map() Don't give warnings about not used plugins if we are using --warnings=0 sql/sql_select.cc: index_read() -> index_read_map() sql-common/client.c: Fixed compiler warning (on Forte) sql-common/my_time.c: Removed never accessed code Fixed compiler warning (on Forte) sql/sql_servers.cc: index_read() -> index_read_map() sql/sql_show.cc: Added TRANSACTIONAL to SHOW CREATE Fixed ROW_TYPE_PAGE sql/sql_string.cc: Avoid compiler warnings when using C function pointers in C++ sql/sql_table.cc: Set create_info->transactional if we used TRANSACTIONAL=1 sql/sql_udf.cc: index_read() -> index_read_map() sql/sql_yacc.yy: Added TRANSACTIONAL=0|1 to CREATE (for future) Added row type PAGE (was only partionally handled before) sql/strfunc.cc: Avoid compiler warnings when using C function pointers in C++ sql/table.cc: More DBUG statements Declare all create_backup_ctx() functions identically Remember if table was created with TRANSACTIONAL flag or not (future safe) Renamed local variable to avoid hiding class variable sql/table.h: Remember if table was created with TRANSACTIONAL=1 sql/tztime.cc: index_read() -> index_read_map() sql-common/pack.c: Fixed compiler warning (on Forte) storage/archive/archive_reader.c: Fixed compiler warning (on Forte) storage/archive/azio.c: Fixed compiler warning (on Forte) storage/blackhole/ha_blackhole.cc: index_read() -> index_read_map() storage/blackhole/ha_blackhole.h: index_read() -> index_read_map() storage/csv/ha_tina.cc: Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte) storage/example/ha_example.cc: index_read() -> index_read_map() storage/example/ha_example.h: index_read() -> index_read_map() storage/heap/ha_heap.cc: index_read() -> index_read_map() storage/heap/ha_heap.h: index_read() -> index_read_map() storage/heap/hp_test1.c: Fixed compiler warning (on Forte) storage/heap/hp_test2.c: Fixed compiler warning (on Forte) storage/myisam/ft_boolean_search.c: Fixed compiler warning (on Forte) storage/myisam/ft_nlq_search.c: Fixed compiler warning (on Forte) storage/myisam/ft_parser.c: Fixed compiler warning (on Forte) storage/myisam/ft_stopwords.c: Fixed compiler warning (on Forte) storage/myisam/ha_myisam.cc: index_read() -> index_read_map() storage/myisam/ha_myisam.h: index_read() -> index_read_map() storage/myisam/mi_check.c: Fixed compiler warning (on Forte) storage/myisam/mi_delete.c: Fixed compiler warning (on Forte) storage/myisam/mi_dynrec.c: Fixed compiler warning (on Forte) storage/myisam/mi_extra.c: Fixed compiler warning (on Forte) storage/myisam/mi_key.c: Fixed compiler warning (on Forte) storage/myisam/mi_keycache.c: Fixed compiler warning (on Forte) storage/myisam/mi_locking.c: Fixed compiler warning (on Forte) storage/myisam/mi_log.c: Fixed compiler warning (on Forte) storage/myisam/mi_open.c: Fixed compiler warning (on Forte) storage/myisam/mi_packrec.c: Fixed compiler warning (on Forte) storage/myisam/mi_page.c: Fixed compiler warning (on Forte) storage/myisam/mi_rkey.c: Added comment storage/myisam/mi_search.c: Fixed compiler warning (on Forte) storage/myisam/mi_statrec.c: Fixed compiler warning (on Forte) storage/myisam/mi_test1.c: Fixed compiler warning (on Forte) storage/myisam/mi_test2.c: Fixed compiler warning (on Forte) storage/myisam/mi_test3.c: Fixed compiler warning (on Forte) storage/myisam/mi_update.c: Fixed compiler warning (on Forte) storage/myisam/mi_write.c: Fixed compiler warning (on Forte) storage/myisam/myisamdef.h: Fixed that file_read/file_write returns type size_t Changed some functions to use uchar * as argument/return value instead of char* This fixed some compiler warnings on Forte storage/myisam/myisamlog.c: Fixed compiler warning (on Forte) storage/myisam/myisampack.c: Fixed compiler warning (on Forte) storage/myisam/rt_test.c: Fixed compiler warning (on Forte) storage/myisam/sort.c: Fixed compiler warning (on Forte) by adding casts or changing variables to uchar* storage/myisam/sp_test.c: Fixed compiler warning (on Forte) by adding casts or changing variables to uchar* storage/myisammrg/ha_myisammrg.cc: index_read() -> index_read_map() storage/myisammrg/ha_myisammrg.h: index_read() -> index_read_map() storage/myisammrg/myrg_create.c: Fixed compiler warning (on Forte) by adding casts or changing variable types storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Tdummy -> align (as in other part of cluster code) storage/ndb/src/kernel/vm/DynArr256.cpp: Removed not used variable storage/ndb/src/ndbapi/Ndb.cpp: Removed not used variable strings/strtod.c: Include ieeefp.h to avoid compiler warning tests/bug25714.c: Fixed compiler warning tests/mysql_client_test.c: Remove not used variable Fixed indentation Removed never reached code Fixed compiler warning (on Forte) by adding casts or changing variable types vio/viosocket.c: Fixed compiler warning (on Forte) by adding casts or changing variable types
819 lines
25 KiB
C
819 lines
25 KiB
C
/* Copyright (C) 2000 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
|
|
|
|
#define CHECK_VERSION "2.5.0"
|
|
|
|
#include "client_priv.h"
|
|
#include <m_ctype.h>
|
|
#include <mysql_version.h>
|
|
#include <mysqld_error.h>
|
|
#include <sslopt-vars.h>
|
|
|
|
/* Exit codes */
|
|
|
|
#define EX_USAGE 1
|
|
#define EX_MYSQLERR 2
|
|
|
|
static MYSQL mysql_connection, *sock = 0;
|
|
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
|
|
opt_compress = 0, opt_databases = 0, opt_fast = 0,
|
|
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
|
|
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
|
|
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
|
|
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
|
|
opt_write_binlog= 1;
|
|
static uint verbose = 0, opt_mysql_port=0;
|
|
static int my_end_arg;
|
|
static char * opt_mysql_unix_port = 0;
|
|
static char *opt_password = 0, *current_user = 0,
|
|
*default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
|
|
*current_host = 0;
|
|
static int first_error = 0;
|
|
DYNAMIC_ARRAY tables4repair;
|
|
#ifdef HAVE_SMEM
|
|
static char *shared_memory_base_name=0;
|
|
#endif
|
|
static uint opt_protocol=0;
|
|
static CHARSET_INFO *charset_info= &my_charset_latin1;
|
|
|
|
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
|
|
|
|
static struct my_option my_long_options[] =
|
|
{
|
|
{"all-databases", 'A',
|
|
"Check all the databases. This will be same as --databases with all databases selected.",
|
|
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
|
0, 0},
|
|
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
|
|
0, 0, 0, 0},
|
|
{"all-in-1", '1',
|
|
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
|
|
(uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
|
0, 0, 0},
|
|
#ifdef __NETWARE__
|
|
{"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
|
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
#endif
|
|
{"auto-repair", OPT_AUTO_REPAIR,
|
|
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
|
|
(uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
|
|
0, 0, 0, 0, 0},
|
|
{"character-sets-dir", OPT_CHARSETS_DIR,
|
|
"Directory where character sets are.", (uchar**) &charsets_dir,
|
|
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
|
|
0, 0, 0, 0},
|
|
{"check-only-changed", 'C',
|
|
"Check only tables that have changed since last check or haven't been closed properly.",
|
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"check-upgrade", 'g',
|
|
"Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
|
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
|
|
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
|
0, 0, 0},
|
|
{"databases", 'B',
|
|
"To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
|
|
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
|
|
0, 0, 0, 0, 0, 0},
|
|
#ifdef DBUG_OFF
|
|
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
|
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
|
#else
|
|
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
|
#endif
|
|
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
|
|
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
|
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
|
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
|
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"default-character-set", OPT_DEFAULT_CHARSET,
|
|
"Set the default character set.", (uchar**) &default_charset,
|
|
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"fast",'F', "Check only tables that haven't been closed properly.",
|
|
(uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
|
0},
|
|
{"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
|
|
(uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
|
|
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
|
|
(uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
|
|
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"force", 'f', "Continue even if we get an sql-error.",
|
|
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
|
0, 0, 0, 0},
|
|
{"extended", 'e',
|
|
"If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
|
|
(uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
|
0, 0, 0},
|
|
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
|
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"host",'h', "Connect to host.", (uchar**) ¤t_host,
|
|
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"medium-check", 'm',
|
|
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
|
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"write-binlog", OPT_WRITE_BINLOG,
|
|
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
|
|
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
|
1, 0, 0, 0, 0, 0},
|
|
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
|
|
0, 0},
|
|
{"password", 'p',
|
|
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
|
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
|
#ifdef __WIN__
|
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
#endif
|
|
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
|
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
|
0},
|
|
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"quick", 'q',
|
|
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
|
|
(uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
|
0},
|
|
{"repair", 'r',
|
|
"Can fix almost anything except unique keys that aren't unique.",
|
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
#ifdef HAVE_SMEM
|
|
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
|
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
|
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
#endif
|
|
{"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
|
|
(uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"socket", 'S', "Socket file to use for connection.",
|
|
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
|
|
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
#include <sslopt-longopts.h>
|
|
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
|
|
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"use-frm", OPT_FRM,
|
|
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
|
|
(uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
|
0},
|
|
#ifndef DONT_ALLOW_USER_CHANGE
|
|
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
|
(uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
#endif
|
|
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
|
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
|
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
|
};
|
|
|
|
static const char *load_default_groups[] = { "mysqlcheck", "client", 0 };
|
|
|
|
|
|
static void print_version(void);
|
|
static void usage(void);
|
|
static int get_options(int *argc, char ***argv);
|
|
static int process_all_databases();
|
|
static int process_databases(char **db_names);
|
|
static int process_selected_tables(char *db, char **table_names, int tables);
|
|
static int process_all_tables_in_db(char *database);
|
|
static int process_one_db(char *database);
|
|
static int use_db(char *database);
|
|
static int handle_request_for_tables(char *tables, uint length);
|
|
static int dbConnect(char *host, char *user,char *passwd);
|
|
static void dbDisconnect(char *host);
|
|
static void DBerror(MYSQL *mysql, const char *when);
|
|
static void safe_exit(int error);
|
|
static void print_result();
|
|
static char *fix_table_name(char *dest, char *src);
|
|
int what_to_do = 0;
|
|
|
|
#include <help_start.h>
|
|
|
|
static void print_version(void)
|
|
{
|
|
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
|
|
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
|
|
NETWARE_SET_SCREEN_MODE(1);
|
|
} /* print_version */
|
|
|
|
|
|
static void usage(void)
|
|
{
|
|
print_version();
|
|
puts("By Jani Tolonen, 2001-04-20, MySQL Development Team\n");
|
|
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
|
|
puts("and you are welcome to modify and redistribute it under the GPL license.\n");
|
|
puts("This program can be used to CHECK (-c,-m,-C), REPAIR (-r), ANALYZE (-a)");
|
|
puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
|
|
puts("used at the same time. Not all options are supported by all storage engines.");
|
|
puts("Please consult the MySQL manual for latest information about the");
|
|
puts("above. The options -c,-r,-a and -o are exclusive to each other, which");
|
|
puts("means that the last option will be used, if several was specified.\n");
|
|
puts("The option -c will be used by default, if none was specified. You");
|
|
puts("can change the default behavior by making a symbolic link, or");
|
|
puts("copying this file somewhere with another name, the alternatives are:");
|
|
puts("mysqlrepair: The default option will be -r");
|
|
puts("mysqlanalyze: The default option will be -a");
|
|
puts("mysqloptimize: The default option will be -o\n");
|
|
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
|
|
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
|
|
my_progname);
|
|
printf("OR %s [OPTIONS] --all-databases\n", my_progname);
|
|
print_defaults("my", load_default_groups);
|
|
my_print_help(my_long_options);
|
|
my_print_variables(my_long_options);
|
|
} /* usage */
|
|
|
|
#include <help_end.h>
|
|
|
|
static my_bool
|
|
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|
char *argument)
|
|
{
|
|
switch(optid) {
|
|
#ifdef __NETWARE__
|
|
case OPT_AUTO_CLOSE:
|
|
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
|
|
break;
|
|
#endif
|
|
case 'a':
|
|
what_to_do = DO_ANALYZE;
|
|
break;
|
|
case 'c':
|
|
what_to_do = DO_CHECK;
|
|
break;
|
|
case 'C':
|
|
what_to_do = DO_CHECK;
|
|
opt_check_only_changed = 1;
|
|
break;
|
|
case 'I': /* Fall through */
|
|
case '?':
|
|
usage();
|
|
exit(0);
|
|
case 'm':
|
|
what_to_do = DO_CHECK;
|
|
opt_medium_check = 1;
|
|
break;
|
|
case 'o':
|
|
what_to_do = DO_OPTIMIZE;
|
|
break;
|
|
case OPT_FIX_DB_NAMES:
|
|
what_to_do= DO_UPGRADE;
|
|
default_charset= (char*) "utf8";
|
|
opt_databases= 1;
|
|
break;
|
|
case OPT_FIX_TABLE_NAMES:
|
|
what_to_do= DO_UPGRADE;
|
|
default_charset= (char*) "utf8";
|
|
break;
|
|
case 'p':
|
|
if (argument)
|
|
{
|
|
char *start = argument;
|
|
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
|
opt_password = my_strdup(argument, MYF(MY_FAE));
|
|
while (*argument) *argument++= 'x'; /* Destroy argument */
|
|
if (*start)
|
|
start[1] = 0; /* Cut length of argument */
|
|
tty_password= 0;
|
|
}
|
|
else
|
|
tty_password = 1;
|
|
break;
|
|
case 'r':
|
|
what_to_do = DO_REPAIR;
|
|
break;
|
|
case 'g':
|
|
what_to_do= DO_CHECK;
|
|
opt_upgrade= 1;
|
|
break;
|
|
case 'W':
|
|
#ifdef __WIN__
|
|
opt_protocol = MYSQL_PROTOCOL_PIPE;
|
|
#endif
|
|
break;
|
|
case '#':
|
|
DBUG_PUSH(argument ? argument : "d:t:o");
|
|
debug_check_flag= 1;
|
|
break;
|
|
#include <sslopt-case.h>
|
|
case OPT_TABLES:
|
|
opt_databases = 0;
|
|
break;
|
|
case 'v':
|
|
verbose++;
|
|
break;
|
|
case 'V': print_version(); exit(0);
|
|
case OPT_MYSQL_PROTOCOL:
|
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
|
opt->name);
|
|
break;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
static int get_options(int *argc, char ***argv)
|
|
{
|
|
int ho_error;
|
|
|
|
if (*argc == 1)
|
|
{
|
|
usage();
|
|
exit(0);
|
|
}
|
|
|
|
load_defaults("my", load_default_groups, argc, argv);
|
|
|
|
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
|
exit(ho_error);
|
|
|
|
if (!what_to_do)
|
|
{
|
|
int pnlen = strlen(my_progname);
|
|
|
|
if (pnlen < 6) /* name too short */
|
|
what_to_do = DO_CHECK;
|
|
else if (!strcmp("repair", my_progname + pnlen - 6))
|
|
what_to_do = DO_REPAIR;
|
|
else if (!strcmp("analyze", my_progname + pnlen - 7))
|
|
what_to_do = DO_ANALYZE;
|
|
else if (!strcmp("optimize", my_progname + pnlen - 8))
|
|
what_to_do = DO_OPTIMIZE;
|
|
else
|
|
what_to_do = DO_CHECK;
|
|
}
|
|
|
|
/* TODO: This variable is not yet used */
|
|
if (strcmp(default_charset, charset_info->csname) &&
|
|
!(charset_info= get_charset_by_csname(default_charset,
|
|
MY_CS_PRIMARY, MYF(MY_WME))))
|
|
exit(1);
|
|
if (*argc > 0 && opt_alldbs)
|
|
{
|
|
printf("You should give only options, no arguments at all, with option\n");
|
|
printf("--all-databases. Please see %s --help for more information.\n",
|
|
my_progname);
|
|
return 1;
|
|
}
|
|
if (*argc < 1 && !opt_alldbs)
|
|
{
|
|
printf("You forgot to give the arguments! Please see %s --help\n",
|
|
my_progname);
|
|
printf("for more information.\n");
|
|
return 1;
|
|
}
|
|
if (tty_password)
|
|
opt_password = get_tty_password(NullS);
|
|
if (debug_info_flag)
|
|
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
|
if (debug_check_flag)
|
|
my_end_arg= MY_CHECK_ERROR;
|
|
return(0);
|
|
} /* get_options */
|
|
|
|
|
|
static int process_all_databases()
|
|
{
|
|
MYSQL_ROW row;
|
|
MYSQL_RES *tableres;
|
|
int result = 0;
|
|
|
|
if (mysql_query(sock, "SHOW DATABASES") ||
|
|
!(tableres = mysql_store_result(sock)))
|
|
{
|
|
my_printf_error(0, "Error: Couldn't execute 'SHOW DATABASES': %s",
|
|
MYF(0), mysql_error(sock));
|
|
return 1;
|
|
}
|
|
while ((row = mysql_fetch_row(tableres)))
|
|
{
|
|
if (process_one_db(row[0]))
|
|
result = 1;
|
|
}
|
|
return result;
|
|
}
|
|
/* process_all_databases */
|
|
|
|
|
|
static int process_databases(char **db_names)
|
|
{
|
|
int result = 0;
|
|
for ( ; *db_names ; db_names++)
|
|
{
|
|
if (process_one_db(*db_names))
|
|
result = 1;
|
|
}
|
|
return result;
|
|
} /* process_databases */
|
|
|
|
|
|
static int process_selected_tables(char *db, char **table_names, int tables)
|
|
{
|
|
if (use_db(db))
|
|
return 1;
|
|
if (opt_all_in_1)
|
|
{
|
|
/*
|
|
We need table list in form `a`, `b`, `c`
|
|
that's why we need 4 more chars added to to each table name
|
|
space is for more readable output in logs and in case of error
|
|
*/
|
|
char *table_names_comma_sep, *end;
|
|
int i, tot_length = 0;
|
|
|
|
for (i = 0; i < tables; i++)
|
|
tot_length += strlen(*(table_names + i)) + 4;
|
|
|
|
if (!(table_names_comma_sep = (char *)
|
|
my_malloc((sizeof(char) * tot_length) + 4, MYF(MY_WME))))
|
|
return 1;
|
|
|
|
for (end = table_names_comma_sep + 1; tables > 0;
|
|
tables--, table_names++)
|
|
{
|
|
end= fix_table_name(end, *table_names);
|
|
*end++= ',';
|
|
}
|
|
*--end = 0;
|
|
handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
|
|
my_free(table_names_comma_sep, MYF(0));
|
|
}
|
|
else
|
|
for (; tables > 0; tables--, table_names++)
|
|
handle_request_for_tables(*table_names, strlen(*table_names));
|
|
return 0;
|
|
} /* process_selected_tables */
|
|
|
|
|
|
static char *fix_table_name(char *dest, char *src)
|
|
{
|
|
char *db_sep;
|
|
|
|
*dest++= '`';
|
|
if ((db_sep= strchr(src, '.')))
|
|
{
|
|
dest= strmake(dest, src, (uint) (db_sep - src));
|
|
dest= strmov(dest, "`.`");
|
|
src= db_sep + 1;
|
|
}
|
|
dest= strxmov(dest, src, "`", NullS);
|
|
return dest;
|
|
}
|
|
|
|
|
|
static int process_all_tables_in_db(char *database)
|
|
{
|
|
MYSQL_RES *res;
|
|
MYSQL_ROW row;
|
|
|
|
LINT_INIT(res);
|
|
if (use_db(database))
|
|
return 1;
|
|
if (mysql_query(sock, "SHOW TABLE STATUS") ||
|
|
!((res= mysql_store_result(sock))))
|
|
return 1;
|
|
|
|
if (opt_all_in_1)
|
|
{
|
|
/*
|
|
We need table list in form `a`, `b`, `c`
|
|
that's why we need 4 more chars added to to each table name
|
|
space is for more readable output in logs and in case of error
|
|
*/
|
|
|
|
char *tables, *end;
|
|
uint tot_length = 0;
|
|
|
|
while ((row = mysql_fetch_row(res)))
|
|
tot_length += strlen(row[0]) + 4;
|
|
mysql_data_seek(res, 0);
|
|
|
|
if (!(tables=(char *) my_malloc(sizeof(char)*tot_length+4, MYF(MY_WME))))
|
|
{
|
|
mysql_free_result(res);
|
|
return 1;
|
|
}
|
|
for (end = tables + 1; (row = mysql_fetch_row(res)) ;)
|
|
{
|
|
/* Skip tables with an engine of NULL (probably a view). */
|
|
if (row[1])
|
|
{
|
|
end= fix_table_name(end, row[0]);
|
|
*end++= ',';
|
|
}
|
|
}
|
|
*--end = 0;
|
|
if (tot_length)
|
|
handle_request_for_tables(tables + 1, tot_length - 1);
|
|
my_free(tables, MYF(0));
|
|
}
|
|
else
|
|
{
|
|
while ((row = mysql_fetch_row(res)))
|
|
/* Skip tables with an engine of NULL (probably a view). */
|
|
if (row[1])
|
|
{
|
|
handle_request_for_tables(row[0], strlen(row[0]));
|
|
}
|
|
}
|
|
mysql_free_result(res);
|
|
return 0;
|
|
} /* process_all_tables_in_db */
|
|
|
|
|
|
|
|
static int fix_object_name(const char *obj, const char *name)
|
|
{
|
|
char qbuf[100 + NAME_LEN*4];
|
|
int rc= 0;
|
|
if (strncmp(name, "#mysql50#", 9))
|
|
return 1;
|
|
sprintf(qbuf, "RENAME %s `%s` TO `%s`", obj, name, name + 9);
|
|
if (mysql_query(sock, qbuf))
|
|
{
|
|
fprintf(stderr, "Failed to %s\n", qbuf);
|
|
fprintf(stderr, "Error: %s\n", mysql_error(sock));
|
|
rc= 1;
|
|
}
|
|
if (verbose)
|
|
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
|
|
return rc;
|
|
}
|
|
|
|
|
|
static int process_one_db(char *database)
|
|
{
|
|
if (what_to_do == DO_UPGRADE)
|
|
{
|
|
int rc= 0;
|
|
if (opt_fix_db_names && !strncmp(database,"#mysql50#", 9))
|
|
{
|
|
rc= fix_object_name("DATABASE", database);
|
|
database+= 9;
|
|
}
|
|
if (rc || !opt_fix_table_names)
|
|
return rc;
|
|
}
|
|
return process_all_tables_in_db(database);
|
|
}
|
|
|
|
|
|
static int use_db(char *database)
|
|
{
|
|
if (mysql_get_server_version(sock) >= 50003 &&
|
|
!my_strcasecmp(&my_charset_latin1, database, "information_schema"))
|
|
return 1;
|
|
if (mysql_select_db(sock, database))
|
|
{
|
|
DBerror(sock, "when selecting the database");
|
|
return 1;
|
|
}
|
|
return 0;
|
|
} /* use_db */
|
|
|
|
|
|
static int handle_request_for_tables(char *tables, uint length)
|
|
{
|
|
char *query, *end, options[100], message[100];
|
|
uint query_length= 0;
|
|
const char *op = 0;
|
|
|
|
options[0] = 0;
|
|
end = options;
|
|
switch (what_to_do) {
|
|
case DO_CHECK:
|
|
op = "CHECK";
|
|
if (opt_quick) end = strmov(end, " QUICK");
|
|
if (opt_fast) end = strmov(end, " FAST");
|
|
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
|
|
if (opt_extended) end = strmov(end, " EXTENDED");
|
|
if (opt_check_only_changed) end = strmov(end, " CHANGED");
|
|
if (opt_upgrade) end = strmov(end, " FOR UPGRADE");
|
|
break;
|
|
case DO_REPAIR:
|
|
op= (opt_write_binlog) ? "REPAIR" : "REPAIR NO_WRITE_TO_BINLOG";
|
|
if (opt_quick) end = strmov(end, " QUICK");
|
|
if (opt_extended) end = strmov(end, " EXTENDED");
|
|
if (opt_frm) end = strmov(end, " USE_FRM");
|
|
break;
|
|
case DO_ANALYZE:
|
|
op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
|
|
break;
|
|
case DO_OPTIMIZE:
|
|
op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG";
|
|
break;
|
|
case DO_UPGRADE:
|
|
return fix_object_name("TABLE", tables);
|
|
}
|
|
|
|
if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
|
|
return 1;
|
|
if (opt_all_in_1)
|
|
{
|
|
/* No backticks here as we added them before */
|
|
query_length= my_sprintf(query,
|
|
(query, "%s TABLE %s %s", op, tables, options));
|
|
}
|
|
else
|
|
{
|
|
char *ptr;
|
|
|
|
ptr= strmov(strmov(query, op), " TABLE ");
|
|
ptr= fix_table_name(ptr, tables);
|
|
ptr= strxmov(ptr, " ", options, NullS);
|
|
query_length= (uint) (ptr - query);
|
|
}
|
|
if (mysql_real_query(sock, query, query_length))
|
|
{
|
|
sprintf(message, "when executing '%s TABLE ... %s'", op, options);
|
|
DBerror(sock, message);
|
|
return 1;
|
|
}
|
|
print_result();
|
|
my_free(query, MYF(0));
|
|
return 0;
|
|
}
|
|
|
|
|
|
static void print_result()
|
|
{
|
|
MYSQL_RES *res;
|
|
MYSQL_ROW row;
|
|
char prev[NAME_LEN*2+2];
|
|
uint i;
|
|
my_bool found_error=0;
|
|
|
|
res = mysql_use_result(sock);
|
|
|
|
prev[0] = '\0';
|
|
for (i = 0; (row = mysql_fetch_row(res)); i++)
|
|
{
|
|
int changed = strcmp(prev, row[0]);
|
|
my_bool status = !strcmp(row[2], "status");
|
|
|
|
if (status)
|
|
{
|
|
/*
|
|
if there was an error with the table, we have --auto-repair set,
|
|
and this isn't a repair op, then add the table to the tables4repair
|
|
list
|
|
*/
|
|
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
|
|
strcmp(row[3],"OK"))
|
|
insert_dynamic(&tables4repair, (uchar*) prev);
|
|
found_error=0;
|
|
if (opt_silent)
|
|
continue;
|
|
}
|
|
if (status && changed)
|
|
printf("%-50s %s", row[0], row[3]);
|
|
else if (!status && changed)
|
|
{
|
|
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
|
|
if (strcmp(row[2],"note"))
|
|
found_error=1;
|
|
}
|
|
else
|
|
printf("%-9s: %s", row[2], row[3]);
|
|
strmov(prev, row[0]);
|
|
putchar('\n');
|
|
}
|
|
/* add the last table to be repaired to the list */
|
|
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
|
|
insert_dynamic(&tables4repair, (uchar*) prev);
|
|
mysql_free_result(res);
|
|
}
|
|
|
|
|
|
static int dbConnect(char *host, char *user, char *passwd)
|
|
{
|
|
DBUG_ENTER("dbConnect");
|
|
if (verbose)
|
|
{
|
|
fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost");
|
|
}
|
|
mysql_init(&mysql_connection);
|
|
if (opt_compress)
|
|
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
|
|
#ifdef HAVE_OPENSSL
|
|
if (opt_use_ssl)
|
|
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
|
opt_ssl_capath, opt_ssl_cipher);
|
|
#endif
|
|
if (opt_protocol)
|
|
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
|
|
#ifdef HAVE_SMEM
|
|
if (shared_memory_base_name)
|
|
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
|
|
#endif
|
|
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
|
|
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
|
|
{
|
|
DBerror(&mysql_connection, "when trying to connect");
|
|
return 1;
|
|
}
|
|
mysql_connection.reconnect= 1;
|
|
return 0;
|
|
} /* dbConnect */
|
|
|
|
|
|
static void dbDisconnect(char *host)
|
|
{
|
|
if (verbose)
|
|
fprintf(stderr, "# Disconnecting from %s...\n", host ? host : "localhost");
|
|
mysql_close(sock);
|
|
} /* dbDisconnect */
|
|
|
|
|
|
static void DBerror(MYSQL *mysql, const char *when)
|
|
{
|
|
DBUG_ENTER("DBerror");
|
|
my_printf_error(0,"Got error: %d: %s %s", MYF(0),
|
|
mysql_errno(mysql), mysql_error(mysql), when);
|
|
safe_exit(EX_MYSQLERR);
|
|
DBUG_VOID_RETURN;
|
|
} /* DBerror */
|
|
|
|
|
|
static void safe_exit(int error)
|
|
{
|
|
if (!first_error)
|
|
first_error= error;
|
|
if (ignore_errors)
|
|
return;
|
|
if (sock)
|
|
mysql_close(sock);
|
|
exit(error);
|
|
}
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
MY_INIT(argv[0]);
|
|
/*
|
|
** Check out the args
|
|
*/
|
|
if (get_options(&argc, &argv))
|
|
{
|
|
my_end(my_end_arg);
|
|
exit(EX_USAGE);
|
|
}
|
|
if (dbConnect(current_host, current_user, opt_password))
|
|
exit(EX_MYSQLERR);
|
|
|
|
if (opt_auto_repair &&
|
|
my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
|
|
{
|
|
first_error = 1;
|
|
goto end;
|
|
}
|
|
|
|
if (opt_alldbs)
|
|
process_all_databases();
|
|
/* Only one database and selected table(s) */
|
|
else if (argc > 1 && !opt_databases)
|
|
process_selected_tables(*argv, (argv + 1), (argc - 1));
|
|
/* One or more databases, all tables */
|
|
else
|
|
process_databases(argv);
|
|
if (opt_auto_repair)
|
|
{
|
|
uint i;
|
|
|
|
if (!opt_silent && tables4repair.elements)
|
|
puts("\nRepairing tables");
|
|
what_to_do = DO_REPAIR;
|
|
for (i = 0; i < tables4repair.elements ; i++)
|
|
{
|
|
char *name= (char*) dynamic_array_ptr(&tables4repair, i);
|
|
handle_request_for_tables(name, strlen(name));
|
|
}
|
|
}
|
|
end:
|
|
dbDisconnect(current_host);
|
|
if (opt_auto_repair)
|
|
delete_dynamic(&tables4repair);
|
|
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
|
#ifdef HAVE_SMEM
|
|
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
|
|
#endif
|
|
my_end(my_end_arg);
|
|
return(first_error!=0);
|
|
} /* main */
|