summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore2
-rw-r--r--BUILD/FINISH.sh12
-rw-r--r--BUILD/SETUP.sh12
-rwxr-xr-xBUILD/compile-pentium-debug2
-rw-r--r--Docs/Makefile.am3
-rw-r--r--Docs/manual.texi120
-rw-r--r--acconfig.h3
-rw-r--r--configure.in6
-rwxr-xr-xmysql-test/mysql-test-run.sh11
-rw-r--r--mysql-test/r/crypt.result2
-rw-r--r--mysql-test/r/rpl000014.result2
-rw-r--r--mysql-test/t/crypt.test1
-rw-r--r--mysql-test/t/rpl000014.test5
-rw-r--r--sql/filesort.cc5
-rw-r--r--sql/mysqld.cc105
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_select.cc4
17 files changed, 195 insertions, 102 deletions
diff --git a/.bzrignore b/.bzrignore
index c5f82922101..47b47611d1d 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -179,3 +179,5 @@ libmysql_r/conf_to_src
mysql-test/install_test_db
mysql-test/mysql-test-run
BitKeeper/tmp/gone
+mysqld.S
+mysqld.sym
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 625802f78cb..02deb67bd25 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -8,5 +8,13 @@ done
CFLAGS="$cflags" CXX=gcc CXXFLAGS="$cxxflags" eval "$configure"
-test "$make" = no || $make $AM_MAKEFLAGS
-test -z "$strip" || strip mysqld
+if [ "x$do_make" = "xno" ] ; then
+ exit 0
+fi
+
+$make $AM_MAKEFLAGS
+if [ "x$strip" = "xyes" ]; then
+ nm --numeric-sort sql/mysqld > mysqld.sym
+ objdump -d sql/mysqld > mysqld.S
+ strip sql/mysqld
+fi
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 37c3dc2ea37..e778fc34ceb 100644
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -5,13 +5,14 @@ fi
set -e # exit on error
-AM_MAKEFLAGS="-j4" # XXX: auto-make uses this variable - export it???
+export AM_MAKEFLAGS="-j 4" # XXX: auto-make uses this variable - export it???
# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
# The following warning flag will give too many warnings:
# -Wshadow -Wunused -Winline (The later isn't usable in C++ as
# __attribute()__ doesn't work with gnu C++)
-global_warnings="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wuninitialized -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings"
+global_warnings="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings"
+debug_extra_warnings="-Wuninitialized"
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
@@ -19,8 +20,9 @@ alpha_cflags="-mcpu=ev6 -Wa,-mev6" # not used yet
pentium_cflags="-mpentiumpro"
sparc_cflags=""
-fast_cflags="-O6 -fomit-frame-pointer"
-debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -O2"
+fast_cflags="-O6 -fno-omit-frame-pointer"
+reckless_cflags="-O6 -fomit-frame-pointer"
+debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
@@ -37,7 +39,7 @@ else
make=make
fi
-$make -k clean || true
+$make -k clean || true
/bin/rm -f */.deps/*.P config.cache
aclocal; autoheader; aclocal; automake; autoconf
diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index 37381cc47df..094c4e9ca86 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -4,6 +4,8 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
+c_warnings="$c_warnings $debug_extra_warnings"
+cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
. "$path/FINISH.sh"
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
index 5593f495bf9..ce5fbd263c6 100644
--- a/Docs/Makefile.am
+++ b/Docs/Makefile.am
@@ -28,7 +28,8 @@ all: $(targets) txt_files
txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
../MIRRORS INSTALL-BINARY
-CLEAN_FILES: manual.ps
+CLEAN_FILES: $(BUILD_SOURCES)
+ touch $(BUILD_SOURCES)
# The PostScript and PDF version are so big that they are not included in the
# standard distribution. It is available for download from the home page.
diff --git a/Docs/manual.texi b/Docs/manual.texi
index cae27fb2749..83e03ccc8cf 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -537,7 +537,7 @@ Queries from Twin Project
* Twin pool:: Find all non-distributed twins
* Twin event:: Show a table on twin pair status
-MySQL server functions
+MySQL Server Functions
* Languages:: What languages are supported by @strong{MySQL}?
* Table size:: How big @strong{MySQL} tables can be
@@ -831,14 +831,14 @@ Credits
MySQL change history
-* News-4.0.x:: Changes in release 4.0 (development release)
+* News-4.0.x:: Changes in release 4.0.x (Development; Alpha)
* News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma)
-* News-3.22.x:: Changes in release 3.22.x (Still supported)
+* News-3.22.x:: Changes in release 3.22.x (Older; Still supported)
* News-3.21.x:: Changes in release 3.21.x
* News-3.20.x:: Changes in release 3.20.x
* News-3.19.x:: Changes in release 3.19.x
-Changes in release 4.0 (Alpha)
+Changes in release 4.0.x (Development; Alpha)
* News-4.0.0:: Changes in release 4.0.0
@@ -2189,14 +2189,11 @@ Apart from the following links, you can find and download a lot of
@subheading Tutorials and Manuals
@itemize @bullet
-@c just forwards to the devshed link below.. (jcole)
-@c @item @uref{http://www.devshed.com/resource/advanced/mysql/index.html, A
-@c beginner's tutorial of how to start using @strong{MySQL}}
-
-@item @uref{http://www.4t2.com/mysql. German MySQL maling list}
+@item @uref{http://www.4t2.com/mysql}@*
Information about the German MySQL mailing list.
-@item @uref{http://www.bitmover.com:8888//home/bk/mysql, MySQL bitkeeper repository}
+@item @uref{http://www.bitmover.com:8888//home/bk/mysql}@*
+Web access to the @strong{MySQL} BitKeeper repository.
@item @uref{http://www.analysisandsolutions.com/code/mybasic.htm}@*
Beginners @strong{MySQL} Tutorial on how to install and set up
@@ -2316,12 +2313,11 @@ A free report writer in Java
MySQLExport - Export of @strong{MySQL} create statements and data in a lot of
different formats (SQL, HTML, CVS, text, ZIP, GZIP...)
-@item @uref{http://dlabs.4t2.com, M2D}
-A MySQL-ADmin-client for windows. It supports administration of
+@item @uref{http://dlabs.4t2.com}@*
+M2D, a MySQL-ADmin-client for windows. It supports administration of
MySQL-Databases, creating of new DBs and tables, editing etc.
-@item @uref{http://www.scibit.com/Products/Software/Utils/Mascon.asp,
-Mascon home page}.
+@item @uref{http://www.scibit.com/Products/Software/Utils/Mascon.asp}@*
Mascon is a powerful Win32 GUI for the administering MySQL server databases.
@end itemize
@@ -2330,8 +2326,10 @@ Mascon is a powerful Win32 GUI for the administering MySQL server databases.
@c FIX add the rest (at least a couple more Linuxes)
@itemize @bullet
-@item @uref{http://www.suse.com/}
-SuSE Linux (Suse 6.1 and above)
+@item @uref{http://www.suse.com/}@*
+SuSE Linux (6.1 and above)
+@item @uref{http://www.redhat.com/}@*
+RedHat Linux (7.0 and above)
@end itemize
@subheading Web Development Tools that Support @strong{MySQL}
@@ -2698,7 +2696,7 @@ Database Jump Site
@item @uref{http://black.hole-in-the.net/guy/webdb/}@*
Homepage of the webdb-l (Web Databases) mailing list.
-@item @uref{http://www.symbolstone.org/technology/perl/DBI/index.html}
+@item @uref{http://www.symbolstone.org/technology/perl/DBI/index.html}@*
Perl @code{DBI}/@code{DBD} modules homepage.
@item @uref{http://www.student.uni-koeln.de/cygwin/}@*
@@ -2716,10 +2714,10 @@ forums for Computer Professionals. Features include automatic e-mail
notification of responses, a links library, and member confidentiality
guaranteed.
-@item @uref{http://www.public.asu.edu/~peterjn/btree/, B-tree paper}
+@item @uref{http://www.public.asu.edu/~peterjn/btree/}@*
B-Trees: Balanced Tree Data Structures
-@item @uref{http://www.fit.qut.edu.au/~maire/baobab/lecture/sld001.htm, B-tree lecture}
+@item @uref{http://www.fit.qut.edu.au/~maire/baobab/lecture/sld001.htm}@*
A lecture about B-Trees
@end itemize
@@ -3410,7 +3408,7 @@ Note that a single @strong{MySQL} license covers any number of CPUs and
of clients that connect to the server in any way.
@node Products that use MySQL, ISP, Licensing examples, Licensing examples
-@subsection Selling Products that use @strong{MySQL}
+@subsection Selling Products that use MySQL
To determine whether or not you need a @strong{MySQL} license when
selling your application, you should ask whether the proper functioning
@@ -3454,7 +3452,7 @@ don't need a license.
@end itemize
@node ISP, Web server, Products that use MySQL, Licensing examples
-@subsection ISP @strong{MySQL} Services
+@subsection ISP MySQL Services
@cindex ISP services
@cindex services, ISP
@@ -3482,7 +3480,7 @@ it is patched correctly.
@cindex web server, running
@cindex running, a web server
@node Web server, , ISP, Licensing examples
-@subsection Running a Web Server Using @strong{MySQL}
+@subsection Running a Web Server Using MySQL
If you use @strong{MySQL} in conjunction with a Web server on Unix, you
don't have to pay for a license.
@@ -3498,7 +3496,7 @@ enterprise.
@cindex support costs
@cindex prices, licensing and support
@node Cost, Support, Licensing examples, Licensing and Support
-@section @strong{MySQL} Licensing and Support Costs
+@section MySQL Licensing and Support Costs
@menu
* Payment information:: Payment information
@@ -8964,7 +8962,7 @@ The expected results are shown in the @file{./tests/auto_increment.res} file.
@end enumerate
@node mysql_install_db, Starting server, Post-installation, Post-installation
-@subsection Problems Running @code{mysql_install_db}
+@subsection Problems Running mysql_install_db
@cindex @code{mysql_install_db} script
@cindex scripts, @code{mysql_install_db}
@@ -25100,7 +25098,7 @@ group by
@cindex functions, server
@cindex server functions
@node Server, Replication, Tutorial, Top
-@chapter MySQL server functions
+@chapter MySQL Server Functions
@menu
* Languages:: What languages are supported by @strong{MySQL}?
@@ -27037,7 +27035,7 @@ can be used to find the relevant rows when scanning the table.
@cindex indexes, uses for
@node MySQL indexes, Query Speed, Data size, Performance
-@section How @strong{MySQL} Uses Indexes
+@section How MySQL Uses Indexes
Indexes are used to find rows with a specific value of one column
fast. Without an index @strong{MySQL} has to start with the first record
@@ -37369,13 +37367,13 @@ detail in the PHP manual.
@section MySQL C++ APIs
Two APIs are available in the @strong{MySQL}
-@uref{http://www.mysql.com/Contrib/,Contrib directory}.
+@uref{http://www.mysql.com/Downloads/Contrib/,Contrib directory}.
@cindex Python APIs
@node Python, Tcl, Cplusplus, Clients
@section MySQL Python APIs
-The @strong{MySQL} @uref{http://www.mysql.com/Contrib/,Contrib directory}
+The @strong{MySQL} @uref{http://www.mysql.com/Downloads/Contrib/,Contrib directory}
contains a Python
interface written by Joseph Skinner.
@@ -37389,7 +37387,7 @@ You can also use the Python interface to iODBC to access a
@uref{http://www.binevolve.com/~tdarugar/tcl-sql/, Tcl at binevolve}.
The
-@uref{http://www.mysql.com/Contrib,Contrib directory} contains a Tcl
+@uref{http://www.mysql.com/Downloads/Contrib,Contrib directory} contains a Tcl
interface that is based on msqltcl 1.50.
@cindex databases, MySQL vs. others
@@ -39502,7 +39500,7 @@ Vio interface (foundation for the the encrypted client/server protocol).
@item
Replication.
@item
-@code{SHOW TABLE CREATE}.
+@code{SHOW CREATE TABLE}.
@item
mod_mysql_include
@item
@@ -39516,7 +39514,7 @@ mysql-bench
@item
@strong{MySQL} test suite
@item
-Our web master.
+Our webmaster.
@end itemize
@item Miguel Solórzano
@@ -39546,6 +39544,10 @@ Added keys to the @code{MERGE} library.
Proofreading and editing this fine manual.
@item
@code{ALTER TABLE ... ORDER BY ...}.
+@item
+@code{UPDATE ... ORDER BY ...}.
+@item
+@code{DELETE ... ORDER BY ...}.
@end itemize
@item John Dean
@@ -39811,31 +39813,31 @@ find on the
this means that the version has not yet been released!
@menu
-* News-4.0.x:: Changes in release 4.0 (development version)
+* News-4.0.x:: Changes in release 4.0.x (Development; Alpha)
* News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma)
-* News-3.22.x:: Changes in release 3.22.x (Still supported)
+* News-3.22.x:: Changes in release 3.22.x (Older; Still supported)
* News-3.21.x:: Changes in release 3.21.x
* News-3.20.x:: Changes in release 3.20.x
* News-3.19.x:: Changes in release 3.19.x
@end menu
@node News-4.0.x, News-3.23.x, News, News
-@appendixsec Changes in release 4.0 (Alpha)
+@appendixsec Changes in release 4.0.x (Development; Alpha)
We have now started to work on MySQL 4.0. We will update this section
as we add new features so that other can follow our development.
Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@menu
-* News-4.0.0:: Changes in release 4.0
+* News-4.0.0:: Changes in release 4.0.0
@end menu
@node News-4.0.0, , News-4.0.x, News-4.0.x
-@appendixsubsec Changes in release 4.0
+@appendixsubsec Changes in release 4.0.0
@itemize @bullet
@item
-Added @code{ORDER BY} to @code{DELETE}.
+Added @code{ORDER BY} syntax to @code{UPDATE} and @code{DELETE}.
@end itemize
@node News-3.23.x, News-3.22.x, News-4.0.x, News
@@ -39892,10 +39894,10 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.30
@itemize @bullet
@item
-Fixed a bug from 3.23.29 when allocation the shared structure needed
+Fixed a bug from 3.23.29 when allocating the shared structure needed
for BDB tables.
@item
-Changed mysqld_mult.sh to use configure variables. Patch by
+Changed @file{mysqld_multi.sh} to use configure variables. Patch by
Christopher McCrory.
@item
Added fixing of include files for Solaris 2.8.
@@ -39912,10 +39914,10 @@ Fixed bug when running two simultaneous @code{SHOW LOGS} queries.
@appendixsubsec Changes in release 3.23.29
@itemize @bullet
@item
-Configure updates for Tru64, large file support and better TCP wrappers
+Configure updates for Tru64, large file support, and better TCP wrapper
support. By Albert Chin-A-Young.
@item
-Fixed bug in <=> operator.
+Fixed bug in @code{<=>} operator.
@item
Fixed bug in @code{REPLACE} with BDB tables.
@item
@@ -39937,7 +39939,7 @@ the whole @code{WHERE} part.
Changed drop table to first drop the tables and then the @code{.frm} file.
@item
Fixed a bug in the hostname cache which caused @code{mysqld} to report the
-hostname as '' in some error messages.
+hostname as @code{''} in some error messages.
@item
Fixed a bug with @code{HEAP} type tables; the variable
@code{max_heap_table_size} wasn't used. Now either @code{MAX_ROWS} or
@@ -39954,7 +39956,7 @@ Added support for @code{auto_increment} on sub fields for BDB tables.
Added @code{ANALYZE} of BDB tables.
@item
Store in BDB tables the number of rows; This helps to optimize queries
-when we need an approximation of the number of row.
+when we need an approximation of the number of rows.
@item
If we get an error in a multi-row statement, we now only rollback the
last statement, not the entire transaction.
@@ -39969,7 +39971,7 @@ Added status variable @code{Slave_open_temp_tables}.
Added variables @code{binlog_cache_size} and @code{max_binlog_cache_size} to
@code{mysqld}.
@item
-Made @code{DROP TABLE}, @code{RENAME TABLE}, @code{CREATE INDEX} and
+@code{DROP TABLE}, @code{RENAME TABLE}, @code{CREATE INDEX} and
@code{DROP INDEX} are now transaction endpoints.
@item
If you do a @code{DROP DATABASE} on a symbolic linked database, both
@@ -39978,7 +39980,7 @@ the link and the original database is deleted.
Fixed that @code{DROP DATABASE} works on OS/2.
@item
Fixed bug when doing a @code{SELECT DISTINCT ... table1 LEFT JOIN
-table2..} when table2 was empty.
+table2 ...} when table2 was empty.
@item
Added @code{--abort-slave-event-count} and
@code{--disconnect-slave-event-count} options to @code{mysqld} for
@@ -39996,9 +39998,10 @@ Tim Bunce @email{Tim.Bunce@@ig.co.uk} for modifying @file{mysql.server} to
easily handle hosts running many @code{mysqld} processes.
@item
@file{safe_mysqld}, @file{mysql.server}, and @file{mysql_install_db} have
-been modified to use mysql_print_defaults instead of various hacks to read
-the @file{my.cnf} files. In addition, the handling of various paths has been
-made more consistent with how @code{mysqld} handles them by default.
+been modified to use @code{mysql_print_defaults} instead of various hacks
+to read the @file{my.cnf} files. In addition, the handling of various
+paths has been made more consistent with how @code{mysqld} handles them
+by default.
@item
Automatically remove Berkeley DB transaction logs that no longer are in
use.
@@ -40007,7 +40010,7 @@ Fixed bug with several @code{FULLTEXT} indexes in one table.
@item
Added a warning if number of rows changes on @code{REPAIR}/@code{OPTIMIZE}.
@item
-Applied patches for OS2 by @code{Yuri Dario}.
+Applied patches for OS/2 by @code{Yuri Dario}.
@item
@code{FLUSH TABLES table_name} didn't always flush the index tree
properly to disk.
@@ -41512,7 +41515,7 @@ Added @code{mysqld} option @code{--default-table-type}.
@end itemize
@node News-3.22.x, News-3.21.x, News-3.23.x, News
-@appendixsec Changes in release 3.22.x
+@appendixsec Changes in release 3.22.x (Older; Still supported)
The 3.22 version has faster and safer connect code and a lot of new nice
enhancements. The reason for not including these changes in the 3.21 version
@@ -44607,7 +44610,7 @@ tell us what you want to have done more quickly. @xref{Licensing and Support}.
@node TODO MySQL 4.0, TODO future, TODO, TODO
@appendixsec Things that should be in 4.0
-We plan to make @strong{MySQL} Version 4.0 a 'quick' release where we only
+We plan to make @strong{MySQL} Version 4.0 a ``quick'' release where we only
add some new stuff to enable others to help us with developing new features
into Version 4.1. The @strong{MySQL} 4.0 version should only take us about
a month to make after which we want to stabilize it and start working on
@@ -44639,7 +44642,7 @@ The @code{mysqld} will support all standard @strong{MySQL} features and
one can use it in a threaded client to run different queries in each
thread.
@item
-@code{SHOW DATABASE} should only show the database which you have some kind
+@code{SHOW DATABASES} should only show the database which you have some kind
of access privilege to.
@item
Online backup with very low performance penalty. The online backup will
@@ -44680,10 +44683,6 @@ Fail safe replication.
Subqueries.
@code{select id from t where grp in (select grp from g where u > 100)}
@item
-@code{INSERT SQL_CONCURRENT ...}; This will force the insert to happen at the
-end of the data file if the table is in use by an select to allow
-concurrent inserts.
-@item
Don't allow more than a defined number of threads to run MyISAM recover
at the same time.
@item
@@ -44697,14 +44696,14 @@ Port of @strong{MySQL} to BeOS.
@item
Link the @code{myisampack} code into the server.
@item
-Add a temporary key buffer cache during @code{insert/delete/update} so that we
+Add a temporary key buffer cache during @code{INSERT/DELETE/UPDATE} so that we
can gracefully recover if the index file gets full.
@item
If you perform an @code{ALTER TABLE} on a table that is symlinked to another
disk, create temporary tables on this disk.
@item
-Implement a date/datetime type that handles time zone information properly,
-so that dealing with dates in different time zones is easier.
+Implement a @code{DATE/DATETIME} type that handles time zone information
+properly, so that dealing with dates in different time zones is easier.
@item
FreeBSD and MIT-pthreads; Do sleeping threads take CPU?
@item
@@ -44754,9 +44753,6 @@ Optimize @code{BIT} type to take 1 bit (now @code{BIT} takes 1 char).
@item
Check why MIT-pthreads @code{ctime()} doesn't work on some FreeBSD systems.
@item
-Add @code{ORDER BY} to @code{UPDATE}. This would be handy with functions like:
-@code{generate_id(start,step)}.
-@item
Add an @code{IMAGE} option to @code{LOAD DATA INFILE} to not update
@code{TIMESTAMP} and @code{AUTO_INCREMENT} fields.
@item
diff --git a/acconfig.h b/acconfig.h
index 3b9874b2e6a..b0b6a3aae64 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -117,6 +117,9 @@
/* POSIX sigwait */
#undef HAVE_SIGWAIT
+/* crypt */
+#undef HAVE_CRYPT
+
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
this with 8 arguments */
#undef HAVE_SOLARIS_STYLE_GETHOST
diff --git a/configure.in b/configure.in
index 3ad2ef4b860..c6885bffec0 100644
--- a/configure.in
+++ b/configure.in
@@ -507,7 +507,9 @@ AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
# This may get things to compile even if bind-8 is installed
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
# For crypt() on Linux
-AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt))
+AC_CHECK_LIB(crypt, crypt)
+AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
+
# For compress in zlib
MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
@@ -1264,7 +1266,7 @@ AC_CHECK_FUNCS(alarm bmove \
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
- crypt dlopen dlerror fchmod getpass getpassphrase initgroups mlockall)
+ dlopen dlerror fchmod getpass getpassphrase initgroups mlockall)
# Sanity check: We chould not have any fseeko symbol unless
# large_file_support=yes
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index de477f1420f..5fe578b05a6 100755
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -68,10 +68,6 @@ SLAVE_RUNNING=0
[ -d $MY_TMP_DIR ] || mkdir -p $MY_TMP_DIR
-[ -z "$COLUMNS" ] && COLUMNS=80
-E=`expr $COLUMNS - 8`
-DASH72=`expr substr '________________________________________________________________________' 1 $E`
-
#++
# mysqld Environment Parameters
#--
@@ -113,6 +109,11 @@ TIME=/usr/bin/time
TR=/usr/bin/tr
XARGS=`which xargs | head -1`
+[ -z "$COLUMNS" ] && COLUMNS=80
+E=`$EXPR $COLUMNS - 8`
+#DASH72=`expr substr '________________________________________________________________________' 1 $E`
+DASH72=`$ECHO '________________________________________________________________________'|$CUT -c 1-$E`
+
# on source dist, we pick up freshly build executables
# on binary, use what is installed
if [ x$SOURCE_DIST = x1 ] ; then
@@ -469,7 +470,7 @@ run_testcase ()
fi
timestr="$USERT $SYST $REALT"
- pname=`$EXPR substr "$tname " 1 16`
+ pname=`$ECHO "$tname "|$CUT -c 1-16`
$SETCOLOR_NORMAL && $ECHO -n "$pname $timestr"
diff --git a/mysql-test/r/crypt.result b/mysql-test/r/crypt.result
new file mode 100644
index 00000000000..fe3f80dc90d
--- /dev/null
+++ b/mysql-test/r/crypt.result
@@ -0,0 +1,2 @@
+encrypt('foo', 'ff')
+ffTU0fyIP09Z.
diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result
index 862d7b56bf2..25082dcc60f 100644
--- a/mysql-test/r/rpl000014.result
+++ b/mysql-test/r/rpl000014.result
@@ -1,7 +1,7 @@
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
-127.0.0.1 root 9306 1 4 Yes
+127.0.0.1 root 9306 1 73 Yes
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
diff --git a/mysql-test/t/crypt.test b/mysql-test/t/crypt.test
new file mode 100644
index 00000000000..4a499f3d5b7
--- /dev/null
+++ b/mysql-test/t/crypt.test
@@ -0,0 +1 @@
+select encrypt('foo', 'ff');
diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl000014.test
index e47933b140a..200decf5201 100644
--- a/mysql-test/t/rpl000014.test
+++ b/mysql-test/t/rpl000014.test
@@ -2,9 +2,10 @@ source include/master-slave.inc;
connection master;
show master status;
connection slave;
+sleep 0.2;
show slave status;
change master to master_log_pos=73;
-sleep 1;
+sleep 0.2;
slave stop;
change master to master_log_pos=73;
show slave status;
@@ -19,5 +20,5 @@ create table foo (n int);
insert into foo values (1),(2),(3);
connection slave;
change master to master_log_pos=73;
-sleep 0.3;
+sleep 0.2;
select * from foo;
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 189a8d3a33a..b0333762515 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -325,11 +325,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->rnd_init();
file->extra(HA_EXTRA_CACHE); /* Quicker reads */
}
- else if (quick_select) // QQ For FULLTEXT
- { // QQ Should be removed soon
- file->index_end();
- select->quick->init();
- }
for (;;)
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ad5fc926afd..ccf61ec8303 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -159,6 +159,7 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
opt_ansi_mode=0,opt_myisam_log=0, opt_large_files=sizeof(my_off_t) > 4;
bool opt_sql_bin_update = 0, opt_log_slave_updates = 0;
FILE *bootstrap_file=0;
+int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
extern MASTER_INFO glob_mi;
extern int init_master_info(MASTER_INFO* mi);
@@ -1039,16 +1040,97 @@ static void init_signals(void)
#else
#ifdef HAVE_LINUXTHREADS
+static sig_handler write_core(int sig);
+#ifdef __i386__
+#define SIGRETURN_FRAME_COUNT 1
+inline static __volatile__ void trace_stack()
+{
+ uchar **stack_bottom;
+ uchar** ebp;
+ LINT_INIT(ebp);
+ fprintf(stderr, "Attemping backtrace, please send the info below to\
+ bugs@lists.mysql.com. If you see no messages after this, something \
+ went terribly wrong - report this anyway\n");
+ THD* thd = current_thd;
+ uint frame_count = 0;
+ __asm __volatile__ ("movl %%ebp,%0"
+ :"=r"(ebp)
+ :"r"(ebp));
+ if(!ebp)
+ {
+ fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \
+ -fomit-frame-pointer? Aborting backtrace\n");
+ return;
+ }
+ if(!thd)
+ {
+ fprintf(stderr, "Cannot determine thread, ebp=%p, aborting backtrace\n",
+ ebp);
+ return;
+ }
+ stack_bottom = (uchar**)thd->thread_stack;
+ if(ebp > stack_bottom || ebp < stack_bottom - thread_stack)
+ {
+ fprintf(stderr,
+ "Bogus stack limit or frame pointer, aborting backtrace\n");
+ return;
+ }
-/* Produce a core for the thread */
+ fprintf(stderr, "stack range sanity check, ok, backtrace follows\n");
+
+ while(ebp < stack_bottom)
+ {
+ uchar** new_ebp = (uchar**)*ebp;
+ fprintf(stderr, "%p\n", frame_count == SIGRETURN_FRAME_COUNT ?
+ *(ebp+17) : *(ebp+1));
+ if(new_ebp <= ebp )
+ {
+ fprintf(stderr, "New value of ebp failed sanity check\
+terminating backtrace\n");
+ return;
+ }
+ ebp = new_ebp;
+ ++frame_count;
+ }
-static sig_handler write_core(int sig)
+ fprintf(stderr, "stack trace successful\n");
+}
+#endif
+#endif
+
+static sig_handler handle_segfault(int sig)
{
+ // strictly speaking, one needs a mutex here
+ // but since we have got SIGSEGV already, things are a mess
+ // so not having the mutex is not as bad as possibly using a buggy
+ // mutex - so we keep things simple
+ if(segfaulted)
+ return;
+ segfaulted = 1;
fprintf(stderr,"\
-mysqld got signal %s in thread %d; Writing core file: %s\n\
+mysqld got signal %s in thread %d; \n\
The manual section 'Debugging a MySQL server' tells you how to use a \n\
debugger on the core file to produce a backtrace that may help you find out\n\
-why mysqld died\n",sys_siglist[sig],getpid(),mysql_home);
+why mysqld died\n",sys_siglist[sig],getpid());
+#if defined(HAVE_LINUXTHREADS) && defined(__i386__)
+ trace_stack();
+#endif
+#ifdef HAVE_LINUXTHREADS
+ if (test_flags & TEST_CORE_ON_SIGNAL)
+ write_core(sig);
+ else
+ exit(1);
+#else
+ exit(1); /* abort everything */
+#endif
+}
+
+#ifdef HAVE_LINUXTHREADS
+
+/* Produce a core for the thread */
+
+static sig_handler write_core(int sig)
+{
signal(sig, SIG_DFL);
if (fork() != 0) exit(1); // Abort main program
// Core will be written at exit
@@ -1065,16 +1147,11 @@ static void init_signals(void)
sigset(THR_KILL_SIGNAL,end_thread_signal);
sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
-#ifdef HAVE_LINUXTHREADS
- if (test_flags & TEST_CORE_ON_SIGNAL)
- {
- struct sigaction sa; sa.sa_flags = 0;
- sigemptyset(&sa.sa_mask);
- sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
- sa.sa_handler=write_core;
- sigaction(SIGSEGV, &sa, NULL);
- }
-#endif
+ struct sigaction sa; sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
+ sa.sa_handler=handle_segfault;
+ sigaction(SIGSEGV, &sa, NULL);
(void) sigemptyset(&set);
#ifdef THREAD_SPECIFIC_SIGPIPE
sigset(SIGPIPE,abort_thread);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index eab67c835fd..ca33e9b2367 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -106,13 +106,13 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
}
if (!error)
{
- send_ok(&thd->net); // This should return record count
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query);
mysql_bin_log.write(&qinfo);
}
+ send_ok(&thd->net); // This should return record count
}
DBUG_RETURN(error ? -1 : 0);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1359551fcf1..fdd4541cfc8 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2247,8 +2247,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
/* Use quick key read if it's a constant and it's not used
with key reading */
- if (tab->needed_reg == 0 && tab->type != JT_EQ_REF &&
- (tab->type != JT_REF ||
+ if (tab->needed_reg == 0 && tab->type != JT_EQ_REF
+ && tab->type != JT_FT && (tab->type != JT_REF ||
(uint) tab->ref.key == tab->quick->index))
{
sel->quick=tab->quick; // Use value from get_quick_...