summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild-tools/Do-rpm17
-rw-r--r--man/Makefile.am21
-rw-r--r--man/isamchk.1.in (renamed from man/isamchk.1)41
-rw-r--r--man/isamlog.1.in (renamed from man/isamlog.1)42
-rw-r--r--man/mysql.1.in (renamed from man/mysql.1)58
-rw-r--r--man/mysql_fix_privilege_tables.1.in (renamed from man/mysql_fix_privilege_tables.1)22
-rw-r--r--man/mysql_zap.134
-rw-r--r--man/mysql_zap.1.in52
-rw-r--r--man/mysqlaccess.1.in (renamed from man/mysqlaccess.1)41
-rw-r--r--man/mysqladmin.1.in (renamed from man/mysqladmin.1)45
-rw-r--r--man/mysqld.1.in (renamed from man/mysqld.1)44
-rw-r--r--man/mysqld_multi.1.in (renamed from man/mysqld_multi.1)42
-rw-r--r--man/mysqld_safe.1.in (renamed from man/mysqld_safe.1)37
-rw-r--r--man/mysqldump.1.in (renamed from man/mysqldump.1)41
-rw-r--r--man/mysqlshow.1.in (renamed from man/mysqlshow.1)41
-rw-r--r--man/perror.1.in (renamed from man/perror.1)41
-rw-r--r--man/replace.1.in (renamed from man/replace.1)41
-rw-r--r--myisam/mi_check.c10
-rw-r--r--myisam/mi_dynrec.c144
-rw-r--r--myisam/mi_search.c2
-rw-r--r--myisam/myisamdef.h5
-rw-r--r--mysql-test/r/func_str.result7
-rw-r--r--mysql-test/r/myisam-blob.result27
-rw-r--r--mysql-test/r/myisam.result18
-rw-r--r--mysql-test/r/range.result8
-rw-r--r--mysql-test/t/func_str.test9
-rw-r--r--mysql-test/t/myisam-blob-master.opt1
-rw-r--r--mysql-test/t/myisam-blob.test30
-rw-r--r--mysql-test/t/myisam.test21
-rw-r--r--mysql-test/t/range.test11
-rw-r--r--mysys/my_thr_init.c2
-rw-r--r--sql/item_strfunc.cc9
-rw-r--r--sql/key.cc4
-rw-r--r--sql/mysqld.cc7
-rw-r--r--sql/opt_sum.cc12
-rw-r--r--sql/slave.cc8
-rw-r--r--sql/sql_load.cc36
-rw-r--r--sql/sql_repl.h2
-rw-r--r--sql/sql_select.cc4
39 files changed, 652 insertions, 385 deletions
diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm
index 3473bcb1f5f..7da8b022031 100755
--- a/Build-tools/Do-rpm
+++ b/Build-tools/Do-rpm
@@ -115,10 +115,12 @@ if (defined $opt_log)
if (-x "/usr/bin/rpmbuild")
{
$RPM= "/usr/bin/rpmbuild";
+ $RMSOURCE= "--rmsource --rmspec";
}
else
{
$RPM= "/bin/rpm";
+ $RMSOURCE= "--rmspec";
}
if ($RPM)
@@ -177,7 +179,7 @@ $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
$command= "$RPM";
$command.= " -v" if ($opt_verbose);
$command.= " -ba";
-$command.= " --clean" if $opt_clean;
+$command.= " --clean $RMSOURCE" if $opt_clean;
$command.= " $SPECDIR/";
$command.= basename($SPECFILE);
&logger("Building RPM.");
@@ -198,19 +200,6 @@ $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&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);
exit 0;
diff --git a/man/Makefile.am b/man/Makefile.am
index 9f919e77b8f..37eb8a13f4e 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -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 \
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
%::SCCS/s.%
diff --git a/man/isamchk.1 b/man/isamchk.1.in
index 341e968a131..cad1303ee55 100644
--- a/man/isamchk.1
+++ b/man/isamchk.1.in
@@ -1,4 +1,4 @@
-.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
.BR isamchk
\- Description, check and repair of ISAM tables.
@@ -114,24 +114,29 @@ Print version and exit.
.BR \-w | \-\-wait
Wait if table is locked.
.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),
+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),
+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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/isamlog.1 b/man/isamlog.1.in
index 402c3052ad8..6040f6c4ad8 100644
--- a/man/isamlog.1
+++ b/man/isamlog.1.in
@@ -1,4 +1,4 @@
-.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
isamlog - Write info about whats in a nisam log file.
.SH USAGE
@@ -71,27 +71,31 @@ If one gives table names as arguments only these tables will be updated
.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),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/mysql.1 b/man/mysql.1.in
index c0c37716b14..35ff48693e1 100644
--- a/man/mysql.1
+++ b/man/mysql.1.in
@@ -1,6 +1,8 @@
-.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
mysql \- text-based client for mysqld, a SQL-based relational database daemon
+.SH USAGE
+mysql [OPTIONS] [Database]
.SH SYNOPSIS
.B mysql
.RB [ \-B | \-\-batch ]
@@ -105,16 +107,19 @@ version number and exit.
Wait and retry if the database server connection is down.
.SH FILES
.TP 2.2i
-.I /depot/bin/mysql
-executable
+.I @sysconfdir@/my.cnf
+MySQL configuration file
.TP
-.I /depot/bin/mysqld
-executable
+.I @bindir@/mysql
+Client executable
.TP
-.I /depot/bin/mysqld_safe
+.I @libexecdir@/mysqld
+Server executable
+.TP
+.I @bindir@/mysqld_safe
executable shell script for starting mysqld safely
.TP
-.I /site/var/mysql/data
+.I @localstatedir@
location of database files
.SH EXAMPLE
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 <
backup-file.sql
.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),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 6.3, distribution 3.20.20
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 6.3, 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 R. P. C. Rodgers,
Lister Hill National Center for Biomedical Communication,
diff --git a/man/mysql_fix_privilege_tables.1 b/man/mysql_fix_privilege_tables.1.in
index 4ed81368098..1d42681f298 100644
--- a/man/mysql_fix_privilege_tables.1
+++ b/man/mysql_fix_privilege_tables.1.in
@@ -1,4 +1,4 @@
-.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
mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
.SH SYNOPSIS
@@ -14,7 +14,25 @@ If you get 'Access denied' errors, run the script again
and give the MySQL root user password as an argument.
.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
This manpage was written by Christian Hammers <ch@debian.org>.
diff --git a/man/mysql_zap.1 b/man/mysql_zap.1
deleted file mode 100644
index 71931c03db6..00000000000
--- a/man/mysql_zap.1
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH zap 1 "19 December 2000" "MySQL 4.0" "MySQL database"
-.SH NAME
-zap - a perl script used to kill processes
-.SH USAGE
-/usr/bin/mysql_zap [-signal] [-?Ift] pattern
-.SH SYNOPSIS
-.B zap
-.RB [ \-I | \-? ]
-.RB [ \-f ]
-.RB [ \-t ]
-.SH DESCRIPTION
-.TP
-.BR zap
-supports by executing
-.TP
-.BR \-I | \-?
-info
-.TP
-.BR \-f
-force
-.TP
-.BR \-t
-test
-.SH NOTE
-If
-.BR -f
-isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
-.BR -t
-is given the processes is only shown on stdout.
-.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),
-.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)
-.\" end of man page \ No newline at end of file
diff --git a/man/mysql_zap.1.in b/man/mysql_zap.1.in
new file mode 100644
index 00000000000..511a8feaa7c
--- /dev/null
+++ b/man/mysql_zap.1.in
@@ -0,0 +1,52 @@
+.TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
+.SH NAME
+zap - a perl script used to kill processes
+.SH USAGE
+/usr/bin/mysql_zap [-signal] [-?Ift] pattern
+.SH SYNOPSIS
+.B zap
+.RB [ \-I | \-? ]
+.RB [ \-f ]
+.RB [ \-t ]
+.SH DESCRIPTION
+.TP
+.BR zap
+supports by executing
+.TP
+.BR \-I | \-?
+info
+.TP
+.BR \-f
+force
+.TP
+.BR \-t
+test
+.SH NOTE
+If
+.BR -f
+isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
+.BR -t
+is given the processes is only shown on stdout.
+.SH "SEE ALSO"
+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
+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
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1.in
index 95e392b1194..9a5e58541d2 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1.in
@@ -1,4 +1,4 @@
-.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
.BR mysqlaccess
\- Create new users to mysql.
@@ -95,24 +95,29 @@ If no host is given, `localhost' is assumed
Wildcards (*,?,%,_) are allowed for host, user and db, but be sure
to escape them from your shell!! (i.e., type \\* or '*')
.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),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1.in
index 693e8aa5a72..a549f1c0e22 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1.in
@@ -1,4 +1,4 @@
-.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
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
.SH OPTION SYNOPSIS
@@ -178,31 +178,32 @@ Prints variables available
.BR version
Get version info from server
.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),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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
-
-
-
-
diff --git a/man/mysqld.1 b/man/mysqld.1.in
index 98247cd9445..719711edca2 100644
--- a/man/mysqld.1
+++ b/man/mysqld.1.in
@@ -1,7 +1,6 @@
-.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
-.BR mysqld
- \- Starts the MySQL server demon
+mysqld \- The MySQL server demon
.SH USAGE
mysqld [OPTIONS]
.SH SYNOPSIS
@@ -204,24 +203,29 @@ Output version information and exit.
.SH NOTE
.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_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1.in
index 47418835939..26e7a091b60 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1.in
@@ -1,4 +1,4 @@
-.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
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
.SH USAGE
@@ -58,27 +58,31 @@ Please see the mysql manual for more detailed information on this.
.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_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1.in
index 3679346d7db..641f34677c7 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1.in
@@ -1,4 +1,4 @@
-.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
mysqld_safe \- start the mysqld daemon on Unix.
.SH SYNOPSIS
@@ -60,22 +60,27 @@ Set the timezone (the TZ) variable to the value of this parameter.
.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.
.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),
+mysqldump(1),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
+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.
diff --git a/man/mysqldump.1 b/man/mysqldump.1.in
index 6907fcc8777..34d83dbe0b3 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1.in
@@ -1,4 +1,4 @@
-.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
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:
mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql
.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),
+mysql_fix_privilege_tables(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1.in
index 39590b54375..903d9620fd6 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1.in
@@ -1,4 +1,4 @@
-.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
.BR mysqlshow
\- 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
are shown
.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),
+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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/perror.1 b/man/perror.1.in
index b8eec8af318..f9efb48510b 100644
--- a/man/perror.1
+++ b/man/perror.1.in
@@ -1,4 +1,4 @@
-.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
perror \- describes a system or MySQL error code.
.SH SYNOPSIS
@@ -27,24 +27,29 @@ shell> perror 64 79
Error code 64: Machine is not on the network
Error code 79: Can not access a needed shared library
.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),
+mysql_zap(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/man/replace.1 b/man/replace.1.in
index 46d542d57f4..395411f7e9f 100644
--- a/man/replace.1
+++ b/man/replace.1.in
@@ -1,4 +1,4 @@
-.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
.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.
@@ -41,24 +41,29 @@ this command swaps a and b in the given files:
.TP
shell> replace a b b a -- file1 file2 ...
.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),
+mysql_zap(1),
+perror(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
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+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 /
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 38e48eb5e06..8581f79c99d 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -922,7 +922,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
info->checksum=mi_checksum(info,record);
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",
llstr(start_recpos,llbuff));
@@ -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))+
(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;
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)
info->checksum=mi_checksum(info,sort_param->record);
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",
llstr(sort_param->start_recpos,llbuff));
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index e1bfe4c3ac5..2a3f4aec0a8 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -14,7 +14,15 @@
along with this program; if not, write to the Free Software
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 <assert.h>
@@ -148,7 +156,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
} while (reclength);
DBUG_RETURN(0);
- err:
+err:
DBUG_RETURN(1);
}
@@ -264,37 +272,62 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
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,del_block;
- int error=0;
- my_bool remove_next_block;
- DBUG_ENTER("delete_dynamic_record");
+ MI_BLOCK_INFO block_info;
+ DBUG_ENTER("update_backward_delete_link");
- /* First add a link from the last block to the new one */
- if (info->s->state.dellink != HA_OFFSET_ERROR)
+ if (delete_block != HA_OFFSET_ERROR)
{
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)
{
char buff[8];
mi_sizestore(buff,filepos);
- if (my_pwrite(info->dfile,buff,8,info->s->state.dellink+12,
- MYF(MY_NABP)))
- error=1; /* Error on write */
+ if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
+ DBUG_RETURN(1); /* Error on write */
}
else
{
- error=1; /* Wrong delete link */
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;
do
@@ -518,21 +551,11 @@ int _mi_write_part_record(MI_INFO *info,
*reclength-=(length-head_length);
*flag=6;
- if (del_length && next_delete_block != HA_OFFSET_ERROR)
+ if (del_length)
{
/* link the next delete block to this */
- MI_BLOCK_INFO del_block;
- del_block.second_read=0;
- 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)))
+ if (update_backward_delete_link(info, next_delete_block,
+ info->s->state.dellink))
goto err;
}
@@ -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 +
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 */
if (block_info.filepos + block_info.block_len ==
info->state->data_file_length &&
@@ -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;
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;
del_block.second_read=0;
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,
DBUG_PRINT("info",("Extending current block"));
if (unlink_deleted_block(info,&del_block))
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,
&record,&reclength,&flag))
goto err;
if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR)
+ {
+ /* Start writing data on deleted blocks */
filepos=info->s->state.dellink;
+ }
}
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)
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;
char *pos,*end,*packpos,*to;
@@ -836,8 +899,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
to+=length;
}
}
- if (info->packed_length != (uint) (to - rec_buff)
- + test(info->s->calc_checksum) ||
+ if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1))))
goto err;
if (info->s->calc_checksum)
@@ -850,7 +912,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
}
DBUG_RETURN(0);
- err:
+err:
DBUG_RETURN(1);
}
@@ -966,8 +1028,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
if (info->s->calc_checksum)
from++;
if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1))))
- DBUG_RETURN((info->packed_length=found_length));
- err:
+ DBUG_RETURN(found_length);
+err:
my_errno=HA_ERR_RECORD_DELETED;
DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx",
to,to_end,from,from_end));
@@ -1210,7 +1272,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
}
}
my_errno=0;
- err:
+err:
if (buffer != info->rec_buff)
my_afree((gptr) buffer);
DBUG_RETURN(my_errno);
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index c6ee18a8477..b98ee351195 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -847,7 +847,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
full_b_length=b_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] == ' ')
a_length--;
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index e1df1d73191..51a2dd3a2b3 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -244,6 +244,8 @@ struct st_myisam_info {
my_off_t last_search_keypage; /* Last keypage when searching */
my_off_t dupp_key_pos;
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 */
int dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */
@@ -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,
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,
my_off_t next_filepos,byte **record,
ulong *reclength,int *flag);
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 35a5ba70e86..7d2668c8cf6 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -266,3 +266,10 @@ CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
NULL
</a>..........................
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;
diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result
new file mode 100644
index 00000000000..743d4dac254
--- /dev/null
+++ b/mysql-test/r/myisam-blob.result
@@ -0,0 +1,27 @@
+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;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index e113a48f4da..68a667f6d95 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -385,3 +385,21 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
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;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 45d20a8fced..e87df9a6c24 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -300,11 +300,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*)
6
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;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 33d89b3ca37..1eba49a9583 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill');
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from 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;
diff --git a/mysql-test/t/myisam-blob-master.opt b/mysql-test/t/myisam-blob-master.opt
new file mode 100644
index 00000000000..1a1076c7bad
--- /dev/null
+++ b/mysql-test/t/myisam-blob-master.opt
@@ -0,0 +1 @@
+--max-allowed-packet=24M --skip-innodb --key-buffer-size=1M
diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test
new file mode 100644
index 00000000000..d58222ec8bf
--- /dev/null
+++ b/mysql-test/t/myisam-blob.test
@@ -0,0 +1,30 @@
+#
+# 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;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 12853cd67ca..394261aae40 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -385,3 +385,24 @@ insert into t1 (b) values (repeat('z',100));
update t1 set b="test" where left(b,1) > 'n';
check 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;
+
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 9d9feaa4edc..b04e614a740 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -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);
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;
-
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 57eecd7b746..878a861bc94 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -105,7 +105,7 @@ void my_thread_global_end(void)
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_fast_mutexattr);
#endif
-#ifdef PPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_errchk_mutexattr);
#endif
pthread_mutex_destroy(&THR_LOCK_malloc);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index a4d04253dd7..74a7c97113e 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1507,7 +1507,14 @@ void Item_func_elt::fix_length_and_dec()
{
max_length=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(decimals,args[i]->decimals);
diff --git a/sql/key.cc b/sql/key.cc
index 809c5a164b9..0a5937fc881 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -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->field->key_cmp(key, key_part->length+2))
+ if (key_part->field->key_cmp(key, key_part->length+ HA_KEY_BLOB_LENGTH))
return 1;
- length=key_part->length+2;
+ length=key_part->length+HA_KEY_BLOB_LENGTH;
}
else
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 28cf466f5b3..b2b53e571c3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -306,7 +306,6 @@ char* log_error_file_ptr= log_error_file;
static pthread_t select_thread;
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_old_rpl_compat;
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_readonly = 0;
@@ -3198,7 +3197,7 @@ enum options_mysqld {
OPT_HAVE_NAMED_PIPE,
OPT_DO_PSTACK, OPT_REPORT_HOST,
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_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
@@ -3544,10 +3543,6 @@ Does nothing yet.",
{"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol",
(gptr*) &protocol_version, (gptr*) &protocol_version, 0, GET_UINT, NO_ARG,
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
{"one-thread", OPT_ONE_THREAD,
"Only use one thread (for debugging under Linux)", 0, 0, 0, GET_NO_ARG,
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index abf04cf5517..b5eec2d5dd4 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -440,14 +440,16 @@ static bool find_range_key(TABLE_REF *ref, Field* field, COND *cond)
left_length < part->store_length ||
(table->file->index_flags(idx) & HA_WRONG_ASCII_ORDER))
break;
+ uint store_length= part->store_length;
// Save found constant
if (part->null_bit)
+ {
*key_ptr++= (byte) test(part->field->is_null());
- part->field->get_key_image((char*) key_ptr,
- (part->field->type() == FIELD_TYPE_BLOB) ?
- part->length + HA_KEY_BLOB_LENGTH : part->length);
- key_ptr+=part->store_length - test(part->null_bit);
- left_length-=part->store_length;
+ store_length--;
+ }
+ part->field->get_key_image((char*) key_ptr, store_length);
+ key_ptr+= store_length;
+ left_length-= part->store_length;
}
if (part == part_end && part->field == field)
{
diff --git a/sql/slave.cc b/sql/slave.cc
index 116d602b238..d6510b26271 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2840,6 +2840,14 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
if (unlikely(!num_bytes)) /* eof */
{
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);
xev.log_pos = mi->master_log_pos;
if (unlikely(mi->rli.relay_log.append(&xev)))
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 7c3e7b8e877..93dfcd84caf 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -220,7 +220,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
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.ex = ex;
@@ -287,7 +287,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
{
if (transactional_table)
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.
@@ -332,28 +332,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
if (mysql_bin_log.is_open())
{
- if (opt_old_rpl_compat)
- {
- if (!read_file_from_client)
- {
- Load_log_event qinfo(thd, ex, db, table->table_name, fields,
- handle_duplicates, log_delayed);
- mysql_bin_log.write(&qinfo);
- }
- }
- else
+ /*
+ As already explained above, we need to call end_io_cache() or the last
+ 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)
{
- /*
- As already explained above, we need to call end_io_cache() or the last
- 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);
- }
+ Execute_load_log_event e(thd, db, log_delayed);
+ mysql_bin_log.write(&e);
}
}
if (transactional_table)
@@ -644,7 +632,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term,
cache.read_function = _my_b_net_read;
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 =
(IO_CACHE_CALLBACK) log_loaded_block;
}
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index c73744c4b7c..570c41c98f7 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -11,7 +11,7 @@ typedef struct st_slave_info
THD* thd;
} 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 bool server_id_supplied;
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1d7187824fe..e3bd3c8b570 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1475,8 +1475,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level,
bool optimizable=0;
for (uint i=0; i<num_values; i++)
{
- used_tables|=(*value)->used_tables();
- if (!((*value)->used_tables() & (field->table->map | RAND_TABLE_BIT)))
+ used_tables|=(value[i])->used_tables();
+ if (!((value[i])->used_tables() & (field->table->map | RAND_TABLE_BIT)))
optimizable=1;
}
if (!optimizable)