Commit c2b47100 authored by unknown's avatar unknown

Merge


configure.in:
  Auto merged
Docs/manual.texi:
  Auto merged
parents d6ae9514 bee9933a
......@@ -4,8 +4,8 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options="";
$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;
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();
$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","tcpip") || usage();
usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
......@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log";
$opt_distribution =~ /(mysql-[^\/]*)\.tar/;
$ver=$1;
$gcc_version=which("gcc");
$connect_option= ($opt_tcpip ? "--host=$host" : "");
if (defined($gcc_version) && ! $opt_config_env)
{
$tmp=`$gcc_version -v 2>&1`;
......@@ -186,7 +187,7 @@ if ($opt_stage <= 7 && !$opt_no_test)
{
safe_cd("$test_dir/sql-bench");
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)
......@@ -194,7 +195,7 @@ if ($opt_stage <= 8 && !$opt_no_test)
safe_cd("$test_dir/sql-bench");
log_system("rm -f output/*");
$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)
......
......@@ -228,6 +228,7 @@ System-specific issues
* HP-UX 10.20:: HP-UX 10.20 notes
* HP-UX 11.x:: HP-UX 11.x notes
* MacOSX:: MacOSX notes
* BEOS::
Linux notes (all Linux versions)
......@@ -238,7 +239,7 @@ Linux notes (all Linux versions)
* Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes
* Linux-Ia64:: IA64 Linux notes
* Linux-Ia64::
BSD/OS notes
......@@ -649,7 +650,7 @@ Some common errors when using MySQL
Solving some common problems with MySQL
* Log Replication:: Database replication with update log
* Log Replication:: Database replication with update log
* Backup:: Database backups
* Update log:: The update log
* Slow query log:: Log of slow queries
......@@ -765,6 +766,7 @@ MySQL change history
Changes in release 3.23.x (Released as beta)
* News-3.23.24:: Changes in release 3.23.24
* News-3.23.23:: Changes in release 3.23.23
* News-3.23.22:: Changes in release 3.23.22
* News-3.23.21:: Changes in release 3.23.21
......@@ -5609,6 +5611,7 @@ distribution.
* HP-UX 10.20:: HP-UX 10.20 notes
* HP-UX 11.x:: HP-UX 11.x notes
* MacOSX:: MacOSX notes
* BEOS::
@end menu
@node Solaris, Solaris 2.7, Source install system issues, Source install system issues
......@@ -6872,11 +6875,25 @@ Automatic detection of @code{xlC} is missing from Autoconf, so a
@strong{MySQL}: (The example uses the IBM compiler)
@example
shell> CC="xlc_r" CFLAGS="-ma -O3 -qstrict" \
CXX="xlC_r" CXXFLAGS="-ma -O3 -qstrict" \
./configure
export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 "
export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192"
export CFLAGS="-I /usr/local/include"
export LDLFAGS="-L /usr/local/lib"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
./configure --prefix=/usr/local \
--localstatedir=/var/mysql \
--sysconfdir=/etc/mysql \
--sbindir='/usr/local/bin' \
--libexecdir='/usr/local/bin' \
--enable-thread-safe-client \
--enable-large-files
@end example
The above is the options used to compile the @strong{MySQL} distribution that
can be found at @uref{http://www-frec.bull.com/, www-frec.bull.com}.
If you change the @code{-O3} to @code{-O2} in the above configure line,
you must also remove the @code{-qstrict} option (this is a limitation in
the IBM C compiler).
......@@ -6884,16 +6901,26 @@ the IBM C compiler).
If you are using @code{gcc} or @code{egcs} to compile @strong{MySQL}, you
@strong{MUST} use the @code{-fno-exceptions} flag, as the exception
handling in @code{gcc}/@code{egcs} is not thread-safe! (This is tested with
@code{egcs} 1.1.) We recommend the following @code{configure} line with
@code{egcs} and @code{gcc} on AIX:
@code{egcs} 1.1.). There is also some known problems with IBM's assembler
which may cause it to generate bad code when used with gcc.
We recommend the following @code{configure} line with @code{egcs} and
@code{gcc 2.95} on AIX:
@example
shell> CC=gcc \
CXX=gcc \
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \" \
shell> CC="gcc -pipe -mcpu=power2 -Wa,-many" \
CXX="gcc -pipe -mcpu=power2 -Wa,-many" \
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-debug --with-low-memory
@end example
The @code{-Wa,-many} is necessary for the compile to be successful. IBM is
aware of this problem but is in to hurry to fix because of the
workaround available. We don't know if the @code{-fno-exceptions} is required
with @code{gcc 2.95}, but as @strong{MySQL} doesn't use exceptions and the
above option generates faster code we recommend that one should always use
this option with @code{egcs / gcc}.
If you have problems with signals (@strong{MySQL} dies unexpectedly
under high load) you may have found an OS bug with threads and
signals. In this case you can tell @strong{MySQL} not to use signals by
......@@ -7036,7 +7063,7 @@ The optimization flags used by @strong{MySQL} (-O3) are not recognized
by HP's compilers. I did not change the flags.
@end itemize
@node MacOSX, , HP-UX 11.x, Source install system issues
@node MacOSX, BEOS, HP-UX 11.x, Source install system issues
@subsection MacOS X notes
You can get @strong{MySQL} to work on MacOS X by following the links to
......@@ -7055,6 +7082,20 @@ alias mysql '/usr/local/mysql/bin/mysql'
alias mysqladmin '/usr/local/mysql/libexec/mysqladmin'
@end example
@node BEOS, , MacOSX, Source install system issues
@subsection BeOS notes
We are really interested in getting @strong{MySQL} to work on BeOS, but
unfortunately we don't have any person that knows BeOS or have
time to do a port.
We are interested to find someone to do a port and we will help them
with any techincal questions they may have while doing the port.
We have previously talked with some BeOS developers that have said that
@strong{MySQL} is '80% ported to BeOS', but we haven't heard from these
in a while.
@node Windows, OS/2, Source install system issues, Installing
@section Windows notes
......@@ -9894,8 +9935,9 @@ unchecked values to @strong{MySQL} is very dangerous!
Check data sizes before passing them to @strong{MySQL}.
@item
Consider having your application connect to the database using a
different user name than the one you use for administrative purposes. Do not give
your applications any more access privileges than what they need.
different user name than the one you use for administrative purposes. Do
not give your applications any more access privileges than what they
need.
@end itemize
@item
Users of PHP:
......@@ -12301,6 +12343,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
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
@item TIME
......@@ -25914,6 +25961,18 @@ whole databases. @xref{Backup}.
mysqldump --opt database > backup-file.sql
@end example
You can read this back into @strong{MySQL} with:
@example
mysql database < backup-file.sql
@end example
or
@example
mysql -e "source /patch-to-backup/backup-file.sql" database
@end example
However, it's also very useful to populate another @strong{MySQL} server with
information from a database:
......@@ -28107,9 +28166,10 @@ program.
@node Which ODBC OS, ODBC administrator, ODBC, ODBC
@section Operating systems supported by MyODBC
@strong{MyODBC} is a 32-bit ODBC (2.50) level 0 driver for connecting
an ODBC-aware application to @strong{MySQL}. @strong{MyODBC} works on
Windows95, Windows98, NT and on most Unix platforms.
@strong{MyODBC} is a 32-bit ODBC (2.50) level 0 (with level 1 and level
2 features) driver for connecting an ODBC-aware application to
@strong{MySQL}. @strong{MyODBC} works on Windows95, Windows98, NT and
on most Unix platforms.
Normally you only need to install @strong{MyODBC} on Windows machines.
You only need @strong{MyODBC} for Unix if you have a program like
......@@ -28280,17 +28340,32 @@ If you are using Access 2000, you should get and install the newest
Microsoft MDAC (@code{Microsoft Data Access Components}) from
@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
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
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
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}
is recommended instead of other @code{TIMESTAMP(X)} variations.
@item
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
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
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
......@@ -28302,8 +28377,18 @@ with these, change the columns to @code{DATETIME}.
In some cases, Access may generate illegal SQL queries that
@strong{MySQL} can't understand. You can fix this by selecting
@code{"Query|SQLSpecific|Pass-Through"} from the Access menu.
@end itemize
@item ADO
When you access @strong{MyODBC} through ADO, @strong{MyODBC} doesn't
return a result for @code{SQLRowCount} for a query. We have tried to
track this down and according to ODBC logs, @strong{MyODBC} returns the
correct answer but the ADO client only gets -1 back from the ODBC
manager. Because of this we can only assume this is a bug in ADO.
The only known workaround is to use a @code{SELECT COUNT(*)} statement
for a similar query to get the correct row count.
@item Borland Builder 4
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
......@@ -34401,8 +34486,7 @@ more than one way to compute}
@item @uref{http://www.yaboo.dk/, Yaboo - Yet Another BOOkmarker}
@c Didn't answer 2000-07-11
@c @item @uref{http://www.yahoosuck.com, Yahoosuck}
item @uref{http://www.yahoosuck.com, Yahoosuck}
@item @uref{http://www.ozsearch.com.au, OzSearch Internet Guide}
......@@ -34415,6 +34499,8 @@ more than one way to compute}
@itemize @bullet
@item @uref{http:www.spylog.ru/, SpyLOG ; A very popular web counter site}
@item @uref{http://www.tucows.com/, TuCows Network; Free Software archive}
@item @uref{http://www.jobvertise.com,Jobvertise: Post and search for jobs}
......@@ -34944,11 +35030,18 @@ only on Linux.
You can always find the latest version
@uref{http://www.trash.net/~ffischer/admin/index.html, here}.
@item @uref{http://www.mysql.com/Downloads/Win32/MySQL-Maker091.zip,MySQL-Maker 091}.
Shareware @strong{MySQL} client for windows. It's WYSIWYG tool which allows
you to create, change and delete databases and tables.
You can change field - structure and add, change and delete data in
these tables directly without ODBC-driver.
@uref{http://www.presult.de, MySQL Maker homepage (look under support/downloads)}
@item @uref{http://www.mysql.com/Downloads/Contrib/mysqlwinadmn.zip, mysqlwinadmn.zip}
Windows GUI (binary only) to administrate a database, by David B. Mansel,
@email{david@@zhadum.org}.
@item @uref{http://www.mysql.com/Downloads/Contrib/netadmin.zip, netadmin.zip}
@item @uref{http://www.mysql.com/Downloads/Win32/netadmin.zip, netadmin.zip}
An administrator tool for @strong{MySQL} on Windows 95/98 and Windows NT
4.0. Only tested with @strong{MySQL} 3.23.5 - 3.23.7. Written using the
Tmysql components.
......@@ -34959,6 +35052,9 @@ have still some bugs. you can test the program with all features. Please
send bugs and hints to Marco Suess @email{ms@@it-netservice.de}. Original
URL @url{http://www.it-netservice.de/pages/software/index.html}.
@item @uref{http://www.mysql.com/Downloads/Win32/netadmin2.zip, netadmin2.zip}
New version of netadmin; See above for details.
@item @uref{http://www.mysql.com/Downloads/Win32/ARTADMIN203.EXE,Atronic's @strong{MySQL} client for Windows 2.0.3.0}.
Home page for this can be found at: @uref{http://www.artronic.hr}.
@item @uref{http://www.mysql.com/Downloads/Win32/W9xstop.zip,Utility from Artronic to stop MySQL on win9x}
......@@ -35161,11 +35257,17 @@ This module authenticates users via @code{pam}, using @strong{MySQL}.
Netscape Web Server API (NSAPI) functions to authenticate (BASIC) users
against @strong{MySQL} tables. By Yuan John Jiang.
@item @uref{http://www.mysql.com/Downloads/Contrib/qmail-1.03-mysql-0.6.5.patch.gz,
qmail-1.03-mysql-0.6.5.patch.gz}
@item @uref{http://www.mysql.com/Downloads/Contrib/qmail-1.03-mysql-0.6.6.patch.gz,qmail-1.03-mysql-0.6.6.patch.gz}
Patch for qmail to authenticate users from a @strong{MySQL} table.
By @email{takeshi@@SoftAgency.co.jp}
@item @uref{http://www.mysql.com/Downloads/Contrib/proftpd-1.2.0rc2-fix-mysql.patch, proftpd-1.2.0rc2-fix-mysql.patch}
Patch for proftpd1.2.0rc2. By @email{takeshi@@SoftAgency.co.jp}
@item @uref{http://www.mysql.com/Downloads/Contrib/pwcheck_mysql-0.1.tar.gz,pwcheck_mysql-0.1.tar.gz}
An authentication module for the Cyrus IMAP server. By Aaron Newsome.
@end itemize
@appendixsec Converters
......@@ -35237,16 +35339,19 @@ Raw port of a SQL mode for XEmacs. Supports completion. Original by
Peter D. Pezaris @email{pez@@atlantic2.sbi.com} and partial
@strong{MySQL} port by David Axmark.
@item @uref{http://www.mysql.com/Downloads/Win32/MyAccess97_Ver_1_01.zip, MyAccess97 1.01}
MyAccess is an AddIn for Access 97 and handles a lot of maintanance work
for @strong{MySQL} databases.
@item @uref{http://www.mysql.com/Downloads/Win32/myaccess97_1_1.zip, MyAccess97 1.1}
@item @uref{http://www.mysql.com/Downloads/Win32/myaccess2000_1_1.zip, MyAccess2000 1.1}
@item @uref{http://www.mysql.com/Downloads/Win32/MyAccess2000_Ver_1_01.zip, MyAccess2000 1.01}
MyAccess is an AddIn for Access 2000 and handles a lot of maintanance work
for @strong{MySQL} databases.
MyAccess is an AddIn for MS Access 97/2000 which allows you to manage MySQL databases from within Access. Main functions are:
@itemize @bullet
@item Create/Modify Tables
@item Execute Queries against MySQL
@item Extract "Create Table-Scripts' from MySQL
@item Import/Export tables from Access to MySQL and vice versa
@item Log Changes
@end itemize
@uref{http://www.mysql.com/Downloads/Win32/MyAccess-1.01.readme,
MyAccess-readme}. By Hubertus Hiden.
Written by Hubertus Hiden. @uref{http://myaccess.fsn.net, MyAccess homepage}.
@item @uref{http://www.mysql.com/Downloads/Contrib/radius-0.3.tar.gz, radius-0.3.tar.gz}
Patches for @code{radiusd} to make it support @strong{MySQL}. By Wim Bonis,
......@@ -35672,6 +35777,7 @@ version. The replication and BerkeleyDB code is still under development,
though, so 3.23 is not released as a stable version yet.
@menu
* News-3.23.24:: Changes in release 3.23.24
* News-3.23.23:: Changes in release 3.23.23
* News-3.23.22:: Changes in release 3.23.22
* News-3.23.21:: Changes in release 3.23.21
......@@ -35698,10 +35804,31 @@ though, so 3.23 is not released as a stable version yet.
* News-3.23.0:: Changes in release 3.23.0
@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.
@item
Changed sort order for latin1 as it was before 3.23.22. Any table with
@code{CHAR} columns that may have characters > ASCII 128 created or
modified with 3.23.22 must be repaired!
@item
Fixed small memory leak introduced from 3.23.22 when creating a
temporary table.
@item
Fixed problem with BDB tables and reading on unique (not primary) key.
@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
@itemize @bullet
@item
Changed sort order for 'German'; All tables created with 'German' sortorder
must be repaired with @code{REPAIR TABLE} or myisamchk before use!
@item
Added option @code{--core-file} to @code{mysqld} to get a core file on
Linux if mysqld dies on the SIGSEGV signal.
@item
......@@ -35795,6 +35922,9 @@ Fixed fatal bug in @code{LOAD TABLE FROM MASTER} that did not lock the table dur
More variables in @code{SHOW SLAVE STATUS} and @code{SHOW MASTER STATUS}
@item
@code{SLAVE STOP} now will not return until the slave thread actually exits
@item
Full text search via the @code{MATCH} function and @code{FULLTEXT} index type.
(For MyISAM files). This made @code{FULLTEXT} is reserved word.
@end itemize
@node News-3.23.22, News-3.23.21, News-3.23.23, News-3.23.x
......@@ -300,7 +300,7 @@ int main(int argc,char *argv[])
}
}
#endif
sprintf(buff, "Type 'help;' or '\\h' for help.\n");
sprintf(buff, "Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer\n");
put_info(buff,INFO_INFO);
status.exit_status=read_lines(1); // read lines and execute them
mysql_end(0);
......@@ -1680,8 +1680,9 @@ static int com_source(String *buffer, char *line)
while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1])))
end--;
end[0]=0;
unpack_filename(source_name,source_name);
/* open file name */
if (!(sql_file = my_fopen(source_name, O_RDONLY,MYF(0))))
if (!(sql_file = my_fopen(source_name, O_RDONLY | O_BINARY,MYF(0))))
{
char buff[FN_REFLEN+60];
sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno);
......
......@@ -604,6 +604,28 @@ static uint getTableStructure(char *table, char* db)
DBUG_RETURN(0);
}
/* Make an sql-file, if path was given iow. option -T was given */
if (!tFlag)
{
if (path)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
strmov(tmp_path,path);
convert_dirname(tmp_path);
sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
O_WRONLY, MYF(MY_WME));
if (!sql_file) /* If file couldn't be opened */
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
}
write_heder(sql_file, db);
}
fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table);
if (opt_drop)
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
fprintf(sql_file, "CREATE TABLE %s (\n", table_name);
}
if (cFlag)
sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name);
else
......@@ -619,18 +641,32 @@ static uint getTableStructure(char *table, char* db)
ulong *lengths=mysql_fetch_lengths(tableRes);
if (init)
{
if (!tFlag)
fputs(",\n",sql_file);
if (cFlag)
strpos=strmov(strpos,", ");
}
init=1;
if (cFlag)
strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff));
}
if (cFlag)
{
strpos=strmov(strpos,") VALUES ");
if (!extended_insert)
strpos=strmov(strpos,"(");
if (!tFlag)
{
if (opt_keywords)
fprintf(sql_file, " %s.%s %s", table_name,
quote_name(row[SHOW_FIELDNAME],name_buff), row[SHOW_TYPE]);
else
fprintf(sql_file, " %s %s", quote_name(row[SHOW_FIELDNAME],name_buff),
row[SHOW_TYPE]);
if (row[SHOW_DEFAULT])
{
fputs(" DEFAULT ", sql_file);
unescape(sql_file,row[SHOW_DEFAULT],lengths[SHOW_DEFAULT]);
}
if (!row[SHOW_NULL][0])
fputs(" NOT NULL", sql_file);
if (row[SHOW_EXTRA][0])
fprintf(sql_file, " %s",row[SHOW_EXTRA]);
}
}
numFields = (uint) mysql_num_rows(tableRes);
mysql_free_result(tableRes);
......@@ -638,37 +674,102 @@ static uint getTableStructure(char *table, char* db)
{
/* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN];
sprintf(buff,"show create table %s",table_name);
uint keynr,primary_key;
sprintf(buff,"show keys from %s",table_name);
if (mysql_query(sock, buff))
{
fprintf(stderr, "%s: Can't get CREATE TABLE for table '%s' (%s)\n",
fprintf(stderr, "%s: Can't get keys for table '%s' (%s)\n",
my_progname, table, mysql_error(sock));
if (sql_file != stdout)
my_fclose(sql_file, MYF(MY_WME));
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
}
if (path)
tableRes=mysql_store_result(sock);
/* Find first which key is primary key */
keynr=0;
primary_key=INT_MAX;
while ((row=mysql_fetch_row(tableRes)))
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
strmov(tmp_path,path);
convert_dirname(tmp_path);
sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
O_WRONLY, MYF(MY_WME));
if (!sql_file) /* If file couldn't be opened */
if (atoi(row[3]) == 1)
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
keynr++;
#ifdef FORCE_PRIMARY_KEY
if (atoi(row[1]) == 0 && primary_key == INT_MAX)
primary_key=keynr;
#endif
if (!strcmp(row[2],"PRIMARY"))
{
primary_key=keynr;
break;
}
}
write_heder(sql_file, db);
}
fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table);
if (opt_drop)
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
mysql_data_seek(tableRes,0);
keynr=0;
while ((row=mysql_fetch_row(tableRes)))
{
if (atoi(row[3]) == 1)
{
if (keynr++)
putc(')', sql_file);
if (atoi(row[1])) /* Test if duplicate key */
/* Duplicate allowed */
fprintf(sql_file, ",\n KEY %s (",quote_name(row[2],name_buff));
else if (keynr == primary_key)
fputs(",\n PRIMARY KEY (",sql_file); /* First UNIQUE is primary */
else
fprintf(sql_file, ",\n UNIQUE %s (",quote_name(row[2],name_buff));
}
else
putc(',', sql_file);
fputs(quote_name(row[4],name_buff), sql_file);
if (row[7])
fprintf(sql_file, "(%s)",row[7]); /* Sub key */
}
if (keynr)
putc(')', sql_file);
fputs("\n)",sql_file);
tableRes=mysql_store_result(sock);
row=mysql_fetch_row(tableRes);
fprintf(sql_file, "%s;\n", row[1]);
/* Get MySQL specific create options */
if (create_options)
{
sprintf(buff,"show table status like '%s'",table);
if (mysql_query(sock, buff))
{
if (mysql_errno(sock) != ER_PARSE_ERROR)
{ /* If old MySQL version */
if (verbose)
fprintf(stderr,
"# Warning: Couldn't get status information for table '%s' (%s)\n",
table,mysql_error(sock));
}
}
else if (!(tableRes=mysql_store_result(sock)) ||
!(row=mysql_fetch_row(tableRes)))
{
fprintf(stderr,
"Error: Couldn't read status information for table '%s' (%s)\n",
table,mysql_error(sock));
}
else
{
fputs("/*!",sql_file);
print_value(sql_file,tableRes,row,"type=","Type",0);
print_value(sql_file,tableRes,row,"","Create_options",0);
print_value(sql_file,tableRes,row,"comment=","Comment",1);
fputs(" */",sql_file);
}
mysql_free_result(tableRes); /* Is always safe to free */
}
fputs(";\n", sql_file);
}
if (cFlag)
{
strpos=strmov(strpos,") VALUES ");
if (!extended_insert)
strpos=strmov(strpos,"(");
}
DBUG_RETURN(numFields);
} /* getTableStructure */
......@@ -841,7 +942,7 @@ static void dumpTable(uint numFields, char *table)
{
if (length)
{
if (!IS_NUM(field->type))
if (!IS_NUM_FIELD(field))
{
if (dynstr_realloc(&extended_row,length * 2+2))
{
......@@ -873,7 +974,7 @@ static void dumpTable(uint numFields, char *table)
putchar(',');
if (row[i])
{
if (!IS_NUM(field->type))
if (!IS_NUM_FIELD(field))
unescape(stdout, row[i], lengths[i]);
else
fputs(row[i],stdout);
......
......@@ -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.23-beta)
AM_INIT_AUTOMAKE(mysql, 3.23.24-beta)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
......@@ -685,8 +685,8 @@ case $SYSTEM_TYPE in
;;
*aix4.3*)
echo "Adding defines for AIX"
CFLAGS="$CFLAGS -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_INITGROUPS"
CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
;;
esac
......@@ -789,6 +789,7 @@ then
#
elif test "$with_named_thread" = "no"
then
AC_MSG_RESULT("no")
AC_MSG_CHECKING("SCO UnixWare 7.1 native threads")
if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
then
......@@ -807,6 +808,7 @@ then
else
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
fi
AC_MSG_RESULT("yes")
# We must have cc
AC_MSG_CHECKING("for gcc")
if expr "$CC" : ".*gcc.*"
......@@ -817,7 +819,6 @@ then
CC="$CC -Kthread -DUNIXWARE_7";
CXX="$CXX -Kthread -DUNIXWARE_7";
fi
AC_MSG_RESULT("yes")
else
{ echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
fi
......
......@@ -66,6 +66,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_ASSERT(A) A
#else /* No debugger */
#define DBUG_ENTER(a1)
......@@ -85,6 +86,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON
#define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE
#define DBUG_ASSERT(A) {}
#endif
#ifdef __cplusplus
}
......
......@@ -490,6 +490,11 @@ extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */
#define THREAD_NAME_SIZE 10
#if defined(__ia64__)
#define DEFAULT_THREAD_STACK (128*1024)
#else
#define DEFAULT_THREAD_STACK (64*1024)
#endif
struct st_my_thread_var
{
......
......@@ -313,9 +313,13 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->rc_pos - (info)->rc_request_pos))
typedef struct st_changeable_var {
const char *name;
long *varptr;
long def_value,min_value,max_value,sub_size,block_size;
const char *name; /* Name of variable */
long *varptr; /* Pointer to variable */
long def_value, /* Default value */
min_value, /* Min allowed value */
max_value, /* Max allowed value */
sub_size, /* Subtract this from given value */
block_size; /* Value should be a mult. of this */
} CHANGEABLE_VAR;
......@@ -527,6 +531,7 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
void init_alloc_root(MEM_ROOT *mem_root,uint block_size);
gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
void free_root(MEM_ROOT *root);
......
......@@ -73,6 +73,8 @@ extern char *mysql_unix_port;
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#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 {
char *name; /* Name of column */
......
......@@ -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 TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#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 GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
......
......@@ -852,6 +852,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags= (uint) (uchar) row->data[4][0];
field->decimals=(uint) (uchar) row->data[4][1];
}
if (INTERNAL_NUM_FIELD(field))
field->flags|= NUM_FLAG;
if (default_value && row->data[5])
field->def=strdup_root(alloc,(char*) row->data[5]);
else
......
......@@ -283,7 +283,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length;
get_key_length(length,key);
#ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end)
if (length > keyseg->length || key+length > key_end)
goto err;
#endif
memcpy(record+keyseg->start,(byte*) key, length);
......@@ -294,7 +294,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length;
get_key_length(length,key);
#ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end)
if (length > keyseg->length || key+length > key_end)
goto err;
#endif
memcpy(record+keyseg->start+keyseg->bit_start,
......
No preview for this file type
......@@ -380,7 +380,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
cs=get_internal_charset(cs_number);
if (!cs && flags & MY_WME)
if (!cs && (flags & MY_WME))
{
char index_file[FN_REFLEN], cs_string[23];
strmov(get_charsets_dir(index_file), "Index");
......
......@@ -42,6 +42,17 @@
#define CHANGED_BLOCKS_MASK (CHANGED_BLOCKS_HASH-1)
#define FLUSH_CACHE 2000 /* Sort this many blocks at once */
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
static uint find_next_bigger_power(uint value);
static SEC_LINK *find_key_block(int file,my_off_t filepos,int *error);
......@@ -287,7 +298,6 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length,
} while ((length-= read_length));
pthread_mutex_unlock(&THR_LOCK_keycache);
return(start);
pthread_mutex_unlock(&THR_LOCK_keycache);
}
_my_cache_r_requests++;
_my_cache_read++;
......@@ -457,6 +467,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
static void free_block(SEC_LINK *used)
{
used->file= -1;
used->changed=0;
if (used != _my_used_first) /* Relink used-chain */
{
if (used == _my_used_last)
......@@ -568,7 +579,6 @@ int flush_key_blocks(File file, enum flush_type type)
if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE)
{
/* This will not destroy position or data */
used->changed=0;
_my_blocks_changed--;
free_block(used);
}
......
......@@ -33,16 +33,6 @@ struct st_remember {
sig_handler (*func)(int number);
};
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
struct irem {
struct remember *_pNext; /* Linked list of structures */
struct remember *_pPrev; /* Other link */
......
......@@ -71,6 +71,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
......
......@@ -11,56 +11,82 @@
ldata=@localstatedir@
execdir=@libexecdir@
bindir=@bindir@
sbindir=@sbindir@
force=0
IN_RPM=0
defaults=
# Are we doing an rpm install?
if test "$1" = "-IN-RPM"; then IN_RPM=1; shift; fi
if test "$1" = "--force"; then force=1; shift; fi
# Get mysqld/safe_mysqld options from /etc/my.cnf or ~/.my.cnf
case "$1" in
--no-defaults) defaults="$1"; conf=/nonexistent; shift ;;
--defaults-file=*) defaults="$1"; conf=`echo "$1"|sed 's;^--defaults-file=;;'`; shift ;;
*)
if test -w /
then
conf=/etc/my.cnf
else
conf=$HOME/.my.cnf
fi
;;
esac
while [ "x$1" != x ]
do
case "$1" in
-*) eqvalue="`echo $1 |sed 's/[-_a-zA-Z0-9]*=//'`"
case "$1" in
-IN-RPM) IN_RPM=1
;;
--force) force=1
;;
--no-defaults=*) CONFIG_FILES=/nonexistent
;;
--defaults-file=*) CONFIG_FILES="$eqvalue"
;;
--basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bon\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; "
;;
--ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";"
;;
--user=*) SETVARS="$SETVARS user=\"$eqvalue\";"
;;
esac
;;
esac
shift
done
GetCNF () {
if test -f "$conf"
then
if grep "^datadir" $conf >/dev/null
then
ldata=`grep "^datadir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^execdir" $conf >/dev/null
then
execdir=`grep "^execdir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^bindir" $conf >/dev/null
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
fi
VARIABLES="basedir bindir datadir sbindir user pid-file log port socket"
# set it not already set
CONFIG_FILES=${CONFIG_FILES:-"/etc/my.cnf ./my.cnf $HOME/.my.cnf"}
for arg
for c in $CONFIG_FILES
do
case "$arg" in
--basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;;
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;;
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;;
esac
if [ -f $c ]
then
#echo "Processing $c..."
for v in $VARIABLES
do
# This method assumes last of duplicate $variable entries will be the
# value set ([mysqld])
# This could easily be rewritten to gather [xxxxx]-specific entries,
# but for now it looks like only the mysqld ones are needed for
# server startup scripts
eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
# it would be easier if the my.cnf and variable values were
# all matched, but since they aren't we need to map them here.
case $v in
pid-file) v=pid_file ;;
log) v=log_file ;;
datadir) v=ldata ;;
esac
# As long as $thevar isn't blank, use it to set or override current
# value
[ "$thevar" != "" ] && eval $v=$thevar
done
#else
# echo "No $c config file."
fi
done
}
# run function to get config values
GetCNF
# Override/set with command-line values
eval $SETVARS
mdata=$ldata/mysql
......@@ -310,7 +336,7 @@ then
echo
echo "The latest information about MySQL is available on the web at"
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
exit 0
else
......
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:36:42
ATIS table test
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)
Inserting data
Time to insert (9768): 5 wallclock secs ( 0.88 usr 1.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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_join (200): 22 wallclock secs (12.86 usr 5.22 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_group (2800): 20 wallclock secs ( 3.55 usr 1.13 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: 68 wallclock secs (23.67 usr 10.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:23:52
ATIS table test
Creating tables
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
Time to insert (9768): 5 wallclock secs ( 0.69 usr 1.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data
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 (13.20 usr 5.34 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): 19 wallclock secs ( 3.31 usr 0.98 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: 67 wallclock secs (23.42 usr 10.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Benchmark DBD suite: 2.8
Date of test: 2000-06-02 23:00:05
Running tests on: Windows NT Version 4.0
Arguments:
Comments: Pentium 2x550 xeon, 550 Mhz, IDE
Limits from:
Server version: MySQL 3.23.17a alpha
alter-table: Total time: 2260 wallclock secs ( 0.89 usr 0.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
ATIS: Total time: 68 wallclock secs (23.67 usr 10.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
big-tables: Total time: 80 wallclock secs (17.91 usr 18.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
connect: Total time: 186 wallclock secs (56.84 usr 51.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
create: Total time: 1040 wallclock secs (13.34 usr 9.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
insert: Total time: 4284 wallclock secs (485.59 usr 280.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
select: Total time: 2255 wallclock secs (315.95 usr 115.52 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
wisconsin: Total time: 29 wallclock secs ( 8.19 usr 5.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Totals per operation:
Operation seconds usr sys cpu tests
alter_table_add 1201.00 0.53 0.19 0.00 992
alter_table_drop 1009.00 0.23 0.09 0.00 496
connect 34.00 11.53 10.31 0.00 10000
connect+select_1_row 39.00 12.75 13.53 0.00 10000
connect+select_simple 37.00 12.56 11.92 0.00 10000
count 40.00 0.11 0.05 0.00 100
count_distinct 69.00 1.17 0.41 0.00 1000
count_distinct_big 1229.00 224.25 81.19 0.00 1020
count_distinct_group 152.00 2.81 0.92 0.00 1000
count_distinct_group_on_key 38.00 0.70 0.17 0.00 1000
count_distinct_group_on_key_parts 153.00 2.61 1.03 0.00 1000
count_group_on_key_parts 34.00 2.64 1.00 0.00 1000
count_on_key 347.00 21.47 8.38 0.00 50100
create+drop 123.00 3.36 2.61 0.00 10000
create_MANY_tables 232.00 2.97 1.23 0.00 10000
create_index 25.00 0.00 0.00 0.00 8
create_key+drop 156.00 5.13 2.78 0.00 10000
create_table 1.00 0.02 0.00 0.00 31
delete_big 21.00 0.00 0.00 0.00 13
delete_big_many_keys 438.00 0.00 0.00 0.00 2
delete_key 6.00 0.84 1.30 0.00 10000
drop_index 25.00 0.00 0.00 0.00 8
drop_table 0.00 0.00 0.00 0.00 28
drop_table_when_MANY_tables 223.00 0.80 1.34 0.00 10000
insert 235.00 34.08 47.74 0.00 350768
insert_duplicates 38.00 8.48 12.98 0.00 300000
insert_key 1418.00 13.78 12.97 0.00 100000
insert_many_fields 22.00 0.58 0.49 0.00 2000
min_max 18.00 0.05 0.00 0.00 60
min_max_on_key 175.00 37.82 14.90 0.00 85000
multiple_value_insert 10.00 2.59 0.14 0.00 100000
order_by 98.00 62.59 25.67 0.00 10
order_by_key 88.00 62.23 25.44 0.00 10
outer_join 115.00 0.00 0.00 0.00 10
outer_join_found 102.00 0.01 0.00 0.00 10
outer_join_not_found 54.00 0.02 0.00 0.00 500
outer_join_on_key 37.00 0.05 0.00 0.00 10
select_1_row 5.00 1.11 1.91 0.00 10000
select_2_rows 7.00 1.23 1.58 0.00 10000
select_big 142.00 78.10 33.81 0.00 10080
select_column+column 6.00 1.05 1.86 0.00 10000
select_diff_key 138.00 0.52 0.16 0.00 500
select_distinct 17.00 4.78 1.80 0.00 800
select_group 51.00 3.64 1.15 0.00 2911
select_group_when_MANY_tables 306.00 1.09 1.50 0.00 10000
select_join 22.00 12.86 5.22 0.00 200
select_key 201.00 92.41 38.77 0.00 200000
select_key_prefix 198.00 93.94 37.94 0.00 200000
select_many_fields 55.00 17.33 18.16 0.00 2000
select_range 213.00 37.28 12.82 0.00 25420
select_range_prefix 28.00 9.94 4.00 0.00 25010
select_simple 4.00 0.94 1.67 0.00 10000
select_simple_join 3.00 1.58 0.66 0.00 500
update_big 64.00 0.00 0.01 0.00 500
update_of_key 468.00 4.61 6.75 0.00 756
update_of_key_big 33.00 0.05 0.05 0.00 501
update_with_key 185.00 25.34 40.66 0.00 100000
wisc_benchmark 9.00 5.66 1.53 0.00 114
TOTALS 10191.00 921.17 488.93 0.00 1685468
Benchmark DBD suite: 2.9
Date of test: 2000-09-01 3:34:21
Running tests on: Windows NT Version 4.0
Arguments:
Comments: Pentium 2x550 xeon, 550 Mhz, IDE
Limits from:
Server version: MySQL 3.23.23 beta
alter-table: Total time: 2313 wallclock secs ( 0.84 usr 0.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
ATIS: Total time: 67 wallclock secs (23.42 usr 10.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
big-tables: Total time: 79 wallclock secs (18.42 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
connect: Total time: 185 wallclock secs (59.45 usr 51.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
create: Total time: 852 wallclock secs (14.36 usr 9.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
insert: Total time: 4332 wallclock secs (490.00 usr 278.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
select: Total time: 2278 wallclock secs (313.80 usr 117.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
wisconsin: Total time: 28 wallclock secs ( 7.91 usr 5.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
All 8 test executed successfully
Totals per operation:
Operation seconds usr sys cpu tests
alter_table_add 1228.00 0.55 0.17 0.00 992
alter_table_drop 1033.00 0.17 0.08 0.00 496
connect 33.00 11.69 10.25 0.00 10000
connect+select_1_row 39.00 11.72 12.45 0.00 10000
connect+select_simple 36.00 12.89 11.09 0.00 10000
count 39.00 0.14 0.03 0.00 100
count_distinct 75.00 1.13 0.31 0.00 1000
count_distinct_big 1223.00 223.30 83.02 0.00 1020
count_distinct_group 157.00 2.50 1.09 0.00 1000
count_distinct_group_on_key 40.00 0.81 0.23 0.00 1000
count_distinct_group_on_key_parts 158.00 2.78 1.14 0.00 1000
count_group_on_key_parts 40.00 2.53 0.92 0.00 1000
count_on_key 345.00 22.07 8.56 0.00 50100
create+drop 128.00 3.75 2.59 0.00 10000
create_MANY_tables 219.00 2.70 1.36 0.00 10000
create_index 25.00 0.00 0.00 0.00 8
create_key+drop 161.00 5.14 2.31 0.00 10000
create_table 0.00 0.00 0.00 0.00 31
delete_big 22.00 0.00 0.02 0.00 13
delete_big_many_keys 412.00 0.00 0.00 0.00 2
delete_key 7.00 0.73 1.13 0.00 10000
drop_index 27.00 0.00 0.00 0.00 8
drop_table 0.00 0.00 0.00 0.00 28
drop_table_when_MANY_tables 153.00 1.09 1.41 0.00 10000
insert 236.00 34.70 45.91 0.00 350768
insert_duplicates 59.00 8.80 11.75 0.00 300000
insert_key 1434.00 14.73 12.73 0.00 100000
insert_many_fields 21.00 0.82 0.31 0.00 2000
min_max 18.00 0.03 0.02 0.00 60
min_max_on_key 180.00 36.53 14.18 0.00 85000
multiple_value_insert 9.00 2.48 0.19 0.00 100000
order_by 98.00 62.34 25.09 0.00 10
order_by_key 88.00 63.17 24.64 0.00 10
outer_join 118.00 0.01 0.00 0.00 10
outer_join_found 104.00 0.02 0.00 0.00 10
outer_join_not_found 59.00 0.02 0.00 0.00 500
outer_join_on_key 40.00 0.00 0.01 0.00 10
select_1_row 5.00 0.95 2.00 0.00 10000
select_2_rows 5.00 1.30 1.92 0.00 10000
select_big 145.00 81.09 35.81 0.00 10080
select_column+column 6.00 1.11 1.64 0.00 10000
select_diff_key 124.00 0.48 0.05 0.00 500
select_distinct 17.00 4.75 1.70 0.00 800
select_group 52.00 3.45 0.98 0.00 2911
select_group_when_MANY_tables 191.00 1.67 1.97 0.00 10000
select_join 22.00 13.20 5.34 0.00 200
select_key 201.00 92.67 41.23 0.00 200000
select_key_prefix 200.00 92.94 38.81 0.00 200000
select_many_fields 56.00 17.60 18.74 0.00 2000
select_range 219.00 37.55 12.72 0.00 25420
select_range_prefix 27.00 9.96 4.16 0.00 25010
select_simple 4.00 1.03 1.67 0.00 10000
select_simple_join 4.00 1.47 0.69 0.00 500
update_big 68.00 0.02 0.00 0.00 500
update_of_key 490.00 4.80 6.55 0.00 756
update_of_key_big 34.00 0.05 0.06 0.00 501
update_with_key 188.00 26.88 40.59 0.00 100000
wisc_benchmark 9.00 5.69 1.53 0.00 114
TOTALS 10131.00 928.00 491.15 0.00 1695468
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 16:59:02
Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps
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 alter_table_add (992): 1201 wallclock secs ( 0.53 usr 0.19 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 alter_table_drop (496): 1009 wallclock secs ( 0.23 usr 0.09 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)
Testing server 'MySQL 3.23.23 beta' at 2000-09-01 0:45:18
Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table
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): 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 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): 1033 wallclock secs ( 0.17 usr 0.08 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 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.56 usr 9.05 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): 35 wallclock secs ( 8.77 usr 9.11 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.30 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.19 usr 0.19 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)
Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:25:00
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.72 usr 9.24 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 ( 8.88 usr 9.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES()
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()
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: 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 the speed of connecting to the server and sending of data
All tests are done 10000 times
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)
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)
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)
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)
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)
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)
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)
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)
Total time: 186 wallclock secs (56.84 usr 51.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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
All tests are done 10000 times
Testing connection/disconnect
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
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
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
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
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
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 (+)
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)
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: 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 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): 232 wallclock secs ( 2.97 usr 1.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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)
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)
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_key+drop (10000): 156 wallclock secs ( 5.13 usr 2.78 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)
Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:29:26
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): 219 wallclock secs ( 2.70 usr 1.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables
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
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
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): 161 wallclock secs ( 5.14 usr 2.31 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 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): 204 wallclock secs (29.41 usr 41.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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)
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 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 (10:3000000): 98 wallclock secs (62.59 usr 25.67 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_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 (5010:42084): 15 wallclock secs ( 4.53 usr 1.78 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 (200000): 201 wallclock secs (92.41 usr 38.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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 (20000:43500): 13 wallclock secs ( 5.55 usr 2.27 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 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 (60): 18 wallclock secs ( 0.05 usr 0.00 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 (100): 40 wallclock secs ( 0.11 usr 0.05 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)
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_big (501): 33 wallclock secs ( 0.05 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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)
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)
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 (10:10): 115 wallclock secs ( 0.00 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_not_found (500:10): 54 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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_big (12): 21 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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)
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)
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)
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 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)
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.
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): 206 wallclock secs (30.56 usr 39.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert of duplicates
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
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 (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.34 usr 25.09 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): 14 wallclock secs ( 4.63 usr 1.80 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): 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.67 usr 41.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test of compares with simple ranges
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): 14 wallclock secs ( 5.75 usr 2.14 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.51 usr 2.45 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): 25 wallclock secs ( 0.01 usr 0.00 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): 98 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of keys with functions
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): 34 wallclock secs ( 0.05 usr 0.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update with key
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
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
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): 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): 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): 59 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing delete
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.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
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
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
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
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)
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 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.27 usr 1.42 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.39 usr 0.11 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 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 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_group_on_key_parts (1000:0): 34 wallclock secs ( 2.64 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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_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_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 (1000:100000): 152 wallclock secs ( 2.81 usr 0.92 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)
Total time: 2255 wallclock secs (315.95 usr 115.52 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
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
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.23 usr 1.14 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.34 usr 0.20 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): 166 wallclock secs (30.02 usr 11.73 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): 40 wallclock secs ( 2.53 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): 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): 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): 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): 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): 1125 wallclock secs (223.27 usr 83.00 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
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.52 usr 3.91 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.66 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)
Testing server 'MySQL 3.23.23 beta' at 2000-09-01 3:33:51
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): 18 wallclock secs ( 2.22 usr 3.97 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
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: 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>
* Added RENAME TABLE.
......
......@@ -514,7 +514,7 @@ public:
Field_timestamp(char *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg, const char *field_name_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 ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
void store(const char *to,uint length);
......
......@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
start_value=7223692L; best_t1=2365832L; best_t2=1560117L; best_type=0; /* mode=4519 add=5 func_type: 0 */
start_value=2610463L; best_t1=8358376L; best_t2=860646L; best_type=2; /* mode=4111 add=8 func_type: 0 */
if (get_options(argc,(char **) argv))
exit(1);
......
......@@ -972,7 +972,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key,
statistic_increment(ha_read_key_count,&LOCK_status);
DBUG_ENTER("index_read_idx");
current_row.flags=DB_DBT_REALLOC;
DBUG_RETURN(read_row(file->get(file, transaction,
DBUG_RETURN(read_row(file->get(key_file[keynr], transaction,
pack_key(&last_key, keynr, key_buff, key,
key_len),
&current_row,0),
......
......@@ -317,8 +317,11 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
}
if (!error)
{
if (!(ref=(byte*) alloc_root(&table->mem_root,
ALIGN_SIZE(ref_length)*2)))
if (!alloc_root_inited(&table->mem_root)) // If temporary table
ref=sql_alloc(ALIGN_SIZE(ref_length)*2);
else
ref=(byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2);
if (!ref)
{
close();
error=HA_ERR_OUT_OF_MEM;
......
......@@ -426,7 +426,7 @@ void sql_print_error(const char *format,...)
extern char mysql_data_home[2],server_version[50],max_sort_char,
mysql_real_data_home[];
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,
created_tmp_tables, aborted_threads,aborted_connects,
delayed_insert_timeout,
......
......@@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0;
// 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,
master_info_file = (char*) "master.info";
const char *localhost=LOCAL_HOST;
uint master_port = MYSQL_PORT, master_connect_retry = 60;
ulong max_tmp_tables,max_heap_table_size;
......@@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue;
}
if (!(vio_tmp=vio_new(new_sock,
new_sock == unix_sock ? VIO_TYPE_SOCKET :
sock == unix_sock ? VIO_TYPE_SOCKET :
VIO_TYPE_TCPIP,
new_sock == unix_sock)) ||
sock == unix_sock)) ||
my_net_init(&thd->net,vio_tmp))
{
if (vio_tmp)
......@@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue;
}
if (sock == unix_sock)
{
if (!(thd->host=my_strdup(LOCAL_HOST,MYF(0))))
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES);
delete thd;
continue;
}
}
thd->host=(char*) localhost;
create_new_thread(thd);
}
......@@ -2332,7 +2326,7 @@ CHANGEABLE_VAR changeable_vars[] = {
{ "tmp_table_size", (long*) &tmp_table_size,
1024*1024L, 1024, ~0L, MALLOC_OVERHEAD, 1 },
{ "thread_stack", (long*) &thread_stack,
1024*64, 1024*32, ~0L, 0, 1024 },
DEFAULT_THREAD_STACK, 1024*32, ~0L, 0, 1024 },
{ "wait_timeout", (long*) &net_wait_timeout,
NET_WAIT_TIMEOUT, 1, ~0L, 0, 1 },
{ NullS, (long*) 0, 0, 0, 0, 0, 0}
......
......@@ -68,7 +68,7 @@
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE 59
41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
......@@ -150,7 +150,8 @@ THD::~THD()
DBUG_PRINT("info", ("freeing host"));
safeFree(host);
if (host != localhost) // If not pointer to constant
safeFree(host);
safeFree(user);
safeFree(db);
safeFree(ip);
......
......@@ -180,10 +180,7 @@ check_connections(THD *thd)
#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
/* Fast local hostname resolve for Win32 */
if (!strcmp(thd->ip,"127.0.0.1"))
{
if (!(thd->host=my_strdup("localhost",MYF(0))))
return (ER_OUT_OF_RESOURCES);
}
thd->host=(char*) localhost;
else
#endif
if (!(specialflag & SPECIAL_NO_RESOLVE))
......@@ -199,9 +196,9 @@ check_connections(THD *thd)
if (acl_check_host(thd->host,thd->ip))
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;
bzero((char*) &thd->remote,sizeof(struct sockaddr));
}
......@@ -561,7 +558,7 @@ bool do_command(THD *thd)
{
packet=(char*) net->read_pos;
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,
command_name[command]));
}
......
......@@ -2368,6 +2368,7 @@ keyword:
| ESCAPE_SYM {}
| EXTENDED_SYM {}
| FAST_SYM {}
| FULL {}
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
......
......@@ -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))))
{
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(NO_FCNTL_NONBLOCK)
vio->fcntl_mode = fcntl(sd, F_GETFL);
......
......@@ -53,6 +53,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
......
#!/bin/sh
# search & check GNU patch
PATCH="gpatch"
$PATCH --version || PATCH="patch"
$PATCH --version || exit
if /usr/bin/test ! -e PKG/stamp-pre ; then
grep VERSION configure | head -1 | sed 's/VERSION=//' > ./PKG/version
touch PKG/stamp-pre
fi
if /usr/bin/test ! -e PKG/stamp-patch ; then
${PATCH} -p0 < ./PKG/patch
touch PKG/stamp-patch
fi
if /usr/bin/test ! -e PKG/stamp-compile ; then
sh ./PKG/compile.sh ujis
touch PKG/stamp-compile
sh ./PKG/doc.sh ujis
fi
cd PKG
sh mkpkg.sh ujis
#!/bin/sh
# GNU ncurses
# search & check GNU make
GMAKE="gmake"
$GMAKE --version || GMAKE="make"
$GMAKE --version || exit
MAKE=$GMAKE
export MAKE
CC=gcc
CFLAGS="-O6 -fomit-frame-pointer"
CXX=gcc
CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
# LDFLAGS="-static"
LD=gcc
export CC
export CXX
export LD
export CFLAGS
export CXXFLAGS
# export LDFLAGS
# Solaris don't have libpthread.a.
if [ "x$1" = "x" ]; then
echo " please set character set"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
#---------------
P=`pwd`
if [ -f Makefile ] ; then
${GMAKE} distclean
fi
for i in bin sbin include man share/doc/mysql mysql-data
do
/usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i}
done
/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d
#----------------------------
./configure \
--prefix=/usr/local \
--libexecdir=/usr/local/sbin \
--sbindir=/usr/local/sbin \
--localstatedir=/usr/local/mysql-data \
--with-charset=${CHAR} \
--with-extra-charsets=all \
--with-raid \
--without-docs \
--without-bench \
--without-perl \
--with-gcc \
--with-mysqld-ldflags="-static" \
--with-client-ldflags="-static" \
--with-named-curses-libs=/usr/local/lib/libncurses.a \
--with-mysqld-user=mysql
# --with-berkeley-db-includes=/usr/local/include/db3 \
# --with-berkeley-db-libs=/usr/local/lib/libdb3.a \
# --with-low-memory
${GMAKE}
${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR}
v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'`
km="libmysqlclient.so.$v"
export km
(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \
for i in libmysqlclient* ; do \
if /usr/bin/test ! -L $i ; then \
mv $i ../ ; ln -sf ../$i ; \
fi ; \
done ; \
k=`ls libmysqlclient.so.*.*.*` ; \
cd .. ; \
if /usr/bin/test ! -z libmysqlclient.so ; then \
ln -sf $k libmysqlclient.so ;
fi ; \
if /usr/bin/test ! -z $km ; then \
ln -sf $k $km ;
fi ; \
)
#
(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * )
(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * )
#!/bin/sh
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
cp -r Docs/* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cp INSTALL-SOURCE* COPYING* MIRRORS README* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cd PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
gzip *.txt *.texi *.info *.pdf
#!/bin/sh
if [ "x$1" = "x" ]; then
echo " please set charset"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis ; CH=uj
;;
[sS]*)
CHAR=sjis ; CH=sj
;;
esac
#-------------------
DIR=`pwd`
VERSION=`cat version`
T=`uname -p`
sed -e "s/@CHAR1@/${CH}/" \
-e "s/@CHAR2@/${CHAR}/" \
-e "s/@VERSION@/${VERSION}/" \
-e "s/@TYPE@/${T}/" \
pkginfo.ini > pkginfo.${CHAR}
sed -e "s,@DIR@,${DIR},g" \
-e "s,@PKGINFO@,${DIR}/pkginfo.${CHAR}," \
prototype.ini > prototype.${CHAR}
INIT="tmp-${CHAR}/etc/init.d/mysql"
cp ../support-files/mysql.server $INIT
chmod 755 $INIT
(cd tmp-${CHAR}; \
chown root etc usr ; \
chgrp sys etc usr ;\
chmod 755 usr etc; \
chgrp sys etc/init.d ; \
chmod 755 etc/init.d ; \
find . -print|pkgproto >> ../prototype.${CHAR})
pkgmk -o -f prototype.${CHAR} -r ${DIR}/tmp-${CHAR}
--- scripts/safe_mysqld.sh.orig Sat Sep 2 17:28:26 2000
+++ scripts/safe_mysqld.sh Sat Sep 2 17:31:19 2000
@@ -89,10 +89,10 @@
NOHUP_NICENESS=`nohup nice`
-if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then
+if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice -1 echo foo > /dev/null 2>&1; then
NOHUP_NICENESS="nohup"
else
- NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"
+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup"
fi
export MYSQL_UNIX_PORT
@@ -163,7 +163,8 @@
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld`
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
+ echo | tee -a $err_log
+ echo "Number of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
@@ -185,4 +186,6 @@
echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log
done
-echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log
+echo | tee -a $err_log
+echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log
+echo | tee -a $err_log
--- support-files/mysql.server.sh.orig Sat Sep 2 17:35:56 2000
+++ support-files/mysql.server.sh Sat Sep 2 17:36:35 2000
@@ -23,6 +23,9 @@
mysql_daemon_user=@MYSQLD_USER@
export PATH
+## your options...
+OPT=""
+
mode=$1
if test -w / # determine if we should look at the root config file
@@ -82,8 +85,9 @@
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $bindir/safe_mysqld $OPT \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
echo "Can't execute $bindir/safe_mysqld"
fi
--- configure.orig Sat Sep 2 17:54:03 2000
+++ configure Sat Sep 2 17:54:18 2000
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- configure.in.orig Sat Sep 2 17:53:57 2000
+++ configure.in Sat Sep 2 17:54:36 2000
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
PKG=MySQL
NAME=MySQL
ARCH=@TYPE@
VERSION=@VERSION@
CATEGORY=utility
VENDOR=TcX DataKonsult AB, Detron HB and MySQL AB
BASEDIR=/
CLASSES=none
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
D0="/usr/local/mysql-data"
D="${D0}/mysql"
DOFIX=0
if /usr/bin/test ! -f ${D}/tables_priv.frm -a -d ${D} ; then
DOFIX=1
fi
if [ ! -d ${D} ]; then
DOFIX=2
/usr/local/bin/mysql_install_db
fi
chown -R mysql $D0
chgrp -R mysql $D0
if /usr/bin/test $DOFIX -eq 1 ; then
/etc/init.d/mysql start
/usr/local/bin/mysql_fix_privilege_tables
else
/etc/init.d/mysql start || true
fi
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
if /usr/bin/test -x /etc/init.d/mysql ; then
/etc/init.d/mysql stop || true
fi
#----- user check
P=`grep mysql /etc/passwd`
G=`grep mysql /etc/group`
if /usr/bin/test "x$G" = "x" ; then
/usr/sbin/groupadd mysql
fi
if /usr/bin/test "x$P" = "x" ; then
/usr/sbin/useradd -g mysql -d /usr/local/mysql-data -s /bin/false mysql
fi
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
pid=`/usr/bin/ps -e | /usr/bin/grep mysqld | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
[ "$pid" != "" ] && /usr/local/bin/mysqladmin shutdown
#---
#/usr/ucb/echo -n "Remove DATA Directory (All data expire) [Y/N]? "
#read I
I=No
case "$I" in
Y*|y*)
/usr/ucb/echo -n "Removing MySQL DATA ALL..."
rm -rf /usr/local/mysql-data
echo "done."
;;
*)
echo "not purge DATA directory"
;;
esac;
i pkginfo=@PKGINFO@
i postinstall=@DIR@/postinstall
i preinstall=@DIR@/preinstall
i preremove=@DIR@/preremove
mysql for DEBIAN
----------------------
Comments regarding the Package
* about patch files
if you want to make new patch,
write patch file and put it into debian/patches/.
debian/rules do patch debian/patches/* automatically.
* about server packages
I use Debian alternative system, to switch next 3 type MySQL server.
mysql-server :
this is static linked MySQL server(/usr/sbin/mysqld-static) and share/mysql/ files.
mysql-server-shared:
this is dynamic linked MySQL server only. (/usr/sbin/mysqld-shared)
mysql-server-debug:
--with-debug flag. mysqld only. (/usr/sbin/mysqld-debug)
* about charset
I build MySQL server --with-extra-charsets=all
* about location
server programs ...... /usr/sbin/
share files .......... /usr/share/mysql/
client programs ...... /usr/bin/
MySQL data directory . /var/mysql/data/
benchmark directory .. /var/mysql/sql-bench/
socket file ......... /tmp/mysql.sock
include files ........ /usr/include/mysql/
libraries ........... /usr/lib/ , /usr/lib/mysql/
put libmysqlclient* into /usr/lib/ ,
others, put /usr/lib/mysql/ .
takeshi@SoftAgency.co.jp
mysql (3.23.23-1potato.2) unstable; urgency=low
* move patch into debian/patches/
if you want to make new patch,
write patch file and put it into debian/patches/.
debian/rules do patch debian/patches/* automatically.
* change debian/rules , debian/move
-- takeshi <takeshi@softagency.co.jp> Tue, 5 Sep 2000 05:07:35 +0900
mysql (3.23.23-1potato) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Sat, 2 Sep 2000 05:07:35 +0900
mysql (3.23.22-1potato) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Tue, 1 Aug 2000 05:07:35 +0900
mysql (3.23.21-1potato.2) unstable; urgency=low
* MYI patch
* /usr/lib/mysql/libmysqlclient.a -> /usr/lib/
* libmysqlclient patch
* fix mysql-dev conflicts libmysqlclient6
-- takeshi <takeshi@softagency.co.jp> Sun, 30 Jul 2000 05:07:35 +0900
mysql (3.23.21-1potato.1) unstable; urgency=low
* MYI patch
* /usr/lib/mysql/libmysqlclient.a -> /usr/lib/
-- takeshi <takeshi@softagency.co.jp> Tue, 25 Jul 2000 05:07:35 +0900
mysql (3.23.21-1potato) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Thr, 6 Jul 2000 05:07:35 +0900
mysql (3.23.20-1potato) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Thr, 29 Jun 2000 05:07:35 +0900
mysql (3.23.19-1potato) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Thr, 29 Jun 2000 05:07:35 +0900
mysql (3.23.18-1) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Tue, 13 May 2000 05:07:35 +0900
mysql (3.23.17-1) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Wed, 31 May 2000 05:07:35 +0900
mysql (3.23.16-1) unstable; urgency=low
* new
* branch static mysqld & shared mysqld
* no need ujis,sjis branch. 3.23 support dynamic charset
* add conf file /etc/my.cnf
-- takeshi <takeshi@softagency.co.jp> Wed, 31 May 2000 05:07:35 +0900
mysql (3.22.32-2) unstable; urgency=low
* fix mysqldump
* fix sjis
-- takeshi <takeshi@softagency.co.jp> Thr, 6 Apr 2000 05:07:35 +0900
mysql (3.22.32-1) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Tue, 15 Feb 2000 05:07:35 +0900
mysql (3.22.30-2) unstable; urgency=low
* fix perl path
* with system readline
-- takeshi <takeshi@softagency.co.jp> Tue, 8 Feb 2000 05:07:35 +0900
mysql (3.22.30-1) unstable; urgency=low
* new
* OOP! debian remove libreadlineg2-dev!
--without-readline => --with-readline
-- takeshi <takeshi@softagency.co.jp> Fri, 14 Jan 2000 05:07:35 +0900
mysql (3.22.29-1) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Mon, 3 Jan 2000 05:07:35 +0900
mysql (3.22.29-0bo) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Mon, 3 Jan 2000 05:07:35 +0900
mysql (3.22.27-0bo.2) unstable; urgency=low
* with linuxthread-0.71
-- takeshi <takeshi@softagency.co.jp> Thr, 9 Dec 1999 05:07:35 +0900
mysql (3.22.27-0bo.1) unstable; urgency=low
* fix: mysqlaccess incorrect path
-- takeshi <takeshi@softagency.co.jp> Sat, 13 Nov 1999 05:07:35 +0900
mysql (3.22.27-0bo) unstable; urgency=low
* sql/sql_parse.cc patch
-- takeshi <takeshi@softagency.co.jp> Wed, 13 Oct 1999 05:07:35 +0900
mysql (3.22.26a-0bo.1) unstable; urgency=low
* BLOB SELECT DISTINCT patch
* all static linked
* fix: @sbindir@ was not changed
* mysql_find_rows -> /usr/bin/
-- takeshi <takeshi@softagency.co.jp> Mon, 20 Sep 1999 05:07:35 +0900
mysql (3.22.26a-0bo) unstable; urgency=low
* new upstream
* fix incorrect path: init.d/mysql (= mysql.server.sh), msql2mysql, mysql_install_db
* change daemon user -> mysql
-- takeshi <takeshi@softagency.co.jp> Mon, 13 Sep 1999 05:07:35 +0900
mysql (3.22.25-0bo) unstable; urgency=low
* new
* change : libmysql6 -> libmysqlclient6
-- takeshi <takeshi@softagency.co.jp> Tue, 3 Aug 1999 05:07:35 +0900
mysql (3.22.24-0bo) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Mon, 25 Jul 1999 05:07:35 +0900
mysql (3.22.23b-0bo.1) unstable; urgency=low
* new
* gcc patch + sql_load patch
-- takeshi <takeshi@softagency.co.jp> Thr, 24 Jun 1999 05:07:35 +0900
mysql (3.22.23b-0bo) unstable; urgency=low
* new
* gcc patch
-- takeshi <takeshi@softagency.co.jp> Tue, 15 Jun 1999 05:07:35 +0900
mysql (3.22.22-0bo) unstable; urgency=low
* new
-- takeshi <takeshi@softagency.co.jp> Mon, 3 May 1999 05:07:35 +0900
mysql (3.22.21-0bo.1) unstable; urgency=low
* re-compile
-- takeshi <takeshi@softagency.co.jp> Fri, 30 Apr 1999 05:07:35 +0900
mysql (3.22.21-0bo) unstable; urgency=low
* New up stream
-- takeshi <takeshi@softagency.co.jp> Tue, 6 Apr 1999 05:07:35 +0900
mysql (3.22.20a-0bo) unstable; urgency=low
* New up stream
-- takeshi <takeshi@softagency.co.jp> Fri, 19 Mar 1999 05:07:35 +0900
mysql (3.22.19a-0bo) unstable; urgency=low
* New up stream
-- takeshi <takeshi@softagency.co.jp> Wed, 3 Mar 1999 05:07:35 +0900
mysql (3.22.18-0bo) unstable; urgency=low
* New up stream
-- takeshi <takeshi@softagency.co.jp> Sun, 28 Feb 1999 05:07:35 +0900
mysql (3.22.16a-gamma-0bo.1) unstable; urgency=low
* fix libmysqlclient5 -> libmysqlclient6
-- takeshi <takeshi@softagency.co.jp> Thr, 11 Feb 1999 05:07:35 +0900
mysql (3.22.16a-gamma-0bo) unstable; urgency=low
* new upstream
-- takeshi <takeshi@softagency.co.jp> Sun, 7 Feb 1999 05:07:35 +0900
mysql (3.22.15-gamma-0bo) unstable; urgency=low
* new upstream
-- takeshi <takeshi@softagency.co.jp> Fri, 29 Jan 1999 05:07:35 +0900
mysql (3.22.14b-gamma-0bo) unstable; urgency=low
* new upstream
* apply mb problem patch
-- takeshi <takeshi@softagency.co.jp> Tue, 26 Jan 1999 05:07:35 +0900
mysql (3.22.14-gamma-0bo.1) unstable; urgency=low
* egcs -all-static
-- takeshi <takeshi@softagency.co.jp> Sun, 3 Jan 1999 05:07:35 +0900
mysql (3.22.14-gamma-0bo) unstable; urgency=low
* New upstream
-- takeshi <takeshi@softagency.co.jp> Sun, 3 Jan 1999 05:07:35 +0900
mysql (3.22.13-beta-0bo) unstable; urgency=low
* New upstream
-- takeshi <takeshi@softagency.co.jp> Fri, 11 Nov 1998 00:29:14 +0900
mysql (3.22.12-beta-0bo) unstable; urgency=low
* New upstream
-- takeshi <takeshi@softagency.co.jp> Fri, 11 Nov 1998 00:29:14 +0900
mysql (3.22.11-beta-0bo) unstable; urgency=low
* New upstream
* !!! CHANGE PACKAGE NAME !!!
libmysql5 <- only libmysqlclinet.so.5
mysql-client <- client commands
mysql-server <- server
mysql-dev <- .h & .a
mysql-doc <- Docs
mysql-bench <- benchmark suite.
-- takeshi <takeshi@softagency.co.jp> Wed, 25 Nov 1998 15:03:45 +0900
mysql (3.22.10-beta-0bo.2) unstable; urgency=low
* fix debian/rules , debian/*.dirs
* gcc-2.7.2.3, g++-2.7.2.1 compiled
* remove /usr/bin/mysql-sub/
* rename /usr/bin/mysql-sub/replace -> /usr/bin/mysql_replace
* mv mysql-base:/usr/bin/mysql-sub/{perror,resolveip} -> mysql-server:/usr/bin/
perror -> mysql_perror
resolveip-> mysql_resolveip
* mv add_*, make_binary_distribution -> /usr/share/mysql/
* add japanese errmsg (/usr/share/mysql/japanese)
-- takeshi <takeshi@softagency.co.jp> Fri, 13 Nov 1998 15:03:45 +0900
mysql (3.22.10-beta-0bo.1) unstable; urgency=low
* fix debian/rules
* egcs compiled
* link libstdc++2.8.a (mysqld), so, you don't need libstdc++2.8 for running mysqld.
(not client programs.)
-- takeshi <takeshi@softagency.co.jp> Wed, 11 Nov 1998 15:03:45 +0900
mysql (3.22.10-beta-0bo) unstable; urgency=low
* New upstream
* egcs compiled
* fix: mysql-base-{char}/usr/bin/comp_err -> mysql-server-{char}/usr/sbin/comp_err
-- takeshi <takeshi@softagency.co.jp> Thr, 5 Nov 1998 15:03:45 +0900
mysql (3.22.9-beta-0bo.1) unstable; urgency=low
* new patch to sql_string.cc ('%' bug)
-- takeshi <takeshi@softagency.co.jp> Tue, 27 Oct 1998 15:03:45 +0900
mysql (3.22.9-beta-0bo) unstable; urgency=low
* fix cflags
* fix diff files
* fix & change categorize of client or server
mysql-server:
/usr/sbin/mysql_install_db
safe_mysqld mysqld
isamchk isamlog
mysql-base:
/usr/bin/
comp_err msql2mysql mysql mysql_zap
mysqlaccess mysqladmin mysqlbug
mysqldump mysqlimport mysqlshow
/usr/bin/mysql-sub/
add_file_priv add_func_table
add_long_password make_binary_distribution
perror replace resolveip
* patch to sql_string.cc ('%' bug)
-- takeshi <takeshi@softagency.co.jp> Wed, 7 Oct 1998 15:03:45 +0900
mysql (3.22.8-beta-0bo) unstable; urgency=low
* New up stream
-- takeshi <takeshi@softagency.co.jp> Wed, 7 Oct 1998 15:03:45 +0900
mysql (3.22.7b-0bo.1) unstable; urgency=low
* left join patch
-- takeshi <takeshi@softagency.co.jp> Thr, 24 Sep 1998 15:03:45 +0900
mysql (3.22.7b-0bo) unstable; urgency=low
* New upstream version (bo)
* mb patch
* *.a -> /usr/lib/mysql/
* add_file_priv add_func_table make_binary_distribution
add_long_password perror replace resolveip
-> /usr/bin/mysql-sub/
* mysqld, safe_mysqld, mysql_install_db -> mysql-server /usr/sbin/
* add '-lm -lz -ldl' when building libmysqlclient.so.4.0.0
-- takeshi <takeshi@softagency.co.jp> Sat, 15 Aug 1998 15:03:45 +0900
mysql (3.22.4a-0bo) unstable; urgency=low
* New upstream version (bo)
* use system libreadline
-- takeshi <takeshi@softagency.co.jp> Sat, 15 Aug 1998 15:03:45 +0900
mysql (3.21.33-0bo) unstable; urgency=low
* New upstream version
-- takeshi <takeshi@softagency.co.jp> Wed, 22 Jul 1998 12:51:45 +0900
mysql (3.21.30-1) unstable; urgency=low
* New upstream version
* fix conffile setting
-- takeshi <takeshi@softagency.co.jp> Tue, 12 May 1998 20:24:45 +0900
mysql (3.21.29.gamma-2) unstable; urgency=low
* charset=ujis,sjis packages
* branch mysql-base-* (lib*.so)
* /usr/local/mysql/lib/mysql/lib* -> /usr/lib/
* /usr/local/mysql/include -> /usr/include
* /usr/local/mysql/info -> /usr/info
* /usr/local/mysql/man -> /usr/man
* /usr/local/mysql/share -> /usr/share
* /usr/local/mysql/bin -> /usr/bin
* /usr/local/mysql/libexec -> /usr/sbin
* /usr/local/mysql/var -> /var/mysql/data
* /usr/local/mysql/sql-bench -> /var/mysql/sql-bench
-- takeshi <takeshi@softagency.co.jp> Fri, 8 May 1998 00:04:45 +0900
mysql (3.21.29.gamma-1) unstable; urgency=low
* Initial Release.
-- takeshi <takeshi@softagency.co.jp> Sat, 2 May 1998 03:42:24 +0900
Local variables:
mode: debian-changelog
add-log-mailing-address: "takeshi@softagency.co.jp"
End:
Source: mysql
Section: devel
Priority: extra
Maintainer: takeshi <takeshi@softagency.co.jp>
Standards-Version: 2.1.2.2
Package: mysql
Architecture: all
Description: mysql
Missing
Package: mysql-doc
Architecture: all
Description: mysql Documentation (html)
MySQL Doc.
Package: libmysqlclient9
Architecture: any
Provides: libmysqlclient9
Description: libmysqlclient.so.9
libmysqlclient.so.9
Package: mysql-client
Architecture: any
Depends: ${shlibs:Depends}
Section: devel
Priority: extra
Conflicts: mysql-client-ujis, mysql-client-sjis
Replaces: mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-client-ujis, mysql-client-sjis
Provides: mysql-client
Description: mysql clients.
MySQL clients programs.
Package: mysql-server
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Provides: mysql-server
Description: MySQL server (static linked)
MySQL server. static linked.
Package: mysql-server-shared
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server (dynamic linked)
MySQL server. dynamic linked.
Package: mysql-server-debug
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server debug
MySQL server. debug
Package: mysql-dev
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-dev-sjis, mysql-dev-ujis
Replaces: mysql-dev-sjis, mysql-dev-ujis, libmysqlclient6-ujis, libmysqlclient6-sjis
Provides: mysql-dev
Description: MySQL develop suite
MySQL develop.
Package: mysql-bench
Architecture: all
Description: mysql benchmark suite.
MySQL sql-bench files.
This package was debianized by takeshi@softagency.co.jp on
Sat, 2 May 1998 03:42:24 +0900.
It was downloaded from
http://www.mysql.com/
Copyright:
GPL
Docs/Makefile
strings/Makefile
dbug/Makefile
mysys/Makefile
extra/Makefile
regex/Makefile
isam/Makefile
heap/Makefile
merge/Makefile
sql/Makefile
sql/share/Makefile
support-files/binary-configure
support-files/my-example.cnf
support-files/mysql-log-rotate
scripts/add_func_table
scripts/mysql_setpermisson
scripts/mysqlbug
scripts/mysqlhotcopy
client/my_static.h
client/mysys_priv.h
include/my_config.h
sql/lex_hash.h
sql-bench/Makefile
scripts/mysql_config
libmysql_r/Makefile
#!/bin/sh
STAMPFILE="debian/stamp-move"
if [ -e $STAMPFILE ]; then
exit
fi
#----------
CLIENT1="msql2mysql mysql mysql_convert_table_format mysql_find_rows mysql_fix_privilege_tables mysql_setpermission mysql_zap mysqlaccess mysqladmin mysqlbug mysqldump mysqlhotcopy mysqlimport mysqlshow"
# CLIENT2="add_file_priv add_func_table add_long_password make_binary_distribution"
P=`pwd`
#----------
for CHAR in build
do
#-----
cp -Rpd debian/${CHAR}/usr debian/mysql-server/
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so.* debian/libmysqlclient9/usr/lib/
#----- mysql-server-shared ---
cp -Rpd debian/${CHAR}-shared/usr/sbin/mysqld debian/mysql-server-shared/usr/sbin/mysqld-shared
#----- mysql-server-debug ---
cp -Rpd debian/${CHAR}-debug/usr/sbin/mysqld debian/mysql-server-debug/usr/sbin/mysqld-debug
#----- mysql-server ---
mv debian/mysql-server/usr/sbin/mysqld debian/mysql-server/usr/sbin/mysqld-static
#----- mysql-client ----
cd ${P}/debian/mysql-server/usr/bin/ && mv $CLIENT1 ../../../mysql-client/usr/bin/
cd ${P}
mv -f debian/mysql-server/usr/{man,info} debian/mysql-client/usr/share/
mv debian/mysql-server/usr/share/mysql/my-example.cnf debian/mysql-client/usr/share/mysql/
mv -f debian/mysql-server/usr/bin/replace debian/mysql-client/usr/bin/mysql_replace
#----- mysql-server ---
mv debian/mysql-server/usr/bin/* debian/mysql-server/usr/sbin/
mv debian/mysql-server/usr/sbin/my_print_defaults debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/comp_err debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/perror debian/mysql-server/usr/bin/mysql_perror
mv debian/mysql-server/usr/sbin/resolveip debian/mysql-server/usr/bin/mysql_resolveip
#----- mysql-dev ----
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so debian/mysql-dev/usr/lib/
mv debian/mysql-server/usr/include debian/mysql-dev/usr/
mv debian/mysql-server/usr/lib/mysql debian/mysql-dev/usr/lib/
mv debian/mysql-dev/usr/lib/mysql/libmysqlclient.a debian/mysql-dev/usr/lib/
(cd debian/mysql-dev/usr/lib/mysql ; ln -sf "../libmysqlclient.a" )
#-----
cp debian/README.debian debian/copyright debian/changelog \
debian/mysql-client/usr/share/doc/mysql/
done
####################
### doc
cp -r COPYING* MIRRORS README* Docs/* debian/mysql-doc/usr/share/doc/mysql/
#### sql-bench
mv debian/mysql-server/usr/sql-bench \
debian/mysql-bench/var/mysql/
touch $STAMPFILE
# Example mysql config file.
# You can copy this to one of:
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is @localstatedir@) or
# ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options
# This will be passed to all mysql clients
[client]
#password = my_password
#port = 3306
#socket = /tmp/mysql.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# The MySQL server
[mysqld]
default-character-set = ujis
#port = 3306
#socket = /tmp/mysql.sock
#skip-locking
#set-variable = key_buffer=16M
#set-variable = max_allowed_packet=1M
#set-variable = thread_stack=128K
## Start logging
#log
[mysqldump]
default-character-set = ujis
#quick
#set-variable = max_allowed_packet=16M
[mysql]
default-character-set = ujis
#no-auto-rehash
[isamchk]
#set-variable = key_buffer=16M
usr/bin
usr/share/mysql
usr/share/doc/mysql
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-debug 20
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-shared 15
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-rc.d mysql defaults 50 >/dev/null
#--------
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-static 10
#--------
DOFIX=0
if [ ! -e /var/mysql/data/mysql/tables_priv.frm -a -d /var/mysql/data/mysql ]; then
DOFIX=1
fi
#--------
i=`grep '^mysql:' /etc/group`
if [ "x${i}" == "x" ]; then
groupadd mysql || true
fi
i=`grep '^mysql:' /etc/passwd`
if [ "x${i}" == "x" ]; then
useradd -g mysql -d /var/mysql/data -s /noexists mysql || true
fi
#--------
if [ ! -d /var/mysql/data/mysql ]; then
install -d /var/mysql/data || true
/usr/sbin/mysql_install_db || true
chown -R mysql.mysql /var/mysql
fi
#--------
/etc/init.d/mysql start || true
if [ $DOFIX -eq 1 ]; then
echo "***************************************"
echo " Now, fix tables for MySQL 3.22.11...."
echo " if you set root passwd, please in..."
echo -n " ? MySQL root passwd ? : "
read pass dumy
/usr/sbin/mysql_fix_privilege_tables $pass
fi
#!/bin/sh
update-alternatives --auto mysqld
if [ "$1" = "purge" ]
then
update-rc.d mysql remove >/dev/null
echo -n " Shall I also remove all of the databases (y/N)?"; read ans
if [ "$ans" = "y" -o "$ans" = "Y" ]; then
rm -rf /var/mysql
fi
fi
#!/bin/sh
/etc/init.d/mysql stop || true
--- mysql-3.23.23.orig/sql/Makefile.in
+++ mysql-3.23.23/sql/Makefile.in
@@ -366,7 +366,7 @@
mysqlbinlog: $(mysqlbinlog_OBJECTS) $(mysqlbinlog_DEPENDENCIES)
@rm -f mysqlbinlog
- $(CXXLINK) $(mysqlbinlog_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqlbinlog_LDADD) $(LIBS)
+ $(CXXLINK) $(mysqld_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqld_LDADD) $(LIBS)
mysqld: $(mysqld_OBJECTS) $(mysqld_DEPENDENCIES)
@rm -f mysqld
--- mysql-3.23.23.orig/scripts/Makefile.in
+++ mysql-3.23.23/scripts/Makefile.in
@@ -337,6 +337,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/support-files/Makefile.in
+++ mysql-3.23.23/support-files/Makefile.in
@@ -308,6 +308,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/scripts/msql2mysql.sh
+++ mysql-3.23.23/scripts/msql2mysql.sh
@@ -13,4 +13,4 @@
# described in the License. Among other things, the License requires that
# the copyright notice and this notice be preserved on all copies.
-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
+@bindir@/mysql_replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
--- mysql-3.23.23.orig/scripts/mysql_install_db.sh
+++ mysql-3.23.23/scripts/mysql_install_db.sh
@@ -11,6 +11,7 @@
ldata=@localstatedir@
execdir=@libexecdir@
bindir=@bindir@
+sbindir=@sbindir@
force=0
IN_RPM=0
defaults=
@@ -47,6 +48,10 @@
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | sed '.*=[ \t]*//`
+ fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
@@ -56,7 +61,7 @@
for arg
do
case "$arg" in
- --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;;
+ --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; sbindir="$basedir/sbin"; execdir="$basedir/libexec" ;;
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;;
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;;
esac
@@ -82,10 +87,10 @@
# Check if hostname is valid
if test "$IN_RPM" -eq 0 -a $force -eq 0
then
- resolved=`$bindir/resolveip $hostname 2>&1`
+ resolved=`$bindir/mysql_resolveip $hostname 2>&1`
if [ $? -ne 0 ]
then
- resolved=`$bindir/resolveip localhost 2>&1`
+ resolved=`$bindir/mysql_resolveip localhost 2>&1`
if [ $? -eq 0 ]
then
echo "Sorry, the host '$hostname' could not be looked up."
@@ -300,7 +305,7 @@
if test -z "$IN_RPM"
then
echo "You can start the MySQL demon with:"
- echo "cd @prefix@ ; $bindir/safe_mysqld &"
+ echo "cd @prefix@ ; $sbindir/safe_mysqld &"
echo
echo "You can test the MySQL demon with the benchmarks in the 'sql-bench' directory:"
echo "cd sql-bench ; run-all-tests"
--- mysql-3.23.23.orig/support-files/mysql.server.sh Tue Sep 5 19:13:35 2000
+++ mysql-3.23.23/support-files/mysql.server.sh Tue Sep 5 19:19:40 2000
@@ -16,6 +16,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@
bindir=@bindir@
+sbindir=@sbindir@
datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
@@ -64,6 +65,10 @@
then
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | cut -f 2 -d= | tr -d ' '`
+ fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
@@ -78,14 +83,15 @@
'start')
# Start daemon
- if test -x $bindir/safe_mysqld
+ if test -x $sbindir/safe_mysqld
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $sbindir/safe_mysqld \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
- echo "Can't execute $bindir/safe_mysqld"
+ echo "Can't execute $sbindir/safe_mysqld"
fi
;;
--- mysql-3.23.23.orig/configure
+++ mysql-3.23.23/configure
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- mysql-3.23.23.orig/configure.in
+++ mysql-3.23.23/configure.in
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
package=mysql
CHARSET=ujis
TEMPINST=build
#CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static
CC=gcc
CFLAGS=-O6 -fomit-frame-pointer
CXX=gcc
CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti
# CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-rtti
SYSNAME=
COMMONCONF= --prefix=/usr --libexecdir=/usr/sbin \
--localstatedir=/var/mysql/data \
--enable-shared \
--without-perl --without-readline \
--without-docs --without-bench \
--with-mysqld-user=mysql \
--with-extra-charsets=all
SERVERCONF=$(COMMONCONF) --enable-assembler \
--with-raid
# --with-berkeley-db-includes=/usr/include/db3 \
# --with-berkeley-db-libs=/usr/lib/libdb3.a
STATICCONF=--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
CLIENTCONF=$(COMMONCONF) --without-server
##################################################
patches debian/stamp-patches:
-test -e debian/stamp-patches || \
for i in `find debian/patches -type f -print` ; do \
patch -p1 < $$i ; \
done
touch debian/stamp-patches
##################################################
premkdir debian/stamp-premkdir:
$(checkdir)
-rm -rf debian/tmp debian/$(TEMPINST)*
dh_installdirs
-install -d debian/$(TEMPINST)/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-shared/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-debug/usr/{bin,sbin,share,man,include,info}
touch debian/stamp-premkdir
##################################################
config debian/stamp-config: debian/stamp-premkdir debian/stamp-patches
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
LDFLAGS="-static" \
./configure $(SERVERCONF) $(STATICCONF) \
--with-charset=$(CHARSET) \
--with-bench \
$(SYSNAME)
# sed 's/-fno-implicit-templates//g' sql/Makefile > .m
# mv .m sql/Makefile
touch debian/stamp-config
##################################################
build: debian/stamp-config
make LDFLAGS="-static"
make install DESTDIR=`pwd`/debian/$(TEMPINST)
cp include/m_ctype.h `pwd`/debian/$(TEMPINST)/usr/include/mysql/
touch build
##################################################
build-shared debian/stamp-build-shared: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-shared
touch debian/stamp-build-shared
##################################################
build-debug debian/stamp-build-debug: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
--with-debug \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-debug
touch debian/stamp-build-debug
##################################################
clean:
$(checkdir)
-make distclean
-test -e debian/stamp-patches && \
for i in `find debian/patches -type f -print` ; do \
patch -R -p1 < $$i ; \
done
-rm -rf build debian/stamp-* debian/$(TEMPINST)*
-dh_clean
-rm -f `find . -name "*~"`
-rm -rf debian/tmp debian/files* core
-rm -f debian/*substvars
-rm -f `cat debian/gomi`
##################################################
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build debian/stamp-build-shared debian/stamp-build-debug
sh debian/move
### init, post*
dh_installdeb
cp debian/shlibs debian/libmysqlclient9/DEBIAN/
cp debian/my.cnf debian/mysql-server/etc/
cp support-files/mysql.server debian/mysql-server/etc/init.d/mysql ; chmod +x debian/mysql-server/etc/init.d/mysql
### dpkg-xxx
dh_compress
dh_fixperms
dh_strip
dh_shlibdeps
dh_gencontrol
dpkg --build debian/libmysqlclient9 ..
dpkg --build debian/mysql-client ..
dpkg --build debian/mysql-server ..
dpkg --build debian/mysql-server-shared ..
dpkg --build debian/mysql-server-debug ..
dpkg --build debian/mysql-dev ..
dpkg --build debian/mysql-bench ..
dpkg --build debian/mysql-doc ..
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
##################################################
checkroot:
$(checkdir)
test root = "`whoami`"
##################################################
.PHONY: binary binary-arch binary-indep clean checkroot
libmysqlclient 9 libmysqlclient9
File mode changed from 100755 to 100644
......@@ -13,63 +13,61 @@
# chkconfig: 2345 90 90
# description: A very fast and reliable SQL database engine.
# The following variables are only set for letting mysql.server find things
# if you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf or other configuration files
PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@
bindir=@bindir@
sbindir=@sbindir@
datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
# Run mysqld as this user.
mysql_daemon_user=@MYSQLD_USER@
export PATH
mode=$1
if test -w / # determine if we should look at the root config file
then # or user config file
conf=/etc/my.cnf
else
conf=$HOME/.my.cnf # Using the users config file
fi
# The following code tries to get the variables safe_mysqld needs from the
# config file. This isn't perfect as this ignores groups, but it should
# work as the options doesn't conflict with anything else.
if test -f "$conf" # Extract those fields we need from config file.
then
if grep "^datadir" $conf >/dev/null
then
datadir=`grep "^datadir" $conf | cut -f 2 -d= | tr -d ' '`
fi
if grep "^user" $conf >/dev/null
then
mysql_daemon_user=`grep "^user" $conf | cut -f 2 -d= | tr -d ' ' | head -1`
fi
if grep "^pid-file" $conf >/dev/null
then
pid_file=`grep "^pid-file" $conf | cut -f 2 -d= | tr -d ' '`
else
if test -d "$datadir"
then
pid_file=$datadir/`hostname`.pid
fi
fi
if grep "^basedir" $conf >/dev/null
then
basedir=`grep "^basedir" $conf | cut -f 2 -d= | tr -d ' '`
bindir=$basedir/bin
fi
if grep "^bindir" $conf >/dev/null
then
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
fi
fi
GetCNF () {
VARIABLES="basedir bindir sbindir datadir pid-file"
CONFIG_FILES="/etc/my.cnf $basedir/my.cnf $HOME/.my.cnf"
for c in $CONFIG_FILES
do
if [ -f $c ]
then
#echo "Processing $c..."
for v in $VARIABLES
do
# This method assumes last of duplicate $variable entries will be the
# value set ([mysqld])
# This could easily be rewritten to gather [xxxxx]-specific entries,
# but for now it looks like only the mysqld ones are needed for
# server startup scripts
eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
# it would be easier if the my.cnf and variable values were
# all matched, but since they aren't we need to map them here.
case $v in
pid-file) v=pid_file ;;
log) v=log_file ;;
esac
# As long as $thevar isn't blank, use it to set or override current
# value
[ "$thevar" != "" ] && eval $v=$thevar
done
#else
# echo "No $c config file."
fi
done
}
# run function to get config values
GetCNF
# Safeguard (relative paths, core dumps..)
cd $basedir
......@@ -83,7 +81,7 @@ case "$mode" in
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
$bindir/safe_mysqld \
--user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
--datadir=$datadir --pid-file=$pid_file &
else
echo "Can't execute $bindir/safe_mysqld"
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