Commit 4bc4d17a authored by unknown's avatar unknown

Merge tulin@bk-internal.mysql.com:/home/bk/wl2299

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


ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
parents cdfc45e1 d4b9b95e
......@@ -43,7 +43,13 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
base_max_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio"
max_leave_isam_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-raid --with-openssl --with-raid --with-vio --with-embedded-server"
max_no_es_configs="$max_leave_isam_configs --without-isam"
max_configs="$max_no_es_configs --with-embedded-server"
alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
amd64_cflags="-DBIG_TABLES"
pentium_cflags="-mcpu=pentiumpro"
pentium64_cflags="-mcpu=nocona -m64"
ppc_cflags="-mpowerpc -mcpu=powerpc"
......@@ -58,9 +64,11 @@ reckless_cflags="-O3 -fomit-frame-pointer "
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
amd64_cxxflags="-DBIG_TABLES"
base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline"
static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static"
amd64_configs=""
alpha_configs="" # Not used yet
pentium_configs=""
sparc_configs=""
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
amd64_cflags="-DBIG_TABLES"
amd64_cxx_flags="-DBIG_TABLES"
amd64_configs=""
base_cxxflags="$amd64_cxx_flags $base_cxxflags"
extra_flags="$amd64_cflags $debug_cflags"
extra_flags="$amd64_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$amd64_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster"
extra_configs="$amd64_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
......@@ -2,16 +2,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
amd64_cflags="-DBIG_TABLES"
amd64_cxx_flags="-DBIG_TABLES"
amd64_configs=""
base_cxxflags="$amd64_cxx_flags $base_cxxflags"
extra_flags="$amd64_cflags $fast_cflags -g"
extra_configs="$amd64_configs"
#strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --with-ndbcluster"
extra_flags="$amd64_cflags $fast_cflags $max_cflags -g"
extra_configs="$amd64_configs $max_configs"
. "$path/FINISH.sh"
......@@ -3,11 +3,9 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster"
extra_configs="$pentium_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
......@@ -3,11 +3,9 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-openssl --with-raid"
extra_configs="$pentium_configs $debug_configs $max_no_es_configs"
. "$path/FINISH.sh"
......@@ -3,12 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs"
#strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --with-ndbcluster"
extra_flags="$pentium_cflags $fast_cflags $max_cflags -g"
extra_configs="$pentium_configs $max_configs"
. "$path/FINISH.sh"
......@@ -3,13 +3,13 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
# We want to test isam when building with valgrind
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-vio --with-raid --with-ndbcluster"
extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
. "$path/FINISH.sh"
......
......@@ -3,11 +3,9 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$ppc_cflags $debug_cflags"
extra_flags="$ppc_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster"
extra_configs="$debug_configs $max_configs"
. "$path/FINISH.sh"
......@@ -3,11 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$ppc_cflags $fast_cflags -g"
#strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --with-ndbcluster"
extra_flags="$ppc_cflags $fast_cflags $max_cflags -g"
extra_configs="$extra_configs $max_configs"
. "$path/FINISH.sh"
......@@ -22,7 +22,6 @@ use Getopt::Long;
Getopt::Long::Configure ("bundling");
use Sys::Hostname;
$opt_nobuild = undef;
$opt_cc= undef;
$opt_cflags= undef;
$opt_clean= undef;
......@@ -33,6 +32,9 @@ $opt_help= undef;
$opt_log= undef;
$opt_mail= "";
$opt_verbose= undef;
$opt_susebuild= undef;
$opt_susebuildroot= undef;
$opt_suserpms= undef;
# Set a dummy version until we know the correct one
$VERSION= "x.y.z";
......@@ -49,7 +51,9 @@ GetOptions(
"help|h",
"log|l:s",
"mail|m=s",
"nobuild",
"susebuild|s",
"susebuildroot|r=s",
"suserpms=s",
"verbose|v",
) || &print_help;
......@@ -57,6 +61,20 @@ GetOptions(
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
$PWD= cwd();
$LOGGER= "$PWD/logger.pm";
......@@ -72,7 +90,7 @@ else
$subject= "RPM build for $SPECFILE failed" if $opt_mail;
# 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>;
close SPEC;
......@@ -94,7 +112,7 @@ $HOST= hostname();
$HOST=~ /^([^.-]*)/;
$HOST= $1;
$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
......@@ -114,103 +132,149 @@ if (defined $opt_log)
}
}
#
# Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs
#
if (-x "/usr/bin/rpmbuild")
&logger("Using spec file for version: $VERSION");
if ($opt_susebuild)
{
$RPM= "/usr/bin/rpmbuild";
$RMSOURCE= "--rmsource --rmspec";
&susebuild;
}
else
{
$RPM= "/bin/rpm";
$RMSOURCE= "--rmspec";
{
&rpmbuild;
}
if ($RPM)
{
&logger("Found rpm binary: $RPM");
}
else
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
exit 0;
#
# 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`);
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`);
$SOURCEFILE= glob "mysql*-$VERSION.tar.gz";
sub rpmbuild
{
unless($opt_nobuild) {
#
# 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";
}
&logger("Starting RPM build of MySQL-$VERSION on $HOST");
if ($RPM)
{
&logger("Found rpm binary: $RPM");
}
else
{
&abort("Unable to find RPM binary!");
}
foreach $file ($SOURCEFILE, $SPECFILE)
{
&abort("Unable to find $file!") unless (-f "$file");
}
#
# 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`);
#
# Install source and spec file
#
&logger("Copying SOURCE and SPEC file to build directories.");
unless ($opt_dry_run)
{
copy($SOURCEFILE, $SOURCEDIR)
or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!");
copy($SPECFILE, $SPECDIR)
or &abort("Unable to copy $SPECFILE to $SPECDIR!");
}
$SOURCEFILE= glob "mysql*-$VERSION.tar.gz";
#
# Set environment variables - these are being used in the
# official MySQL RPM spec file
#
&logger("Setting special build environment variables")
if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx);
$ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc);
$ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags);
$ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags);
$ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
&logger("Starting RPM build of MySQL-$VERSION on $HOST");
#
# Build the RPMs
#
$command= "$RPM";
$command.= " -v" if ($opt_verbose);
$command.= " -ba";
$command.= " --clean $RMSOURCE" if $opt_clean;
$command.= " $SPECDIR/";
$command.= basename($SPECFILE);
&logger("Building RPM.");
&run_command($command, "Error while building the RPMs!");
}
foreach $file ($SOURCEFILE, $SPECFILE)
{
&abort("Unable to find $file!") unless (-f "$file");
}
#
# 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!");
#
# Install source and spec file
#
&logger("Copying SOURCE and SPEC file to build directories.");
unless ($opt_dry_run)
{
copy($SOURCEFILE, $SOURCEDIR)
or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!");
copy($SPECFILE, $SPECDIR)
or &abort("Unable to copy $SPECFILE to $SPECDIR!");
}
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
exit 0;
#
# Set environment variables - these are being used in the
# official MySQL RPM spec file
#
&logger("Setting special build environment variables")
if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx);
$ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc);
$ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags);
$ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags);
$ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
#
# Build the RPMs
#
$command= "$RPM";
$command.= " -v" if ($opt_verbose);
$command.= " -ba";
$command.= " --clean $RMSOURCE" if $opt_clean;
$command.= " $SPECDIR/";
$command.= basename($SPECFILE);
&logger("Building RPM.");
&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_SRPM*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");
}
sub print_help
{
......@@ -218,7 +282,7 @@ sub print_help
if ($message ne "")
{
print "\n";
print "ERROR: $message\n\n}";
print "ERROR: $message\n\n";
}
print <<EOF;
......@@ -241,12 +305,22 @@ Options:
-t, --dry-run Dry run without executing
-h, --help Print this help
-l, --log[=<filename>] Write a log file [to <filename>]
(default is "$LOGFILE")
-m, --mail=<address> Mail a failure report to the given address
(and include a log file snippet, if logging
is enabled)
Note that the \@-Sign needs to be quoted!
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
Example:
......
......@@ -42,7 +42,7 @@ sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc
noinst_HEADERS = embedded_priv.h emb_qcache.h
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
ha_innodb.cc ha_berkeley.cc ha_heap.cc \
ha_innodb.cc ha_berkeley.cc ha_heap.cc ha_federated.cc \
ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
hostname.cc init.cc password.c \
item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
......
......@@ -540,6 +540,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
INSTALL_DB="./install_test_db"
MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
else
if test -x "$BASEDIR/libexec/mysqld"
then
......@@ -566,6 +567,7 @@ else
INSTALL_DB="./install_test_db --bin"
MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
NDB_TOOLS_DIR="$CLIENT_BINDIR"
NDB_MGM="$CLIENT_BINDIR/ndb_mgm"
if test -d "$BASEDIR/share/mysql/english"
then
LANGUAGE="$BASEDIR/share/mysql/english/"
......@@ -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 CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR
export NDB_TOOLS_DIR
export NDB_MGM
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
......
......@@ -157,6 +157,14 @@ a
bbbb
цццц
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;
select '1.0' in (1,2);
'1.0' in (1,2)
......
......@@ -784,32 +784,32 @@ t2.flag_value IS NULL;
flag_name flag_value
flag2 NULL
DROP TABLE t1,t2;
CREATE TABLE invoice (
CREATE TABLE t1 (
id int(11) unsigned NOT NULL auto_increment,
text_id int(10) unsigned default NULL,
PRIMARY KEY (id)
);
INSERT INTO invoice VALUES("1", "0");
INSERT INTO invoice VALUES("2", "10");
CREATE TABLE text_table (
INSERT INTO t1 VALUES("1", "0");
INSERT INTO t1 VALUES("2", "10");
CREATE TABLE t2 (
text_id char(3) NOT NULL default '',
language_id char(3) NOT NULL default '',
text_data text,
PRIMARY KEY (text_id,language_id)
);
INSERT INTO text_table VALUES("0", "EN", "0-EN");
INSERT INTO text_table VALUES("0", "SV", "0-SV");
INSERT INTO text_table VALUES("10", "EN", "10-EN");
INSERT INTO text_table VALUES("10", "SV", "10-SV");
SELECT invoice.id, invoice.text_id, text_table.text_data
FROM invoice LEFT JOIN text_table
ON invoice.text_id = text_table.text_id
AND text_table.language_id = 'SV'
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
INSERT INTO t2 VALUES("0", "EN", "0-EN");
INSERT INTO t2 VALUES("0", "SV", "0-SV");
INSERT INTO t2 VALUES("10", "EN", "10-EN");
INSERT INTO t2 VALUES("10", "SV", "10-SV");
SELECT t1.id, t1.text_id, t2.text_data
FROM t1 LEFT JOIN t2
ON t1.text_id = t2.text_id
AND t2.language_id = 'SV'
WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
id text_id text_data
1 0 0-SV
2 10 10-SV
DROP TABLE invoice, text_table;
DROP TABLE t1, t2;
CREATE TABLE t0 (a0 int PRIMARY KEY);
CREATE TABLE t1 (a1 int PRIMARY KEY);
CREATE TABLE t2 (a2 int);
......
......@@ -359,6 +359,16 @@ information_schema
mysql
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 (
a int NOT NULL PRIMARY KEY,
b int
......
......@@ -2160,3 +2160,11 @@ WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
f1
NULL
1
drop table t1,t2;
create table t1 (a1 int);
create table t2 (b1 int);
select * from t1 where a2 > any(select b1 from t2);
ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery'
select * from t1 where a1 > any(select b1 from t2);
a1
drop table t1,t2;
......@@ -80,6 +80,11 @@ create table t1 (a char(10) character set utf8 not null);
insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
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;
select '1.0' in (1,2);
......
......@@ -554,34 +554,34 @@ SELECT t1.flag_name,t2.flag_value
DROP TABLE t1,t2;
CREATE TABLE invoice (
CREATE TABLE t1 (
id int(11) unsigned NOT NULL auto_increment,
text_id int(10) unsigned default NULL,
PRIMARY KEY (id)
);
INSERT INTO invoice VALUES("1", "0");
INSERT INTO invoice VALUES("2", "10");
INSERT INTO t1 VALUES("1", "0");
INSERT INTO t1 VALUES("2", "10");
CREATE TABLE text_table (
CREATE TABLE t2 (
text_id char(3) NOT NULL default '',
language_id char(3) NOT NULL default '',
text_data text,
PRIMARY KEY (text_id,language_id)
);
INSERT INTO text_table VALUES("0", "EN", "0-EN");
INSERT INTO text_table VALUES("0", "SV", "0-SV");
INSERT INTO text_table VALUES("10", "EN", "10-EN");
INSERT INTO text_table VALUES("10", "SV", "10-SV");
INSERT INTO t2 VALUES("0", "EN", "0-EN");
INSERT INTO t2 VALUES("0", "SV", "0-SV");
INSERT INTO t2 VALUES("10", "EN", "10-EN");
INSERT INTO t2 VALUES("10", "SV", "10-SV");
SELECT invoice.id, invoice.text_id, text_table.text_data
FROM invoice LEFT JOIN text_table
ON invoice.text_id = text_table.text_id
AND text_table.language_id = 'SV'
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
SELECT t1.id, t1.text_id, t2.text_data
FROM t1 LEFT JOIN t2
ON t1.text_id = t2.text_id
AND t2.language_id = 'SV'
WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
DROP TABLE invoice, text_table;
DROP TABLE t1, t2;
# Test for bug #5896
......
......@@ -452,6 +452,26 @@ drop database test2;
show databases;
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
# file, the table t9 will be used and dropped
......
......@@ -1417,3 +1417,14 @@ SELECT f1 FROM t1
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
drop table t1,t2;
# Test for BUG#7885: Server crash when 'any' subselect compared to
# non-existant field.
create table t1 (a1 int);
create table t2 (b1 int);
--error 1054
select * from t1 where a2 > any(select b1 from t2);
select * from t1 where a1 > any(select b1 from t2);
drop table t1,t2;
......@@ -17,7 +17,6 @@
#ifndef ATTRIBUTE_HEADER
#define ATTRIBUTE_HEADER
#include <new>
/**
* @class AttributeHeader
* @brief Header passed in front of every attribute value in AttrInfo signal
......
......@@ -48,7 +48,7 @@
#define NDB_TYPE_BIGUNSIGNED 10
#define NDB_TYPE_FLOAT 11
#define NDB_TYPE_DOUBLE 12
#define NDB_TYPE_DECIMAL 13 // not used
#define NDB_TYPE_DECIMAL 13 /* not used */
#define NDB_TYPE_CHAR 14
#define NDB_TYPE_VARCHAR 15
#define NDB_TYPE_BINARY 16
......
......@@ -115,10 +115,8 @@ static const char table_name_separator = '/';
#endif
#ifdef __cplusplus
#include <new>
#endif
#ifdef __cplusplus
inline void* operator new(size_t, void* __p) { return __p; }
inline void* operator new[](size_t, void* __p) { return __p; }
extern "C" {
#endif
......
......@@ -22,7 +22,6 @@
//===========================================================================
#include "Backup.hpp"
#include <new>
#include <Properties.hpp>
#include <Configuration.hpp>
......
......@@ -39,7 +39,6 @@
#include <EventLogger.hpp>
#include <TimeQueue.hpp>
#include <new>
#include <NdbSleep.h>
#include <SafeCounter.hpp>
......
......@@ -18,7 +18,6 @@
#define DBDIH_C
#include "Dbdih.hpp"
#include <ndb_limits.h>
#include <new>
#define DEBUG(x) { ndbout << "DIH::" << x << endl; }
......
......@@ -19,7 +19,6 @@
#define DBLQH_C
#include "Dblqh.hpp"
#include <ndb_limits.h>
#include <new>
#define DEBUG(x) { ndbout << "LQH::" << x << endl; }
......
......@@ -20,7 +20,6 @@
#include <ndb_limits.h>
#include <Properties.hpp>
#include <Configuration.hpp>
#include <new>
#define DEBUG(x) { ndbout << "TC::" << x << endl; }
......
......@@ -1312,7 +1312,10 @@ void Dbtc::execTCRELEASEREQ(Signal* signal)
if (tapiBlockref == apiConnectptr.p->ndbapiBlockref) {
if (apiConnectptr.p->apiConnectstate == CS_CONNECTED ||
(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 */
releaseApiCon(signal, apiConnectptr.i);
signal->theData[0] = tuserpointer;
......
......@@ -31,7 +31,6 @@
#include <signaldata/TupKey.hpp>
#include <signaldata/DropTab.hpp>
#include <new>
#define DEBUG(x) { ndbout << "TUP::" << x << endl; }
......
......@@ -17,7 +17,6 @@
#ifndef DBTUX_H
#define DBTUX_H
#include <new>
#include <ndb_limits.h>
#include <SimulatedBlock.hpp>
#include <AttributeDescriptor.hpp>
......
......@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "Grep.hpp"
#include <new>
#include <Properties.hpp>
#include <Configuration.hpp>
......
......@@ -16,7 +16,6 @@
#include "Suma.hpp"
#include <new>
#include <Properties.hpp>
#include <Configuration.hpp>
......
......@@ -33,7 +33,6 @@
#include <NdbOut.hpp>
#include <NdbMutex.h>
#include <NdbSleep.h>
#include <new>
extern "C" {
extern void (* ndb_new_handler)();
......
......@@ -36,7 +36,6 @@
#include <ErrorReporter.hpp>
#include <ErrorHandlingMacros.hpp>
#include <new>
#include "DLList.hpp"
#include "ArrayPool.hpp"
#include "DLHashTable.hpp"
......
#include <ndb_types.h>
#include <mgmapi.h>
#include "mgmapi_configuration.hpp"
#include <new>
ndb_mgm_configuration_iterator::ndb_mgm_configuration_iterator
(const ndb_mgm_configuration & conf, unsigned type_of_section)
......
......@@ -1591,6 +1591,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
abort();
}
int distKeys= impl.m_noOfDistributionKeys;
for(i = 0; i<sz; i++){
const NdbColumnImpl * col = impl.m_columns[i];
if(col == 0)
......@@ -1625,7 +1626,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
DBUG_RETURN(-1);
}
// distribution key not supported for Char attribute
if (col->m_distributionKey && col->m_cs != NULL) {
if (distKeys && col->m_distributionKey && col->m_cs != NULL) {
m_error.code= 745;
DBUG_RETURN(-1);
}
......
......@@ -230,17 +230,17 @@ NdbScanOperation::fix_receivers(Uint32 parallel){
if(parallel > m_allocated_receivers){
const Uint32 sz = parallel * (4*sizeof(char*)+sizeof(Uint32));
Uint32 * tmp = new Uint32[(sz+3)/4];
Uint64 * tmp = new Uint64[(sz+7)/8];
// Save old receivers
memcpy(tmp+parallel, m_receivers, m_allocated_receivers*sizeof(char*));
memcpy(tmp, m_receivers, m_allocated_receivers*sizeof(char*));
delete[] m_array;
m_array = tmp;
m_array = (Uint32*)tmp;
m_prepared_receivers = tmp;
m_receivers = (NdbReceiver**)(tmp + parallel);
m_receivers = (NdbReceiver**)tmp;
m_api_receivers = m_receivers + parallel;
m_conf_receivers = m_api_receivers + parallel;
m_sent_receivers = m_conf_receivers + parallel;
m_prepared_receivers = (Uint32*)(m_sent_receivers + parallel);
// Only get/init "new" receivers
NdbReceiver* tScanRec;
......
......@@ -18,6 +18,22 @@
#include <NDBT.hpp>
#include <Base64.hpp>
static
Uint32
myRand(Uint64 * seed)
{
const Uint64 mul= 0x5deece66dull;
const Uint64 add= 0xb;
Uint64 loc_result = *seed * mul + add;
* seed= loc_result;
return loc_result >> 1;
}
static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
/* *************************************************************
* HugoCalculator
*
......@@ -79,21 +95,23 @@ HugoCalculator::calcValue(int record,
int updates,
char* buf,
int len) const {
unsigned seed;
Uint64 seed;
const NdbDictionary::Column* attr = m_tab.getColumn(attrib);
Uint32 val;
do
{
if (attrib == m_idCol)
{
*((Uint32*)buf)= record;
val= record;
memcpy(buf, &val, 4);
return buf;
}
// If this is the update column
if (attrib == m_updatesCol)
{
*((Uint32*)buf)= updates;
val= updates;
memcpy(buf, &val, 4);
return buf;
}
......@@ -106,26 +124,13 @@ HugoCalculator::calcValue(int record,
seed = record + attrib + updates;
}
} while (0);
val = rand_r(&seed);
val = myRand(&seed);
if(attr->getNullable() && (((val >> 16) & 255) > 220))
return NULL;
memcpy(buf, &val, (len > 4 ? 4 : len));
int pos= 4;
while(pos + 4 < len)
{
val= rand_r(&seed);
memcpy(buf+pos, &val, 4);
pos++;
}
if(pos < len)
{
val= rand_r(&seed);
memcpy(buf+pos, &val, (len - pos));
}
int pos= 0;
switch(attr->getType()){
case NdbDictionary::Column::Tinyint:
case NdbDictionary::Column::Tinyunsigned:
......@@ -144,15 +149,24 @@ HugoCalculator::calcValue(int record,
case NdbDictionary::Column::Datetime:
case NdbDictionary::Column::Time:
case NdbDictionary::Column::Date:
break;
case NdbDictionary::Column::Bit:
{
Uint32 bits= attr->getLength();
Uint32 tmp = bits >> 5;
Uint32 size = bits & 31;
((Uint32*)buf)[tmp] &= ((1 << size) - 1);
while (len > 4)
{
memcpy(buf+pos, &val, 4);
pos += 4;
len -= 4;
val= myRand(&seed);
}
memcpy(buf+pos, &val, len);
if(attr->getType() == NdbDictionary::Column::Bit)
{
Uint32 bits= attr->getLength();
Uint32 tmp = bits >> 5;
Uint32 size = bits & 31;
((Uint32*)buf)[tmp] &= ((1 << size) - 1);
}
break;
}
case NdbDictionary::Column::Varbinary:
case NdbDictionary::Column::Varchar:
case NdbDictionary::Column::Text:
......@@ -160,9 +174,21 @@ HugoCalculator::calcValue(int record,
case NdbDictionary::Column::Longvarchar:
case NdbDictionary::Column::Longvarbinary:
{
BaseString tmp;
base64_encode(buf, len, tmp);
memcpy(buf, tmp.c_str(), len);
char* ptr= (char*)&val;
while(len >= 4)
{
len -= 4;
buf[pos++] = base64_table[ptr[0] & 0x3f];
buf[pos++] = base64_table[ptr[1] & 0x3f];
buf[pos++] = base64_table[ptr[2] & 0x3f];
buf[pos++] = base64_table[ptr[3] & 0x3f];
val= myRand(&seed);
}
for(; len; len--, pos++)
buf[pos] = base64_table[ptr[len] & 0x3f];
pos--;
break;
}
case NdbDictionary::Column::Blob:
......
......@@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned int _timeout);
enum ndb_waiter_options {
NDB_STD_OPTS_OPTIONS
NDB_STD_OPTS_OPTIONS,
OPT_WAIT_STATUS_NOT_STARTED
};
NDB_STD_OPTS_VARS;
static int _no_contact = 0;
static int _not_started = 0;
static int _timeout = 120;
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",
(gptr*) &_no_contact, (gptr*) &_no_contact, 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",
(gptr*) &_timeout, (gptr*) &_timeout, 0,
GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 },
......@@ -91,12 +96,22 @@ int main(int argc, char** argv){
if (_hostName == 0)
_hostName= opt_connect_str;
if (_no_contact) {
if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
} else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
enum ndb_mgm_node_status wait_status;
if (_no_contact)
{
wait_status= NDB_MGM_NODE_STATUS_NO_CONTACT;
}
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);
}
......
......@@ -210,8 +210,10 @@ do
done
$CP mysql-test/include/*.inc $BASE/mysql-test/include
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data
$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
$BASE/mysql-test/std_data
$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t
$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r
......
......@@ -1776,64 +1776,13 @@ void Item_func_in::fix_length_and_dec()
agg_cmp_type(&cmp_type, args, arg_count);
if (cmp_type == STRING_RESULT &&
agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV))
return;
for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
const_itm&= arg[0]->const_item();
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;
}
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++)
{
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 =>
they can't be processed as static
......
......@@ -264,6 +264,7 @@ class Item_func_trig_cond: public Item_bool_func
longlong val_int() { return *trig_var ? args[0]->val_int() : 1; }
enum Functype functype() const { return TRIG_COND_FUNC; };
const char *func_name() const { return "trigcond"; };
bool const_item() const { return FALSE; }
};
class Item_func_not_all :public Item_func_not
......
......@@ -177,6 +177,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
}
fix_length_and_dec();
}
else
return 1;
uint8 uncacheable= engine->uncacheable();
if (uncacheable)
{
......@@ -264,7 +266,6 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex)
{
DBUG_ENTER("Item_singlerow_subselect::Item_singlerow_subselect");
init(select_lex, new select_singlerow_subselect(this));
max_columns= 1;
maybe_null= 1;
max_columns= UINT_MAX;
DBUG_VOID_RETURN;
......
......@@ -182,12 +182,12 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
if ((error=(*tables)->file->external_lock(thd,lock_type)))
{
print_lock_error(error, (*tables)->file->table_type());
for (; i-- ; tables--)
{
(*tables)->file->external_lock(thd, F_UNLCK);
(*tables)->current_lock=F_UNLCK;
}
print_lock_error(error, (*tables)->file->table_type());
DBUG_RETURN(error);
}
else
......@@ -375,12 +375,13 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
{
(*table)->current_lock = F_UNLCK;
if ((error=(*table)->file->external_lock(thd, F_UNLCK)))
{
error_code=error;
print_lock_error(error_code, (*table)->file->table_type());
}
}
table++;
} while (--count);
if (error_code)
print_lock_error(error_code, (*table)->file->table_type());
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
# /root/.my.cnf configuration file with the following
......@@ -22,8 +27,10 @@
compress
postrotate
# just if mysqld is really running
if test -n "`ps acx|grep mysqld`"; then
@bindir@/mysqladmin flush-logs
if test -x @bindir@/mysqladmin && \
@bindir@/mysqladmin ping &>/dev/null
then
@bindir@/mysqladmin flush-logs
fi
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