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 \
Support/generate-mirror-listing.pl
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
EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY
......@@ -30,9 +30,9 @@ txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
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.
paper: manual_a4.ps manual_letter.ps
paper: manual_a4.ps manual_letter.ps $(PDFMANUAL)
#########################################################################
......
This diff is collapsed.
......@@ -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
# 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:
cd include; $(MAKE) link_sources
......
......@@ -109,7 +109,7 @@ static HashTable ht;
enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE;
const char *VER="11.6";
const char *VER="11.7";
static MYSQL mysql; /* The connection */
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,
vertical=0,skip_line_numbers=0,skip_column_names=0,opt_html=0,
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 int connect_flag=CLIENT_INTERACTIVE;
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 String glob_buffer,old_buffer;
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];
char pager[FN_REFLEN], outfile[FN_REFLEN];
FILE *PAGER, *OUTFILE;
......@@ -371,7 +371,7 @@ sig_handler mysql_end(int sig)
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} ;
......@@ -420,7 +420,6 @@ static struct option long_options[] =
{"socket", required_argument, 0, 'S'},
#include "sslopt-longopts.h"
{"table", no_argument, 0, 't'},
{"timeout", required_argument, 0, OPT_TIMEOUT},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'},
#endif
......@@ -434,6 +433,7 @@ static struct option long_options[] =
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,
24*1024L*1024L, MALLOC_OVERHEAD,1024},
{ "net_buffer_length",(long*) &net_buffer_length,16384,1024,24*1024*1024L,
......@@ -697,9 +697,6 @@ static int get_options(int argc, char **argv)
opt_mysql_unix_port=my_strdup(MYSQL_NAMEDPIPE,MYF(0));
#endif
break;
case OPT_TIMEOUT:
opt_connect_timeout=atoi(optarg);
break;
case 'V': usage(1); exit(0);
case 'I':
case '?':
......@@ -2045,8 +2042,11 @@ sql_real_connect(char *host,char *database,char *user,char *password,
}
mysql_init(&mysql);
if (opt_connect_timeout)
{
uint timeout=opt_connect_timeout;
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT,
(char*) &opt_connect_timeout);
(char*) &timeout);
}
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
......
......@@ -28,7 +28,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
#define ADMIN_VERSION "8.12"
#define ADMIN_VERSION "8.13"
#define MAX_MYSQL_VAR 64
#define MAX_TIME_TO_WAIT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
......@@ -40,6 +40,7 @@ static int interval=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;
static uint tcp_port = 0, option_wait = 0;
static ulong opt_connect_timeout;
static my_string unix_port=0;
/* When using extended-status relatively, ex_val_max_len is the estimated
......@@ -116,11 +117,12 @@ static struct option long_options[] = {
#endif
{"port", required_argument, 0, 'P'},
{"relative", no_argument, 0, 'r'},
{"set-variable", required_argument, 0, 'O'},
{"silent", no_argument, 0, 's'},
{"socket", required_argument, 0, 'S'},
{"sleep", required_argument, 0, 'i'},
#include "sslopt-longopts.h"
{"timeout", required_argument, 0, 't'},
{"connect-timeout", required_argument, 0, 't'},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'},
#endif
......@@ -131,6 +133,11 @@ static struct option long_options[] = {
{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 };
int main(int argc,char *argv[])
......@@ -143,7 +150,7 @@ int main(int argc,char *argv[])
mysql_init(&mysql);
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)
{
switch(c) {
......@@ -187,6 +194,13 @@ int main(int argc,char *argv[])
case 'E':
opt_vertical = 1;
break;
case 'O':
if (set_changeable_var(optarg, changeable_vars))
{
usage();
return(1);
}
break;
case 's':
option_silent = 1;
break;
......@@ -198,12 +212,6 @@ int main(int argc,char *argv[])
unix_port=MYSQL_NAMEDPIPE;
#endif
break;
case 't':
{
uint tmp=atoi(optarg);
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, (char*) &tmp);
break;
}
case '#':
DBUG_PUSH(optarg ? optarg : "d:t:o,/tmp/mysqladmin.trace");
break;
......@@ -253,6 +261,11 @@ int main(int argc,char *argv[])
if (opt_compress)
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
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
......@@ -763,6 +776,7 @@ static void print_version(void)
static void usage(void)
{
uint i;
print_version();
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");
......@@ -804,6 +818,11 @@ static void usage(void)
-V, --version Output version information and exit\n\
-w, --wait[=retries] Wait and retry if connection is down\n");
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\
create databasename Create a new database\n\
......
......@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# 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)
PROTOCOL_VERSION=10
......
......@@ -686,6 +686,7 @@ static const char *default_options[]=
"init-command", "host", "database", "debug", "return-found-rows",
"ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath",
"character-set-dir", "default-character-set", "interactive-timeout",
"connect_timeout",
NullS
};
......@@ -745,6 +746,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
case 5: /* pipe */
options->named_pipe=1; /* Force named pipe */
break;
case 20: /* connect_timeout */
case 6: /* timeout */
if (opt_arg)
options->connect_timeout=atoi(opt_arg);
......
......@@ -108,7 +108,7 @@ int chk_status(MI_CHECK *param, register MI_INFO *info)
else if (mi_is_crashed(info))
mi_check_print_warning(param,
"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,
"%d clients is using or hasn't closed the table properly",
......
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 @@
# $server Object for current server
# $limits Hash reference to limits for benchmark
$benchmark_version="2.9";
$benchmark_version="2.10";
use Getopt::Long;
require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n";
......
......@@ -171,7 +171,8 @@ bool berkeley_flush_logs()
int berkeley_commit(THD *thd, void *trans)
{
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);
#ifndef DBUG_OFF
if (error)
......@@ -183,7 +184,8 @@ int berkeley_commit(THD *thd, void *trans)
int berkeley_rollback(THD *thd, void *trans)
{
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);
DBUG_RETURN(error);
}
......@@ -1350,7 +1352,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
if (!thd->transaction.bdb_lock_count++)
{
/* 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)
{
/* We have to start a master transaction */
......
......@@ -138,7 +138,7 @@ static void init_sum_functions(Item_sum **func);
static bool update_sum_func(Item_sum **func);
static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
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.
......@@ -336,7 +336,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
}
if (select_options & SELECT_DESCRIBE)
{
describe_info("Select tables optimized away");
describe_info(thd,"Select tables optimized away");
delete procedure;
DBUG_RETURN(0);
}
......@@ -347,7 +347,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
{ // Only test of functions
error=0;
if (select_options & SELECT_DESCRIBE)
describe_info("No tables used");
describe_info(thd,"No tables used");
else
{
result->send_fields(fields,1);
......@@ -2726,7 +2726,7 @@ return_zero_rows(select_result *result,TABLE_LIST *tables,List<Item> &fields,
if (select_options & SELECT_DESCRIBE)
{
describe_info(info);
describe_info(current_thd, info);
DBUG_RETURN(0);
}
if (procedure)
......@@ -6421,6 +6421,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
THD *thd=join->thd;
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("type",10));
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,
}
static void describe_info(const char *info)
static void describe_info(THD *thd, const char *info)
{
List<Item> field_list;
THD *thd=current_thd;
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));
if (send_fields(thd,field_list,1))
return; /* purecov: inspected */
......
......@@ -83,6 +83,11 @@ case "$mode" in
# be overwritten at next upgrade.
$bindir/safe_mysqld \
--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
echo "Can't execute $bindir/safe_mysqld"
fi
......@@ -109,6 +114,11 @@ case "$mode" in
elif [ -n "$flags" ]
then echo " done"
fi
# delete lock for RedHat / SuSE
if test -d /var/lock/subsys
then
rm /var/lock/subsys/mysql
fi
else
echo "No mysqld pid file found. Looked for $pid_file."
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