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

Changes for --with-server-suffix

Fixed mutex bug in logging (crash on windows when doing SET PASSWORD=)
Changed MERGE  tables to not use FILE
parent efb0dad5
......@@ -566,6 +566,7 @@ Replication in MySQL
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication
Getting Maximum Performance from MySQL
......@@ -592,6 +593,7 @@ System/Compile Time and Startup Parameter Tuning
* Memory use:: How MySQL uses memory
* Internal locking:: How MySQL locks tables
* Table locking:: Table locking issues
* DNS::
Disk Issues
......@@ -855,7 +857,7 @@ Changes in release 4.0.x (Development; Alpha)
Changes in release 3.23.x (Stable)
* News-3.23.32::
* News-3.23.32:: Changes in release 3.23.32
* News-3.23.31:: Changes in release 3.23.31
* News-3.23.30:: Changes in release 3.23.30
* News-3.23.29:: Changes in release 3.23.29
......@@ -9520,15 +9522,13 @@ tables.
@item --skip-name-resolve
Hostnames are not resolved. All @code{Host} column values in the grant
tables must be IP numbers or @code{localhost}.
tables must be IP numbers or @code{localhost}. @xref{DNS}.
@item --skip-networking
Don't listen for TCP/IP connections at all.
All interaction with @code{mysqld} must be made via Unix sockets.
This option is highly recommended for systems where only local requests
are allowed. However, this option is unsuitable for systems that use
MIT-pthreads, because the MIT-pthreads package doesn't support Unix
sockets.
are allowed. @xref{DNS}.
@item --skip-new
Don't use new, possible wrong routines.
......@@ -9537,7 +9537,7 @@ This will also set default table type to @code{ISAM}. @xref{ISAM}.
@item --skip-host-cache
Never use host name cache for faster name-ip resolution, but query
DNS server on every connect instead.
DNS server on every connect instead. @xref{DNS}.
@item --skip-show-database
Don't allow 'SHOW DATABASE' commands, unless the user has
......@@ -12830,8 +12830,9 @@ Access denied for user: 'root@' (Using password: YES)
This means that @strong{MySQL} got some error when trying to resolve the
IP to a hostname. In this case you can execute @code{mysqladmin
flush-hosts} to reset the internal DNS cache. Some permanent solutions
are:
flush-hosts} to reset the internal DNS cache. @xref{DNS}.
Some permanent solutions are:
@itemize @minus
@item
......@@ -25691,7 +25692,7 @@ tables}.
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication
@end menu
@node Replication Intro, Replication Implementation, Replication, Replication
......@@ -26252,7 +26253,7 @@ last log on the list), backup all the logs you are about to delete
@end multitable
@node Replication FAQ,Troubleshooting Replication, Replication SQL, Replication
@node Replication FAQ, Troubleshooting Replication, Replication SQL, Replication
@section Replication FAQ
@cindex @code{Binlog_Dump}
......@@ -26506,7 +26507,7 @@ We are currently working on intergrating an automatic master election
system into @strong{MySQL}, but until it is ready, you will have to
create your own monitoring tools.
@node Troubleshooting Replication, ,Replication FAQ, Replication
@node Troubleshooting Replication, , Replication FAQ, Replication
@section Troubleshooting Replication
If you have followed the instructions, and your replication setup is not
......@@ -26728,6 +26729,7 @@ are using @code{--skip-locking}
* Memory use:: How MySQL uses memory
* Internal locking:: How MySQL locks tables
* Table locking:: Table locking issues
* DNS::
@end menu
@node Compile and link options, Disk issues, System, System
......@@ -27338,7 +27340,7 @@ single queue. In this case, write locks and read locks would have the same
priority, which might help some applications.
@cindex problems, table locking
@node Table locking, , Internal locking, System
@node Table locking, DNS, Internal locking, System
@subsection Table Locking Issues
The table locking code in @strong{MySQL} is deadlock free.
......@@ -27389,6 +27391,10 @@ Another client issues another @code{SELECT} statement on the same table. As
@code{UPDATE} has higher priority than @code{SELECT}, this @code{SELECT}
will wait for the @code{UPDATE} to finish. It will also wait for the first
@code{SELECT} to finish!
@item
A thread is waiting for something like @code{full disk}, in which case all
threads that wants to access the problem table will also be put in a waiting
state until more disk space is made available.
@end itemize
Some possible solutions to this problem are:
......@@ -27436,6 +27442,39 @@ If you have problems with @code{SELECT} and @code{DELETE}, the @code{LIMIT}
option to @code{DELETE} may help. @xref{DELETE, , @code{DELETE}}.
@end itemize
@cindex DNS
@cindex hostname caching
@node DNS, , Table locking, System
@subsection How MySQL uses DNS
When a new threads connects to @code{mysqld}, @code{mysqld} will span a
new thread to handle the request. This thread will first check if the
hostname is in the hostname cache. If not the thread will call
@code{gethostbyaddr_r()} and @code{gethostbyname_r()} to resolve the
hostname.
If the operating system doesn't support the above thread-safe calls, the
thread will lock a mutex and call @code{gethostbyaddr()} and
@code{gethostbyname()} instead. Note that in this case no other thread
can resolve other hostnames that is not in the hostname cache until the
first thread is ready.
You can disable DNS host lookup by starting @code{mysqld} with
@code{--skip-name-resolve}. In this case you can however only use IP
names in the @strong{MySQL} privilege tables.
If you have a very slow DNS and many hosts, you can get more performance by
either disabling DNS lookop with @code{--skip-name-resolve} or by
increasing the @code{HOST_CACHE_SIZE} define (default: 128) and recompile
@code{mysqld}.
You can disable the hostname cache with @code{--skip-host-cache}. You
can clear the hostname cache with @code{FLUSH HOSTS} or @code{mysqladmin
flush-hosts}.
If you don't want to allow connections over @code{TCP/IP}, you can do this
by starting mysqld with @code{--skip-networking}.
@cindex data, size
@cindex reducing, data size
@cindex storage space, minimizing
......@@ -40667,6 +40706,10 @@ not yet 100 % confident in this code.
@appendixsubsec Changes in release 3.23.32
@itemize @bullet
@item
@code{MERGE} tables didn't work on windows.
@item
Fixed problem with @code{SET PASSWORD=...} on windows.
@item
Added missing @file{my_config.h} to RPM distribution.
@item
@code{TRIM("foo" from "foo")} didn't return an empty string.
......@@ -45267,6 +45310,7 @@ fields, the @code{BLOB} was garbage on output.
Fixed @code{DISTINCT} with calculated columns.
@end itemize
@cindex bugs, known
@cindex errors, known
@cindex design, issues
@cindex known errors
......@@ -45313,6 +45357,9 @@ mapped tables.
@item
For the moment @code{MATCH} only works with @code{SELECT} statements.
@item
When using @code{SET CHARACTER SET}, one can't use translated
characters in database, table and column names.
@item
You cannot build in another directory when using
MIT-pthreads. Because this requires changes to MIT-pthreads, we are not
likely to fix this.
......@@ -45560,6 +45607,10 @@ expansions of column names) should not open the table, but only the
definition file. This will require less memory and be much faster.
@item
New key cache
@item
When using @code{SET CHARACTER SET} we should translate the whole query
at once and not only strings. This will enable users to use the translated
characters in database, table and column names.
@end itemize
@node TODO future, TODO sometime, TODO MySQL 4.0, TODO
......@@ -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.31)
AM_INIT_AUTOMAKE(mysql, 3.23.32)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
......
......@@ -15,7 +15,7 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
BUILT_SOURCES = mysql_version.h m_ctype.h
BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h
pkginclude_HEADERS = dbug.h m_string.h my_sys.h mysql.h mysql_com.h \
mysqld_error.h my_list.h \
my_pthread.h my_no_pthread.h raid.h errmsg.h \
......@@ -43,6 +43,11 @@ all-local: my_global.h my_config.h
link_sources:
$(CP) ../config.h my_config.h
# Keep automake happy
my_config.h: ../config.h
$(CP) ../config.h my_config.h
# This should be changed in the source and removed.
my_global.h: global.h
$(RM) -f my_global.h
......
......@@ -26,6 +26,7 @@
#define NAME_LEN 64 /* Field/table name length */
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
#define SERVER_VERSION_LENGTH 60
#define LOCAL_HOST "localhost"
#define LOCAL_HOST_NAMEDPIPE "."
......
/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB & Detron HB
/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
This file is public domain and comes with NO WARRANTY of any kind */
/* Version numbers for protocol & mysqld */
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#include <custom_conf.h>
#else
#define PROTOCOL_VERSION @PROTOCOL_VERSION@
#define MYSQL_SERVER_VERSION "@VERSION@"
......
......@@ -36,11 +36,12 @@ int mode;
int handle_locking;
{
int save_errno,i,errpos;
uint files,dir_length;
uint files,dir_length,length;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MRG_INFO info,*m_info;
FILE *file;
File fd;
IO_CACHE file;
N_INFO *isam,*last_isam;
DBUG_ENTER("mrg_open");
......@@ -48,15 +49,18 @@ int handle_locking;
isam=0;
errpos=files=0;
bzero((gptr) &info,sizeof(info));
if (!(file=my_fopen(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))))
bzero((char*) &file,sizeof(file));
if ((fd=my_open(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))) < 0 ||
init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0,
MYF(MY_WME | MY_NABP)))
goto err;
errpos=1;
dir_length=dirname_part(name_buff,name);
info.reclength=0;
while (fgets(buff,FN_REFLEN-1,file))
while ((length=my_b_gets(&file,buff,FN_REFLEN-1)))
{
if ((end=strend(buff))[-1] == '\n')
if ((end=buff+length)[-1] == '\n')
end[-1]='\0';
if (buff[0]) /* Skipp empty lines */
{
......@@ -113,7 +117,8 @@ int handle_locking;
m_info->end_table=m_info->open_tables+files;
m_info->last_used_table=m_info->open_tables;
VOID(my_fclose(file,MYF(0)));
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
m_info->open_list.data=(void*) m_info;
pthread_mutex_lock(&THR_LOCK_open);
mrg_open_list=list_add(mrg_open_list,&m_info->open_list);
......@@ -124,7 +129,8 @@ err:
save_errno=my_errno;
switch (errpos) {
case 1:
VOID(my_fclose(file,MYF(0)));
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
for (i=files ; i-- > 0 ; )
{
isam=last_isam;
......
......@@ -30,8 +30,7 @@ dist-hook:
cp -p $(srcdir)/t/*.test $(srcdir)/t/*.opt $(distdir)/t
cp -p $(srcdir)/include/*.inc $(distdir)/include
cp -p $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
cp -p $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.frm \
$(srcdir)/std_data/*.MRG $(distdir)/std_data
cp -p $(srcdir)/std_data/*.dat $(distdir)/std_data
install-data-local:
$(mkinstalldirs) \
......
......@@ -106,4 +106,4 @@ incr othr
2 24
4 33
3 53
c
a
......@@ -75,5 +75,6 @@ drop table t3,t2,t1;
#
# Test table without unions
#
select * from m;
create table t1 (a int not null) type=merge;
select * from t1;
drop table t1;
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 14:00:43
Testing server 'MySQL 3.23.31' at 2001-01-18 0:38:04
ATIS table test
Creating tables
Time for create_table (28): 1 wallclock secs ( 0.02 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (9768): 5 wallclock secs ( 1.06 usr 1.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (9768): 5 wallclock secs ( 0.95 usr 1.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data
Time for select_simple_join (500): 3 wallclock secs ( 1.56 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (200): 23 wallclock secs (13.31 usr 5.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 17 wallclock secs ( 4.36 usr 2.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 20 wallclock secs ( 3.14 usr 1.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_simple_join (500): 3 wallclock secs ( 1.59 usr 0.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (100): 4 wallclock secs ( 1.39 usr 0.55 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key_prefix_join (100): 19 wallclock secs (12.20 usr 4.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 17 wallclock secs ( 4.72 usr 1.55 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 20 wallclock secs ( 3.14 usr 0.95 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Removing tables
Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 69 wallclock secs (23.45 usr 11.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 68 wallclock secs (24.02 usr 9.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
This diff is collapsed.
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 13:16:20
Testing server 'MySQL 3.23.31' at 2001-01-17 23:59:28
Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table
Time for insert (1000) 1 wallclock secs ( 0.11 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for insert (1000) 1 wallclock secs ( 0.13 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 1433 wallclock secs ( 0.45 usr 0.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 1225 wallclock secs ( 0.47 usr 0.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_index (8): 27 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_index (8): 25 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_index (8): 25 wallclock secs ( 0.00 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_index (8): 25 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 1177 wallclock secs ( 0.17 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 1039 wallclock secs ( 0.19 usr 0.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2663 wallclock secs ( 0.73 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2315 wallclock secs ( 0.78 usr 0.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 14:01:53
Testing server 'MySQL 3.23.31' at 2001-01-18 0:39:12
Testing of some unusual tables
All tests are done 1000 times with 1000 fields
Testing table with 1000 fields
Testing select * from table with 1 record
Time to select_many_fields(1000): 20 wallclock secs ( 8.03 usr 9.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_many_fields(1000): 20 wallclock secs ( 8.56 usr 9.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select all_fields from table with 1 record
Time to select_many_fields(1000): 36 wallclock secs ( 9.00 usr 8.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_many_fields(1000): 35 wallclock secs ( 9.09 usr 9.48 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES()
Time to insert_many_fields(1000): 3 wallclock secs ( 0.39 usr 0.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert_many_fields(1000): 4 wallclock secs ( 0.47 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert (all_fields) VALUES()
Time to insert_many_fields(1000): 19 wallclock secs ( 0.16 usr 0.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert_many_fields(1000): 18 wallclock secs ( 0.17 usr 0.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 80 wallclock secs (17.59 usr 18.69 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 80 wallclock secs (18.31 usr 19.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 14:03:13
Testing server 'MySQL 3.23.31' at 2001-01-18 0:40:33
Testing the speed of connecting to the server and sending of data
All tests are done 10000 times
Testing connection/disconnect
Time to connect (10000): 33 wallclock secs (11.66 usr 10.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to connect (10000): 33 wallclock secs (11.47 usr 9.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test connect/simple select/disconnect
Time for connect+select_simple (10000): 38 wallclock secs (12.14 usr 12.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for connect+select_simple (10000): 36 wallclock secs (12.84 usr 11.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test simple select
Time for select_simple (10000): 4 wallclock secs ( 1.05 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_simple (10000): 4 wallclock secs ( 0.88 usr 1.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing connect/select 1 row from table/disconnect
Time to connect+select_1_row (10000): 38 wallclock secs (12.94 usr 12.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to connect+select_1_row (10000): 38 wallclock secs (13.19 usr 12.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 1 row from table
Time to select_1_row (10000): 5 wallclock secs ( 0.78 usr 1.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_1_row (10000): 5 wallclock secs ( 1.14 usr 1.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 2 rows from table
Time to select_2_rows (10000): 6 wallclock secs ( 0.91 usr 2.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_2_rows (10000): 6 wallclock secs ( 0.91 usr 2.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test select with aritmetic (+)
Time for select_column+column (10000): 6 wallclock secs ( 1.00 usr 1.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_column+column (10000): 6 wallclock secs ( 0.88 usr 1.83 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing retrieval of big records (65000 bytes)
Time to select_big (10000): 48 wallclock secs (17.38 usr 7.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_big (10000): 55 wallclock secs (19.23 usr 8.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 178 wallclock secs (57.88 usr 48.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 183 wallclock secs (60.53 usr 49.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 14:06:11
Testing server 'MySQL 3.23.31' at 2001-01-18 0:43:36
Testing the speed of creating and droping tables
Testing with 10000 tables and 10000 loop count
Testing create of tables
Time for create_MANY_tables (10000): 213 wallclock secs ( 2.77 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_MANY_tables (10000): 245 wallclock secs ( 2.73 usr 1.56 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables
Time to select_group_when_MANY_tables (10000): 193 wallclock secs ( 1.28 usr 2.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_group_when_MANY_tables (10000): 249 wallclock secs ( 1.39 usr 2.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing drop
Time for drop_table_when_MANY_tables (10000): 159 wallclock secs ( 1.22 usr 1.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_table_when_MANY_tables (10000): 187 wallclock secs ( 1.08 usr 1.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing create+drop
Time for create+drop (10000): 124 wallclock secs ( 3.22 usr 2.39 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 159 wallclock secs ( 5.92 usr 2.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 848 wallclock secs (14.42 usr 10.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create+drop (10000): 142 wallclock secs ( 3.30 usr 2.89 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 172 wallclock secs ( 5.14 usr 2.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 995 wallclock secs (13.64 usr 10.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
This diff is collapsed.
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 15:53:40
Testing server 'MySQL 3.23.31' at 2001-01-18 2:59:37
Testing the speed of selecting on keys that consist of many parts
The test-table has 10000 rows and the test is done with 500 ranges.
Creating table
Inserting 10000 rows
Time to insert (10000): 7 wallclock secs ( 1.06 usr 1.39 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (10000): 7 wallclock secs ( 1.30 usr 1.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing big selects on the table
Time for select_big (70:17207): 1 wallclock secs ( 0.38 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 189 wallclock secs (26.94 usr 9.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 178 wallclock secs (29.56 usr 11.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 371 wallclock secs (20.88 usr 9.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_big (70:17207): 1 wallclock secs ( 0.41 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 187 wallclock secs (27.39 usr 9.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 179 wallclock secs (29.25 usr 12.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 346 wallclock secs (21.52 usr 9.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:0): 41 wallclock secs ( 2.72 usr 0.84 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:100000): 41 wallclock secs ( 2.81 usr 0.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing count(distinct) on the table
Time for count_distinct (1000:2000): 74 wallclock secs ( 0.95 usr 0.28 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 40 wallclock secs ( 0.63 usr 0.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 149 wallclock secs ( 2.95 usr 1.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 149 wallclock secs ( 2.50 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (1000:10000000): 1095 wallclock secs (227.86 usr 86.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2294 wallclock secs (316.44 usr 121.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct (2000:2000): 80 wallclock secs ( 0.94 usr 0.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 45 wallclock secs ( 0.67 usr 0.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 150 wallclock secs ( 3.31 usr 0.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 150 wallclock secs ( 3.03 usr 1.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (100:1000000): 111 wallclock secs (23.03 usr 7.88 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1297 wallclock secs (113.66 usr 43.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.26 gamma' at 2000-10-13 16:31:55
Testing server 'MySQL 3.23.31' at 2001-01-18 3:21:15
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): 19 wallclock secs ( 2.59 usr 4.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (31000): 19 wallclock secs ( 2.50 usr 3.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to delete_big (1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Running actual benchmark
Time for wisc_benchmark (114): 9 wallclock secs ( 5.80 usr 1.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for wisc_benchmark (114): 9 wallclock secs ( 5.44 usr 1.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 28 wallclock secs ( 8.39 usr 5.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 28 wallclock secs ( 7.94 usr 5.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
......@@ -269,7 +269,7 @@ int MYSQL_LOG::find_first_log(LOG_INFO* linfo, const char* log_name)
for(;;)
{
uint length;
if (!(length=my_b_gets(&io_cache, fname, FN_REFLEN)))
if (!(length=my_b_gets(&io_cache, fname, FN_REFLEN-1)))
{
error = !io_cache.error ? LOG_INFO_EOF : LOG_INFO_IO;
goto err;
......@@ -608,7 +608,9 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
bool MYSQL_LOG::write(Query_log_event* event_info)
{
/* In most cases this is only called if 'is_open()' is true */
bool error=1;
bool error=0;
if (!inited) // Can't use mutex if not init
return 0;
VOID(pthread_mutex_lock(&LOCK_log));
if (is_open())
{
......@@ -622,6 +624,7 @@ bool MYSQL_LOG::write(Query_log_event* event_info)
VOID(pthread_mutex_unlock(&LOCK_log));
return 0;
}
error=1;
if (thd->last_insert_id_used)
{
......@@ -665,8 +668,6 @@ err:
if (file == &log_file)
VOID(pthread_cond_broadcast(&COND_binlog_update));
}
else
error=0;
VOID(pthread_mutex_unlock(&LOCK_log));
return error;
}
......@@ -729,6 +730,8 @@ err:
bool MYSQL_LOG::write(Load_log_event* event_info)
{
bool error=0;
if (inited)
{
VOID(pthread_mutex_lock(&LOCK_log));
if (is_open())
{
......@@ -746,6 +749,7 @@ bool MYSQL_LOG::write(Load_log_event* event_info)
}
}
VOID(pthread_mutex_unlock(&LOCK_log));
}
return error;
}
......
......@@ -311,7 +311,7 @@ public:
void print(FILE* file, bool short_form = 0);
};
extern char server_version[50];
extern char server_version[SERVER_VERSION_LENGTH];
class Start_log_event: public Log_event
{
......@@ -333,6 +333,7 @@ public:
return;
binlog_version = uint2korr(buf+4);
memcpy(server_version, buf + 6, sizeof(server_version));
server_version[sizeof(server_version)-1]=0;
created = uint4korr(buf + 6 + sizeof(server_version));
}
Start_log_event(const char* buf);
......
......@@ -275,6 +275,7 @@ char *net_store_length(char *packet,uint length);
char *net_store_data(char *to,const char *from);
char *net_store_data(char *to,int32 from);
char *net_store_data(char *to,longlong from);
bool net_store_null(String *packet);
bool net_store_data(String *packet,uint32 from);
bool net_store_data(String *packet,longlong from);
......@@ -282,6 +283,9 @@ bool net_store_data(String *packet,const char *from);
bool net_store_data(String *packet,const char *from,uint length);
bool net_store_data(String *packet,struct tm *tmp);
bool net_store_data(String* packet, I_List<i_string>* str_list);
bool net_store_data(String *packet,CONVERT *convert, const char *from,
uint length);
bool net_store_data(String *packet, CONVERT *convert, const char *from);
SORT_FIELD * make_unireg_sortorder(ORDER *order, uint *length);
int setup_order(THD *thd,TABLE_LIST *tables, List<Item> &fields,
......@@ -464,8 +468,8 @@ void sql_print_error(const char *format,...)
__attribute__ ((format (printf, 1, 2)));
extern uint32 server_id;
extern char mysql_data_home[2],server_version[50],max_sort_char,
mysql_real_data_home[];
extern char mysql_data_home[2],server_version[SERVER_VERSION_LENGTH],
max_sort_char, mysql_real_data_home[];
extern my_string mysql_unix_port,mysql_tmpdir;
extern const char *first_keyword, *localhost;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
......
......@@ -22,14 +22,14 @@
#include <my_sys.h>
#include <getopt.h>
#include <thr_alarm.h>
#include "log_event.h"
#define MYSQL_SERVER // We want the C++ version of net
#include <mysql.h>
#include "log_event.h"
#include "mini_client.h"
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
char server_version[50];
char server_version[SERVER_VERSION_LENGTH];
uint32 server_id = 0;
// needed by net_serv.c
......
......@@ -275,7 +275,7 @@ char mysql_real_data_home[FN_REFLEN],
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file;
char *opt_bin_logname = 0; // this one needs to be seen in sql_parse.cc
char server_version[60]=MYSQL_SERVER_VERSION;
char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION;
const char *first_keyword="first";
const char **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF";
......@@ -1428,7 +1428,10 @@ static void open_log(MYSQL_LOG *log, const char *hostname,
char tmp[FN_REFLEN];
if (!opt_name || !opt_name[0])
{
strnmov(tmp,hostname,FN_REFLEN-5);
/* TODO: The following should be using fn_format(); We just need to
first change fn_format() to cut the file name if it's too long.
*/
strmake(tmp,hostname,FN_REFLEN-5);
strmov(strcend(tmp,'.'),extension);
opt_name=tmp;
}
......@@ -1650,7 +1653,10 @@ The server will not act as a slave.");
if (!opt_bin_logname)
{
char tmp[FN_REFLEN];
strnmov(tmp,glob_hostname,FN_REFLEN-5);
/* TODO: The following should be using fn_format(); We just need to
first change fn_format() to cut the file name if it's too long.
*/
strmake(tmp,glob_hostname,FN_REFLEN-5);
strmov(strcend(tmp,'.'),"-bin");
opt_bin_logname=my_strdup(tmp,MYF(MY_WME));
}
......
......@@ -339,3 +339,24 @@ bool net_store_data(String* packet, I_List<i_string>* str_list)
return net_store_data(packet, (char*)tmp.ptr(), tmp.length());
}
/*
** translate and store data; These are mainly used by the SHOW functions
*/
bool
net_store_data(String *packet,CONVERT *convert, const char *from,uint length)
{
if (convert)
return convert->store(packet, from, length);
return net_store_date(packet,from,length);
}
bool
net_store_data(String *packet, CONVERT *convert, const char *from)
{
uint length=(uint) strlen(from);
if (convert)
return convert->store(packet, from, length);
return net_store_date(packet,from,length);
}
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