Commit ebaa0774 authored by unknown's avatar unknown

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0

into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b2298


myisam/mi_search.c:
  Auto merged
parents ef325a47 e788ed00
...@@ -115,10 +115,12 @@ if (defined $opt_log) ...@@ -115,10 +115,12 @@ if (defined $opt_log)
if (-x "/usr/bin/rpmbuild") if (-x "/usr/bin/rpmbuild")
{ {
$RPM= "/usr/bin/rpmbuild"; $RPM= "/usr/bin/rpmbuild";
$RMSOURCE= "--rmsource --rmspec";
} }
else else
{ {
$RPM= "/bin/rpm"; $RPM= "/bin/rpm";
$RMSOURCE= "--rmspec";
} }
if ($RPM) if ($RPM)
...@@ -177,7 +179,7 @@ $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); ...@@ -177,7 +179,7 @@ $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
$command= "$RPM"; $command= "$RPM";
$command.= " -v" if ($opt_verbose); $command.= " -v" if ($opt_verbose);
$command.= " -ba"; $command.= " -ba";
$command.= " --clean" if $opt_clean; $command.= " --clean $RMSOURCE" if $opt_clean;
$command.= " $SPECDIR/"; $command.= " $SPECDIR/";
$command.= basename($SPECFILE); $command.= basename($SPECFILE);
&logger("Building RPM."); &logger("Building RPM.");
...@@ -198,19 +200,6 @@ $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; ...@@ -198,19 +200,6 @@ $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir."); &logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!"); &run_command($command, "Error moving binary RPMs!");
#
# Clean up
#
if ($opt_clean)
{
&logger("Removing spec file and source package");
unless ($opt_dry_run)
{
unlink("$SPECDIR/" . basename($SPECFILE));
unlink("$SOURCEDIR/$SOURCEFILE");
}
}
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); &logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
exit 0; exit 0;
......
...@@ -21,7 +21,26 @@ man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \ ...@@ -21,7 +21,26 @@ man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \ mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1 perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1
EXTRA_DIST = $(man_MANS) EXTRA_DIST = mysql.1.in isamchk.1.in isamlog.1.in mysql_zap.1.in \
mysqlaccess.1.in mysqladmin.1.in mysqld.1.in mysqld_multi.1.in \
mysqldump.1.in mysqlshow.1.in perror.1.in replace.1.in \
mysqld_safe.1.in mysql_fix_privilege_tables.1.in
CLEANFILES = $(man_MANS)
SUFFIXES = .in
.in:
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
-e 's!@''sysconfdir''@!@sysconfdir@!' \
-e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''libexecdir''@!$(libexecdir)!g' \
-e 's!@''localstatedir''@!$(localstatedir)!g' \
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
$< > $@-t
@MV@ $@-t $@
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
.TH isamchk 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH isamchk 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
.BR isamchk .BR isamchk
\- Description, check and repair of ISAM tables. \- Description, check and repair of ISAM tables.
...@@ -114,24 +114,29 @@ Print version and exit. ...@@ -114,24 +114,29 @@ Print version and exit.
.BR \-w | \-\-wait .BR \-w | \-\-wait
Wait if table is locked. Wait if table is locked.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamlog(1),
isamlog (1), mysql(1),
mysqlaccess (1), mysqlaccess(1),
mysqladmin (1), mysqladmin(1),
mysqlbug (1), mysqld(1),
mysqld (1), mysqld_multi(1),
mysqldump (1), mysqld_safe(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
.TH isamlog 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH isamlog 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
isamlog - Write info about whats in a nisam log file. isamlog - Write info about whats in a nisam log file.
.SH USAGE .SH USAGE
...@@ -71,27 +71,31 @@ If one gives table names as arguments only these tables will be updated ...@@ -71,27 +71,31 @@ If one gives table names as arguments only these tables will be updated
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk(1),
isamchk (1), mysql(1),
isamlog (1), mysqlaccess(1),
mysqlaccess (1), mysqladmin(1),
mysqladmin (1), mysqld(1),
mysqlbug (1), mysqld_multi(1),
mysqld (1), mysqld_safe(1),
mysqldump (1), mysqldump(1),
mysqlshow (1), mysql_fix_privilege_tables(1),
msql2mysql (1), mysqlshow(1),
perror (1), mysql_zap(1),
replace (1), perror(1),
mysqld_safe (1), replace(1)
which1 (1), .P
zap (1), For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect / (kill-9@kill-9.dk), Mercurmedia Data Model Architect /
......
.TH mysql 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysql 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysql \- text-based client for mysqld, a SQL-based relational database daemon mysql \- text-based client for mysqld, a SQL-based relational database daemon
.SH USAGE
mysql [OPTIONS] [Database]
.SH SYNOPSIS .SH SYNOPSIS
.B mysql .B mysql
.RB [ \-B | \-\-batch ] .RB [ \-B | \-\-batch ]
...@@ -105,16 +107,19 @@ version number and exit. ...@@ -105,16 +107,19 @@ version number and exit.
Wait and retry if the database server connection is down. Wait and retry if the database server connection is down.
.SH FILES .SH FILES
.TP 2.2i .TP 2.2i
.I /depot/bin/mysql .I @sysconfdir@/my.cnf
executable MySQL configuration file
.TP .TP
.I /depot/bin/mysqld .I @bindir@/mysql
executable Client executable
.TP .TP
.I /depot/bin/mysqld_safe .I @libexecdir@/mysqld
Server executable
.TP
.I @bindir@/mysqld_safe
executable shell script for starting mysqld safely executable shell script for starting mysqld safely
.TP .TP
.I /site/var/mysql/data .I @localstatedir@
location of database files location of database files
.SH EXAMPLE .SH EXAMPLE
You can also read a backup dump file back into MySQL with: You can also read a backup dump file back into MySQL with:
...@@ -124,24 +129,29 @@ You can also read a backup dump file back into MySQL with: ...@@ -124,24 +129,29 @@ You can also read a backup dump file back into MySQL with:
.BR < .BR <
backup-file.sql backup-file.sql
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysqlaccess(1),
mysqladmin (1), mysqladmin(1),
mysqlbug (1), mysqld(1),
mysqld (1), mysqld_multi(1),
mysqldump (1), mysqld_safe(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 6.3, distribution 3.20.20 Ver 6.3, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/)
This software comes with no warranty. This software comes with no warranty.
Manual page by R. P. C. Rodgers, Manual page by R. P. C. Rodgers,
Lister Hill National Center for Biomedical Communication, Lister Hill National Center for Biomedical Communication,
......
.TH mysql 1 "17 March 2003" "MySQL 4.0" "MySQL database" .TH mysql 1 "17 March 2003" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysql_fix_privilege_tables \- Fixes MySQL privilege tables. mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
.SH SYNOPSIS .SH SYNOPSIS
...@@ -14,7 +14,25 @@ If you get 'Access denied' errors, run the script again ...@@ -14,7 +14,25 @@ If you get 'Access denied' errors, run the script again
and give the MySQL root user password as an argument. and give the MySQL root user password as an argument.
.SH "SEE ALSO" .SH "SEE ALSO"
mysql (1), mysqld (1) isamchk(1),
isamlog(1),
mysql(1),
mysqlaccess(1),
mysqladmin(1),
mysqld(1),
mysqld_multi(1),
mysqld_safe(1),
mysqldump(1),
mysqlshow(1),
mysql_zap(1),
perror(1),
replace(1)
.P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
This manpage was written by Christian Hammers <ch@debian.org>. This manpage was written by Christian Hammers <ch@debian.org>.
......
.TH zap 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
zap - a perl script used to kill processes zap - a perl script used to kill processes
.SH USAGE .SH USAGE
...@@ -28,7 +28,25 @@ isn't given, ask user for confirmation for each process to kill. If signal isn't ...@@ -28,7 +28,25 @@ isn't given, ask user for confirmation for each process to kill. If signal isn't
.BR -t .BR -t
is given the processes is only shown on stdout. is given the processes is only shown on stdout.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1), isamchk(1),
isamlog(1),
mysql(1),
mysqlaccess(1),
mysqladmin(1),
mysqld(1),
mysqld_multi(1),
mysqld_safe(1),
mysqldump(1),
mysql_fix_privilege_tables(1),
mysqlshow(1),
perror(1),
replace(1)
.P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
.\" end of man page .\" end of man page
\ No newline at end of file
.TH mysqlaccess 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
.BR mysqlaccess .BR mysqlaccess
\- Create new users to mysql. \- Create new users to mysql.
...@@ -95,24 +95,29 @@ If no host is given, `localhost' is assumed ...@@ -95,24 +95,29 @@ If no host is given, `localhost' is assumed
Wildcards (*,?,%,_) are allowed for host, user and db, but be sure Wildcards (*,?,%,_) are allowed for host, user and db, but be sure
to escape them from your shell!! (i.e., type \\* or '*') to escape them from your shell!! (i.e., type \\* or '*')
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqladmin(1),
mysqlbug (1), mysqld(1),
mysqld (1), mysqld_multi(1),
mysqldump (1), mysqld_safe(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
.TH mysqladmin 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqladmin 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
.SH OPTION SYNOPSIS .SH OPTION SYNOPSIS
...@@ -178,31 +178,32 @@ Prints variables available ...@@ -178,31 +178,32 @@ Prints variables available
.BR version .BR version
Get version info from server Get version info from server
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqld(1),
mysqld (1), mysqld_multi(1),
mysqldump (1), mysqld_safe(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect / (kill-9@kill-9.dk), Mercurmedia Data Model Architect /
system developer (http://www.mercurmedia.com) system developer (http://www.mercurmedia.com)
.\" end of man page .\" end of man page
.TH mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
.BR mysqld mysqld \- The MySQL server demon
\- Starts the MySQL server demon
.SH USAGE .SH USAGE
mysqld [OPTIONS] mysqld [OPTIONS]
.SH SYNOPSIS .SH SYNOPSIS
...@@ -204,24 +203,29 @@ Output version information and exit. ...@@ -204,24 +203,29 @@ Output version information and exit.
.SH NOTE .SH NOTE
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld_multi(1),
mysqldump (1), mysqld_safe(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
.TH mysqld_multi 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqld_multi 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports. mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
.SH USAGE .SH USAGE
...@@ -58,27 +58,31 @@ Please see the mysql manual for more detailed information on this. ...@@ -58,27 +58,31 @@ Please see the mysql manual for more detailed information on this.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk(1),
isamchk (1), isamlog(1),
isamlog (1), mysql(1),
mysqlaccess (1), mysqlaccess(1),
mysqladmin (1), mysqladmin(1),
mysqlbug (1), mysqld(1),
mysqld (1), mysqld_safe(1),
mysqldump (1), mysqldump(1),
mysqlshow (1), mysql_fix_privilege_tables(1),
msql2mysql (1), mysqlshow(1),
perror (1), mysql_zap(1),
replace (1), perror(1),
mysqld_safe (1), replace(1)
which1 (1), .P
zap (1), For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect / (kill-9@kill-9.dk), Mercurmedia Data Model Architect /
......
.TH safe_mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH safe_mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysqld_safe \- start the mysqld daemon on Unix. mysqld_safe \- start the mysqld daemon on Unix.
.SH SYNOPSIS .SH SYNOPSIS
...@@ -60,22 +60,27 @@ Set the timezone (the TZ) variable to the value of this parameter. ...@@ -60,22 +60,27 @@ Set the timezone (the TZ) variable to the value of this parameter.
.SH NOTE .SH NOTE
Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file. Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld(1),
mysqldump (1), mysqld_multi(1),
mysqlshow (1), mysqldump(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@mysql.com), Michael (Monty) Widenius (monty@mysql.com),
MySQL AB (http://www.mysql.com). MySQL AB (http://www.mysql.com).
This software comes with no warranty. This software comes with no warranty.
......
.TH mysqldump 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data. mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
...@@ -247,24 +247,29 @@ If all the databases are wanted, one can use: ...@@ -247,24 +247,29 @@ If all the databases are wanted, one can use:
mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld(1),
mysqldump (1), mysqld_multi(1),
mysqlshow (1), mysqld_safe(1),
msql2mysql (1), mysql_fix_privilege_tables(1),
perror (1), mysqlshow(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect / (kill-9@kill-9.dk), Mercurmedia Data Model Architect /
......
.TH mysqlshow 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH mysqlshow 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
.BR mysqlshow .BR mysqlshow
\- Shows the structure of a mysql database (databases,tables and columns) \- Shows the structure of a mysql database (databases,tables and columns)
...@@ -67,24 +67,29 @@ If no column is given then all matching columns and columntypes in table ...@@ -67,24 +67,29 @@ If no column is given then all matching columns and columntypes in table
are shown are shown
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld(1),
mysqldump (1), mysqld_multi(1),
mysqlshow (1), mysqld_safe(1),
msql2mysql (1), mysqldump(1),
perror (1), mysql_fix_privilege_tables(1),
replace (1), mysql_zap(1),
mysqld_safe (1), perror(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
.TH perror 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH perror 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
perror \- describes a system or MySQL error code. perror \- describes a system or MySQL error code.
.SH SYNOPSIS .SH SYNOPSIS
...@@ -27,24 +27,29 @@ shell> perror 64 79 ...@@ -27,24 +27,29 @@ shell> perror 64 79
Error code 64: Machine is not on the network Error code 64: Machine is not on the network
Error code 79: Can not access a needed shared library Error code 79: Can not access a needed shared library
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld(1),
mysqldump (1), mysqld_multi(1),
mysqlshow (1), mysqld_safe(1),
msql2mysql (1), mysqldump(1),
perror (1), mysql_fix_privilege_tables(1),
replace (1), mysqlshow(1),
mysqld_safe (1), mysql_zap(1),
which1 (1), replace(1)
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
.TH replace 1 "19 December 2000" "MySQL 4.0" "MySQL database" .TH replace 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME .SH NAME
.TP .TP
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings. replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
...@@ -41,24 +41,29 @@ this command swaps a and b in the given files: ...@@ -41,24 +41,29 @@ this command swaps a and b in the given files:
.TP .TP
shell> replace a b b a -- file1 file2 ... shell> replace a b b a -- file1 file2 ...
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk(1),
isamlog (1), isamlog(1),
mysqlaccess (1), mysql(1),
mysqladmin (1), mysqlaccess(1),
mysqlbug (1), mysqladmin(1),
mysqld (1), mysqld(1),
mysqldump (1), mysqld_multi(1),
mysqlshow (1), mysqld_safe(1),
msql2mysql (1), mysqldump(1),
perror (1), mysql_fix_privilege_tables(1),
replace (1), mysqlshow(1),
mysqld_safe (1), mysql_zap(1),
which1 (1), perror(1),
zap (1), .P
For more information please refer to the MySQL reference
manual, which may already be installed locally and which
is also available online at http://www.mysql.com/doc/en/
.SH BUGS
Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com/).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect / (kill-9@kill-9.dk), Mercurmedia Data Model Architect /
......
...@@ -922,7 +922,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) ...@@ -922,7 +922,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
info->checksum=mi_checksum(info,record); info->checksum=mi_checksum(info,record);
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE)) if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{ {
if (_mi_rec_check(info,record, info->rec_buff)) if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len))
{ {
mi_check_print_error(param,"Found wrong packed record at %s", mi_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff)); llstr(start_recpos,llbuff));
...@@ -2350,6 +2350,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -2350,6 +2350,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[i].record= (((char *)(sort_param+share->base.keys))+ sort_param[i].record= (((char *)(sort_param+share->base.keys))+
(share->base.pack_reclength * i)); (share->base.pack_reclength * i));
if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
{
mi_check_print_error(param,"Not enough memory!");
goto err;
}
sort_param[i].key_length=share->rec_reflength; sort_param[i].key_length=share->rec_reflength;
for (keyseg=sort_param[i].keyinfo->seg; keyseg->type != HA_KEYTYPE_END; for (keyseg=sort_param[i].keyinfo->seg; keyseg->type != HA_KEYTYPE_END;
...@@ -2911,7 +2916,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) ...@@ -2911,7 +2916,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
info->checksum=mi_checksum(info,sort_param->record); info->checksum=mi_checksum(info,sort_param->record);
if ((param->testflag & (T_EXTEND | T_REP)) || searching) if ((param->testflag & (T_EXTEND | T_REP)) || searching)
{ {
if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff)) if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff,
sort_param->find_length))
{ {
mi_check_print_info(param,"Found wrong packed record at %s", mi_check_print_info(param,"Found wrong packed record at %s",
llstr(sort_param->start_recpos,llbuff)); llstr(sort_param->start_recpos,llbuff));
......
...@@ -14,7 +14,15 @@ ...@@ -14,7 +14,15 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Functions to handle space-packed-records and blobs */ /*
Functions to handle space-packed-records and blobs
A row may be stored in one or more linked blocks.
The block size is between MI_MIN_BLOCK_LENGTH and MI_MAX_BLOCK_LENGTH.
Each block is aligned on MI_DYN_ALIGN_SIZE.
The reson for the max block size is to not have too many different types
of blocks. For the differnet block types, look at _mi_get_block_info()
*/
#include "myisamdef.h" #include "myisamdef.h"
#include <assert.h> #include <assert.h>
...@@ -148,7 +156,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record, ...@@ -148,7 +156,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
} while (reclength); } while (reclength);
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -264,37 +272,62 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info) ...@@ -264,37 +272,62 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/* Delete datarecord from database */
/* info->rec_cache.seek_not_done is updated in cmp_record */
static int delete_dynamic_record(MI_INFO *info, my_off_t filepos, /*
uint second_read) Add a backward link to delete block
SYNOPSIS
update_backward_delete_link()
info MyISAM handler
delete_block Position to delete block to update.
If this is 'HA_OFFSET_ERROR', nothing will be done
filepos Position to block that 'delete_block' should point to
RETURN
0 ok
1 error. In this case my_error is set.
*/
static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
my_off_t filepos)
{ {
uint length,b_type; MI_BLOCK_INFO block_info;
MI_BLOCK_INFO block_info,del_block; DBUG_ENTER("update_backward_delete_link");
int error=0;
my_bool remove_next_block;
DBUG_ENTER("delete_dynamic_record");
/* First add a link from the last block to the new one */ if (delete_block != HA_OFFSET_ERROR)
if (info->s->state.dellink != HA_OFFSET_ERROR)
{ {
block_info.second_read=0; block_info.second_read=0;
if (_mi_get_block_info(&block_info,info->dfile,info->s->state.dellink) if (_mi_get_block_info(&block_info,info->dfile,delete_block)
& BLOCK_DELETED) & BLOCK_DELETED)
{ {
char buff[8]; char buff[8];
mi_sizestore(buff,filepos); mi_sizestore(buff,filepos);
if (my_pwrite(info->dfile,buff,8,info->s->state.dellink+12, if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
MYF(MY_NABP))) DBUG_RETURN(1); /* Error on write */
error=1; /* Error on write */
} }
else else
{ {
error=1; /* Wrong delete link */
my_errno=HA_ERR_WRONG_IN_RECORD; my_errno=HA_ERR_WRONG_IN_RECORD;
DBUG_RETURN(1); /* Wrong delete link */
} }
} }
return 0;
}
/* Delete datarecord from database */
/* info->rec_cache.seek_not_done is updated in cmp_record */
static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
uint second_read)
{
uint length,b_type;
MI_BLOCK_INFO block_info,del_block;
int error;
my_bool remove_next_block;
DBUG_ENTER("delete_dynamic_record");
/* First add a link from the last block to the new one */
error= update_backward_delete_link(info, info->s->state.dellink, filepos);
block_info.second_read=second_read; block_info.second_read=second_read;
do do
...@@ -518,21 +551,11 @@ int _mi_write_part_record(MI_INFO *info, ...@@ -518,21 +551,11 @@ int _mi_write_part_record(MI_INFO *info,
*reclength-=(length-head_length); *reclength-=(length-head_length);
*flag=6; *flag=6;
if (del_length && next_delete_block != HA_OFFSET_ERROR) if (del_length)
{ {
/* link the next delete block to this */ /* link the next delete block to this */
MI_BLOCK_INFO del_block; if (update_backward_delete_link(info, next_delete_block,
del_block.second_read=0; info->s->state.dellink))
if (!(_mi_get_block_info(&del_block,info->dfile,next_delete_block)
& BLOCK_DELETED))
{
my_errno=HA_ERR_WRONG_IN_RECORD;
goto err;
}
mi_sizestore(del_block.header+12,info->s->state.dellink);
if (my_pwrite(info->dfile,(char*) del_block.header+12,8,
next_delete_block+12,
MYF(MY_NABP)))
goto err; goto err;
} }
...@@ -574,6 +597,8 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record, ...@@ -574,6 +597,8 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
{ {
uint tmp=MY_ALIGN(reclength - length + 3 + uint tmp=MY_ALIGN(reclength - length + 3 +
test(reclength >= 65520L),MI_DYN_ALIGN_SIZE); test(reclength >= 65520L),MI_DYN_ALIGN_SIZE);
/* Don't create a block bigger than MI_MAX_BLOCK_LENGTH */
tmp= min(length+tmp, MI_MAX_BLOCK_LENGTH)-length;
/* Check if we can extend this block */ /* Check if we can extend this block */
if (block_info.filepos + block_info.block_len == if (block_info.filepos + block_info.block_len ==
info->state->data_file_length && info->state->data_file_length &&
...@@ -588,9 +613,15 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record, ...@@ -588,9 +613,15 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK; info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK;
length+=tmp; length+=tmp;
} }
else else if (length < MI_MAX_BLOCK_LENGTH - MI_MIN_BLOCK_LENGTH)
{ {
/* Check if next block is a deleted block */ /*
Check if next block is a deleted block
Above we have MI_MIN_BLOCK_LENGTH to avoid the problem where
the next block is so small it can't be splited which could
casue problems
*/
MI_BLOCK_INFO del_block; MI_BLOCK_INFO del_block;
del_block.second_read=0; del_block.second_read=0;
if (_mi_get_block_info(&del_block,info->dfile, if (_mi_get_block_info(&del_block,info->dfile,
...@@ -601,7 +632,35 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record, ...@@ -601,7 +632,35 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
DBUG_PRINT("info",("Extending current block")); DBUG_PRINT("info",("Extending current block"));
if (unlink_deleted_block(info,&del_block)) if (unlink_deleted_block(info,&del_block))
goto err; goto err;
length+=del_block.block_len; if ((length+=del_block.block_len) > MI_MAX_BLOCK_LENGTH)
{
/*
New block was too big, link overflow part back to
delete list
*/
my_off_t next_pos;
ulong rest_length= length-MI_MAX_BLOCK_LENGTH;
set_if_bigger(rest_length, MI_MIN_BLOCK_LENGTH);
next_pos= del_block.filepos+ del_block.block_len - rest_length;
if (update_backward_delete_link(info, info->s->state.dellink,
next_pos))
DBUG_RETURN(1);
/* create delete link for data that didn't fit into the page */
del_block.header[0]=0;
mi_int3store(del_block.header+1, rest_length);
mi_sizestore(del_block.header+4,info->s->state.dellink);
bfill(del_block.header+12,8,255);
if (my_pwrite(info->dfile,(byte*) del_block.header,20, next_pos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink= next_pos;
info->s->state.split++;
info->state->del++;
info->state->empty+= rest_length;
length-= rest_length;
}
} }
} }
} }
...@@ -615,7 +674,10 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record, ...@@ -615,7 +674,10 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
&record,&reclength,&flag)) &record,&reclength,&flag))
goto err; goto err;
if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR) if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR)
{
/* Start writing data on deleted blocks */
filepos=info->s->state.dellink; filepos=info->s->state.dellink;
}
} }
if (block_info.next_filepos != HA_OFFSET_ERROR) if (block_info.next_filepos != HA_OFFSET_ERROR)
...@@ -744,7 +806,8 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from) ...@@ -744,7 +806,8 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
Returns 0 if record is ok. Returns 0 if record is ok.
*/ */
my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff) my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
ulong packed_length)
{ {
uint length,new_length,flag,bit,i; uint length,new_length,flag,bit,i;
char *pos,*end,*packpos,*to; char *pos,*end,*packpos,*to;
...@@ -836,8 +899,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff) ...@@ -836,8 +899,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
to+=length; to+=length;
} }
} }
if (info->packed_length != (uint) (to - rec_buff) if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
+ test(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1)))) (bit != 1 && (flag & ~(bit - 1))))
goto err; goto err;
if (info->s->calc_checksum) if (info->s->calc_checksum)
...@@ -850,7 +912,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff) ...@@ -850,7 +912,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
} }
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -966,8 +1028,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from, ...@@ -966,8 +1028,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
if (info->s->calc_checksum) if (info->s->calc_checksum)
from++; from++;
if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1)))) if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1))))
DBUG_RETURN((info->packed_length=found_length)); DBUG_RETURN(found_length);
err: err:
my_errno=HA_ERR_RECORD_DELETED; my_errno=HA_ERR_RECORD_DELETED;
DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx", DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx",
to,to_end,from,from_end)); to,to_end,from,from_end));
...@@ -1210,7 +1272,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record) ...@@ -1210,7 +1272,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
} }
} }
my_errno=0; my_errno=0;
err: err:
if (buffer != info->rec_buff) if (buffer != info->rec_buff)
my_afree((gptr) buffer); my_afree((gptr) buffer);
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
......
...@@ -847,7 +847,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, ...@@ -847,7 +847,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
full_b_length=b_length; full_b_length=b_length;
next_key_length=key_length-b_length-pack_length; next_key_length=key_length-b_length-pack_length;
if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) if ((nextflag & (SEARCH_FIND | SEARCH_UPDATE)) == SEARCH_FIND)
{ {
while (a_length && a[a_length-1] == ' ') while (a_length && a[a_length-1] == ' ')
a_length--; a_length--;
......
...@@ -244,6 +244,8 @@ struct st_myisam_info { ...@@ -244,6 +244,8 @@ struct st_myisam_info {
my_off_t last_search_keypage; /* Last keypage when searching */ my_off_t last_search_keypage; /* Last keypage when searching */
my_off_t dupp_key_pos; my_off_t dupp_key_pos;
ha_checksum checksum; ha_checksum checksum;
/* QQ: the folloing two xxx_length fields should be removed,
as they are not compatible with parallel repair */
ulong packed_length,blob_length; /* Length of found, packed record */ ulong packed_length,blob_length; /* Length of found, packed record */
int dfile; /* The datafile */ int dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */ uint opt_flag; /* Optim. for space/speed */
...@@ -536,7 +538,8 @@ extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**); ...@@ -536,7 +538,8 @@ extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from, extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
ulong reclength); ulong reclength);
extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos); extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos,
ulong reclength);
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length, extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
my_off_t next_filepos,byte **record, my_off_t next_filepos,byte **record,
ulong *reclength,int *flag); ulong *reclength,int *flag);
......
...@@ -266,3 +266,10 @@ CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) ...@@ -266,3 +266,10 @@ CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
NULL NULL
</a>.......................... </a>..........................
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (i int, j int);
INSERT INTO t1 VALUES (1,1),(2,2);
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
i ELT(j, '345', '34')
1 345
2 34
DROP TABLE t1;
drop table if exists t1;
CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL);
UPDATE t1 set data=repeat('a',18*1024*1024);
select length(data) from t1;
length(data)
18874368
delete from t1 where left(data,1)='a';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
truncate table t1;
INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
delete from t1 where left(data,1)='b';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
UPDATE t1 set data=repeat('c',17*1024*1024);
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
delete from t1 where left(data,1)='c';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
...@@ -385,3 +385,21 @@ check table t1; ...@@ -385,3 +385,21 @@ check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
drop table t1; drop table t1;
create table t1 ( a text not null, key a (a(20)));
insert into t1 values ('aaa '),('aaa');
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
select concat(a,'.') from t1 where a='aaa';
concat(a,'.')
aaa.
aaa .
drop table t1;
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
a b c
807780 477 165
drop table t1;
...@@ -300,11 +300,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); ...@@ -300,11 +300,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*) COUNT(*)
6 6
DROP TABLE t1; DROP TABLE t1;
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
a b c
807780 477 165
drop table t1;
...@@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill'); ...@@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill');
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1; SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
DROP TABLE t1; DROP TABLE t1;
#
# test for Bug #2290 "output truncated with ELT when using DISTINCT"
#
CREATE TABLE t1 (i int, j int);
INSERT INTO t1 VALUES (1,1),(2,2);
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
DROP TABLE t1;
--max-allowed-packet=24M --skip-innodb --key-buffer-size=1M
#
# Test bugs in the MyISAM code with blobs
#
--disable_warnings
drop table if exists t1;
--enable_warnings
# Bug #2159 (Problem with update of blob to > 16M)
CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL);
UPDATE t1 set data=repeat('a',18*1024*1024);
select length(data) from t1;
delete from t1 where left(data,1)='a';
check table t1;
truncate table t1;
INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
delete from t1 where left(data,1)='b';
check table t1;
# now we have two blocks in the table, first is a 1M record and second is
# a 16M delete block.
UPDATE t1 set data=repeat('c',17*1024*1024);
check table t1;
delete from t1 where left(data,1)='c';
check table t1;
drop table t1;
...@@ -385,3 +385,24 @@ insert into t1 (b) values (repeat('z',100)); ...@@ -385,3 +385,24 @@ insert into t1 (b) values (repeat('z',100));
update t1 set b="test" where left(b,1) > 'n'; update t1 set b="test" where left(b,1) > 'n';
check table t1; check table t1;
drop table t1; drop table t1;
#
# two bugs in myisam-space-stripping feature
#
create table t1 ( a text not null, key a (a(20)));
insert into t1 values ('aaa '),('aaa');
repair table t1;
select concat(a,'.') from t1 where a='aaa';
drop table t1;
#
# Third bug in the same code (BUG#2295)
#
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
drop table t1;
...@@ -249,14 +249,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1); ...@@ -249,14 +249,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
DROP TABLE t1; DROP TABLE t1;
#
# BUG#2295 - range on blob
#
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
drop table t1;
...@@ -105,7 +105,7 @@ void my_thread_global_end(void) ...@@ -105,7 +105,7 @@ void my_thread_global_end(void)
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_fast_mutexattr); pthread_mutexattr_destroy(&my_fast_mutexattr);
#endif #endif
#ifdef PPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP #ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_errchk_mutexattr); pthread_mutexattr_destroy(&my_errchk_mutexattr);
#endif #endif
pthread_mutex_destroy(&THR_LOCK_malloc); pthread_mutex_destroy(&THR_LOCK_malloc);
......
...@@ -1507,7 +1507,14 @@ void Item_func_elt::fix_length_and_dec() ...@@ -1507,7 +1507,14 @@ void Item_func_elt::fix_length_and_dec()
{ {
max_length=0; max_length=0;
decimals=0; decimals=0;
for (uint i=1 ; i < arg_count ; i++) /*
first numeric argument isn't in args (3.23 and 4.0)
but since 4.1 the cycle should start from 1
so this change
should NOT be merged into 4.1!!!
*/
for (uint i= 0; i < arg_count ; i++)
{ {
set_if_bigger(max_length,args[i]->max_length); set_if_bigger(max_length,args[i]->max_length);
set_if_bigger(decimals,args[i]->decimals); set_if_bigger(decimals,args[i]->decimals);
......
...@@ -182,9 +182,9 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length) ...@@ -182,9 +182,9 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length)
} }
if (key_part->key_part_flag & (HA_BLOB_PART | HA_VAR_LENGTH)) if (key_part->key_part_flag & (HA_BLOB_PART | HA_VAR_LENGTH))
{ {
if (key_part->field->key_cmp(key, key_part->length+2)) if (key_part->field->key_cmp(key, key_part->length+ HA_KEY_BLOB_LENGTH))
return 1; return 1;
length=key_part->length+2; length=key_part->length+HA_KEY_BLOB_LENGTH;
} }
else else
{ {
......
...@@ -306,7 +306,6 @@ char* log_error_file_ptr= log_error_file; ...@@ -306,7 +306,6 @@ char* log_error_file_ptr= log_error_file;
static pthread_t select_thread; static pthread_t select_thread;
static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0; static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool opt_old_rpl_compat;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0, opt_console= 0; my_bool opt_log_slave_updates= 0, opt_console= 0;
my_bool opt_readonly = 0; my_bool opt_readonly = 0;
...@@ -3198,7 +3197,7 @@ enum options_mysqld { ...@@ -3198,7 +3197,7 @@ enum options_mysqld {
OPT_HAVE_NAMED_PIPE, OPT_HAVE_NAMED_PIPE,
OPT_DO_PSTACK, OPT_REPORT_HOST, OPT_DO_PSTACK, OPT_REPORT_HOST,
OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT, OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT, OPT_SHOW_SLAVE_AUTH_INFO,
OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE, OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE, OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE, OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
...@@ -3544,10 +3543,6 @@ Does nothing yet.", ...@@ -3544,10 +3543,6 @@ Does nothing yet.",
{"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol", {"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol",
(gptr*) &protocol_version, (gptr*) &protocol_version, 0, GET_UINT, NO_ARG, (gptr*) &protocol_version, (gptr*) &protocol_version, 0, GET_UINT, NO_ARG,
PROTOCOL_VERSION, 0, 0, 0, 0, 0}, PROTOCOL_VERSION, 0, 0, 0, 0, 0},
{"old-rpl-compat", OPT_OLD_RPL_COMPAT,
"Use old LOAD DATA format in the binary log (don't save data in file)",
(gptr*) &opt_old_rpl_compat, (gptr*) &opt_old_rpl_compat, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef ONE_THREAD #ifdef ONE_THREAD
{"one-thread", OPT_ONE_THREAD, {"one-thread", OPT_ONE_THREAD,
"Only use one thread (for debugging under Linux)", 0, 0, 0, GET_NO_ARG, "Only use one thread (for debugging under Linux)", 0, 0, 0, GET_NO_ARG,
......
...@@ -440,14 +440,16 @@ static bool find_range_key(TABLE_REF *ref, Field* field, COND *cond) ...@@ -440,14 +440,16 @@ static bool find_range_key(TABLE_REF *ref, Field* field, COND *cond)
left_length < part->store_length || left_length < part->store_length ||
(table->file->index_flags(idx) & HA_WRONG_ASCII_ORDER)) (table->file->index_flags(idx) & HA_WRONG_ASCII_ORDER))
break; break;
uint store_length= part->store_length;
// Save found constant // Save found constant
if (part->null_bit) if (part->null_bit)
{
*key_ptr++= (byte) test(part->field->is_null()); *key_ptr++= (byte) test(part->field->is_null());
part->field->get_key_image((char*) key_ptr, store_length--;
(part->field->type() == FIELD_TYPE_BLOB) ? }
part->length + HA_KEY_BLOB_LENGTH : part->length); part->field->get_key_image((char*) key_ptr, store_length);
key_ptr+=part->store_length - test(part->null_bit); key_ptr+= store_length;
left_length-=part->store_length; left_length-= part->store_length;
} }
if (part == part_end && part->field == field) if (part == part_end && part->field == field)
{ {
......
...@@ -2840,6 +2840,14 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev) ...@@ -2840,6 +2840,14 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
if (unlikely(!num_bytes)) /* eof */ if (unlikely(!num_bytes)) /* eof */
{ {
send_ok(net); /* 3.23 master wants it */ send_ok(net); /* 3.23 master wants it */
/*
If we wrote Create_file_log_event, then we need to write
Execute_load_log_event. If we did not write Create_file_log_event,
then this is an empty file and we can just do as if the LOAD DATA
INFILE had not existed, i.e. write nothing.
*/
if (unlikely(cev_not_written))
break;
Execute_load_log_event xev(thd,0,0); Execute_load_log_event xev(thd,0,0);
xev.log_pos = mi->master_log_pos; xev.log_pos = mi->master_log_pos;
if (unlikely(mi->rli.relay_log.append(&xev))) if (unlikely(mi->rli.relay_log.append(&xev)))
......
...@@ -220,7 +220,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, ...@@ -220,7 +220,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
DBUG_RETURN(-1); // Can't allocate buffers DBUG_RETURN(-1); // Can't allocate buffers
} }
if (!opt_old_rpl_compat && mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
lf_info.thd = thd; lf_info.thd = thd;
lf_info.ex = ex; lf_info.ex = ex;
...@@ -287,7 +287,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, ...@@ -287,7 +287,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
{ {
if (transactional_table) if (transactional_table)
ha_autocommit_or_rollback(thd,error); ha_autocommit_or_rollback(thd,error);
if (!opt_old_rpl_compat && mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
/* /*
Make sure last block (the one which caused the error) gets logged. Make sure last block (the one which caused the error) gets logged.
...@@ -332,28 +332,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, ...@@ -332,28 +332,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
if (opt_old_rpl_compat) /*
{ As already explained above, we need to call end_io_cache() or the last
if (!read_file_from_client) block will be logged only after Execute_load_log_event (which is wrong),
{ when read_info is destroyed.
Load_log_event qinfo(thd, ex, db, table->table_name, fields, */
handle_duplicates, log_delayed); read_info.end_io_cache();
mysql_bin_log.write(&qinfo); if (lf_info.wrote_create_file)
}
}
else
{ {
/* Execute_load_log_event e(thd, db, log_delayed);
As already explained above, we need to call end_io_cache() or the last mysql_bin_log.write(&e);
block will be logged only after Execute_load_log_event (which is wrong),
when read_info is destroyed.
*/
read_info.end_io_cache();
if (lf_info.wrote_create_file)
{
Execute_load_log_event e(thd, db, log_delayed);
mysql_bin_log.write(&e);
}
} }
} }
if (transactional_table) if (transactional_table)
...@@ -644,7 +632,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term, ...@@ -644,7 +632,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term,
cache.read_function = _my_b_net_read; cache.read_function = _my_b_net_read;
need_end_io_cache = 1; need_end_io_cache = 1;
if (!opt_old_rpl_compat && mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
cache.pre_read = cache.pre_close = cache.pre_read = cache.pre_close =
(IO_CACHE_CALLBACK) log_loaded_block; (IO_CACHE_CALLBACK) log_loaded_block;
} }
......
...@@ -11,7 +11,7 @@ typedef struct st_slave_info ...@@ -11,7 +11,7 @@ typedef struct st_slave_info
THD* thd; THD* thd;
} SLAVE_INFO; } SLAVE_INFO;
extern my_bool opt_show_slave_auth_info, opt_old_rpl_compat; extern my_bool opt_show_slave_auth_info;
extern char *master_host, *master_info_file; extern char *master_host, *master_info_file;
extern bool server_id_supplied; extern bool server_id_supplied;
extern I_List<i_string> binlog_do_db, binlog_ignore_db; extern I_List<i_string> binlog_do_db, binlog_ignore_db;
......
...@@ -1475,8 +1475,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, ...@@ -1475,8 +1475,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level,
bool optimizable=0; bool optimizable=0;
for (uint i=0; i<num_values; i++) for (uint i=0; i<num_values; i++)
{ {
used_tables|=(*value)->used_tables(); used_tables|=(value[i])->used_tables();
if (!((*value)->used_tables() & (field->table->map | RAND_TABLE_BIT))) if (!((value[i])->used_tables() & (field->table->map | RAND_TABLE_BIT)))
optimizable=1; optimizable=1;
} }
if (!optimizable) if (!optimizable)
......
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