merge from 5.5 main

This commit is contained in:
Bjorn Munch 2011-09-20 12:14:35 +02:00
commit 8589a3e251
46 changed files with 622 additions and 986 deletions

View File

@ -448,7 +448,8 @@ enum ha_base_keytype {
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
#define HA_ERR_INDEX_CORRUPT 179 /* Index corrupted */
#define HA_ERR_LAST 179 /* Copy of last error nr */
#define HA_ERR_UNDO_REC_TOO_BIG 180 /* Undo log record too big */
#define HA_ERR_LAST 180 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

View File

@ -22,6 +22,11 @@
extern uint mysql_port;
extern char * mysql_unix_port;
/*
Note: CLIENT_CAPABILITIES is also defined in sql/client_settings.h.
When adding capabilities here, consider if they should be also added to
the server's version.
*/
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
CLIENT_LONG_FLAG | \
CLIENT_TRANSACTIONS | \

View File

@ -0,0 +1,24 @@
include/master-slave.inc
[connection master]
[connection slave]
include/stop_slave.inc
[connection master]
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
[connection slave]
CHANGE MASTER TO
MASTER_USER= 'plug_user',
MASTER_PASSWORD= 'plug_user';
include/start_slave.inc
# Slave in-sync with master now.
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
user plugin authentication_string
plug_user test_plugin_server plug_user
# Cleanup (on slave).
include/stop_slave.inc
CHANGE MASTER TO MASTER_USER='root';
DROP USER 'plug_user';
# Cleanup (on master).
DROP USER 'plug_user';
include/rpl_end.inc

View File

@ -2785,5 +2785,40 @@ format(123,2,'no_NO')
123,00
DROP TABLE t1;
#
# Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
#
SELECT (rpad(1.0,2048,1)) IS NOT FALSE;
(rpad(1.0,2048,1)) IS NOT FALSE
1
SELECT ((+0) IN
((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
(32767.1)));
((+0) IN
((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
(32767.1)))
0
SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
((rpad(1.0,2048,1)) = ('4(') ^ (0.1))
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '4('
SELECT
pow((rpad(1.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
ERROR 22003: DOUBLE value is out of range in 'pow(rpad(1.0,2048,1),0x07ffffffffff)'
SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
((rpad(1.0,2048,1)) + (0) ^ ('../'))
1.011111111111111
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '../'
SELECT stddev_samp(rpad(1.0,2048,1));
stddev_samp(rpad(1.0,2048,1))
NULL
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)))
1
SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
0
#
# End of 5.5 tests
#

View File

@ -118,3 +118,35 @@ Aborted: file is not compressed
DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
#
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
#
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
a
aaaa
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
a
aaaa
DROP TABLE t1;
# Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
# Populating a table, so it's index file exceeds 65K
# Populating a table, so index file has second level fulltext tree
FLUSH TABLE t1;
# Compressing table
# Fixing index (repair by sort)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FLUSH TABLE t1;
# Fixing index (repair with keycache)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;

View File

@ -975,6 +975,15 @@ INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
DROP TABLE t1;
CREATE TABLE bug12547647(
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
COMMIT;
UPDATE bug12547647 SET c = REPEAT('b',16928);
ERROR HY000: Undo log record is too big.
DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
set global innodb_file_format_max=Antelope;

View File

@ -477,6 +477,19 @@ DELETE FROM t1;
-- sleep 10
DROP TABLE t1;
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
CREATE TABLE bug12547647(
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
COMMIT;
# The following used to cause infinite undo log allocation.
--error ER_UNDO_RECORD_TOO_BIG
UPDATE bug12547647 SET c = REPEAT('b',16928);
DROP TABLE bug12547647;
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
eval set global innodb_file_format_max=$format;

View File

@ -0,0 +1,2 @@
$PLUGIN_AUTH_OPT
$PLUGIN_AUTH_LOAD

View File

@ -0,0 +1,4 @@
--master-retry-count=1
$PLUGIN_AUTH_OPT
$PLUGIN_AUTH_LOAD

View File

@ -0,0 +1,66 @@
--source include/have_plugin_auth.inc
--source include/not_embedded.inc
--source include/master-slave.inc
#
# Check that replication slave can connect to master using an account
# which authenticates with an external authentication plugin (bug#12897501).
#
# First stop the slave to guarantee that nothing is replicated.
#
--connection slave
--echo [connection slave]
--source include/stop_slave.inc
#
# Create an replication account on the master.
#
--connection master
--echo [connection master]
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
#
# Now go to slave and change the replication user.
#
--connection slave
--echo [connection slave]
--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
CHANGE MASTER TO
MASTER_USER= 'plug_user',
MASTER_PASSWORD= 'plug_user';
#
# Start slave with new replication account - this should trigger connection
# to the master server.
#
--source include/start_slave.inc
# Replicate all statements executed on master, in this case,
# (creation of the plug_user account).
#
--connection master
--sync_slave_with_master
--echo # Slave in-sync with master now.
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
#
# Now we can stop the slave and clean up.
#
# Note: it is important that slave is stopped at this
# moment - otherwise master's cleanup statements
# would be replicated on slave!
#
--echo # Cleanup (on slave).
--source include/stop_slave.inc
eval CHANGE MASTER TO MASTER_USER='$master_user';
DROP USER 'plug_user';
--echo # Cleanup (on master).
--connection master
DROP USER 'plug_user';
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View File

@ -1436,6 +1436,25 @@ SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
--echo #
SELECT (rpad(1.0,2048,1)) IS NOT FALSE;
SELECT ((+0) IN
((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
(32767.1)));
SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
--error 1690
SELECT
pow((rpad(1.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
SELECT stddev_samp(rpad(1.0,2048,1));
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
--echo #
--echo # End of 5.5 tests
--echo #

View File

@ -221,3 +221,47 @@ DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
--echo #
--echo # BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
--echo #
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
--exec $MYISAMCHK -srq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
DROP TABLE t1;
--echo # Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
--disable_query_log
--echo # Populating a table, so it's index file exceeds 65K
let $1=1700;
while ($1)
{
eval INSERT INTO t1 VALUES('$1aaaaaaaaaaaaaaaaaaaaaaaaaa');
dec $1;
}
--echo # Populating a table, so index file has second level fulltext tree
let $1=60;
while ($1)
{
eval INSERT INTO t1 VALUES('aaaa'),('aaaa'),('aaaa'),('aaaa'),('aaaa');
dec $1;
}
--enable_query_log
FLUSH TABLE t1;
--echo # Compressing table
--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
--echo # Fixing index (repair by sort)
--exec $MYISAMCHK -srnq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
FLUSH TABLE t1;
--echo # Fixing index (repair with keycache)
--exec $MYISAMCHK -soq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
DROP TABLE t1;

View File

@ -880,13 +880,16 @@
# Note the wildcard in the (mangled) function signatures of
# write_keys() and find_all_keys().
# They both return ha_rows, which is platform dependent.
#
# The '...' wildcards are for 'fun:inline_mysql_file_write' which *may*
# be inlined.
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / one
Memcheck:Param
write(buf)
obj:*/libpthread*.so
fun:my_write
fun:inline_mysql_file_write
...
fun:my_b_flush_io_cache
fun:_my_b_write
fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
@ -894,16 +897,17 @@
fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
}
## {
## Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / two
## Memcheck:Param
## write(buf)
## obj:*/libpthread*.so
## fun:my_write
## fun:my_b_flush_io_cache
## fun:_Z15merge_many_buffP13st_sort_paramPhP10st_buffpekPjP11st_io_cache
## fun:_Z8filesortP3THDP8st_tableP13st_sort_fieldjP10SQL_SELECTybPy
## }
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / two
Memcheck:Param
write(buf)
obj:*/libpthread*.so
fun:my_write
...
fun:my_b_flush_io_cache
fun:_Z15merge_many_buffP13st_sort_paramPhP10st_buffpekPjP11st_io_cache
fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
}
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / three
@ -911,7 +915,7 @@
write(buf)
obj:*/libpthread*.so
fun:my_write
fun:inline_mysql_file_write
...
fun:my_b_flush_io_cache
fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
}

View File

@ -82,7 +82,8 @@ static const char *handler_error_messages[]=
"Read page with wrong checksum",
"Too many active concurrent transactions",
"Index column length exceeds limit",
"Index corrupted"
"Index corrupted",
"Undo record too big"
};
extern void my_handler_error_register(void);

View File

@ -312,18 +312,18 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
* The most important functions during semi-syn replication listed:
*
* Master:
* . reportReplyBinlog(): called by the binlog dump thread when it receives
* the slave's status information.
* . updateSyncHeader(): based on transaction waiting information, decide
* whether to request the slave to reply.
* . writeTraxInBinlog(): called by the transaction thread when it finishes
* writing all transaction events in binlog.
* . commitTrx(): transaction thread wait for the slave reply.
* . reportReplyBinlog(): called by the binlog dump thread when it receives
* the slave's status information.
* . updateSyncHeader(): based on transaction waiting information, decide
* whether to request the slave to reply.
* . writeTranxInBinlog(): called by the transaction thread when it finishes
* writing all transaction events in binlog.
* . commitTrx(): transaction thread wait for the slave reply.
*
* Slave:
* . slaveReadSyncHeader(): read the semi-sync header from the master, get the
* sync status and get the payload for events.
* . slaveReply(): reply to the master about the replication progress.
* sync status and get the payload for events.
* . slaveReply(): reply to the master about the replication progress.
*
******************************************************************************/

View File

@ -1,4 +1,4 @@
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -65,7 +65,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs
IF(UNIX)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
"cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake" )
"cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake\n" )
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
)
@ -104,11 +104,11 @@ IF(UNIX)
# FIND_PROC and CHECK_PID are used by mysqld_safe
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (FIND_PROC
"ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null")
"ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET (FIND_PROC
"ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null")
"ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC)
@ -116,7 +116,7 @@ IF(NOT FIND_PROC)
EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET( FIND_PROC
"ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null")
"ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()
@ -124,7 +124,7 @@ IF(NOT FIND_PROC)
# SysV style
EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null")
SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()

View File

@ -1,342 +0,0 @@
#!/bin/sh
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
#
# This is a script to create a TAR or ZIP binary distribution out of a
# built source tree. The output file will be put at the top level of
# the source tree, as "mysql-<vsn>....{tar.gz,zip}"
#
# Note that the structure created by this script is slightly different from
# what a normal "make install" would produce. No extra "mysql" sub directory
# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or
# "$prefix/share/mysql". This is because the build system explicitly calls
# make with pkgdatadir=<datadir>, etc.
#
# In GNU make/automake terms
#
# "pkglibdir" is set to the same as "libdir"
# "pkgincludedir" is set to the same as "includedir"
# "pkgdatadir" is set to the same as "datadir"
# "pkgplugindir" is set to "$pkglibdir/plugin"
# "pkgsuppdir" is set to "@prefix@/support-files",
# normally the same as "datadir"
#
# The temporary directory path given to "--tmp=<path>" has to be
# absolute and with no spaces.
#
# Note that for best result, the original "make" should be done with
# the same arguments as used for "make install" below, especially the
# 'pkglibdir', as the RPATH should to be set correctly.
#
##############################################################################
##############################################################################
#
# Read the command line arguments that control this script
#
##############################################################################
machine=@MACHINE_TYPE@
system=@SYSTEM_TYPE@
SOURCE=`pwd`
CP="cp -p"
MV="mv"
# There are platforms, notably OS X on Intel (x86 + x86_64),
# for which "uname" does not provide sufficient information.
# The value of CFLAGS as used during compilation is the most exact info
# we can get - after all, we care about _what_ we built, not _where_ we did it.
cflags="@CFLAGS@"
STRIP=1 # Option ignored
SILENT=0
MALLOC_LIB=
PLATFORM=""
TMP=/tmp
NEW_NAME="" # Final top directory and TAR package name
SUFFIX=""
SHORT_PRODUCT_TAG="" # If don't want server suffix in package name
NDBCLUSTER="" # Option ignored
for arg do
case "$arg" in
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;;
--inject-malloc-lib=*) MALLOC_LIB=`echo "$arg" | sed -e 's;^[^=]*=;;'` ;;
--no-strip) STRIP=0 ;;
--machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;;
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
--silent) SILENT=1 ;;
--with-ndbcluster) NDBCLUSTER=1 ;;
*)
echo "Unknown argument '$arg'"
exit 1
;;
esac
done
# ----------------------------------------------------------------------
# Adjust "system" output from "uname" to be more human readable
# ----------------------------------------------------------------------
if [ x"$PLATFORM" = x"" ] ; then
# FIXME move this to the build tools
# Remove vendor from $system
system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
system=`echo $system | sed -e 's/darwin9.*/osx10.5/g'`
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
fi
# Get the "machine", which really is the CPU architecture (including the size).
# The precedence is:
# 1) use an explicit argument, if given;
# 2) use platform-specific fixes, if there are any (see bug#37808);
# 3) stay with the default (determined during "configure", using predefined macros).
if [ x"$MACHINE" != x"" ] ; then
machine=$MACHINE
else
case $system in
osx* )
# Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty!
cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'`
case "$cflag_arch" in
i386 ) case $system in
osx10.4 ) machine=i686 ;; # Used a different naming
* ) machine=x86 ;;
esac ;;
x86_64 ) machine=x86_64 ;;
ppc ) ;; # No treatment needed with PPC
ppc64 ) ;;
* ) # No matching compiler flag? "--platform" is needed
if [ x"$PLATFORM" != x"" ] ; then
: # See below: "$PLATFORM" will take precedence anyway
elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then
: # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch"
else
echo "On system '$system' only specific '-arch' values are expected."
echo "It is taken from the 'CFLAGS' whose value is:"
echo "$cflags"
echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT"
exit 1
fi ;;
esac # "$cflag_arch"
;;
esac # $system
fi
# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence.
if [ x"$PLATFORM" != x"" ] ; then
:
else
PLATFORM="$system-$machine"
fi
# Print the platform name for build logs
echo "PLATFORM NAME: $PLATFORM"
# Change the distribution to a long descriptive name
# For the cluster product, concentrate on the second part
VERSION_NAME=@VERSION@
case $VERSION_NAME in
*-ndb-* ) VERSION_NAME=`echo $VERSION_NAME | sed -e 's/[.0-9]*-ndb-//'` ;;
esac
if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then
NEW_NAME=mysql-$SHORT_PRODUCT_TAG-$VERSION_NAME-$PLATFORM$SUFFIX
else
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$VERSION_NAME-$PLATFORM$SUFFIX
fi
# ----------------------------------------------------------------------
# Define BASE, and remove the old BASE directory if any
# ----------------------------------------------------------------------
BASE=$TMP/my_dist$SUFFIX
if [ -d $BASE ] ; then
rm -rf $BASE
fi
# ----------------------------------------------------------------------
# Find the TAR to use
# ----------------------------------------------------------------------
# This is needed to prefer GNU tar over platform tar because that can't
# always handle long filenames
PATH_DIRS=`echo $PATH | \
sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
which_1 ()
{
for cmd
do
for d in $PATH_DIRS
do
for file in $d/$cmd
do
if [ -x $file -a ! -d $file ] ; then
echo $file
exit 0
fi
done
done
done
exit 1
}
tar=`which_1 gnutar gtar`
if [ $? -ne 0 -o x"$tar" = x"" ] ; then
tar=tar
fi
##############################################################################
#
# Handle the Unix/Linux packaging using "make install"
#
##############################################################################
# ----------------------------------------------------------------------
# Terminate on any base level error
# ----------------------------------------------------------------------
set -e
# ----------------------------------------------------------------------
# Really ugly, one script, "mysql_install_db", needs prefix set to ".",
# i.e. makes access relative the current directory. This matches
# the documentation, so better not change this. And for another script,
# "mysql.server", we make some relative, others not.
# ----------------------------------------------------------------------
cd scripts
rm -f mysql_install_db
@MAKE@ mysql_install_db \
prefix=. \
bindir=./bin \
sbindir=./bin \
scriptdir=./bin \
libexecdir=./bin \
pkgdatadir=./share \
localstatedir=./data
cd ..
cd support-files
rm -f mysql.server
@MAKE@ mysql.server \
bindir=./bin \
sbindir=./bin \
scriptdir=./bin \
libexecdir=./bin \
pkgdatadir=@pkgdatadir@
cd ..
# ----------------------------------------------------------------------
# Do a install that we later are to pack. Use the same paths as in
# the build for the relevant directories.
# ----------------------------------------------------------------------
@MAKE@ DESTDIR=$BASE install \
pkglibdir=@pkglibdir@ \
pkgincludedir=@pkgincludedir@ \
pkgdatadir=@pkgdatadir@ \
pkgplugindir=@pkgplugindir@ \
pkgsuppdir=@pkgsuppdir@ \
mandir=@mandir@ \
infodir=@infodir@
# ----------------------------------------------------------------------
# Rename top directory, and set DEST to the new directory
# ----------------------------------------------------------------------
mv $BASE@prefix@ $BASE/$NEW_NAME
DEST=$BASE/$NEW_NAME
# ----------------------------------------------------------------------
# If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a
# ----------------------------------------------------------------------
if [ x"@GXX@" = x"yes" ] ; then
gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true
if [ -z "$gcclib" ] ; then
echo "Warning: Compiler doesn't tell libgcc.a!"
elif [ -f "$gcclib" ] ; then
$CP $gcclib $DEST/lib/libmygcc.a
else
echo "Warning: Compiler result '$gcclib' not found / no file!"
fi
fi
# If requested, add a malloc library .so into pkglibdir for use
# by mysqld_safe
if [ -n "$MALLOC_LIB" ]; then
cp "$MALLOC_LIB" "$DEST/lib/"
fi
# FIXME let this script be in "bin/", where it is in the RPMs?
# http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html
mkdir $DEST/scripts
mv $DEST/bin/mysql_install_db $DEST/scripts/
# Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1
# Copy readme and license files
cp README Docs/INSTALL-BINARY $DEST/
if [ -f COPYING ] ; then
cp COPYING $DEST/
elif [ -f LICENSE.mysql ] ; then
cp LICENSE.mysql $DEST/
else
echo "ERROR: no license files found"
exit 1
fi
# FIXME should be handled by make file, and to other dir
mkdir -p $DEST/bin $DEST/support-files
cp scripts/mysqlaccess.conf $DEST/bin/
cp support-files/magic $DEST/support-files/
# Create empty data directories, set permission (FIXME why?)
mkdir $DEST/data $DEST/data/mysql $DEST/data/test
chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test
# ----------------------------------------------------------------------
# Create the result tar file
# ----------------------------------------------------------------------
echo "Using $tar to create archive"
OPT=cvf
if [ x$SILENT = x1 ] ; then
OPT=cf
fi
echo "Creating and compressing archive"
rm -f $NEW_NAME.tar.gz
(cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz
echo "$NEW_NAME.tar.gz created"
echo "Removing temporary directory"
rm -rf $BASE
exit 0

View File

@ -1,425 +0,0 @@
#!/bin/sh
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Exit if failing to copy, we want exact specifications, not
# just "what happen to be built".
set -e
# ----------------------------------------------------------------------
# Read first argument that is the base name of the resulting TAR file.
# See usage() function below for a description on the arguments.
#
# NOTE: We will read the rest of the command line later on.
# NOTE: Pattern matching with "{..,..}" can't be used, not portable.
# ----------------------------------------------------------------------
# FIXME why "libmysql.dll" installed both in "bin" and "lib/opt"?
usage()
{
echo <<EOF
Usage: make_win_bin_dist [ options ] package-base-name [ copy-defs... ]
This is a script to run from the top of a source tree built on Windows.
The "package-base-name" argument should be something like
mysql-noinstall-5.0.25-win32 (or winx64)
and will become the name of the directory of the unpacked ZIP (stripping
away the "noinstall" part of the ZIP file name if any) and the base
for the resulting package name.
Options are
--embedded Pack the embedded server and give error if not built.
The default is to pack it if it is built.
--no-embedded Don't pack the embedded server even if built
--debug Pack the debug binaries and give error if not built.
The default is to pack them if they are built.
--no-debug Don't pack the debug binaries even if built
--only-debug The target for this build was "Debug", and we just
want to replace the normal binaries with debug
versions, i.e. no separate "debug" directories.
--exe-suffix=SUF Add a suffix to the filename part of the "mysqld" binary.
As you might want to include files of directories from other builds
(like a "mysqld-max.exe" server), you can instruct this script to copy
them in for you. This is the "copy-def" arguments, and they are of the
form
relative-dest-name=source-name .....
i.e. can be something like
bin/mysqld-max.exe=../my-max-build/sql/release/mysqld.exe
If you specify a directory the whole directory will be copied.
EOF
exit 1
}
# ----------------------------------------------------------------------
# We need to be at the top of a source tree, check that we are
# ----------------------------------------------------------------------
if [ ! -d "sql" ] ; then
echo "You need to run this script from inside the source tree"
usage
fi
# ----------------------------------------------------------------------
# Actual argument processing, first part
# ----------------------------------------------------------------------
NOINST_NAME=""
TARGET="release"
PACK_EMBEDDED="" # Could be "no", "yes" or empty
PACK_DEBUG="" # Could be "no", "yes" or empty
EXE_SUFFIX=""
for arg do
shift
case "$arg" in
--embedded) PACK_EMBEDDED="yes" ;;
--no-embedded) PACK_EMBEDDED="no" ;;
--debug) PACK_DEBUG="yes" ;;
--no-debug) PACK_DEBUG="no" ;;
--only-debug) TARGET="debug" ; PACK_DEBUG="no" ;;
--exe-suffix=*) EXE_SUFFIX=`echo "$arg" | sed -e "s,--exe-suffix=,,"` ;;
-*)
echo "Unknown argument '$arg'"
usage
;;
*)
NOINST_NAME="$arg"
break
esac
done
if [ x"$NOINST_NAME" = x"" ] ; then
echo "No base package name given"
usage
fi
DESTDIR=`echo $NOINST_NAME | sed 's/-noinstall-/-/'`
if [ -e $DESTDIR ] ; then
echo "Please remove the old $DESTDIR before running this script"
usage
fi
trap 'echo "Cleaning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR
# ----------------------------------------------------------------------
# Adjust target name if needed, release with debug info has another name
# ----------------------------------------------------------------------
if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ]
then
TARGET="relwithdebinfo"
fi
# ----------------------------------------------------------------------
# Copy executables, and client DLL
# ----------------------------------------------------------------------
mkdir $DESTDIR
mkdir $DESTDIR/bin
cp client/$TARGET/*.exe $DESTDIR/bin/
cp extra/$TARGET/*.exe $DESTDIR/bin/
cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/
if [ x"$TARGET" != x"release" ] ; then
cp client/$TARGET/mysql.pdb $DESTDIR/bin/
cp client/$TARGET/mysqladmin.pdb $DESTDIR/bin/
cp client/$TARGET/mysqlbinlog.pdb $DESTDIR/bin/
cp client/$TARGET/mysqldump.pdb $DESTDIR/bin/
cp client/$TARGET/mysqlimport.pdb $DESTDIR/bin/
cp client/$TARGET/mysqlshow.pdb $DESTDIR/bin/
fi
cp tests/$TARGET/*.exe $DESTDIR/bin/
cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/
cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe
if [ x"$TARGET" != x"release" ] ; then
cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb
fi
if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \
x"$PACK_DEBUG" = x"yes" ] ; then
cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe
cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb
fi
# ----------------------------------------------------------------------
# Copy data directory, readme files etc
# ----------------------------------------------------------------------
if [ -d win/data ] ; then
cp -pR win/data $DESTDIR/
fi
mkdir $DESTDIR/Docs
cp Docs/INSTALL-BINARY $DESTDIR/Docs/
cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true
cp ChangeLog $DESTDIR/Docs/ || /bin/true
cp support-files/my-*.ini $DESTDIR/
cp README $DESTDIR/
if [ -f COPYING ] ; then
cp COPYING $DESTDIR/
cp COPYING $DESTDIR/Docs/
fi
# ----------------------------------------------------------------------
# These will be filled in when we enable embedded. Note that if no
# argument is given, it is copied if exists, else a check is done.
# ----------------------------------------------------------------------
copy_embedded()
{
mkdir -p $DESTDIR/Embedded/DLL/release \
$DESTDIR/Embedded/static/release \
$DESTDIR/include
cp libmysqld/libmysqld.def $DESTDIR/include/
cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/
cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/
cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/
cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/
if [ x"$TARGET" != x"release" ] ; then
cp libmysqld/$TARGET/mysqlserver.pdb $DESTDIR/Embedded/static/release/
cp libmysqld/$TARGET/libmysqld.pdb $DESTDIR/Embedded/DLL/release/
fi
if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \
x"$PACK_DEBUG" = x"yes" ] ; then
mkdir -p $DESTDIR/Embedded/DLL/debug \
$DESTDIR/Embedded/static/debug
cp libmysqld/debug/mysqlserver.lib $DESTDIR/Embedded/static/debug/
cp libmysqld/debug/mysqlserver.pdb $DESTDIR/Embedded/static/debug/
cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.lib $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.pdb $DESTDIR/Embedded/DLL/debug/
fi
}
if [ x"$PACK_EMBEDDED" = x"" -a \
-f "libmysqld/$TARGET/mysqlserver.lib" -a \
-f "libmysqld/$TARGET/libmysqld.lib" -o \
x"$PACK_EMBEDDED" = x"yes" ] ; then
copy_embedded
fi
# ----------------------------------------------------------------------
# Note: Make sure to sync with include/Makefile.am and WiX installer
# XML specifications
# ----------------------------------------------------------------------
mkdir -p $DESTDIR/include
cp include/mysql.h \
include/mysql_com.h \
include/mysql_time.h \
include/my_list.h \
include/my_alloc.h \
include/typelib.h \
include/my_dbug.h \
include/m_string.h \
include/my_sys.h \
include/my_xml.h \
include/mysql_embed.h \
include/my_pthread.h \
include/my_no_pthread.h \
include/decimal.h \
include/errmsg.h \
include/my_global.h \
include/my_config.h \
include/my_net.h \
include/my_getopt.h \
include/sslopt-longopts.h \
include/my_dir.h \
include/sslopt-vars.h \
include/sslopt-case.h \
include/sql_common.h \
include/keycache.h \
include/m_ctype.h \
include/my_attribute.h \
include/my_compiler.h \
include/mysqld_error.h \
include/sql_state.h \
include/mysqld_ername.h \
include/mysql_version.h \
libmysql/libmysql.def \
$DESTDIR/include/
mkdir -p $DESTDIR/include/mysql
cp include/mysql/plugin.h $DESTDIR/include/mysql/
# ----------------------------------------------------------------------
# Client libraries, and other libraries
# ----------------------------------------------------------------------
mkdir -p $DESTDIR/lib/opt
mkdir -p $DESTDIR/lib/plugin
cp sql/$TARGET/mysqld.lib $DESTDIR/lib/
cp libmysql/$TARGET/libmysql.dll \
libmysql/$TARGET/libmysql.lib \
libmysql/$TARGET/mysqlclient.lib \
mysys/$TARGET/mysys.lib \
regex/$TARGET/regex.lib \
strings/$TARGET/strings.lib \
zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/
if [ -d storage/innodb_plugin ]; then
cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \
$DESTDIR/lib/plugin/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/$TARGET/semisync_master.dll \
plugin/semisync/$TARGET/semisync_slave.dll \
$DESTDIR/lib/plugin/
fi
if [ x"$TARGET" != x"release" ] ; then
cp libmysql/$TARGET/libmysql.pdb \
libmysql/$TARGET/mysqlclient.pdb \
mysys/$TARGET/mysys.pdb \
regex/$TARGET/regex.pdb \
strings/$TARGET/strings.pdb \
zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/
if [ -d storage/innodb_plugin ]; then
cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \
$DESTDIR/lib/plugin/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/$TARGET/semisync_master.pdb \
plugin/semisync/$TARGET/semisync_slave.pdb \
$DESTDIR/lib/plugin/
fi
fi
if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
x"$PACK_DEBUG" = x"yes" ] ; then
mkdir -p $DESTDIR/lib/debug
mkdir -p $DESTDIR/lib/plugin/debug
cp libmysql/debug/libmysql.dll \
libmysql/debug/libmysql.lib \
libmysql/debug/libmysql.pdb \
libmysql/debug/mysqlclient.lib \
libmysql/debug/mysqlclient.pdb \
mysys/debug/mysys.lib \
mysys/debug/mysys.pdb \
regex/debug/regex.lib \
regex/debug/regex.pdb \
strings/debug/strings.lib \
strings/debug/strings.pdb \
zlib/debug/zlib.lib \
zlib/debug/zlib.pdb $DESTDIR/lib/debug/
if [ -d storage/innodb_plugin ]; then
cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \
storage/innodb_plugin/debug/ha_innodb_plugin.lib \
storage/innodb_plugin/debug/ha_innodb_plugin.pdb \
$DESTDIR/lib/plugin/debug/
fi
if [ -d plugin/semisync ]; then
cp plugin/semisync/debug/semisync_master.dll \
plugin/semisync/debug/semisync_master.lib \
plugin/semisync/debug/semisync_master.pdb \
plugin/semisync/debug/semisync_slave.dll \
plugin/semisync/debug/semisync_slave.lib \
plugin/semisync/debug/semisync_slave.pdb \
$DESTDIR/lib/plugin/debug/
fi
fi
# ----------------------------------------------------------------------
# Copy the test directory
# ----------------------------------------------------------------------
mkdir $DESTDIR/mysql-test
cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/
cp mysql-test/mysql-stress-test.pl $DESTDIR/mysql-test/
cp mysql-test/README $DESTDIR/mysql-test/
cp -R mysql-test/{t,r,include,suite,std_data,lib,collections} $DESTDIR/mysql-test/
# Note that this will not copy "extra" if a soft link
if [ -d mysql-test/extra ] ; then
mkdir $DESTDIR/mysql-test/extra
cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/
fi
# ----------------------------------------------------------------------
# Copy what could be usable in the "scripts" directory
# ----------------------------------------------------------------------
mysql_scripts="\
mysql_config.pl \
mysql_convert_table_format.pl \
mysql_install_db.pl \
mysql_secure_installation.pl \
mysqld_multi.pl \
mysqldumpslow.pl \
mysqlhotcopy.pl \
"
mkdir -p $DESTDIR/scripts
for i in $mysql_scripts
do
cp scripts/$i $DESTDIR/scripts/$i
done
cp -pR sql/share $DESTDIR/
cp -pR sql-bench $DESTDIR/
rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile*
# The SQL initialisation code is to be in "share"
cp scripts/*.sql $DESTDIR/share/
# ----------------------------------------------------------------------
# Clean up from possibly copied SCCS directories
# ----------------------------------------------------------------------
rm -rf `find $DESTDIR -type d -name SCCS -print`
# ----------------------------------------------------------------------
# Copy other files specified on command line DEST=SOURCE
# ----------------------------------------------------------------------
for arg do
dst=`echo $arg | sed -n 's/=.*$//p'`
src=`echo $arg | sed -n 's/^.*=//p'`
if [ x"$dst" = x"" -o x"$src" = x"" ] ; then
echo "Invalid specification of what to copy"
usage
fi
mkdir -p `dirname $DESTDIR/$dst`
cp -pR "$src" $DESTDIR/$dst
done
# ----------------------------------------------------------------------
# Finally create the ZIP archive
# ----------------------------------------------------------------------
rm -f $NOINST_NAME.zip
zip -r $NOINST_NAME.zip $DESTDIR
rm -Rf $DESTDIR

View File

@ -61,10 +61,15 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MySQL system
tables on a different host than the target.
--datadir=path The path to the MySQL data directory.
--defaults-extra-file=name
Read this file after the global files are read.
--defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
--help Display this help and exit.
--ldata=path The path to the MySQL data directory. Same as --datadir.
--no-defaults Don't read default options from any option file.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating

View File

@ -46,10 +46,15 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MySQL system
tables on a different host than the target.
--datadir=path The path to the MySQL data directory.
--defaults-extra-file=name
Read this file after the global files are read.
--defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
--help Display this help and exit.
--ldata=path The path to the MySQL data directory. Same as --datadir.
--no-defaults Don't read default options from any option file.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating

View File

@ -23,9 +23,18 @@
#include <thr_alarm.h>
#include <sql_common.h>
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
CLIENT_SECURE_CONNECTION | CLIENT_TRANSACTIONS | \
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
/*
Note: CLIENT_CAPABILITIES is also defined in libmysql/client_settings.h.
When adding capabilities here, consider if they should be also added to
the libmysql version.
*/
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
CLIENT_LONG_FLAG | \
CLIENT_SECURE_CONNECTION | \
CLIENT_TRANSACTIONS | \
CLIENT_PROTOCOL_41 | \
CLIENT_SECURE_CONNECTION | \
CLIENT_PLUGIN_AUTH)
#define read_user_name(A) {}
#undef HAVE_SMEM

View File

@ -2869,6 +2869,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_INDEX_CORRUPT:
textno= ER_INDEX_CORRUPT;
break;
case HA_ERR_UNDO_REC_TOO_BIG:
textno= ER_UNDO_RECORD_TOO_BIG;
break;
default:
{
/* The error was "unknown" to this function.

View File

@ -6417,3 +6417,6 @@ ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
ER_INDEX_CORRUPT
eng "Index %s is corrupted"
ER_UNDO_RECORD_TOO_BIG
eng "Undo log record is too big."

View File

@ -4204,6 +4204,10 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
/* This one is not strictly needed but we have it here for completeness */
mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
/* Set MYSQL_PLUGIN_DIR in case master asks for an external authentication plugin */
if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
(reconnect ? mysql_reconnect(mysql) != 0 :
mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,

View File

@ -1845,6 +1845,7 @@ btr_cur_update_in_place(
roll_ptr_t roll_ptr = 0;
trx_t* trx;
ulint was_delete_marked;
ibool is_hashed;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
@ -1886,7 +1887,21 @@ btr_cur_update_in_place(
return(err);
}
if (block->is_hashed) {
if (!(flags & BTR_KEEP_SYS_FLAG)) {
row_upd_rec_sys_fields(rec, NULL,
index, offsets, trx, roll_ptr);
}
was_delete_marked = rec_get_deleted_flag(
rec, page_is_comp(buf_block_get_frame(block)));
is_hashed = block->is_hashed;
if (is_hashed) {
/* TO DO: Can we skip this if none of the fields
index->search_info->curr_n_fields
are being updated? */
/* The function row_upd_changes_ord_field_binary works only
if the update vector was built for a clustered index, we must
NOT call it if index is secondary */
@ -1902,17 +1917,9 @@ btr_cur_update_in_place(
rw_lock_x_lock(&btr_search_latch);
}
if (!(flags & BTR_KEEP_SYS_FLAG)) {
row_upd_rec_sys_fields(rec, NULL,
index, offsets, trx, roll_ptr);
}
was_delete_marked = rec_get_deleted_flag(
rec, page_is_comp(buf_block_get_frame(block)));
row_upd_rec_in_place(rec, index, offsets, update, page_zip);
if (block->is_hashed) {
if (is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
@ -2638,7 +2645,8 @@ btr_cur_parse_del_mark_set_clust_rec(
/* We do not need to reserve btr_search_latch, as the page
is only being recovered, and there cannot be a hash index to
it. */
it. Besides, these fields are being updated in place
and the adaptive hash index does not depend on them. */
btr_rec_set_deleted_flag(rec, page_zip, val);
@ -2718,9 +2726,9 @@ btr_cur_del_mark_set_clust_rec(
return(err);
}
if (block->is_hashed) {
rw_lock_x_lock(&btr_search_latch);
}
/* The btr_search_latch is not needed here, because
the adaptive hash index does not depend on the delete-mark
and the delete-mark is being updated in place. */
page_zip = buf_block_get_page_zip(block);
@ -2734,10 +2742,6 @@ btr_cur_del_mark_set_clust_rec(
index, offsets, trx, roll_ptr);
}
if (block->is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
btr_cur_del_mark_set_clust_rec_log(flags, rec, index, val, trx,
roll_ptr, mtr);
@ -2813,7 +2817,8 @@ btr_cur_parse_del_mark_set_sec_rec(
/* We do not need to reserve btr_search_latch, as the page
is only being recovered, and there cannot be a hash index to
it. */
it. Besides, the delete-mark flag is being updated in place
and the adaptive hash index does not depend on it. */
btr_rec_set_deleted_flag(rec, page_zip, val);
}
@ -2861,16 +2866,11 @@ btr_cur_del_mark_set_sec_rec(
ut_ad(!!page_rec_is_comp(rec)
== dict_table_is_comp(cursor->index->table));
if (block->is_hashed) {
rw_lock_x_lock(&btr_search_latch);
}
/* We do not need to reserve btr_search_latch, as the
delete-mark flag is being updated in place and the adaptive
hash index does not depend on it. */
btr_rec_set_deleted_flag(rec, buf_block_get_page_zip(block), val);
if (block->is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
btr_cur_del_mark_set_sec_rec_log(rec, val, mtr);
return(DB_SUCCESS);
@ -2891,8 +2891,11 @@ btr_cur_set_deleted_flag_for_ibuf(
ibool val, /*!< in: value to set */
mtr_t* mtr) /*!< in: mtr */
{
/* We do not need to reserve btr_search_latch, as the page has just
been read to the buffer pool and there cannot be a hash index to it. */
/* We do not need to reserve btr_search_latch, as the page
has just been read to the buffer pool and there cannot be
a hash index to it. Besides, the delete-mark flag is being
updated in place and the adaptive hash index does not depend
on it. */
btr_rec_set_deleted_flag(rec, page_zip, val);

View File

@ -330,7 +330,6 @@ buf_buddy_relocate(
{
buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i;
ullint usec = ut_time_us(NULL);
mutex_t* mutex;
ulint space;
ulint page_no;
@ -397,6 +396,7 @@ buf_buddy_relocate(
if (buf_page_can_relocate(bpage)) {
/* Relocate the compressed page. */
ullint usec = ut_time_us(NULL);
ut_a(bpage->zip.data == src);
memcpy(dst, src, size);
bpage->zip.data = dst;

View File

@ -2990,19 +2990,20 @@ buf_page_init_low(
/********************************************************************//**
Inits a page to the buffer buf_pool. */
static
static __attribute__((nonnull))
void
buf_page_init(
/*==========*/
buf_pool_t* buf_pool,/*!< in/out: buffer pool */
ulint space, /*!< in: space id */
ulint offset, /*!< in: offset of the page within space
in units of a page */
ulint fold, /*!< in: buf_page_address_fold(space,offset) */
buf_block_t* block) /*!< in: block to init */
buf_block_t* block) /*!< in/out: block to init */
{
buf_page_t* hash_page;
buf_pool_t* buf_pool = buf_pool_get(space, offset);
ut_ad(buf_pool == buf_pool_get(space, offset));
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(&(block->mutex)));
ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE);
@ -3161,7 +3162,7 @@ err_exit:
ut_ad(buf_pool_from_bpage(bpage) == buf_pool);
buf_page_init(space, offset, fold, block);
buf_page_init(buf_pool, space, offset, fold, block);
/* The block must be put to the LRU list, to the old blocks */
buf_LRU_add_block(bpage, TRUE/* to old blocks */);
@ -3365,7 +3366,7 @@ buf_page_create(
mutex_enter(&block->mutex);
buf_page_init(space, offset, fold, block);
buf_page_init(buf_pool, space, offset, fold, block);
/* The block must be put to the LRU list */
buf_LRU_add_block(&block->page, FALSE);

View File

@ -1045,6 +1045,8 @@ convert_error_code_to_mysql(
return(HA_ERR_UNSUPPORTED);
case DB_INDEX_CORRUPT:
return(HA_ERR_INDEX_CORRUPT);
case DB_UNDO_RECORD_TOO_BIG:
return(HA_ERR_UNDO_REC_TOO_BIG);
}
}

View File

@ -2210,17 +2210,17 @@ ibuf_add_free_page(void)
buf_block_t* block = buf_page_get(
IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
ibuf_enter(&mtr);
mutex_enter(&ibuf_mutex);
root = ibuf_tree_root_get(&mtr);
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
page = buf_block_get_frame(block);
}
ibuf_enter(&mtr);
mutex_enter(&ibuf_mutex);
root = ibuf_tree_root_get(&mtr);
/* Add the page to the free list and update the ibuf size data */
flst_add_last(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,

View File

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -111,6 +111,7 @@ enum db_err {
DB_TOO_BIG_INDEX_COL, /* index column size exceeds maximum
limit */
DB_INDEX_CORRUPT, /* we have corrupted index */
DB_UNDO_RECORD_TOO_BIG, /* the undo log record is too big */
/* The following are partial failure codes */
DB_FAIL = 1000,

View File

@ -68,10 +68,7 @@ typedef byte page_header_t;
#define PAGE_MAX_TRX_ID 18 /* highest id of a trx which may have modified
a record on the page; trx_id_t; defined only
in secondary indexes and in the insert buffer
tree; NOTE: this may be modified only
when the thread has an x-latch to the page,
and ALSO an x-latch to btr_search_latch
if there is a hash index to the page! */
tree */
#define PAGE_HEADER_PRIV_END 26 /* end of private data structure of the page
header which are set in a page create */
/*----*/

View File

@ -157,11 +157,6 @@ row_upd_rec_sys_fields(
{
ut_ad(dict_index_is_clust(index));
ut_ad(rec_offs_validate(rec, index, offsets));
#ifdef UNIV_SYNC_DEBUG
if (!rw_lock_own(&btr_search_latch, RW_LOCK_EX)) {
ut_ad(!buf_block_align(rec)->is_hashed);
}
#endif /* UNIV_SYNC_DEBUG */
if (UNIV_LIKELY_NULL(page_zip)) {
ulint pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);

View File

@ -684,7 +684,6 @@ or row lock! */
#define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
#define SYNC_DOUBLEWRITE 140
#define SYNC_ANY_LATCH 135
#define SYNC_THR_LOCAL 133
#define SYNC_MEM_HASH 131
#define SYNC_MEM_POOL 130

View File

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -204,17 +204,51 @@ trx_undo_add_page(
mtr_t* mtr); /*!< in: mtr which does not have a latch to any
undo log page; the caller must have reserved
the rollback segment mutex */
/********************************************************************//**
Frees the last undo log page.
The caller must hold the rollback segment mutex. */
UNIV_INTERN
void
trx_undo_free_last_page_func(
/*==========================*/
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in/out: undo log memory copy */
mtr_t* mtr) /*!< in/out: mini-transaction which does not
have a latch to any undo log page or which
has allocated the undo log page */
__attribute__((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_free_last_page(trx,undo,mtr) \
trx_undo_free_last_page_func(trx,undo,mtr)
#else /* UNIV_DEBUG */
# define trx_undo_free_last_page(trx,undo,mtr) \
trx_undo_free_last_page_func(undo,mtr)
#endif /* UNIV_DEBUG */
/***********************************************************************//**
Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
/*==================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
trx_undo_t* undo, /*!< in: undo log */
undo_no_t limit); /*!< in: all undo records with undo number
trx_undo_truncate_end_func(
/*=======================*/
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in/out: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
__attribute__((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(trx,undo,limit)
#else /* UNIV_DEBUG */
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(undo,limit)
#endif /* UNIV_DEBUG */
/***********************************************************************//**
Truncates an undo log from the start. This function is used during a purge
operation. */

View File

@ -576,6 +576,7 @@ handle_new_error:
case DB_DUPLICATE_KEY:
case DB_FOREIGN_DUPLICATE_KEY:
case DB_TOO_BIG_RECORD:
case DB_UNDO_RECORD_TOO_BIG:
case DB_ROW_IS_REFERENCED:
case DB_NO_REFERENCED_ROW:
case DB_CANNOT_ADD_CONSTRAINT:
@ -3246,6 +3247,19 @@ check_next_foreign:
"index_id CHAR;\n"
"foreign_id CHAR;\n"
"found INT;\n"
"DECLARE CURSOR cur_fk IS\n"
"SELECT ID FROM SYS_FOREIGN\n"
"WHERE FOR_NAME = :table_name\n"
"AND TO_BINARY(FOR_NAME)\n"
" = TO_BINARY(:table_name)\n"
"LOCK IN SHARE MODE;\n"
"DECLARE CURSOR cur_idx IS\n"
"SELECT ID FROM SYS_INDEXES\n"
"WHERE TABLE_ID = table_id\n"
"LOCK IN SHARE MODE;\n"
"BEGIN\n"
"SELECT ID INTO table_id\n"
"FROM SYS_TABLES\n"
@ -3268,13 +3282,9 @@ check_next_foreign:
"IF (:table_name = 'SYS_FOREIGN_COLS') THEN\n"
" found := 0;\n"
"END IF;\n"
"OPEN cur_fk;\n"
"WHILE found = 1 LOOP\n"
" SELECT ID INTO foreign_id\n"
" FROM SYS_FOREIGN\n"
" WHERE FOR_NAME = :table_name\n"
" AND TO_BINARY(FOR_NAME)\n"
" = TO_BINARY(:table_name)\n"
" LOCK IN SHARE MODE;\n"
" FETCH cur_fk INTO foreign_id;\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE\n"
@ -3284,12 +3294,11 @@ check_next_foreign:
" WHERE ID = foreign_id;\n"
" END IF;\n"
"END LOOP;\n"
"CLOSE cur_fk;\n"
"found := 1;\n"
"OPEN cur_idx;\n"
"WHILE found = 1 LOOP\n"
" SELECT ID INTO index_id\n"
" FROM SYS_INDEXES\n"
" WHERE TABLE_ID = table_id\n"
" LOCK IN SHARE MODE;\n"
" FETCH cur_idx INTO index_id;\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE\n"
@ -3300,6 +3309,7 @@ check_next_foreign:
" AND TABLE_ID = table_id;\n"
" END IF;\n"
"END LOOP;\n"
"CLOSE cur_idx;\n"
"DELETE FROM SYS_COLUMNS\n"
"WHERE TABLE_ID = table_id;\n"
"DELETE FROM SYS_TABLES\n"

View File

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@ -99,14 +99,22 @@ row_sel_sec_rec_is_for_blob(
ulint clust_len, /*!< in: length of clust_field */
const byte* sec_field, /*!< in: column in secondary index */
ulint sec_len, /*!< in: length of sec_field */
ulint prefix_len, /*!< in: index column prefix length
in bytes */
dict_table_t* table) /*!< in: table */
{
ulint len;
byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN];
ulint zip_size = dict_table_flags_to_zip_size(table->flags);
ulint max_prefix_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
/* This function should never be invoked on an Antelope format
table, because they should always contain enough prefix in the
clustered index record. */
ut_ad(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE);
ut_ad(prefix_len >= sec_len);
ut_ad(prefix_len > 0);
ut_a(prefix_len <= sizeof buf);
if (UNIV_UNLIKELY
(!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE,
@ -118,7 +126,7 @@ row_sel_sec_rec_is_for_blob(
return(FALSE);
}
len = btr_copy_externally_stored_field_prefix(buf, max_prefix_len,
len = btr_copy_externally_stored_field_prefix(buf, prefix_len,
zip_size,
clust_field, clust_len);
@ -132,7 +140,7 @@ row_sel_sec_rec_is_for_blob(
}
len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen,
sec_len, len, (const char*) buf);
prefix_len, len, (const char*) buf);
return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len));
}
@ -224,6 +232,7 @@ row_sel_sec_rec_is_for_clust_rec(
col->mbminmaxlen,
clust_field, clust_len,
sec_field, sec_len,
ifield->prefix_len,
clust_index->table)) {
goto inequal;
}
@ -493,7 +502,7 @@ sel_col_prefetch_buf_alloc(
sel_buf = column->prefetch_buf + i;
sel_buf->data = NULL;
sel_buf->len = 0;
sel_buf->val_buf_size = 0;
}
}
@ -518,6 +527,8 @@ sel_col_prefetch_buf_free(
mem_free(sel_buf->data);
}
}
mem_free(prefetch_buf);
}
/*********************************************************************//**

View File

@ -1214,7 +1214,6 @@ sync_thread_add_level(
case SYNC_WORK_QUEUE:
case SYNC_LOG:
case SYNC_LOG_FLUSH_ORDER:
case SYNC_THR_LOCAL:
case SYNC_ANY_LATCH:
case SYNC_FILE_FORMAT_TAG:
case SYNC_DOUBLEWRITE:
@ -1339,8 +1338,7 @@ sync_thread_add_level(
break;
case SYNC_IBUF_INDEX_TREE:
if (sync_thread_levels_contain(array, SYNC_FSP)) {
ut_a(sync_thread_levels_g(
array, SYNC_FSP_PAGE - 1, TRUE));
ut_a(sync_thread_levels_g(array, level - 1, TRUE));
} else {
ut_a(sync_thread_levels_g(
array, SYNC_IBUF_TREE_NODE - 1, TRUE));

View File

@ -669,7 +669,6 @@ trx_undo_page_report_modify(
/* Save to the undo log the old values of the columns to be updated. */
if (update) {
if (trx_undo_left(undo_page, ptr) < 5) {
return(0);
@ -1119,13 +1118,14 @@ trx_undo_rec_get_partial_row(
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************//**
Erases the unused undo log page end. */
static
void
Erases the unused undo log page end.
@return TRUE if the page contained something, FALSE if it was empty */
static __attribute__((nonnull))
ibool
trx_undo_erase_page_end(
/*====================*/
page_t* undo_page, /*!< in: undo page whose end to erase */
mtr_t* mtr) /*!< in: mtr */
page_t* undo_page, /*!< in/out: undo page whose end to erase */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
ulint first_free;
@ -1135,6 +1135,7 @@ trx_undo_erase_page_end(
(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) - first_free);
mlog_write_initial_log_record(undo_page, MLOG_UNDO_ERASE_END, mtr);
return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
}
/***********************************************************//**
@ -1202,6 +1203,9 @@ trx_undo_report_row_operation(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
#ifdef UNIV_DEBUG
int loop_count = 0;
#endif /* UNIV_DEBUG */
rec_offs_init(offsets_);
ut_a(dict_index_is_clust(index));
@ -1264,7 +1268,7 @@ trx_undo_report_row_operation(
mtr_start(&mtr);
for (;;) {
do {
buf_block_t* undo_block;
page_t* undo_page;
ulint offset;
@ -1293,7 +1297,31 @@ trx_undo_report_row_operation(
version the replicate page constructed using the log
records stays identical to the original page */
trx_undo_erase_page_end(undo_page, &mtr);
if (!trx_undo_erase_page_end(undo_page, &mtr)) {
/* The record did not fit on an empty
undo page. Discard the freshly allocated
page and return an error. */
/* When we remove a page from an undo
log, this is analogous to a
pessimistic insert in a B-tree, and we
must reserve the counterpart of the
tree latch, which is the rseg
mutex. We must commit the mini-transaction
first, because it may be holding lower-level
latches, such as SYNC_FSP and SYNC_FSP_PAGE. */
mtr_commit(&mtr);
mtr_start(&mtr);
mutex_enter(&rseg->mutex);
trx_undo_free_last_page(trx, undo, &mtr);
mutex_exit(&rseg->mutex);
err = DB_UNDO_RECORD_TOO_BIG;
goto err_exit;
}
mtr_commit(&mtr);
} else {
/* Success */
@ -1313,16 +1341,15 @@ trx_undo_report_row_operation(
*roll_ptr = trx_undo_build_roll_ptr(
op_type == TRX_UNDO_INSERT_OP,
rseg->id, page_no, offset);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(DB_SUCCESS);
err = DB_SUCCESS;
goto func_exit;
}
ut_ad(page_no == undo->last_page_no);
/* We have to extend the undo log by one page */
ut_ad(++loop_count < 2);
mtr_start(&mtr);
/* When we add a page to an undo log, this is analogous to
@ -1334,18 +1361,19 @@ trx_undo_report_row_operation(
page_no = trx_undo_add_page(trx, undo, &mtr);
mutex_exit(&(rseg->mutex));
} while (UNIV_LIKELY(page_no != FIL_NULL));
if (UNIV_UNLIKELY(page_no == FIL_NULL)) {
/* Did not succeed: out of space */
/* Did not succeed: out of space */
err = DB_OUT_OF_FILE_SPACE;
mutex_exit(&(trx->undo_mutex));
mtr_commit(&mtr);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(DB_OUT_OF_FILE_SPACE);
}
err_exit:
mutex_exit(&trx->undo_mutex);
mtr_commit(&mtr);
func_exit:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(err);
}
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/

View File

@ -1004,29 +1004,28 @@ trx_undo_free_page(
}
/********************************************************************//**
Frees an undo log page when there is also the memory object for the undo
log. */
static
Frees the last undo log page.
The caller must hold the rollback segment mutex. */
UNIV_INTERN
void
trx_undo_free_page_in_rollback(
/*===========================*/
trx_t* trx __attribute__((unused)), /*!< in: transaction */
trx_undo_t* undo, /*!< in: undo log memory copy */
ulint page_no,/*!< in: page number to free: must not be the
header page */
mtr_t* mtr) /*!< in: mtr which does not have a latch to any
undo log page; the caller must have reserved
the rollback segment mutex */
trx_undo_free_last_page_func(
/*==========================*/
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in/out: undo log memory copy */
mtr_t* mtr) /*!< in/out: mini-transaction which does not
have a latch to any undo log page or which
has allocated the undo log page */
{
ulint last_page_no;
ut_ad(mutex_own(&trx->undo_mutex));
ut_ad(undo->hdr_page_no != undo->last_page_no);
ut_ad(undo->size > 0);
ut_ad(undo->hdr_page_no != page_no);
ut_ad(mutex_own(&(trx->undo_mutex)));
undo->last_page_no = trx_undo_free_page(
undo->rseg, FALSE, undo->space,
undo->hdr_page_no, undo->last_page_no, mtr);
last_page_no = trx_undo_free_page(undo->rseg, FALSE, undo->space,
undo->hdr_page_no, page_no, mtr);
undo->last_page_no = last_page_no;
undo->size--;
}
@ -1062,9 +1061,11 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
trx_undo_truncate_end(
/*==================*/
trx_t* trx, /*!< in: transaction whose undo log it is */
trx_undo_truncate_end_func(
/*=======================*/
#ifdef UNIV_DEBUG
const trx_t* trx, /*!< in: transaction whose undo log it is */
#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
@ -1090,18 +1091,7 @@ trx_undo_truncate_end(
rec = trx_undo_page_get_last_rec(undo_page, undo->hdr_page_no,
undo->hdr_offset);
for (;;) {
if (rec == NULL) {
if (last_page_no == undo->hdr_page_no) {
goto function_exit;
}
trx_undo_free_page_in_rollback(
trx, undo, last_page_no, &mtr);
break;
}
while (rec) {
if (trx_undo_rec_get_undo_no(rec) >= limit) {
/* Truncate at least this record off, maybe
more */
@ -1115,6 +1105,14 @@ trx_undo_truncate_end(
undo->hdr_offset);
}
if (last_page_no == undo->hdr_page_no) {
goto function_exit;
}
ut_ad(last_page_no == undo->last_page_no);
trx_undo_free_last_page(trx, undo, &mtr);
mtr_commit(&mtr);
}

View File

@ -714,6 +714,8 @@ ut_strerr(
return("No index on referenced keys in referenced table");
case DB_INDEX_CORRUPT:
return("Index corrupted");
case DB_UNDO_RECORD_TOO_BIG:
return("Undo record too big");
case DB_END_OF_INDEX:
return("End of index");
/* do not add default: in order to produce a warning if new code

View File

@ -360,7 +360,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
int subkeys=1;
my_bool can_go_down;
MI_INFO *info=ftb->info;
uint UNINIT_VAR(off), extra=HA_FT_WLEN+info->s->base.rec_reflength;
uint UNINIT_VAR(off), extra= HA_FT_WLEN + info->s->rec_reflength;
uchar *lastkey_buf=ftbw->word+ftbw->off;
if (ftbw->flags & FTB_FLAG_TRUNC)

View File

@ -72,7 +72,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr];
uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
uint extra= HA_FT_WLEN + info->s->rec_reflength;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight;
#else

View File

@ -3899,7 +3899,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
SORT_FT_BUF *ft_buf=sort_info->ft_buf;
SORT_KEY_BLOCKS *key_block=sort_info->key_block;
val_len=HA_FT_WLEN+sort_info->info->s->base.rec_reflength;
val_len= HA_FT_WLEN + sort_info->info->s->rec_reflength;
get_key_full_length_rdonly(a_len, (uchar *)a);
if (!ft_buf)
@ -3909,7 +3909,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
and row format is NOT static - for _mi_dpointer not to garble offsets
*/
if ((sort_info->info->s->base.key_reflength <=
sort_info->info->s->base.rec_reflength) &&
sort_info->info->s->rec_reflength) &&
(sort_info->info->s->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
ft_buf=(SORT_FT_BUF *)my_malloc(sort_param->keyinfo->block_length +

View File

@ -519,7 +519,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if (keyinfo->block_length - a_length < 32 &&
keyinfo->flag & HA_FULLTEXT && key_pos == endpos &&
info->s->base.key_reflength <= info->s->base.rec_reflength &&
info->s->base.key_reflength <= info->s->rec_reflength &&
info->s->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))
{
/*

View File

@ -46,7 +46,7 @@
see if it is possible to get rid of malloc().
this constant is sufficient to avoid malloc() on all inputs I have tried.
*/
#define DTOA_BUFF_SIZE (420 * sizeof(void *))
#define DTOA_BUFF_SIZE (460 * sizeof(void *))
/* Magic value returned by dtoa() to indicate overflow */
#define DTOA_OVERFLOW 9999
@ -659,6 +659,7 @@ typedef struct Stack_alloc
static Bigint *Balloc(int k, Stack_alloc *alloc)
{
Bigint *rv;
DBUG_ASSERT(k <= Kmax);
if (k <= Kmax && alloc->freelist[k])
{
rv= alloc->freelist[k];
@ -1005,7 +1006,7 @@ static Bigint p5_a[]=
static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc)
{
Bigint *b1, *p5, *p51;
Bigint *b1, *p5, *p51=NULL;
int i;
static int p05[3]= { 5, 25, 125 };
@ -1037,6 +1038,8 @@ static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc)
p5= p51;
}
}
if (p51)
Bfree(p51, alloc);
return b;
}

View File

@ -139,43 +139,62 @@
%endif
%endif
%else
%if %(test -f /etc/redhat-release && echo 1 || echo 0)
%define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%rhelver" == "4"
%define distro_description Red Hat Enterprise Linux 4
%define distro_releasetag rhel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%if %(test -f /etc/oracle-release && echo 1 || echo 0)
%define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%elver" == "6"
%define distro_description Oracle Linux 6
%define distro_releasetag el6
%define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%rhelver" == "5"
%define distro_description Red Hat Enterprise Linux 5
%define distro_releasetag rhel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
%endif
%{error:Oracle Linux %{elver} is unsupported}
%endif
%else
%if %(test -f /etc/SuSE-release && echo 1 || echo 0)
%define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
%if "%susever" == "10"
%define distro_description SUSE Linux Enterprise Server 10
%define distro_releasetag sles10
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%if %(test -f /etc/redhat-release && echo 1 || echo 0)
%define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%rhelver" == "4"
%define distro_description Red Hat Enterprise Linux 4
%define distro_releasetag rhel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%susever" == "11"
%define distro_description SUSE Linux Enterprise Server 11
%define distro_releasetag sles11
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%if "%rhelver" == "5"
%define distro_description Red Hat Enterprise Linux 5
%define distro_releasetag rhel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:SuSE %{susever} is unsupported}
%if "%rhelver" == "6"
%define distro_description Red Hat Enterprise Linux 6
%define distro_releasetag rhel6
%define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
%endif
%endif
%endif
%else
%{error:Unsupported distribution}
%if %(test -f /etc/SuSE-release && echo 1 || echo 0)
%define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
%if "%susever" == "10"
%define distro_description SUSE Linux Enterprise Server 10
%define distro_releasetag sles10
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%else
%if "%susever" == "11"
%define distro_description SUSE Linux Enterprise Server 11
%define distro_releasetag sles11
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%else
%{error:SuSE %{susever} is unsupported}
%endif
%endif
%else
%{error:Unsupported distribution}
%endif
%endif
%endif
%endif
@ -444,25 +463,6 @@ mkdir release
make ${MAKE_JFLAG} VERBOSE=1
)
# Use the build root for temporary storage of the shared libraries.
RBR=$RPM_BUILD_ROOT
# Clean up the BuildRoot first
[ "$RBR" != "/" ] && [ -d "$RBR" ] && rm -rf "$RBR";
# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). This
# needs to be during build phase as $CC is not set during install.
if "$CC" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1
then
libgcc=`$CC $CFLAGS --print-libgcc-file`
if [ -f $libgcc ]
then
mkdir -p $RBR%{_libdir}/mysql
install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
fi
fi
##############################################################################
%install
@ -485,6 +485,23 @@ install -d $RBR%{_sbindir}
make DESTDIR=$RBR install
)
# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). Do
# this in a sub-shell to ensure we don't pollute the install environment
# with compiler bits.
(
PATH=${MYSQL_BUILD_PATH:-$PATH}
CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
if "${CC}" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1; then
libgcc=`${CC} ${CFLAGS} --print-libgcc-file`
if [ -f ${libgcc} ]; then
mkdir -p $RBR%{_libdir}/mysql
install -m 644 ${libgcc} $RBR%{_libdir}/mysql/libmygcc.a
echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
fi
fi
)
# FIXME: at some point we should stop doing this and just install everything
# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
@ -516,7 +533,7 @@ install -m 644 "%{malloc_lib_source}" \
# Remove man pages we explicitly do not want to package, avoids 'unpackaged
# files' warning.
rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
# This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
##############################################################################
# Post processing actions, i.e. when installed
@ -970,6 +987,7 @@ echo "=====" >> $STATUS_HISTORY
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
@ -996,11 +1014,11 @@ echo "=====" >> $STATUS_HISTORY
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
%attr(755, root, root) %{_bindir}/mysql_install_db
%attr(755, root, root) %{_bindir}/mysql_plugin
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
%attr(755, root, root) %{_bindir}/mysql_upgrade
%attr(755, root, root) %{_bindir}/mysql_plugin
%attr(755, root, root) %{_bindir}/mysql_zap
%attr(755, root, root) %{_bindir}/mysqlbug
%attr(755, root, root) %{_bindir}/mysqld_multi
@ -1133,6 +1151,21 @@ echo "=====" >> $STATUS_HISTORY
# merging BK trees)
##############################################################################
%changelog
* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to
changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
this necessitated a move of the libmygcc.a installation to the install
phase, which is probably where it belonged in the first place.
* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- "make_win_bin_dist" and its manual are dropped, cmake does it different.
* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Add the manual page for "mysql_plugin" to the server package.
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Null-upmerge the fix of bug#37165: This spec file is not affected.