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

Quoting of TIMESTAMP columns and small optimizations

parent 7155d2a1
...@@ -4,8 +4,8 @@ use Getopt::Long; ...@@ -4,8 +4,8 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env=""; $opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=""; $opt_dbd_options=$opt_perl_options="";
$opt_tmp=""; $opt_tmp="";
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=0; $opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=0;
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s") || usage(); GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip") || usage();
usage() if ($opt_help || $opt_Information); usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution); usage() if (!$opt_distribution);
...@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log"; ...@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log";
$opt_distribution =~ /(mysql-[^\/]*)\.tar/; $opt_distribution =~ /(mysql-[^\/]*)\.tar/;
$ver=$1; $ver=$1;
$gcc_version=which("gcc"); $gcc_version=which("gcc");
$connect_option= ($opt_tcpip ? "--host=$host" : "");
if (defined($gcc_version) && ! $opt_config_env) if (defined($gcc_version) && ! $opt_config_env)
{ {
$tmp=`$gcc_version -v 2>&1`; $tmp=`$gcc_version -v 2>&1`;
...@@ -185,7 +186,7 @@ if ($opt_stage <= 7 && !$opt_no_test) ...@@ -185,7 +186,7 @@ if ($opt_stage <= 7 && !$opt_no_test)
{ {
safe_cd("$test_dir/sql-bench"); safe_cd("$test_dir/sql-bench");
log_system("rm -f limits/mysql.cfg"); log_system("rm -f limits/mysql.cfg");
safe_system("perl ./crash-me --force --batch-mode"); safe_system("perl ./crash-me --force --batch-mode $connect_option");
} }
if ($opt_stage <= 8 && !$opt_no_test) if ($opt_stage <= 8 && !$opt_no_test)
...@@ -193,7 +194,7 @@ if ($opt_stage <= 8 && !$opt_no_test) ...@@ -193,7 +194,7 @@ if ($opt_stage <= 8 && !$opt_no_test)
safe_cd("$test_dir/sql-bench"); safe_cd("$test_dir/sql-bench");
log_system("rm -f output/*"); log_system("rm -f output/*");
$tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : ""; $tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : "";
check_system("perl ./run-all-tests --log --die-on-errors $tmp","RUN-mysql"); check_system("perl ./run-all-tests --log --die-on-errors $connect_option $tmp","RUN-mysql");
} }
if ($opt_stage <= 9 && $opt_result) if ($opt_stage <= 9 && $opt_result)
......
...@@ -238,7 +238,7 @@ Linux notes (all Linux versions) ...@@ -238,7 +238,7 @@ Linux notes (all Linux versions)
* Linux-Alpha:: Linux-Alpha notes * Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes * MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes * Qube2:: Qube2 Linux notes
* Linux-Ia64:: IA64 Linux notes * Linux-Ia64::
BSD/OS notes BSD/OS notes
...@@ -650,7 +650,7 @@ Some common errors when using MySQL ...@@ -650,7 +650,7 @@ Some common errors when using MySQL
Solving some common problems with MySQL Solving some common problems with MySQL
* Log Replication:: Database replication with update log * Log Replication:: Database replication with update log
* Backup:: Database backups * Backup:: Database backups
* Update log:: The update log * Update log:: The update log
* Slow query log:: Log of slow queries * Slow query log:: Log of slow queries
...@@ -766,6 +766,7 @@ MySQL change history ...@@ -766,6 +766,7 @@ MySQL change history
Changes in release 3.23.x (Recommended; beta) Changes in release 3.23.x (Recommended; beta)
* News-3.23.24::
* News-3.23.23:: Changes in release 3.23.23 * News-3.23.23:: Changes in release 3.23.23
* News-3.23.22:: Changes in release 3.23.22 * News-3.23.22:: Changes in release 3.23.22
* News-3.23.21:: Changes in release 3.23.21 * News-3.23.21:: Changes in release 3.23.21
...@@ -9895,8 +9896,9 @@ unchecked values to @strong{MySQL} is very dangerous! ...@@ -9895,8 +9896,9 @@ unchecked values to @strong{MySQL} is very dangerous!
Check data sizes before passing them to @strong{MySQL}. Check data sizes before passing them to @strong{MySQL}.
@item @item
Consider having your application connect to the database using a Consider having your application connect to the database using a
different user name than the one you use for administrative purposes. Do not give different user name than the one you use for administrative purposes. Do
your applications any more access privileges than what they need. not give your applications any more access privileges than what they
need.
@end itemize @end itemize
@item @item
Users of PHP: Users of PHP:
...@@ -12302,6 +12304,11 @@ recent operation if you don't give it a value yourself. You can also set it ...@@ -12302,6 +12304,11 @@ recent operation if you don't give it a value yourself. You can also set it
to the current date and time by assigning it a @code{NULL} value. @xref{Date to the current date and time by assigning it a @code{NULL} value. @xref{Date
and time types}. and time types}.
Note that @code{TIMESTAMP(X)} columns where X is 8 or 14 are reported to
be numbers while other @code{TIMESTAMP(X)} columns are reported to be
strings. This is just to ensure that one can reliable dump and restore
the table with these types!
@tindex TIME @tindex TIME
@item TIME @item TIME
...@@ -28281,17 +28288,32 @@ If you are using Access 2000, you should get and install the newest ...@@ -28281,17 +28288,32 @@ If you are using Access 2000, you should get and install the newest
Microsoft MDAC (@code{Microsoft Data Access Components}) from Microsoft MDAC (@code{Microsoft Data Access Components}) from
@uref{http://www.microsoft.com/data}. This will fix the bug in Access @uref{http://www.microsoft.com/data}. This will fix the bug in Access
that when you export data to @strong{MySQL}, the table and column names that when you export data to @strong{MySQL}, the table and column names
aren't specified. aren't specified. Another way to around this bug is to upgrade to
MyODBC 2.50.33 and @strong{MySQL} 3.23.x, which together provides a
workaround for this bug!
@item @item
You should have a primary key in the table. Set the `Return matching rows' MyODBC option field when connecting to
@strong{MySQL}.
@item
You should have a primary key in the table; If not, new or updated rows
may chow up as @code{#Deleted#}.
@item @item
You should have a timestamp in all tables you want to be able to update. You should have a timestamp in all tables you want to be able to update.
For maximum portability @code{TIMESTAMP(14)} or simple @code{TIMESTAMP} For maximum portability @code{TIMESTAMP(14)} or simple @code{TIMESTAMP}
is recommended instead of other @code{TIMESTAMP(X)} variations. is recommended instead of other @code{TIMESTAMP(X)} variations.
@item @item
Only use double float fields. Access fails when comparing with single floats. Only use double float fields. Access fails when comparing with single floats.
The symptom usually is that new or updated rows may chow up as @code{#Deleted#}
or that you can't find or update rows.
@item @item
Set the `Return matching rows' option field when connecting to @strong{MySQL}. If you still get the error @code{Another user has changed your data} after
adding a @code{TIMESTAMP} column the following trick may help you:
Don't use @code{table} data sheet view. Create instead a form with the
fields you want, and use that @code{form} data sheet view. You should
set the @code{DefaultValue} property for the @code{TIMESTAMP} column to
@code{NOW()}. It may be a good idea to hide the @code{TIMESTAMP} column
from the view to not confuse your users.
@item @item
Access on NT will report @code{BLOB} columns as @code{OLE OBJECTS}. If Access on NT will report @code{BLOB} columns as @code{OLE OBJECTS}. If
you want to have @code{MEMO} columns instead, you should change the you want to have @code{MEMO} columns instead, you should change the
...@@ -28303,8 +28325,8 @@ with these, change the columns to @code{DATETIME}. ...@@ -28303,8 +28325,8 @@ with these, change the columns to @code{DATETIME}.
In some cases, Access may generate illegal SQL queries that In some cases, Access may generate illegal SQL queries that
@strong{MySQL} can't understand. You can fix this by selecting @strong{MySQL} can't understand. You can fix this by selecting
@code{"Query|SQLSpecific|Pass-Through"} from the Access menu. @code{"Query|SQLSpecific|Pass-Through"} from the Access menu.
@end itemize @end itemize
@item Borland Builder 4 @item Borland Builder 4
When you start a query you can use the property @code{Active} or use the When you start a query you can use the property @code{Active} or use the
method @code{Open}. Note that @code{Active} will start by automatically issue method @code{Open}. Note that @code{Active} will start by automatically issue
...@@ -35673,6 +35695,7 @@ version. The replication and BerkeleyDB code is still under development, ...@@ -35673,6 +35695,7 @@ version. The replication and BerkeleyDB code is still under development,
though, so 3.23 is not released as a stable version yet. though, so 3.23 is not released as a stable version yet.
@menu @menu
* News-3.23.24:: Changes in release 3.23.24
* News-3.23.23:: Changes in release 3.23.23 * News-3.23.23:: Changes in release 3.23.23
* News-3.23.22:: Changes in release 3.23.22 * News-3.23.22:: Changes in release 3.23.22
* News-3.23.21:: Changes in release 3.23.21 * News-3.23.21:: Changes in release 3.23.21
...@@ -35699,7 +35722,16 @@ though, so 3.23 is not released as a stable version yet. ...@@ -35699,7 +35722,16 @@ though, so 3.23 is not released as a stable version yet.
* News-3.23.0:: Changes in release 3.23.0 * News-3.23.0:: Changes in release 3.23.0
@end menu @end menu
@node News-3.23.23, News-3.23.22, News-3.23.x, News-3.23.x @node News-3.23.24, News-3.23.23, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.24
@itemize @bullet
@item
To make it possibly to reliable dump and restore tables with
@code{TIMESTAMP(X)} columns, @code{MySQL} now reports columns with X
other than 14 or 8 to be strings.
@end itemize
@node News-3.23.23, News-3.23.22, News-3.23.24, News-3.23.x
@appendixsubsec Changes in release 3.23.23 @appendixsubsec Changes in release 3.23.23
@itemize @bullet @itemize @bullet
@item @item
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee>
**/ **/
#define DUMP_VERSION "8.8" #define DUMP_VERSION "8.9"
#include <global.h> #include <global.h>
#include <my_sys.h> #include <my_sys.h>
...@@ -943,7 +943,7 @@ static void dumpTable(uint numFields, char *table) ...@@ -943,7 +943,7 @@ static void dumpTable(uint numFields, char *table)
{ {
if (length) if (length)
{ {
if (!IS_NUM(field->type)) if (!IS_NUM_FIELD(field))
{ {
if (dynstr_realloc(&extended_row,length * 2+2)) if (dynstr_realloc(&extended_row,length * 2+2))
{ {
...@@ -975,7 +975,7 @@ static void dumpTable(uint numFields, char *table) ...@@ -975,7 +975,7 @@ static void dumpTable(uint numFields, char *table)
putchar(','); putchar(',');
if (row[i]) if (row[i])
{ {
if (!IS_NUM(field->type)) if (!IS_NUM_FIELD(field))
unescape(stdout, row[i], lengths[i]); unescape(stdout, row[i], lengths[i]);
else else
fputs(row[i],stdout); fputs(row[i],stdout);
......
...@@ -73,6 +73,8 @@ extern char *mysql_unix_port; ...@@ -73,6 +73,8 @@ extern char *mysql_unix_port;
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && (f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8) || (f)->type == FIELD_TYPE_YEAR)
typedef struct st_mysql_field { typedef struct st_mysql_field {
char *name; /* Name of column */ char *name; /* Name of column */
......
...@@ -61,6 +61,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, ...@@ -61,6 +61,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ #define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#define SET_FLAG 2048 /* field is a set */ #define SET_FLAG 2048 /* field is a set */
#define NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ #define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */ #define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
......
...@@ -852,6 +852,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, ...@@ -852,6 +852,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags= (uint) (uchar) row->data[4][0]; field->flags= (uint) (uchar) row->data[4][0];
field->decimals=(uint) (uchar) row->data[4][1]; field->decimals=(uint) (uchar) row->data[4][1];
} }
if (INTERNAL_NUM_FIELD(field))
field->flags|= NUM_FLAG;
if (default_value && row->data[5]) if (default_value && row->data[5])
field->def=strdup_root(alloc,(char*) row->data[5]); field->def=strdup_root(alloc,(char*) row->data[5]);
else else
......
...@@ -310,7 +310,7 @@ then ...@@ -310,7 +310,7 @@ then
echo echo
echo "The latest information about MySQL is available on the web at" echo "The latest information about MySQL is available on the web at"
echo "http://www.mysql.com" echo "http://www.mysql.com"
echo "Support MySQL by buying support/licenses at http://www.mysql.com/license.htmy." echo "Support MySQL by buying support/licenses at https://order.mysql.com"
echo echo
exit 0 exit 0
else else
......
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:36:42 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:23:52
ATIS table test ATIS table test
Creating tables Creating tables
Time for create_table (28): 1 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data Inserting data
Time to insert (9768): 5 wallclock secs ( 0.88 usr 1.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (9768): 5 wallclock secs ( 0.69 usr 1.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data Retrieving data
Time for select_simple_join (500): 3 wallclock secs ( 1.58 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple_join (500): 4 wallclock secs ( 1.47 usr 0.69 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (200): 22 wallclock secs (12.86 usr 5.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 22 wallclock secs (13.20 usr 5.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 17 wallclock secs ( 4.78 usr 1.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 17 wallclock secs ( 4.75 usr 1.70 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 20 wallclock secs ( 3.55 usr 1.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 19 wallclock secs ( 3.31 usr 0.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Removing tables 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) 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: 68 wallclock secs (23.67 usr 10.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 67 wallclock secs (23.42 usr 10.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
This diff is collapsed.
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 16:59:02 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 0:45:18
Testing of ALTER TABLE Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table Insert data into the table
Time for insert (1000) 0 wallclock secs ( 0.13 usr 0.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert (1000) 0 wallclock secs ( 0.13 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 1201 wallclock secs ( 0.53 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for alter_table_add (992): 1228 wallclock secs ( 0.55 usr 0.17 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 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.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop_index (8): 27 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 1009 wallclock secs ( 0.23 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for alter_table_drop (496): 1033 wallclock secs ( 0.17 usr 0.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2260 wallclock secs ( 0.89 usr 0.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 2313 wallclock secs ( 0.84 usr 0.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:37:50 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:25:00
Testing of some unusual tables Testing of some unusual tables
All tests are done 1000 times with 1000 fields All tests are done 1000 times with 1000 fields
Testing table with 1000 fields Testing table with 1000 fields
Testing select * from table with 1 record Testing select * from table with 1 record
Time to select_many_fields(1000): 20 wallclock secs ( 8.56 usr 9.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_many_fields(1000): 20 wallclock secs ( 8.72 usr 9.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select all_fields from table with 1 record Testing select all_fields from table with 1 record
Time to select_many_fields(1000): 35 wallclock secs ( 8.77 usr 9.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_many_fields(1000): 36 wallclock secs ( 8.88 usr 9.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES() Testing insert VALUES()
Time to insert_many_fields(1000): 3 wallclock secs ( 0.39 usr 0.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert_many_fields(1000): 3 wallclock secs ( 0.66 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert (all_fields) VALUES() Testing insert (all_fields) VALUES()
Time to insert_many_fields(1000): 19 wallclock secs ( 0.19 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert_many_fields(1000): 18 wallclock secs ( 0.16 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 80 wallclock secs (17.91 usr 18.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 79 wallclock secs (18.42 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 22:55:01 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:26:20
Testing the speed of connecting to the server and sending of data Testing the speed of connecting to the server and sending of data
All tests are done 10000 times All tests are done 10000 times
Testing connection/disconnect Testing connection/disconnect
Time to connect (10000): 34 wallclock secs (11.53 usr 10.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to connect (10000): 33 wallclock secs (11.69 usr 10.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test connect/simple select/disconnect Test connect/simple select/disconnect
Time for connect+select_simple (10000): 37 wallclock secs (12.56 usr 11.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for connect+select_simple (10000): 36 wallclock secs (12.89 usr 11.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test simple select Test simple select
Time for select_simple (10000): 4 wallclock secs ( 0.94 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple (10000): 4 wallclock secs ( 1.03 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing connect/select 1 row from table/disconnect Testing connect/select 1 row from table/disconnect
Time to connect+select_1_row (10000): 39 wallclock secs (12.75 usr 13.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to connect+select_1_row (10000): 39 wallclock secs (11.72 usr 12.45 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 1 row from table Testing select 1 row from table
Time to select_1_row (10000): 5 wallclock secs ( 1.11 usr 1.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_1_row (10000): 5 wallclock secs ( 0.95 usr 2.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 2 rows from table Testing select 2 rows from table
Time to select_2_rows (10000): 7 wallclock secs ( 1.23 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_2_rows (10000): 5 wallclock secs ( 1.30 usr 1.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test select with aritmetic (+) Test select with aritmetic (+)
Time for select_column+column (10000): 6 wallclock secs ( 1.05 usr 1.86 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_column+column (10000): 6 wallclock secs ( 1.11 usr 1.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing retrieval of big records (65000 bytes) Testing retrieval of big records (65000 bytes)
Time to select_big (10000): 54 wallclock secs (15.66 usr 8.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_big (10000): 57 wallclock secs (18.77 usr 10.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 186 wallclock secs (56.84 usr 51.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 185 wallclock secs (59.45 usr 51.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:41:14 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:29:26
Testing the speed of creating and droping tables Testing the speed of creating and droping tables
Testing with 10000 tables and 10000 loop count Testing with 10000 tables and 10000 loop count
Testing create of tables Testing create of tables
Time for create_MANY_tables (10000): 232 wallclock secs ( 2.97 usr 1.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_MANY_tables (10000): 219 wallclock secs ( 2.70 usr 1.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables Accessing tables
Time to select_group_when_MANY_tables (10000): 306 wallclock secs ( 1.09 usr 1.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_group_when_MANY_tables (10000): 191 wallclock secs ( 1.67 usr 1.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing drop Testing drop
Time for drop_table_when_MANY_tables (10000): 223 wallclock secs ( 0.80 usr 1.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop_table_when_MANY_tables (10000): 153 wallclock secs ( 1.09 usr 1.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing create+drop Testing create+drop
Time for create+drop (10000): 123 wallclock secs ( 3.36 usr 2.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create+drop (10000): 128 wallclock secs ( 3.75 usr 2.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 156 wallclock secs ( 5.13 usr 2.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_key+drop (10000): 161 wallclock secs ( 5.14 usr 2.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1040 wallclock secs (13.34 usr 9.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 852 wallclock secs (14.36 usr 9.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:58:36 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:43:39
Testing the speed of inserting data into 1 table and do some selects on it. 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. The tests are done with a table that has 100000 rows.
Generating random keys Generating random keys
Creating tables Creating tables
Inserting 100000 rows in order Inserting 100000 rows in order
Inserting 100000 rows in reverse order Inserting 100000 rows in reverse order
Inserting 100000 rows in random order Inserting 100000 rows in random order
Time for insert (300000): 204 wallclock secs (29.41 usr 41.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert (300000): 206 wallclock secs (30.56 usr 39.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert of duplicates Testing insert of duplicates
Time for insert_duplicates (300000): 38 wallclock secs ( 8.48 usr 12.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert_duplicates (300000): 59 wallclock secs ( 8.80 usr 11.75 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data from the table Retrieving data from the table
Time for select_big (10:3000000): 87 wallclock secs (62.05 usr 25.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_big (10:3000000): 87 wallclock secs (61.98 usr 25.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_key (10:3000000): 88 wallclock secs (62.23 usr 25.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for order_by_key (10:3000000): 88 wallclock secs (63.17 usr 24.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by (10:3000000): 98 wallclock secs (62.59 usr 25.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for order_by (10:3000000): 98 wallclock secs (62.34 usr 25.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_diff_key (500:1000): 138 wallclock secs ( 0.52 usr 0.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_diff_key (500:1000): 124 wallclock secs ( 0.48 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range_prefix (5010:42084): 15 wallclock secs ( 4.33 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range_prefix (5010:42084): 14 wallclock secs ( 4.63 usr 1.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (5010:42084): 15 wallclock secs ( 4.53 usr 1.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (5010:42084): 16 wallclock secs ( 4.67 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key_prefix (200000): 198 wallclock secs (93.94 usr 37.94 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_key_prefix (200000): 200 wallclock secs (92.94 usr 38.81 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key (200000): 201 wallclock secs (92.41 usr 38.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_key (200000): 201 wallclock secs (92.67 usr 41.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test of compares with simple ranges Test of compares with simple ranges
Time for select_range_prefix (20000:43500): 13 wallclock secs ( 5.61 usr 2.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range_prefix (20000:43500): 13 wallclock secs ( 5.33 usr 2.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (20000:43500): 13 wallclock secs ( 5.55 usr 2.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (20000:43500): 14 wallclock secs ( 5.75 usr 2.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (111): 31 wallclock secs ( 0.09 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (111): 33 wallclock secs ( 0.14 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (15000): 14 wallclock secs ( 6.27 usr 2.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max_on_key (15000): 14 wallclock secs ( 6.51 usr 2.45 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max (60): 18 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max (60): 18 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (100): 26 wallclock secs ( 0.06 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_on_key (100): 25 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count (100): 40 wallclock secs ( 0.11 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count (100): 39 wallclock secs ( 0.14 usr 0.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (20): 95 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_big (20): 98 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of keys with functions Testing update of keys with functions
Time for update_of_key (500): 62 wallclock secs ( 4.58 usr 6.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key (500): 63 wallclock secs ( 4.78 usr 6.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for update_of_key_big (501): 33 wallclock secs ( 0.05 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key_big (501): 34 wallclock secs ( 0.05 usr 0.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update with key Testing update with key
Time for update_with_key (100000): 185 wallclock secs (25.34 usr 40.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_with_key (100000): 188 wallclock secs (26.88 usr 40.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of all rows Testing update of all rows
Time for update_big (500): 64 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_big (500): 68 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing left outer join Testing left outer join
Time for outer_join_on_key (10:10): 37 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_on_key (10:10): 40 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join (10:10): 115 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join (10:10): 118 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join_found (10:10): 102 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_found (10:10): 104 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join_not_found (500:10): 54 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_not_found (500:10): 59 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing delete Testing delete
Time for delete_key (10000): 6 wallclock secs ( 0.84 usr 1.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_key (10000): 7 wallclock secs ( 0.73 usr 1.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for delete_big (12): 21 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_big (12): 21 wallclock secs ( 0.00 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Insert into table with 16 keys and with a primary key with 16 parts Insert into table with 16 keys and with a primary key with 16 parts
Time for insert_key (100000): 1418 wallclock secs (13.78 usr 12.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert_key (100000): 1434 wallclock secs (14.73 usr 12.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of keys Testing update of keys
Time for update_of_key (256): 406 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key (256): 427 wallclock secs ( 0.02 usr 0.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Deleting everything from table Deleting everything from table
Time for delete_big_many_keys (2): 438 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_big_many_keys (2): 412 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting 100000 rows with multiple values Inserting 100000 rows with multiple values
Time for multiple_value_insert (100000): 10 wallclock secs ( 2.59 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for multiple_value_insert (100000): 9 wallclock secs ( 2.48 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop table(1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop table(1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 4284 wallclock secs (485.59 usr 280.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 4332 wallclock secs (490.00 usr 278.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 19:10:01 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 2:55:53
Testing the speed of selecting on keys that consist of many parts 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. The test-table has 10000 rows and the test is done with 500 ranges.
Creating table Creating table
Inserting 10000 rows Inserting 10000 rows
Time to insert (10000): 7 wallclock secs ( 1.27 usr 1.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (10000): 7 wallclock secs ( 1.23 usr 1.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing big selects on the table Testing big selects on the table
Time for select_big (70:17207): 1 wallclock secs ( 0.39 usr 0.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_big (70:17207): 1 wallclock secs ( 0.34 usr 0.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 185 wallclock secs (27.20 usr 8.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (410:1057904): 189 wallclock secs (27.13 usr 9.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 161 wallclock secs (31.55 usr 12.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max_on_key (70000): 166 wallclock secs (30.02 usr 11.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 321 wallclock secs (21.41 usr 8.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_on_key (50000): 320 wallclock secs (22.06 usr 8.56 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:0): 34 wallclock secs ( 2.64 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_group_on_key_parts (1000:0): 40 wallclock secs ( 2.53 usr 0.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing count(distinct) on the table Testing count(distinct) on the table
Time for count_distinct (1000:2000): 69 wallclock secs ( 1.17 usr 0.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct (1000:2000): 75 wallclock secs ( 1.13 usr 0.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 38 wallclock secs ( 0.70 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group_on_key (1000:6000): 40 wallclock secs ( 0.81 usr 0.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 153 wallclock secs ( 2.61 usr 1.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group_on_key_parts (1000:100000): 158 wallclock secs ( 2.78 usr 1.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 152 wallclock secs ( 2.81 usr 0.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group (1000:100000): 157 wallclock secs ( 2.50 usr 1.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (1000:10000000): 1134 wallclock secs (224.20 usr 81.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_big (1000:10000000): 1125 wallclock secs (223.27 usr 83.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2255 wallclock secs (315.95 usr 115.52 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 2278 wallclock secs (313.80 usr 117.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 19:47:36 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 3:33:51
Wisconsin benchmark test 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) 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 Inserting data
Time to insert (31000): 19 wallclock secs ( 2.52 usr 3.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (31000): 18 wallclock secs ( 2.22 usr 3.97 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) 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 Running actual benchmark
Time for wisc_benchmark (114): 9 wallclock secs ( 5.66 usr 1.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for wisc_benchmark (114): 9 wallclock secs ( 5.69 usr 1.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 29 wallclock secs ( 8.19 usr 5.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 28 wallclock secs ( 7.91 usr 5.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
2000-09-01 Michael Widenius <monty@mysql.com>
* Avoid allocation of "localhost" string.
* Changed that TIMESTAMP(X) is sometimes as string
* Release of 3.23.23
2000-08-21 Michael Widenius <monty@mysql.com> 2000-08-21 Michael Widenius <monty@mysql.com>
* Added RENAME TABLE. * Added RENAME TABLE.
......
...@@ -514,7 +514,7 @@ public: ...@@ -514,7 +514,7 @@ public:
Field_timestamp(char *ptr_arg, uint32 len_arg, Field_timestamp(char *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg); struct st_table *table_arg);
enum Item_result result_type () const { return INT_RESULT; } enum Item_result result_type () const { return field_length == 8 || field_length == 14 ? INT_RESULT : STRING_RESULT; }
enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;} enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
void store(const char *to,uint length); void store(const char *to,uint length);
......
...@@ -426,7 +426,7 @@ void sql_print_error(const char *format,...) ...@@ -426,7 +426,7 @@ void sql_print_error(const char *format,...)
extern char mysql_data_home[2],server_version[50],max_sort_char, extern char mysql_data_home[2],server_version[50],max_sort_char,
mysql_real_data_home[]; mysql_real_data_home[];
extern my_string mysql_unix_port,mysql_tmpdir; extern my_string mysql_unix_port,mysql_tmpdir;
extern const char *first_keyword; extern const char *first_keyword, *localhost;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables, extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
created_tmp_tables, aborted_threads,aborted_connects, created_tmp_tables, aborted_threads,aborted_connects,
delayed_insert_timeout, delayed_insert_timeout,
......
...@@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0; ...@@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0;
// replication parameters, if master_host is not NULL, we are slaving off the master // replication parameters, if master_host is not NULL, we are slaving off the master
my_string master_user = (char*) "test", master_password = 0, master_host=0, my_string master_user = (char*) "test", master_password = 0, master_host=0,
master_info_file = (char*) "master.info"; master_info_file = (char*) "master.info";
const char *localhost=LOCAL_HOST;
uint master_port = MYSQL_PORT, master_connect_retry = 60; uint master_port = MYSQL_PORT, master_connect_retry = 60;
ulong max_tmp_tables,max_heap_table_size; ulong max_tmp_tables,max_heap_table_size;
...@@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue; continue;
} }
if (!(vio_tmp=vio_new(new_sock, if (!(vio_tmp=vio_new(new_sock,
new_sock == unix_sock ? VIO_TYPE_SOCKET : sock == unix_sock ? VIO_TYPE_SOCKET :
VIO_TYPE_TCPIP, VIO_TYPE_TCPIP,
new_sock == unix_sock)) || sock == unix_sock)) ||
my_net_init(&thd->net,vio_tmp)) my_net_init(&thd->net,vio_tmp))
{ {
if (vio_tmp) if (vio_tmp)
...@@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue; continue;
} }
if (sock == unix_sock) if (sock == unix_sock)
{ thd->host=(char*) localhost;
if (!(thd->host=my_strdup(LOCAL_HOST,MYF(0))))
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES);
delete thd;
continue;
}
}
create_new_thread(thd); create_new_thread(thd);
} }
......
...@@ -150,7 +150,8 @@ THD::~THD() ...@@ -150,7 +150,8 @@ THD::~THD()
DBUG_PRINT("info", ("freeing host")); DBUG_PRINT("info", ("freeing host"));
safeFree(host); if (host != localhost) // If not pointer to constant
safeFree(host);
safeFree(user); safeFree(user);
safeFree(db); safeFree(db);
safeFree(ip); safeFree(ip);
......
...@@ -180,10 +180,7 @@ check_connections(THD *thd) ...@@ -180,10 +180,7 @@ check_connections(THD *thd)
#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread) #if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
/* Fast local hostname resolve for Win32 */ /* Fast local hostname resolve for Win32 */
if (!strcmp(thd->ip,"127.0.0.1")) if (!strcmp(thd->ip,"127.0.0.1"))
{ thd->host=(char*) localhost;
if (!(thd->host=my_strdup("localhost",MYF(0))))
return (ER_OUT_OF_RESOURCES);
}
else else
#endif #endif
if (!(specialflag & SPECIAL_NO_RESOLVE)) if (!(specialflag & SPECIAL_NO_RESOLVE))
...@@ -199,9 +196,9 @@ check_connections(THD *thd) ...@@ -199,9 +196,9 @@ check_connections(THD *thd)
if (acl_check_host(thd->host,thd->ip)) if (acl_check_host(thd->host,thd->ip))
return(ER_HOST_NOT_PRIVILEGED); return(ER_HOST_NOT_PRIVILEGED);
} }
else /* No hostname means that the connection was on a socket */ else /* Hostname given means that the connection was on a socket */
{ {
DBUG_PRINT("general",("Host: localhost")); DBUG_PRINT("general",("Host: %s",thd->host));
thd->ip=0; thd->ip=0;
bzero((char*) &thd->remote,sizeof(struct sockaddr)); bzero((char*) &thd->remote,sizeof(struct sockaddr));
} }
...@@ -561,7 +558,7 @@ bool do_command(THD *thd) ...@@ -561,7 +558,7 @@ bool do_command(THD *thd)
{ {
packet=(char*) net->read_pos; packet=(char*) net->read_pos;
command = (enum enum_server_command) (uchar) packet[0]; command = (enum enum_server_command) (uchar) packet[0];
DBUG_PRINT("general",("Command on socket %s = %d (%s)", DBUG_PRINT("general",("Command on %s = %d (%s)",
vio_description(net->vio), command, vio_description(net->vio), command,
command_name[command])); command_name[command]));
} }
......
...@@ -97,7 +97,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) ...@@ -97,7 +97,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME)))) if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
{ {
vio_reset(vio, type, sd, 0, localhost); vio_reset(vio, type, sd, 0, localhost);
sprintf(vio->desc, "socket (%d)", vio->sd); sprintf(vio->desc,
(vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
vio->sd);
#if !defined(___WIN__) && !defined(__EMX__) #if !defined(___WIN__) && !defined(__EMX__)
#if !defined(NO_FCNTL_NONBLOCK) #if !defined(NO_FCNTL_NONBLOCK)
vio->fcntl_mode = fcntl(sd, F_GETFL); vio->fcntl_mode = fcntl(sd, F_GETFL);
......
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