Commit dc5e32ea authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Added connect_timeout and fix for transactions per statement

parent 8e332209
...@@ -18,7 +18,7 @@ noinst_SCRIPTS = Support/texi2html Support/generate-text-files.pl \ ...@@ -18,7 +18,7 @@ noinst_SCRIPTS = Support/texi2html Support/generate-text-files.pl \
Support/generate-mirror-listing.pl Support/generate-mirror-listing.pl
info_TEXINFOS = manual.texi info_TEXINFOS = manual.texi
targets = manual.txt mysql.info manual.html $(PDFMANUAL) targets = manual.txt mysql.info manual.html
BUILT_SOURCES = $(targets) manual_toc.html include.texi BUILT_SOURCES = $(targets) manual_toc.html include.texi
EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY
...@@ -30,9 +30,9 @@ txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \ ...@@ -30,9 +30,9 @@ txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
CLEAN_FILES: manual.ps CLEAN_FILES: manual.ps
# The PostScript version is so big that is not included in the # The PostScript and PDF version are so big that they are not included in the
# standard distribution. It is available for download from the home page. # standard distribution. It is available for download from the home page.
paper: manual_a4.ps manual_letter.ps paper: manual_a4.ps manual_letter.ps $(PDFMANUAL)
######################################################################### #########################################################################
......
...@@ -9401,6 +9401,11 @@ password=my_password ...@@ -9401,6 +9401,11 @@ password=my_password
[mysql] [mysql]
no-auto-rehash no-auto-rehash
set-variable = connect_timeout=2
[mysql-hot-copy]
interactive-timeout
@end example @end example
@tindex .my.cnf file @tindex .my.cnf file
...@@ -16971,6 +16976,7 @@ mysql> select CONNECTION_ID(); ...@@ -16971,6 +16976,7 @@ mysql> select CONNECTION_ID();
-> 1 -> 1
@end example @end example
@cindex timeout
@findex GET_LOCK() @findex GET_LOCK()
@item GET_LOCK(str,timeout) @item GET_LOCK(str,timeout)
Tries to obtain a lock with a name given by the string @code{str}, with a Tries to obtain a lock with a name given by the string @code{str}, with a
...@@ -18009,6 +18015,8 @@ exist. ...@@ -18009,6 +18015,8 @@ exist.
@code{RESTRICT} and @code{CASCADE} are allowed to make porting easier. @code{RESTRICT} and @code{CASCADE} are allowed to make porting easier.
For the moment they don't do anything. For the moment they don't do anything.
@cindex tables, defragment
@cindex tables, fragmentation
@findex OPTIMIZE TABLE @findex OPTIMIZE TABLE
@node OPTIMIZE TABLE, CHECK TABLE, DROP TABLE, Reference @node OPTIMIZE TABLE, CHECK TABLE, DROP TABLE, Reference
@section @code{OPTIMIZE TABLE} Syntax @section @code{OPTIMIZE TABLE} Syntax
...@@ -18022,7 +18030,7 @@ table or if you have made many changes to a table with variable-length rows ...@@ -18022,7 +18030,7 @@ table or if you have made many changes to a table with variable-length rows
(tables that have @code{VARCHAR}, @code{BLOB}, or @code{TEXT} columns). (tables that have @code{VARCHAR}, @code{BLOB}, or @code{TEXT} columns).
Deleted records are maintained in a linked list and subsequent @code{INSERT} Deleted records are maintained in a linked list and subsequent @code{INSERT}
operations reuse old record positions. You can use @code{OPTIMIZE TABLE} to operations reuse old record positions. You can use @code{OPTIMIZE TABLE} to
reclaim the unused space. reclaim the unused space and to defragment the data file.
For the moment @code{OPTIMIZE TABLE} only works on @strong{MyISAM} For the moment @code{OPTIMIZE TABLE} only works on @strong{MyISAM}
tables. You can get optimize table to work on other table types by tables. You can get optimize table to work on other table types by
...@@ -18892,6 +18900,8 @@ After every @code{delayed_insert_limit} rows are written, the handler checks ...@@ -18892,6 +18900,8 @@ After every @code{delayed_insert_limit} rows are written, the handler checks
whether or not any @code{SELECT} statements are still pending. If so, it whether or not any @code{SELECT} statements are still pending. If so, it
allows these to execute before continuing. allows these to execute before continuing.
@cindex delayed_insert_limit
@cindex timeout
@item @item
When the handler has no more rows in its queue, the table is unlocked. If no When the handler has no more rows in its queue, the table is unlocked. If no
new @code{INSERT DELAYED} commands are received within new @code{INSERT DELAYED} commands are received within
...@@ -18962,7 +18972,8 @@ the old record is deleted before the new record is inserted. ...@@ -18962,7 +18972,8 @@ the old record is deleted before the new record is inserted.
@xref{INSERT, , @code{INSERT}}. @xref{INSERT, , @code{INSERT}}.
In other words, you can't access the values of the old row from a In other words, you can't access the values of the old row from a
@code{REPLACE} statement. @code{REPLACE} statement. In some old @strong{MySQL} version it looked
like you could do this, but that was a bug that has been corrected.
@findex LOAD DATA INFILE @findex LOAD DATA INFILE
@node LOAD DATA, UPDATE, REPLACE, Reference @node LOAD DATA, UPDATE, REPLACE, Reference
...@@ -20019,6 +20030,7 @@ on @code{MyISAM} tables at the same time as you run @code{SELECT} queries ...@@ -20019,6 +20030,7 @@ on @code{MyISAM} tables at the same time as you run @code{SELECT} queries
on them. You can turn this option off by starting mysqld with @code{--safe} on them. You can turn this option off by starting mysqld with @code{--safe}
or @code{--skip-new}. or @code{--skip-new}.
@cindex timeout
@item @code{connect_timeout} @item @code{connect_timeout}
The number of seconds the @code{mysqld} server is waiting for a connect The number of seconds the @code{mysqld} server is waiting for a connect
packet before responding with @code{Bad handshake}. packet before responding with @code{Bad handshake}.
...@@ -21837,6 +21849,7 @@ This format is a litte more complex because each row has to have a header ...@@ -21837,6 +21849,7 @@ This format is a litte more complex because each row has to have a header
that says how long it is. One record can also end up at more than one that says how long it is. One record can also end up at more than one
location when it is made longer at an update. location when it is made longer at an update.
@cindex tables, defragment
You can use @code{OPTIMIZE table} or @code{myisamchk} to defragment a You can use @code{OPTIMIZE table} or @code{myisamchk} to defragment a
table. If you have static data that you access/change a lot in the same table. If you have static data that you access/change a lot in the same
table as some @code{VARCHAR} or @code{BLOB} columns, it might be a good table as some @code{VARCHAR} or @code{BLOB} columns, it might be a good
...@@ -21938,10 +21951,10 @@ Can be uncompressed with @code{myisamchk}. ...@@ -21938,10 +21951,10 @@ Can be uncompressed with @code{myisamchk}.
@node MERGE, ISAM, MyISAM, Table types @node MERGE, ISAM, MyISAM, Table types
@section MERGE Tables @section MERGE Tables
@code{MERGE} tables are new in @strong{MySQL} Version 3.23.25. The code is still @code{MERGE} tables are new in @strong{MySQL} Version 3.23.25. The code
in alpha, but should stabilize soon! The one thing that is currently is still in alpha, but should stabilize soon! The one thing that is
missing is a way for the SQL prompt to say which tables are part of the currently missing is a way for the SQL prompt to say which tables are
@code{MERGE} table. part of the @code{MERGE} table.
A @code{MERGE} table is a collection of identical @code{MyISAM} tables A @code{MERGE} table is a collection of identical @code{MyISAM} tables
that can be used as one. You can only @code{SELECT}, @code{DELETE}, and that can be used as one. You can only @code{SELECT}, @code{DELETE}, and
...@@ -28092,6 +28105,19 @@ Output version information and exit. ...@@ -28092,6 +28105,19 @@ Output version information and exit.
Wait and retry if connection is down instead of aborting. Wait and retry if connection is down instead of aborting.
@end table @end table
You can also set the following variables with @code{-O} or
@code{--set-variable}:
@cindex timeout
@multitable @columnfractions .3 .2 .5
@item Variablename @tab Default @tab Description
@item connect_timeout @tab 0 @tab Number of seconds before timeout connection.
@item max_allowed_packet @tab 16777216 @tab Max packetlength to send/receive from to server
@item net_buffer_length @tab 16384 @tab Buffer for TCP/IP and socket communication
@item select_limit @tab 1000 @tab Automatic limit for SELECT when using --i-am-a-dummy
@item max_join_size @tab 1000000 @tab Automatic limit for rows in a join when using --i-am-a-dummy.
@end multitable
If you type 'help' on the command line, @code{mysql} will print out the If you type 'help' on the command line, @code{mysql} will print out the
commands that it supports: commands that it supports:
...@@ -29068,9 +29094,9 @@ to start using the new table. ...@@ -29068,9 +29094,9 @@ to start using the new table.
@node Table maintenance, Maintenance regimen, Maintenance, Maintenance @node Table maintenance, Maintenance regimen, Maintenance, Maintenance
@section Using @code{myisamchk} for table maintenance and crash recovery @section Using @code{myisamchk} for table maintenance and crash recovery
Starting with @strong{MySQL} Version 3.23.13, you can check MyISAM tables with the Starting with @strong{MySQL} Version 3.23.13, you can check MyISAM
@code{CHECK TABLE} command. @xref{CHECK TABLE}. You can repair tables tables with the @code{CHECK TABLE} command. @xref{CHECK TABLE}. You can
with the @code{REPAIR TABLE} command. @xref{REPAIR TABLE}. repair tables with the @code{REPAIR TABLE} command. @xref{REPAIR TABLE}.
To check/repair MyISAM tables (@code{.MYI} and @code{.MYD}) you should To check/repair MyISAM tables (@code{.MYI} and @code{.MYD}) you should
use the @code{myisamchk} utility. To check/repair ISAM tables use the @code{myisamchk} utility. To check/repair ISAM tables
...@@ -29146,6 +29172,13 @@ with the path to the @strong{MySQL} data directory: ...@@ -29146,6 +29172,13 @@ with the path to the @strong{MySQL} data directory:
shell> myisamchk /path/to/datadir/*/*.MYI shell> myisamchk /path/to/datadir/*/*.MYI
@end example @end example
The recommended way to quickly check all tables is:
@example
myisamchk --fast --silent /path/to/datadir/*/*.MYI
isamchk --silent /path/to/datadir/*/*.ISM
@end example
@code{myisamchk} supports the following options: @code{myisamchk} supports the following options:
@menu @menu
...@@ -29405,18 +29438,18 @@ If you have a problem with disk space during repair, you can try to use ...@@ -29405,18 +29438,18 @@ If you have a problem with disk space during repair, you can try to use
@node Maintenance regimen, Table-info, Table maintenance, Maintenance @node Maintenance regimen, Table-info, Table maintenance, Maintenance
@section Setting up a table maintenance regimen @section Setting up a table maintenance regimen
Starting with @strong{MySQL} Version 3.23.13, you can check MyISAM tables with the Starting with @strong{MySQL} Version 3.23.13, you can check MyISAM
@code{CHECK TABLE} command. @xref{CHECK TABLE}. You can repair tables tables with the @code{CHECK TABLE} command. @xref{CHECK TABLE}. You can
with the @code{REPAIR TABLE} command. @xref{REPAIR TABLE}. repair tables with the @code{REPAIR TABLE} command. @xref{REPAIR TABLE}.
It is a good idea to perform table checks on a regular basis rather than It is a good idea to perform table checks on a regular basis rather than
waiting for problems to occur. For maintenance purposes, you can use waiting for problems to occur. For maintenance purposes, you can use
@code{myisamchk -s} to check tables. The @code{-s} option causes @code{myisamchk -s} to check tables. The @code{-s} option (short for
@code{myisamchk} to run in silent mode, printing messages only when errors @code{--silent}) causes @code{myisamchk} to run in silent mode, printing
occur. messages only when errors occur.
@tindex .pid (process ID) file @tindex .pid (process ID) file
It's a good idea to check tables when the server starts up. It's also a good idea to check tables when the server starts up.
For example, whenever the machine has done a reboot in the middle of an For example, whenever the machine has done a reboot in the middle of an
update, you usually need to check all the tables that could have been update, you usually need to check all the tables that could have been
affected. (This is an ``expected crashed table''.) You could add a test to affected. (This is an ``expected crashed table''.) You could add a test to
...@@ -29435,7 +29468,7 @@ operation. At MySQL AB, we run a @code{cron} job to check all our important ...@@ -29435,7 +29468,7 @@ operation. At MySQL AB, we run a @code{cron} job to check all our important
tables once a week, using a line like this in a @file{crontab} file: tables once a week, using a line like this in a @file{crontab} file:
@example @example
35 0 * * 0 /path/to/myisamchk -s /path/to/datadir/*/*.MYI 35 0 * * 0 /path/to/myisamchk --fast --silent /path/to/datadir/*/*.MYI
@end example @end example
This prints out information about crashed tables so we can examine and repair This prints out information about crashed tables so we can examine and repair
...@@ -29450,6 +29483,21 @@ We recommend that to start with, you execute @code{myisamchk -s} each ...@@ -29450,6 +29483,21 @@ We recommend that to start with, you execute @code{myisamchk -s} each
night on all tables that have been updated during the last 24 hours, night on all tables that have been updated during the last 24 hours,
until you come to trust @strong{MySQL} as much as we do. until you come to trust @strong{MySQL} as much as we do.
@cindex tables, defragment
Normally you don't need to maintain MySQL tables that much. If you are
changing tables with dynamic size rows (tables with @code{VARCHAR},
@code{BLOB} or @code{TEXT} columns) or have tables with many deleted rows
you may want to from time to time (once a month?) defragment/reclaim space
from the tables.
You can do this by using @code{OPTIMIZE TABLE} on the tables in question or
if you can take the @code{mysqld} server down for a while do:
@example
isamchk -r --silent --sort-index -O sort_buffer_size=16M */*.ISM
myisamchk -r --silent --sort-index -O sort_buffer_size=16M */*.MYI
@end example
@cindex tables, information @cindex tables, information
@node Table-info, Crash recovery, Maintenance regimen, Maintenance @node Table-info, Crash recovery, Maintenance regimen, Maintenance
@section Getting information about a table @section Getting information about a table
...@@ -29459,11 +29507,12 @@ below. We explain some of the information in more detail later. ...@@ -29459,11 +29507,12 @@ below. We explain some of the information in more detail later.
@table @code @table @code
@item myisamchk -d tbl_name @item myisamchk -d tbl_name
Runs @code{myisamchk} in ``describe mode'' to produce a description of your Runs @code{myisamchk} in ``describe mode'' to produce a description of
table. If you start the @strong{MySQL} server using the @code{--skip-locking} your table. If you start the @strong{MySQL} server using the
option, @code{myisamchk} may report an error for a table that is updated while @code{--skip-locking} option, @code{myisamchk} may report an error for a
it runs. However, because @code{myisamchk} doesn't change the table in describe table that is updated while it runs. However, because @code{myisamchk}
mode, there isn't any risk of destroying data. doesn't change the table in describe mode, there isn't any risk of
destroying data.
@item myisamchk -d -v tbl_name @item myisamchk -d -v tbl_name
To produce more information about what @code{myisamchk} is doing, add @code{-v} To produce more information about what @code{myisamchk} is doing, add @code{-v}
...@@ -29482,9 +29531,9 @@ This is like @code{-eis}, but tells you what is being done. ...@@ -29482,9 +29531,9 @@ This is like @code{-eis}, but tells you what is being done.
Example of @code{myisamchk -d} output: Example of @code{myisamchk -d} output:
@example @example
MyISAM file: company.MYI MyISAM file: company.MYI
Record format: Fixed length Record format: Fixed length
Data records: 1403698 Deleted blocks: 0 Data records: 1403698 Deleted blocks: 0
Recordlength: 226 Recordlength: 226
table description: table description:
Key Start Len Index Type Key Start Len Index Type
...@@ -35032,6 +35081,7 @@ Note that the group @code{client} is always read if you use ...@@ -35032,6 +35081,7 @@ Note that the group @code{client} is always read if you use
The specified group in the option file may contain the following options: The specified group in the option file may contain the following options:
@multitable @columnfractions .3 .7 @multitable @columnfractions .3 .7
@item @code{connect_timeout} @tab Connect timeout in seconds. On Linux this timeout is also used for waiting for the first answer from the server.
@item @code{compress} @tab Use the compressed client/server protocol. @item @code{compress} @tab Use the compressed client/server protocol.
@item @code{database} @tab Connect to this database if no database was specified in the connect command. @item @code{database} @tab Connect to this database if no database was specified in the connect command.
@item @code{debug} @tab Debug options. @item @code{debug} @tab Debug options.
...@@ -35044,11 +35094,12 @@ The specified group in the option file may contain the following options: ...@@ -35044,11 +35094,12 @@ The specified group in the option file may contain the following options:
@item @code{return-found-rows} @tab Tell @code{mysql_info()} to return found rows instead of updated rows when using @code{UPDATE}. @item @code{return-found-rows} @tab Tell @code{mysql_info()} to return found rows instead of updated rows when using @code{UPDATE}.
@item @code{socket} @tab Default socket number. @item @code{socket} @tab Default socket number.
@item @item
@code{timeout} @tab Connect timeout in seconds. On Linux this timeout also
is used for waiting for the first answer from the server.
@item @code{user} @tab Default user. @item @code{user} @tab Default user.
@end multitable @end multitable
Note that @code{timeout} has been replaced by @code{connect_timeout}, but
@code{timeout} will still work for a while.
For more information about option files, see @ref{Option files}. For more information about option files, see @ref{Option files}.
@subsubheading Return values @subsubheading Return values
...@@ -35268,8 +35319,8 @@ Failed to wait for a named pipe on Windows. ...@@ -35268,8 +35319,8 @@ Failed to wait for a named pipe on Windows.
Failed to get a pipe handler on Windows. Failed to get a pipe handler on Windows.
@item CR_SERVER_LOST @item CR_SERVER_LOST
If @code{timeout} > 0 and it took longer then @code{timeout} seconds to If @code{connect_timeout} > 0 and it took longer then @code{connect_timeout}
connect to the server or if the server died while executing the seconds to connect to the server or if the server died while executing the
@code{init-command}. @code{init-command}.
@end table @end table
...@@ -38846,6 +38897,11 @@ If you do a @code{ROLLBACK} when you have updated a non-transactional table ...@@ -38846,6 +38897,11 @@ If you do a @code{ROLLBACK} when you have updated a non-transactional table
you will get an error as a warning. you will get an error as a warning.
@item @item
Reset status variable which could cause problem if one used @code{--slow-log}. Reset status variable which could cause problem if one used @code{--slow-log}.
@item
Added variable @code{connect_timeout} to @code{mysql} and @code{mysqladmin}.
@item
Added @code{connect_timeout} as an alias for @code{timeout} for config files
read by @code{mysql_options()}.
@end itemize @end itemize
@node News-3.23.28, News-3.23.27, News-3.23.29, News-3.23.x @node News-3.23.28, News-3.23.27, News-3.23.29, News-3.23.x
...@@ -38864,7 +38920,7 @@ Fixed a major performance bug in the table locking code when one ...@@ -38864,7 +38920,7 @@ Fixed a major performance bug in the table locking code when one
constantly had a LOT of @code{SELECT}, @code{UPDATE} and @code{INSERT} constantly had a LOT of @code{SELECT}, @code{UPDATE} and @code{INSERT}
statements running. The symptom was that the @code{UPDATE} and statements running. The symptom was that the @code{UPDATE} and
@code{INSERT} queries was locked a long time while new @code{SELECT} @code{INSERT} queries was locked a long time while new @code{SELECT}
statements where executed without locks. statements where executed before the updates.
@item @item
When reading options_files with @code{mysql_options()} the When reading options_files with @code{mysql_options()} the
@code{return-found-rows} option was ignored. @code{return-found-rows} option was ignored.
...@@ -38874,9 +38930,10 @@ is read by @code{mysql_options()}. This makes it possible to force ...@@ -38874,9 +38930,10 @@ is read by @code{mysql_options()}. This makes it possible to force
programs that runs for a long time (like @code{mysqlhotcopy}) to use programs that runs for a long time (like @code{mysqlhotcopy}) to use
@code{interactive_timeout} instead of @code{wait_timeout}. @code{interactive_timeout} instead of @code{wait_timeout}.
@item @item
We now always print when the query was made and who made it in the 'slow Added to the slow query log the time and the user name for each logged
query log'. If you are using @code{--log-long-format} then also queries query. If you are using @code{--log-long-format} then also queries that
that are not using indexes are printed. are not using indexes are logged, even the query takes less than
@code{long_query_time} seconds.
@item @item
Fixed problem in @code{LEFT JOIN} which caused all columns in reference Fixed problem in @code{LEFT JOIN} which caused all columns in reference
table to be NULL. table to be NULL.
...@@ -30,7 +30,7 @@ SUBDIRS = include @docs_dirs@ @readline_dir@ \ ...@@ -30,7 +30,7 @@ SUBDIRS = include @docs_dirs@ @readline_dir@ \
CLEANFILES = linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources linked_include_sources CLEANFILES = linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources linked_include_sources
# This is just so that the linking is done early. # This is just so that the linking is done early.
config.h: linked_include_sources linked_client_sources linked_server_sources config.h: linked_include_sources linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources
linked_include_sources: linked_include_sources:
cd include; $(MAKE) link_sources cd include; $(MAKE) link_sources
......
...@@ -109,7 +109,7 @@ static HashTable ht; ...@@ -109,7 +109,7 @@ static HashTable ht;
enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT}; enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE; typedef enum enum_info_type INFO_TYPE;
const char *VER="11.6"; const char *VER="11.7";
static MYSQL mysql; /* The connection */ static MYSQL mysql; /* The connection */
static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0, static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
...@@ -118,7 +118,7 @@ static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0, ...@@ -118,7 +118,7 @@ static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
opt_compress=0, opt_compress=0,
vertical=0,skip_line_numbers=0,skip_column_names=0,opt_html=0, vertical=0,skip_line_numbers=0,skip_column_names=0,opt_html=0,
opt_nopager=1, opt_outfile=0, no_named_cmds=1; opt_nopager=1, opt_outfile=0, no_named_cmds=1;
static uint verbose=0,opt_silent=0,opt_mysql_port=0,opt_connect_timeout=0; static uint verbose=0,opt_silent=0,opt_mysql_port=0;
static my_string opt_mysql_unix_port=0; static my_string opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE; static int connect_flag=CLIENT_INTERACTIVE;
static char *current_host,*current_db,*current_user=0,*opt_password=0, static char *current_host,*current_db,*current_user=0,*opt_password=0,
...@@ -126,7 +126,7 @@ static char *current_host,*current_db,*current_user=0,*opt_password=0, ...@@ -126,7 +126,7 @@ static char *current_host,*current_db,*current_user=0,*opt_password=0,
static char *histfile; static char *histfile;
static String glob_buffer,old_buffer; static String glob_buffer,old_buffer;
static STATUS status; static STATUS status;
static ulong select_limit,max_join_size; static ulong select_limit,max_join_size,opt_connect_timeout=0;
static char default_pager[FN_REFLEN]; static char default_pager[FN_REFLEN];
char pager[FN_REFLEN], outfile[FN_REFLEN]; char pager[FN_REFLEN], outfile[FN_REFLEN];
FILE *PAGER, *OUTFILE; FILE *PAGER, *OUTFILE;
...@@ -371,7 +371,7 @@ sig_handler mysql_end(int sig) ...@@ -371,7 +371,7 @@ sig_handler mysql_end(int sig)
exit(status.exit_status); exit(status.exit_status);
} }
enum options {OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_TIMEOUT, enum options {OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
OPT_PAGER, OPT_NOPAGER, OPT_TEE, OPT_NOTEE} ; OPT_PAGER, OPT_NOPAGER, OPT_TEE, OPT_NOTEE} ;
...@@ -420,7 +420,6 @@ static struct option long_options[] = ...@@ -420,7 +420,6 @@ static struct option long_options[] =
{"socket", required_argument, 0, 'S'}, {"socket", required_argument, 0, 'S'},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"table", no_argument, 0, 't'}, {"table", no_argument, 0, 't'},
{"timeout", required_argument, 0, OPT_TIMEOUT},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'}, {"user", required_argument, 0, 'u'},
#endif #endif
...@@ -434,6 +433,7 @@ static struct option long_options[] = ...@@ -434,6 +433,7 @@ static struct option long_options[] =
CHANGEABLE_VAR changeable_vars[] = { CHANGEABLE_VAR changeable_vars[] = {
{ "connect_timeout", (long*) &opt_connect_timeout, 0, 0, 3600*12, 0, 1},
{ "max_allowed_packet", (long*) &max_allowed_packet,16*1024L*1024L,4096, { "max_allowed_packet", (long*) &max_allowed_packet,16*1024L*1024L,4096,
24*1024L*1024L, MALLOC_OVERHEAD,1024}, 24*1024L*1024L, MALLOC_OVERHEAD,1024},
{ "net_buffer_length",(long*) &net_buffer_length,16384,1024,24*1024*1024L, { "net_buffer_length",(long*) &net_buffer_length,16384,1024,24*1024*1024L,
...@@ -697,9 +697,6 @@ static int get_options(int argc, char **argv) ...@@ -697,9 +697,6 @@ static int get_options(int argc, char **argv)
opt_mysql_unix_port=my_strdup(MYSQL_NAMEDPIPE,MYF(0)); opt_mysql_unix_port=my_strdup(MYSQL_NAMEDPIPE,MYF(0));
#endif #endif
break; break;
case OPT_TIMEOUT:
opt_connect_timeout=atoi(optarg);
break;
case 'V': usage(1); exit(0); case 'V': usage(1); exit(0);
case 'I': case 'I':
case '?': case '?':
...@@ -2045,8 +2042,11 @@ sql_real_connect(char *host,char *database,char *user,char *password, ...@@ -2045,8 +2042,11 @@ sql_real_connect(char *host,char *database,char *user,char *password,
} }
mysql_init(&mysql); mysql_init(&mysql);
if (opt_connect_timeout) if (opt_connect_timeout)
{
uint timeout=opt_connect_timeout;
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT,
(char*) &opt_connect_timeout); (char*) &timeout);
}
if (opt_compress) if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <my_pthread.h> /* because of signal() */ #include <my_pthread.h> /* because of signal() */
#endif #endif
#define ADMIN_VERSION "8.12" #define ADMIN_VERSION "8.13"
#define MAX_MYSQL_VAR 64 #define MAX_MYSQL_VAR 64
#define MAX_TIME_TO_WAIT 3600 /* Wait for shutdown */ #define MAX_TIME_TO_WAIT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3 #define MAX_TRUNC_LENGTH 3
...@@ -40,6 +40,7 @@ static int interval=0; ...@@ -40,6 +40,7 @@ static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0,option_silent=0, static my_bool option_force=0,interrupted=0,new_line=0,option_silent=0,
opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0; opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0;
static uint tcp_port = 0, option_wait = 0; static uint tcp_port = 0, option_wait = 0;
static ulong opt_connect_timeout;
static my_string unix_port=0; static my_string unix_port=0;
/* When using extended-status relatively, ex_val_max_len is the estimated /* When using extended-status relatively, ex_val_max_len is the estimated
...@@ -116,11 +117,12 @@ static struct option long_options[] = { ...@@ -116,11 +117,12 @@ static struct option long_options[] = {
#endif #endif
{"port", required_argument, 0, 'P'}, {"port", required_argument, 0, 'P'},
{"relative", no_argument, 0, 'r'}, {"relative", no_argument, 0, 'r'},
{"set-variable", required_argument, 0, 'O'},
{"silent", no_argument, 0, 's'}, {"silent", no_argument, 0, 's'},
{"socket", required_argument, 0, 'S'}, {"socket", required_argument, 0, 'S'},
{"sleep", required_argument, 0, 'i'}, {"sleep", required_argument, 0, 'i'},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"timeout", required_argument, 0, 't'}, {"connect-timeout", required_argument, 0, 't'},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'}, {"user", required_argument, 0, 'u'},
#endif #endif
...@@ -131,6 +133,11 @@ static struct option long_options[] = { ...@@ -131,6 +133,11 @@ static struct option long_options[] = {
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
CHANGEABLE_VAR changeable_vars[] = {
{ "connect_timeout", (long*) &opt_connect_timeout, 0, 0, 3600*12, 0, 1},
{ 0, 0, 0, 0, 0, 0, 0}
};
static const char *load_default_groups[]= { "mysqladmin","client",0 }; static const char *load_default_groups[]= { "mysqladmin","client",0 };
int main(int argc,char *argv[]) int main(int argc,char *argv[])
...@@ -143,7 +150,7 @@ int main(int argc,char *argv[]) ...@@ -143,7 +150,7 @@ int main(int argc,char *argv[])
mysql_init(&mysql); mysql_init(&mysql);
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
while ((c=getopt_long(argc,argv,"h:i:p::u:#::P:sS:Ct:fq?vVw::WrE", while ((c=getopt_long(argc,argv,"h:i:p::u:#::P:sS:Ct:fq?vVw::WrEO:",
long_options, &option_index)) != EOF) long_options, &option_index)) != EOF)
{ {
switch(c) { switch(c) {
...@@ -187,6 +194,13 @@ int main(int argc,char *argv[]) ...@@ -187,6 +194,13 @@ int main(int argc,char *argv[])
case 'E': case 'E':
opt_vertical = 1; opt_vertical = 1;
break; break;
case 'O':
if (set_changeable_var(optarg, changeable_vars))
{
usage();
return(1);
}
break;
case 's': case 's':
option_silent = 1; option_silent = 1;
break; break;
...@@ -198,12 +212,6 @@ int main(int argc,char *argv[]) ...@@ -198,12 +212,6 @@ int main(int argc,char *argv[])
unix_port=MYSQL_NAMEDPIPE; unix_port=MYSQL_NAMEDPIPE;
#endif #endif
break; break;
case 't':
{
uint tmp=atoi(optarg);
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, (char*) &tmp);
break;
}
case '#': case '#':
DBUG_PUSH(optarg ? optarg : "d:t:o,/tmp/mysqladmin.trace"); DBUG_PUSH(optarg ? optarg : "d:t:o,/tmp/mysqladmin.trace");
break; break;
...@@ -253,6 +261,11 @@ int main(int argc,char *argv[]) ...@@ -253,6 +261,11 @@ int main(int argc,char *argv[])
if (opt_compress) if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_connect_timeout)
{
uint tmp=opt_connect_timeout;
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, (char*) &tmp);
}
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
...@@ -763,6 +776,7 @@ static void print_version(void) ...@@ -763,6 +776,7 @@ static void print_version(void)
static void usage(void) static void usage(void)
{ {
uint i;
print_version(); print_version();
puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB"); puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
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");
...@@ -804,6 +818,11 @@ static void usage(void) ...@@ -804,6 +818,11 @@ static void usage(void)
-V, --version Output version information and exit\n\ -V, --version Output version information and exit\n\
-w, --wait[=retries] Wait and retry if connection is down\n"); -w, --wait[=retries] 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");
for (i=0 ; changeable_vars[i].name ; i++)
printf("%-20s current value: %lu\n",
changeable_vars[i].name,
(ulong) *changeable_vars[i].varptr);
puts("\nWhere command is a one or more of: (Commands may be shortened)\n\ puts("\nWhere command is a one or more of: (Commands may be shortened)\n\
create databasename Create a new database\n\ create databasename Create a new database\n\
......
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.28-gamma) AM_INIT_AUTOMAKE(mysql, 3.23.29-gamma)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
......
...@@ -686,6 +686,7 @@ static const char *default_options[]= ...@@ -686,6 +686,7 @@ static const char *default_options[]=
"init-command", "host", "database", "debug", "return-found-rows", "init-command", "host", "database", "debug", "return-found-rows",
"ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath", "ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath",
"character-set-dir", "default-character-set", "interactive-timeout", "character-set-dir", "default-character-set", "interactive-timeout",
"connect_timeout",
NullS NullS
}; };
...@@ -745,6 +746,7 @@ static void mysql_read_default_options(struct st_mysql_options *options, ...@@ -745,6 +746,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
case 5: /* pipe */ case 5: /* pipe */
options->named_pipe=1; /* Force named pipe */ options->named_pipe=1; /* Force named pipe */
break; break;
case 20: /* connect_timeout */
case 6: /* timeout */ case 6: /* timeout */
if (opt_arg) if (opt_arg)
options->connect_timeout=atoi(opt_arg); options->connect_timeout=atoi(opt_arg);
......
...@@ -108,7 +108,7 @@ int chk_status(MI_CHECK *param, register MI_INFO *info) ...@@ -108,7 +108,7 @@ int chk_status(MI_CHECK *param, register MI_INFO *info)
else if (mi_is_crashed(info)) else if (mi_is_crashed(info))
mi_check_print_warning(param, mi_check_print_warning(param,
"Table is marked as crashed"); "Table is marked as crashed");
if (share->state.open_count) if (share->state.open_count != (info->s->global_changed ? 1 : 0))
{ {
mi_check_print_warning(param, mi_check_print_warning(param,
"%d clients is using or hasn't closed the table properly", "%d clients is using or hasn't closed the table properly",
......
...@@ -465,7 +465,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -465,7 +465,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.state.create_time= (long) time((time_t*) 0); share.state.create_time= (long) time((time_t*) 0);
if ((file = my_create(fn_format(buff,name,"",MI_NAME_IEXT,4),0, if ((file = my_create(fn_format(buff,name,"",MI_NAME_IEXT,4),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
goto err; goto err;
errpos=1; errpos=1;
VOID(fn_format(buff,name,"",MI_NAME_DEXT,2+4)); VOID(fn_format(buff,name,"",MI_NAME_DEXT,2+4));
......
Testing server '2.1' at 2000-11-23 16:03:39
ATIS table test
Creating tables
Time for create_table (28): 1 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (9768): 33 wallclock secs ( 3.61 usr 2.85 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data
Warning: Query 'select flight.flight_code,aircraft.aircraft_type from flight,aircraft where flight.aircraft_code=aircraft.aircraft_code' returned 100 rows when it should have returned 579 rows
Time for select_simple_join (500): 28 wallclock secs ( 0.35 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Warning: Query 'select airline.airline_name,aircraft.aircraft_type from aircraft,airline,flight where flight.aircraft_code=aircraft.aircraft_code and flight.airline_code=airline.airline_code' returned 100 rows when it should have returned 579 rows
Warning: Query 'select fare.fare_code from restrict_carrier,airline,fare where restrict_carrier.airline_code=airline.airline_code and fare.restrict_code=restrict_carrier.restrict_code' returned 100 rows when it should have returned 5692 rows
Time for select_join (200): 97 wallclock secs ( 0.25 usr 0.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
520 queries in 65 loops of 100 loops took 609 seconds
Estimated time for select_distinct (800): 936 wallclock secs ( 1.20 usr 0.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Warning: Query 'select flight_number,range_miles,fare_class FROM aircraft,flight,flight_class WHERE flight.flight_code=flight_class.flight_code AND flight.aircraft_code=aircraft.aircraft_code AND range_miles<>0 AND (stops=1 OR stops=2) GROUP BY flight_number,range_miles,fare_class' returned 100 rows when it should have returned 150 rows
Warning: Query 'select from_airport,to_airport,range_miles,time_elapsed FROM aircraft,flight WHERE aircraft.aircraft_code=flight.aircraft_code AND to_airport NOT LIKE from_airport AND range_miles<>0 AND time_elapsed<>0 GROUP BY from_airport,to_airport,range_miles,time_elapsed' returned 100 rows when it should have returned 409 rows
Time for select_group (2200): 359 wallclock secs ( 1.35 usr 0.82 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Removing tables
Time to drop_table (28): 7 wallclock secs ( 0.01 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Estimated total time: 1461 wallclock secs ( 6.81 usr 4.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Benchmark DBD suite: 2.9
Date of test: 2000-11-24 15:36:25
Running tests on: Linux 2.2.14-my-SMP i686
Arguments: --tcpip
Comments:
Limits from: frontbase,mysql
Server version: 2.1
ATIS: Estimated total time: 1461 wallclock secs ( 6.81 usr 4.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
alter-table: Total time: 1033 wallclock secs ( 1.13 usr 0.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
big-tables: Total time: 49 wallclock secs ( 2.66 usr 1.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
connect: Total time: 16 wallclock secs ( 3.38 usr 3.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
create: Failed (output/create-frontbase-Linux_2.2.14_my_SMP_i686-cmp-frontbase,mysql)
insert: Failed (output/insert-frontbase-Linux_2.2.14_my_SMP_i686-cmp-frontbase,mysql)
select: Failed (output/select-frontbase-Linux_2.2.14_my_SMP_i686-cmp-frontbase,mysql)
wisconsin: Failed (output/wisconsin-frontbase-Linux_2.2.14_my_SMP_i686-cmp-frontbase,mysql)
Of 8 tests, 4 tests didn't work
Tests with estimated time have a + at end of line
Tests with didn't return the correct result have a ? at end of line
Totals per operation:
Operation seconds usr sys cpu tests
alter_table_add 1018.00 0.71 0.41 0.00 992
connect 4.00 0.87 0.74 0.00 1000
connect+select_1_row 7.00 1.37 1.41 0.00 1000
create_index 5.00 0.00 0.01 0.00 8
create_table 1.00 0.03 0.02 0.00 28
drop_index 0.00 0.00 0.01 0.00 8
drop_table 7.00 0.01 0.02 0.00 28
insert 33.00 3.61 2.85 0.00 9768
insert_many_fields 37.00 0.69 0.74 0.00 2000
select_1_row 2.00 0.37 0.28 0.00 1000
select_2_rows 1.00 0.41 0.35 0.00 1000
select_column+column 2.00 0.35 0.31 0.00 1000
select_distinct 936.00 1.20 0.31 0.00 800 +
select_group 359.00 1.35 0.82 0.00 2200 ?
select_join 97.00 0.25 0.08 0.00 200 ?
select_many_fields 11.00 1.97 0.34 0.00 1000
select_simple_join 28.00 0.35 0.17 0.00 500 ?
TOTALS 2548.00 13.54 8.87 0.00 22532 +???
Testing server '2.1' at 2000-11-23 16:22:34
Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table
Time for insert (1000) 4 wallclock secs ( 0.42 usr 0.29 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 1018 wallclock secs ( 0.71 usr 0.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_index (8): 5 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_index (8): 0 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1033 wallclock secs ( 1.13 usr 0.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server '2.1' at 2000-11-23 17:15:31
Testing of some unusual tables
All tests are done 1000 times with 150 fields
Testing table with 150 fields
Testing select * from table with 1 record
Time to select_many_fields(1000): 11 wallclock secs ( 1.97 usr 0.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES()
Time to insert_many_fields(1000): 14 wallclock secs ( 0.35 usr 0.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert (all_fields) VALUES()
Time to insert_many_fields(1000): 23 wallclock secs ( 0.34 usr 0.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 49 wallclock secs ( 2.66 usr 1.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server '2.1' at 2000-11-23 19:22:47
Testing the speed of connecting to the server and sending of data
All tests are done 1000 times
Testing connection/disconnect
Time to connect (1000): 4 wallclock secs ( 0.87 usr 0.74 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing connect/select 1 row from table/disconnect
Time to connect+select_1_row (1000): 7 wallclock secs ( 1.37 usr 1.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 1 row from table
Time to select_1_row (1000): 2 wallclock secs ( 0.37 usr 0.28 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 2 rows from table
Time to select_2_rows (1000): 1 wallclock secs ( 0.41 usr 0.35 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test select with aritmetic (+)
Time for select_column+column (1000): 2 wallclock secs ( 0.35 usr 0.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 16 wallclock secs ( 3.38 usr 3.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server '2.1' at 2000-11-23 21:30:54
Testing the speed of creating and droping tables
Testing with 1000 tables and 10000 loop count
Testing create of tables
Time for create_MANY_tables (1000): 27 wallclock secs ( 0.63 usr 0.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables
Time to select_group_when_MANY_tables (1000): 5 wallclock secs ( 0.29 usr 0.29 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing drop
Time for drop_table_when_MANY_tables (1000): 799 wallclock secs ( 0.81 usr 0.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing create+drop
Time for create+drop (10000): 2122 wallclock secs (12.59 usr 6.29 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server '2.1' at 2000-11-23 23:33:36
Testing the speed of inserting data into 1 table and do some selects on it.
The tests are done with a table that has 100000 rows.
Generating random keys
Creating tables
Inserting 100000 rows in order
Inserting 100000 rows in reverse order
Inserting 100000 rows in random order
Time for insert (300000): 1077 wallclock secs (121.99 usr 88.83 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data from the table
Warning: Got 100 rows when selecting a whole table of 300000 rows
Contact the database or DBD author!
Time for select_big (10:1000): 0 wallclock secs ( 0.01 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_big_key (10:1000): 206 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_big_key_desc (10:1000): 217 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_big_key2 (10:1000): 200 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_big_key_diff (10:1000): 201 wallclock secs ( 0.04 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_big (10:1000): 204 wallclock secs ( 0.04 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
214 queries in 214 loops of 500 loops took 601 seconds
Estimated time for order_by_range (500:16549): 1404 wallclock secs ( 0.89 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
213 queries in 213 loops of 500 loops took 601 seconds
Estimated time for order_by_key (500:16449): 1410 wallclock secs ( 0.56 usr 0.21 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
209 queries in 209 loops of 500 loops took 601 seconds
Estimated time for order_by_key2_diff (500:20900): 1437 wallclock secs ( 1.03 usr 0.26 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
201 queries in 201 loops of 500 loops took 602 seconds
Estimated time for select_diff_key (500:402): 1497 wallclock secs ( 0.42 usr 0.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
20 queries in 20 loops of 5000 loops took 626 seconds
Estimated time for select_range_prefix (5000:252): 156500 wallclock secs ( 5.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
20 queries in 20 loops of 5000 loops took 608 seconds
Estimated time for select_range_key2 (5000:252): 152000 wallclock secs ( 2.50 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
318 queries in 159 loops of 100000 loops took 603 seconds
Estimated time for select_key_prefix (200000): 379245 wallclock secs (132.08 usr 31.45 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
314 queries in 157 loops of 100000 loops took 602 seconds
Estimated time for select_key (200000): 383439 wallclock secs (159.24 usr 89.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
312 queries in 156 loops of 100000 loops took 604 seconds
Estimated time for select_key2 (200000): 387179 wallclock secs (173.08 usr 57.69 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test of compares with simple ranges
Testing server '2.1' at 2000-11-24 12:38:06
Testing the speed of selecting on keys that consist of many parts
The test-table has 10000 rows and the test is done with 150 ranges.
Creating table
Inserting 10000 rows
Time to insert (10000): 36 wallclock secs ( 3.58 usr 2.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing big selects on the table
Time for select_big (70:17207): 11 wallclock secs ( 0.22 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server '2.1' at 2000-11-24 13:53:57
Wisconsin benchmark test
Time for create_table (3): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (31000): 140 wallclock secs (13.88 usr 9.10 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to delete_big (1): 1 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Running actual benchmark
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
# $server Object for current server # $server Object for current server
# $limits Hash reference to limits for benchmark # $limits Hash reference to limits for benchmark
$benchmark_version="2.9"; $benchmark_version="2.10";
use Getopt::Long; use Getopt::Long;
require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n"; require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n";
......
...@@ -171,7 +171,8 @@ bool berkeley_flush_logs() ...@@ -171,7 +171,8 @@ bool berkeley_flush_logs()
int berkeley_commit(THD *thd, void *trans) int berkeley_commit(THD *thd, void *trans)
{ {
DBUG_ENTER("berkeley_commit"); DBUG_ENTER("berkeley_commit");
DBUG_PRINT("trans",("ending transaction")); DBUG_PRINT("trans",("ending transaction %s",
trans == thd->transaction.stmt.bdb_tid ? "stmt" : "all"));
int error=txn_commit((DB_TXN*) trans,0); int error=txn_commit((DB_TXN*) trans,0);
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (error) if (error)
...@@ -183,7 +184,8 @@ int berkeley_commit(THD *thd, void *trans) ...@@ -183,7 +184,8 @@ int berkeley_commit(THD *thd, void *trans)
int berkeley_rollback(THD *thd, void *trans) int berkeley_rollback(THD *thd, void *trans)
{ {
DBUG_ENTER("berkeley_rollback"); DBUG_ENTER("berkeley_rollback");
DBUG_PRINT("trans",("aborting transaction")); DBUG_PRINT("trans",("aborting transaction %s",
trans == thd->transaction.stmt.bdb_tid ? "stmt" : "all"));
int error=txn_abort((DB_TXN*) trans); int error=txn_abort((DB_TXN*) trans);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -1350,7 +1352,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) ...@@ -1350,7 +1352,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
if (!thd->transaction.bdb_lock_count++) if (!thd->transaction.bdb_lock_count++)
{ {
/* First table lock, start transaction */ /* First table lock, start transaction */
if (!(thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) && if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) &&
!thd->transaction.all.bdb_tid) !thd->transaction.all.bdb_tid)
{ {
/* We have to start a master transaction */ /* We have to start a master transaction */
......
...@@ -138,7 +138,7 @@ static void init_sum_functions(Item_sum **func); ...@@ -138,7 +138,7 @@ static void init_sum_functions(Item_sum **func);
static bool update_sum_func(Item_sum **func); static bool update_sum_func(Item_sum **func);
static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
bool distinct); bool distinct);
static void describe_info(const char *info); static void describe_info(THD *thd, const char *info);
/***************************************************************************** /*****************************************************************************
** check fields, find best join, do the select and output fields. ** check fields, find best join, do the select and output fields.
...@@ -336,7 +336,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, ...@@ -336,7 +336,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
} }
if (select_options & SELECT_DESCRIBE) if (select_options & SELECT_DESCRIBE)
{ {
describe_info("Select tables optimized away"); describe_info(thd,"Select tables optimized away");
delete procedure; delete procedure;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -347,7 +347,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, ...@@ -347,7 +347,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
{ // Only test of functions { // Only test of functions
error=0; error=0;
if (select_options & SELECT_DESCRIBE) if (select_options & SELECT_DESCRIBE)
describe_info("No tables used"); describe_info(thd,"No tables used");
else else
{ {
result->send_fields(fields,1); result->send_fields(fields,1);
...@@ -2726,7 +2726,7 @@ return_zero_rows(select_result *result,TABLE_LIST *tables,List<Item> &fields, ...@@ -2726,7 +2726,7 @@ return_zero_rows(select_result *result,TABLE_LIST *tables,List<Item> &fields,
if (select_options & SELECT_DESCRIBE) if (select_options & SELECT_DESCRIBE)
{ {
describe_info(info); describe_info(current_thd, info);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
if (procedure) if (procedure)
...@@ -6421,6 +6421,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -6421,6 +6421,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
THD *thd=join->thd; THD *thd=join->thd;
DBUG_ENTER("select_describe"); DBUG_ENTER("select_describe");
/* Don't log this into the slow query log */
join->thd->lex.options&= ~(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED);
field_list.push_back(new Item_empty_string("table",NAME_LEN)); field_list.push_back(new Item_empty_string("table",NAME_LEN));
field_list.push_back(new Item_empty_string("type",10)); field_list.push_back(new Item_empty_string("type",10));
field_list.push_back(item=new Item_empty_string("possible_keys", field_list.push_back(item=new Item_empty_string("possible_keys",
...@@ -6573,12 +6575,13 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -6573,12 +6575,13 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
} }
static void describe_info(const char *info) static void describe_info(THD *thd, const char *info)
{ {
List<Item> field_list; List<Item> field_list;
THD *thd=current_thd;
String *packet= &thd->packet; String *packet= &thd->packet;
/* Don't log this into the slow query log */
thd->lex.options&= ~(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED);
field_list.push_back(new Item_empty_string("Comment",80)); field_list.push_back(new Item_empty_string("Comment",80));
if (send_fields(thd,field_list,1)) if (send_fields(thd,field_list,1))
return; /* purecov: inspected */ return; /* purecov: inspected */
......
...@@ -83,6 +83,11 @@ case "$mode" in ...@@ -83,6 +83,11 @@ case "$mode" in
# be overwritten at next upgrade. # be overwritten at next upgrade.
$bindir/safe_mysqld \ $bindir/safe_mysqld \
--datadir=$datadir --pid-file=$pid_file & --datadir=$datadir --pid-file=$pid_file &
# Make lock for RedHat / SuSE
if test -d /var/lock/subsys
then
touch /var/lock/subsys/mysql
fi
else else
echo "Can't execute $bindir/safe_mysqld" echo "Can't execute $bindir/safe_mysqld"
fi fi
...@@ -109,6 +114,11 @@ case "$mode" in ...@@ -109,6 +114,11 @@ case "$mode" in
elif [ -n "$flags" ] elif [ -n "$flags" ]
then echo " done" then echo " done"
fi fi
# delete lock for RedHat / SuSE
if test -d /var/lock/subsys
then
rm /var/lock/subsys/mysql
fi
else else
echo "No mysqld pid file found. Looked for $pid_file." echo "No mysqld pid file found. Looked for $pid_file."
fi fi
......
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