Commit 86197400 authored by tomas@poseidon.ndb.mysql.com's avatar tomas@poseidon.ndb.mysql.com

Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0

into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
parents bca4f687 dd6958eb
...@@ -22,7 +22,6 @@ use Getopt::Long; ...@@ -22,7 +22,6 @@ use Getopt::Long;
Getopt::Long::Configure ("bundling"); Getopt::Long::Configure ("bundling");
use Sys::Hostname; use Sys::Hostname;
$opt_nobuild = undef;
$opt_cc= undef; $opt_cc= undef;
$opt_cflags= undef; $opt_cflags= undef;
$opt_clean= undef; $opt_clean= undef;
...@@ -33,6 +32,9 @@ $opt_help= undef; ...@@ -33,6 +32,9 @@ $opt_help= undef;
$opt_log= undef; $opt_log= undef;
$opt_mail= ""; $opt_mail= "";
$opt_verbose= undef; $opt_verbose= undef;
$opt_susebuild= undef;
$opt_susebuildroot= undef;
$opt_suserpms= undef;
# Set a dummy version until we know the correct one # Set a dummy version until we know the correct one
$VERSION= "x.y.z"; $VERSION= "x.y.z";
...@@ -49,7 +51,9 @@ GetOptions( ...@@ -49,7 +51,9 @@ GetOptions(
"help|h", "help|h",
"log|l:s", "log|l:s",
"mail|m=s", "mail|m=s",
"nobuild", "susebuild|s",
"susebuildroot|r=s",
"suserpms=s",
"verbose|v", "verbose|v",
) || &print_help; ) || &print_help;
...@@ -57,6 +61,20 @@ GetOptions( ...@@ -57,6 +61,20 @@ GetOptions(
defined($SPECFILE=$ARGV[0]) || print_help("Please provide the spec file name!"); defined($SPECFILE=$ARGV[0]) || print_help("Please provide the spec file name!");
&print_help("Please define the location of the RPM repository!") if $opt_susebuild && !($opt_suserpms || $ENV{BUILD_RPMS});
unless ($opt_susebuildroot)
{
if ($ENV{BUILD_ROOT})
{
$opt_susebuildroot= $ENV{BUILD_ROOT};
}
else
{
$opt_susebuildroot="/var/tmp/build-root";
}
}
# Include helper functions # Include helper functions
$PWD= cwd(); $PWD= cwd();
$LOGGER= "$PWD/logger.pm"; $LOGGER= "$PWD/logger.pm";
...@@ -72,7 +90,7 @@ else ...@@ -72,7 +90,7 @@ else
$subject= "RPM build for $SPECFILE failed" if $opt_mail; $subject= "RPM build for $SPECFILE failed" if $opt_mail;
# Open the spec file and extract the version number # Open the spec file and extract the version number
open(SPEC, $SPECFILE) or &abort("Unable to open \"$ARGV[0]\": $!"); open(SPEC, $SPECFILE) or die "Unable to open \"$ARGV[0]\": $!";
@spec= <SPEC>; @spec= <SPEC>;
close SPEC; close SPEC;
...@@ -94,7 +112,7 @@ $HOST= hostname(); ...@@ -94,7 +112,7 @@ $HOST= hostname();
$HOST=~ /^([^.-]*)/; $HOST=~ /^([^.-]*)/;
$HOST= $1; $HOST= $1;
$LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; $LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log";
&logger("Using spec file for version: $VERSION"); &logger("Logging to $LOGFILE");
# #
# Override predefined Log file name # Override predefined Log file name
...@@ -114,41 +132,91 @@ if (defined $opt_log) ...@@ -114,41 +132,91 @@ if (defined $opt_log)
} }
} }
# &logger("Using spec file for version: $VERSION");
# Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs
# if ($opt_susebuild)
if (-x "/usr/bin/rpmbuild")
{ {
$RPM= "/usr/bin/rpmbuild"; &susebuild;
$RMSOURCE= "--rmsource --rmspec";
} }
else else
{ {
$RPM= "/bin/rpm"; &rpmbuild;
$RMSOURCE= "--rmspec";
} }
if ($RPM) &logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
{ exit 0;
&logger("Found rpm binary: $RPM");
} #
else # Build using SUSE's "build" script
#
sub susebuild
{ {
&abort("Unable to find RPM binary!"); $BUILD= "/usr/bin/build";
( -x $BUILD) ? &logger("$BUILD found, proceeding.") : &abort("$BUILD could not be found!");
$command= "sudo $BUILD --clean";
$command.= " --root=$opt_susebuildroot";
$command.= " --rpms=$opt_suserpms" if $opt_suserpms;
$command.= " $SPECFILE";
&logger("Building RPMs using SUSE build.");
&run_command($command, "Error while running the SUSE RPM build!");
#
# Move the resulting RPMs into the pwd - we can use broad globs here
# as the build root has been cleaned up before so there should not be
# any residuals from previous build runs
#
$command= "cp";
$command.= " -v " if ($opt_verbose);
$command.= " $opt_susebuildroot/usr/src/packages/SRPMS/MySQL*.src.rpm $PWD";
&logger("Copying source RPM to current dir.");
&run_command($command, "Error moving source RPM!");
$command= "cp";
$command.= " -v " if ($opt_verbose);
$command.= " $opt_susebuildroot/usr/src/packages/RPMS/*/MySQL*.rpm $PWD";
&logger("Copying binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");
} }
# #
# determine some RPM settings for this host # Build using "plain" RPM
# #
chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); sub rpmbuild
chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); {
chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`);
chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); #
chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); # Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs
#
if (-x "/usr/bin/rpmbuild")
{
$RPM= "/usr/bin/rpmbuild";
$RMSOURCE= "--rmsource --rmspec";
}
else
{
$RPM= "/bin/rpm";
$RMSOURCE= "--rmspec";
}
if ($RPM)
{
&logger("Found rpm binary: $RPM");
}
else
{
&abort("Unable to find RPM binary!");
}
$SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; #
# determine some RPM settings for this host
#
chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`);
chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`);
chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`);
chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`);
chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`);
unless($opt_nobuild) { $SOURCEFILE= glob "mysql*-$VERSION.tar.gz";
&logger("Starting RPM build of MySQL-$VERSION on $HOST"); &logger("Starting RPM build of MySQL-$VERSION on $HOST");
...@@ -157,9 +225,9 @@ unless($opt_nobuild) { ...@@ -157,9 +225,9 @@ unless($opt_nobuild) {
&abort("Unable to find $file!") unless (-f "$file"); &abort("Unable to find $file!") unless (-f "$file");
} }
# #
# Install source and spec file # Install source and spec file
# #
&logger("Copying SOURCE and SPEC file to build directories."); &logger("Copying SOURCE and SPEC file to build directories.");
unless ($opt_dry_run) unless ($opt_dry_run)
{ {
...@@ -169,10 +237,10 @@ unless($opt_nobuild) { ...@@ -169,10 +237,10 @@ unless($opt_nobuild) {
or &abort("Unable to copy $SPECFILE to $SPECDIR!"); or &abort("Unable to copy $SPECFILE to $SPECDIR!");
} }
# #
# Set environment variables - these are being used in the # Set environment variables - these are being used in the
# official MySQL RPM spec file # official MySQL RPM spec file
# #
&logger("Setting special build environment variables") &logger("Setting special build environment variables")
if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx);
$ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); $ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc);
...@@ -180,9 +248,9 @@ unless($opt_nobuild) { ...@@ -180,9 +248,9 @@ unless($opt_nobuild) {
$ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); $ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags);
$ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
# #
# Build the RPMs # Build the RPMs
# #
$command= "$RPM"; $command= "$RPM";
$command.= " -v" if ($opt_verbose); $command.= " -v" if ($opt_verbose);
$command.= " -ba"; $command.= " -ba";
...@@ -191,26 +259,22 @@ unless($opt_nobuild) { ...@@ -191,26 +259,22 @@ unless($opt_nobuild) {
$command.= basename($SPECFILE); $command.= basename($SPECFILE);
&logger("Building RPM."); &logger("Building RPM.");
&run_command($command, "Error while building the RPMs!"); &run_command($command, "Error while building the RPMs!");
}
#
# Move the resulting RPMs into the pwd
#
$command= "mv";
$command.= " -v " if ($opt_verbose);
$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD";
&logger("Moving source RPM to current dir.");
&run_command($command, "Error moving source RPM!");
$command= "mv";
$command.= " -v " if ($opt_verbose);
# $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); #
exit 0; # Move the resulting RPMs into the pwd
#
$command= "mv";
$command.= " -v " if ($opt_verbose);
$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD";
&logger("Moving source RPM to current dir.");
&run_command($command, "Error moving source RPM!");
$command= "mv";
$command.= " -v " if ($opt_verbose);
$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");
}
sub print_help sub print_help
{ {
...@@ -218,7 +282,7 @@ sub print_help ...@@ -218,7 +282,7 @@ sub print_help
if ($message ne "") if ($message ne "")
{ {
print "\n"; print "\n";
print "ERROR: $message\n\n}"; print "ERROR: $message\n\n";
} }
print <<EOF; print <<EOF;
...@@ -241,12 +305,22 @@ Options: ...@@ -241,12 +305,22 @@ Options:
-t, --dry-run Dry run without executing -t, --dry-run Dry run without executing
-h, --help Print this help -h, --help Print this help
-l, --log[=<filename>] Write a log file [to <filename>] -l, --log[=<filename>] Write a log file [to <filename>]
(default is "$LOGFILE")
-m, --mail=<address> Mail a failure report to the given address -m, --mail=<address> Mail a failure report to the given address
(and include a log file snippet, if logging (and include a log file snippet, if logging
is enabled) is enabled)
Note that the \@-Sign needs to be quoted! Note that the \@-Sign needs to be quoted!
Example: --mail=user\\\@domain.com Example: --mail=user\\\@domain.com
-s, --susebuild Use the SUSE "build" script instead of RPM
directly (requires sudo privileges to run the
/usr/bin/build command)
-r, --susebuildroot=<root> Use <root> as the build root directory for the
SUSE "build" (default is /var/tmp/build-root
or defined by the BUILD_ROOT environment
variable)
--suserpms=<path> Path to the SUSE RPM repository to build up
the build root (mandatory option when using
--susebuild and the BUILD_RPMS environment
variable is not set.)
-v, --verbose Verbose execution -v, --verbose Verbose execution
Example: Example:
......
...@@ -540,6 +540,7 @@ if [ x$SOURCE_DIST = x1 ] ; then ...@@ -540,6 +540,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
INSTALL_DB="./install_test_db" INSTALL_DB="./install_test_db"
MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
NDB_TOOLS_DIR="$BASEDIR/ndb/tools" NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
else else
if test -x "$BASEDIR/libexec/mysqld" if test -x "$BASEDIR/libexec/mysqld"
then then
...@@ -566,6 +567,7 @@ else ...@@ -566,6 +567,7 @@ else
INSTALL_DB="./install_test_db --bin" INSTALL_DB="./install_test_db --bin"
MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
NDB_TOOLS_DIR="$CLIENT_BINDIR" NDB_TOOLS_DIR="$CLIENT_BINDIR"
NDB_MGM="$CLIENT_BINDIR/ndb_mgm"
if test -d "$BASEDIR/share/mysql/english" if test -d "$BASEDIR/share/mysql/english"
then then
LANGUAGE="$BASEDIR/share/mysql/english/" LANGUAGE="$BASEDIR/share/mysql/english/"
...@@ -615,6 +617,7 @@ MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --u ...@@ -615,6 +617,7 @@ MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --u
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR
export NDB_TOOLS_DIR export NDB_TOOLS_DIR
export NDB_MGM
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
......
...@@ -157,6 +157,14 @@ a ...@@ -157,6 +157,14 @@ a
bbbb bbbb
цццц цццц
drop table t1; drop table t1;
create table t1 (a char(10) character set latin1 not null);
insert into t1 values ('a'),('b'),('c');
select a from t1 where a IN ('a','b','c') order by a;
a
a
b
c
drop table t1;
set names latin1; set names latin1;
select '1.0' in (1,2); select '1.0' in (1,2);
'1.0' in (1,2) '1.0' in (1,2)
......
...@@ -359,6 +359,16 @@ information_schema ...@@ -359,6 +359,16 @@ information_schema
mysql mysql
test test
use test; use test;
drop database if exists test_only_ndb_tables;
create database test_only_ndb_tables;
use test_only_ndb_tables;
create table t1 (a int primary key) engine=ndb;
select * from t1;
a
select * from t1;
ERROR HY000: Can't lock file (errno: 4009)
use test;
drop database test_only_ndb_tables;
CREATE TABLE t9 ( CREATE TABLE t9 (
a int NOT NULL PRIMARY KEY, a int NOT NULL PRIMARY KEY,
b int b int
......
...@@ -80,6 +80,11 @@ create table t1 (a char(10) character set utf8 not null); ...@@ -80,6 +80,11 @@ create table t1 (a char(10) character set utf8 not null);
insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ'); insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a; select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
drop table t1; drop table t1;
# Bug#7834 Illegal mix of collations in IN operator
create table t1 (a char(10) character set latin1 not null);
insert into t1 values ('a'),('b'),('c');
select a from t1 where a IN ('a','b','c') order by a;
drop table t1;
set names latin1; set names latin1;
select '1.0' in (1,2); select '1.0' in (1,2);
......
...@@ -452,6 +452,26 @@ drop database test2; ...@@ -452,6 +452,26 @@ drop database test2;
show databases; show databases;
use test; use test;
#########################################################
# Bug#8035
# mysqld would segfault on second select * before bug was fixed
#
--disable_warnings
drop database if exists test_only_ndb_tables;
--enable_warnings
create database test_only_ndb_tables;
use test_only_ndb_tables;
create table t1 (a int primary key) engine=ndb;
select * from t1;
--exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
--error 1015
select * from t1;
--exec $NDB_MGM --no-defaults -e "all start" > /dev/null
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
use test;
drop database test_only_ndb_tables;
###################################################### ######################################################
# Note! This should always be the last step in this # Note! This should always be the last step in this
# file, the table t9 will be used and dropped # file, the table t9 will be used and dropped
......
...@@ -1312,7 +1312,10 @@ void Dbtc::execTCRELEASEREQ(Signal* signal) ...@@ -1312,7 +1312,10 @@ void Dbtc::execTCRELEASEREQ(Signal* signal)
if (tapiBlockref == apiConnectptr.p->ndbapiBlockref) { if (tapiBlockref == apiConnectptr.p->ndbapiBlockref) {
if (apiConnectptr.p->apiConnectstate == CS_CONNECTED || if (apiConnectptr.p->apiConnectstate == CS_CONNECTED ||
(apiConnectptr.p->apiConnectstate == CS_ABORTING && (apiConnectptr.p->apiConnectstate == CS_ABORTING &&
apiConnectptr.p->abortState == AS_IDLE)){ apiConnectptr.p->abortState == AS_IDLE) ||
(apiConnectptr.p->apiConnectstate == CS_STARTED &&
apiConnectptr.p->firstTcConnect == RNIL))
{
jam(); /* JUST REPLY OK */ jam(); /* JUST REPLY OK */
releaseApiCon(signal, apiConnectptr.i); releaseApiCon(signal, apiConnectptr.i);
signal->theData[0] = tuserpointer; signal->theData[0] = tuserpointer;
......
...@@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, ...@@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned int _timeout); unsigned int _timeout);
enum ndb_waiter_options { enum ndb_waiter_options {
NDB_STD_OPTS_OPTIONS NDB_STD_OPTS_OPTIONS,
OPT_WAIT_STATUS_NOT_STARTED
}; };
NDB_STD_OPTS_VARS; NDB_STD_OPTS_VARS;
static int _no_contact = 0; static int _no_contact = 0;
static int _not_started = 0;
static int _timeout = 120; static int _timeout = 120;
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
...@@ -43,6 +45,9 @@ static struct my_option my_long_options[] = ...@@ -43,6 +45,9 @@ static struct my_option my_long_options[] =
{ "no-contact", 'n', "Wait for cluster no contact", { "no-contact", 'n', "Wait for cluster no contact",
(gptr*) &_no_contact, (gptr*) &_no_contact, 0, (gptr*) &_no_contact, (gptr*) &_no_contact, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started",
(gptr*) &_not_started, (gptr*) &_not_started, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "timeout", 't', "Timeout to wait", { "timeout", 't', "Timeout to wait",
(gptr*) &_timeout, (gptr*) &_timeout, 0, (gptr*) &_timeout, (gptr*) &_timeout, 0,
GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 },
...@@ -91,12 +96,22 @@ int main(int argc, char** argv){ ...@@ -91,12 +96,22 @@ int main(int argc, char** argv){
if (_hostName == 0) if (_hostName == 0)
_hostName= opt_connect_str; _hostName= opt_connect_str;
if (_no_contact) { enum ndb_mgm_node_status wait_status;
if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0) if (_no_contact)
return NDBT_ProgramExit(NDBT_FAILED); {
} else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0) wait_status= NDB_MGM_NODE_STATUS_NO_CONTACT;
return NDBT_ProgramExit(NDBT_FAILED); }
else if (_not_started)
{
wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED;
}
else
{
wait_status= NDB_MGM_NODE_STATUS_STARTED;
}
if (waitClusterStatus(_hostName, wait_status, _timeout) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
return NDBT_ProgramExit(NDBT_OK); return NDBT_ProgramExit(NDBT_OK);
} }
......
...@@ -1776,63 +1776,12 @@ void Item_func_in::fix_length_and_dec() ...@@ -1776,63 +1776,12 @@ void Item_func_in::fix_length_and_dec()
agg_cmp_type(&cmp_type, args, arg_count); agg_cmp_type(&cmp_type, args, arg_count);
for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) if (cmp_type == STRING_RESULT &&
const_itm&= arg[0]->const_item(); agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV))
if (cmp_type == STRING_RESULT)
{
/*
We allow consts character set conversion for
item IN (const1, const2, const3, ...)
if item is in a superset for all arguments,
and if it is a stong side according to coercibility rules.
TODO: add covnersion for non-constant IN values
via creating Item_func_conv_charset().
*/
if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count,
MY_COLL_ALLOW_SUPERSET_CONV))
return;
if ((!my_charset_same(args[0]->collation.collation,
cmp_collation.collation) || !const_itm))
{
if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count))
return; return;
}
else
{
/*
Conversion is possible:
All IN arguments are constants.
*/
Item_arena *arena, backup;
arena= thd->change_arena_if_needed(&backup);
for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++) for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
{ const_itm&= arg[0]->const_item();
if (!arg[0]->null_value &&
!my_charset_same(cmp_collation.collation,
arg[0]->collation.collation))
{
Item_string *conv;
String tmp, cstr, *ostr= arg[0]->val_str(&tmp);
uint dummy_errors;
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(),
cmp_collation.collation, &dummy_errors);
conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(),
arg[0]->collation.derivation);
conv->str_value.copy();
arg[0]= conv;
}
}
if (arena)
thd->restore_backup_item_arena(arena, &backup);
}
}
/* /*
Row item with NULLs inside can return NULL or FALSE => Row item with NULLs inside can return NULL or FALSE =>
......
...@@ -182,12 +182,12 @@ static int lock_external(THD *thd, TABLE **tables, uint count) ...@@ -182,12 +182,12 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
if ((error=(*tables)->file->external_lock(thd,lock_type))) if ((error=(*tables)->file->external_lock(thd,lock_type)))
{ {
print_lock_error(error, (*tables)->file->table_type());
for (; i-- ; tables--) for (; i-- ; tables--)
{ {
(*tables)->file->external_lock(thd, F_UNLCK); (*tables)->file->external_lock(thd, F_UNLCK);
(*tables)->current_lock=F_UNLCK; (*tables)->current_lock=F_UNLCK;
} }
print_lock_error(error, (*tables)->file->table_type());
DBUG_RETURN(error); DBUG_RETURN(error);
} }
else else
...@@ -375,12 +375,13 @@ static int unlock_external(THD *thd, TABLE **table,uint count) ...@@ -375,12 +375,13 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
{ {
(*table)->current_lock = F_UNLCK; (*table)->current_lock = F_UNLCK;
if ((error=(*table)->file->external_lock(thd, F_UNLCK))) if ((error=(*table)->file->external_lock(thd, F_UNLCK)))
{
error_code=error; error_code=error;
print_lock_error(error_code, (*table)->file->table_type());
}
} }
table++; table++;
} while (--count); } while (--count);
if (error_code)
print_lock_error(error_code, (*table)->file->table_type());
DBUG_RETURN(error_code); DBUG_RETURN(error_code);
} }
......
This diff is collapsed.
# This logname is set in mysql.server.sh that ends up in /etc/rc.d/init.d/mysql # This logname can be set in /etc/my.cnf
# by setting the variable "err-log"
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
# err-log=@localstatedir@/mysqld.log
# #
# If the root user has a password you have to create a # If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following # /root/.my.cnf configuration file with the following
...@@ -22,7 +27,9 @@ ...@@ -22,7 +27,9 @@
compress compress
postrotate postrotate
# just if mysqld is really running # just if mysqld is really running
if test -n "`ps acx|grep mysqld`"; then if test -x @bindir@/mysqladmin && \
@bindir@/mysqladmin ping &>/dev/null
then
@bindir@/mysqladmin flush-logs @bindir@/mysqladmin flush-logs
fi fi
endscript endscript
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment