diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index d378276a0a3..fa20fd14571 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -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="" diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max index 46291db48b1..530bdba009b 100755 --- a/BUILD/compile-amd64-debug-max +++ b/BUILD/compile-amd64-debug-max @@ -1,15 +1,9 @@ #! /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" diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max index 087dba7f94a..228448f6392 100755 --- a/BUILD/compile-amd64-max +++ b/BUILD/compile-amd64-max @@ -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" diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 8894782050c..420657e0b73 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -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" diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded index 4554e38fdc1..803a6a9d6d3 100755 --- a/BUILD/compile-pentium-debug-max-no-embedded +++ b/BUILD/compile-pentium-debug-max-no-embedded @@ -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" diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index caf657a2049..595581f604e 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -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" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index fd9543163d6..f0dc92c2ffd 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -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" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max index 9d67b46601a..49d1442fd45 100755 --- a/BUILD/compile-ppc-debug-max +++ b/BUILD/compile-ppc-debug-max @@ -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" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max index f7193eb8aca..1d89be81c9c 100755 --- a/BUILD/compile-ppc-max +++ b/BUILD/compile-ppc-max @@ -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" diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 17410f02fe2..4cd53216434 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -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 \ diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index b7343065c73..d2879e18726 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -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); diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 1a1a9a256db..5fd2053a3ec 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -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; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index ce2ce577b46..66de5e5a4c9 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -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 diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index bedeecd5d12..244802d4d6e 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -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; + diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0851edd56ce..69f9092f1fd 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -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 diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index a6fe9e44a3d..a156322e13c 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -264,6 +264,7 @@ public: 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 diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2d4f88ed57b..d6d58adaf7c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -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;