summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-26 16:06:31 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-26 16:06:31 +0300
commit84766b060a09ae3709fcd17cadc16c982c0d3a78 (patch)
treed57dcac492c1a0c330c28bcf82a1d33db6111e5b
parenta7dd42b57db41efc174b640f20bf9aff02f88415 (diff)
parent03561d35e30807e841c8544a6f5c07d708c6acbd (diff)
downloadmariadb-git-84766b060a09ae3709fcd17cadc16c982c0d3a78.tar.gz
Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in scripts/Makefile.am Text conflict in sql/share/Makefile.am
-rw-r--r--configure.in2
-rw-r--r--mysql-test/Makefile.am4
-rw-r--r--mysql-test/r/bigint.result34
-rw-r--r--mysql-test/r/delete.result24
-rw-r--r--mysql-test/r/having.result20
-rw-r--r--mysql-test/r/innodb_mysql.result14
-rw-r--r--mysql-test/r/join.result11
-rw-r--r--mysql-test/t/bigint.test35
-rw-r--r--mysql-test/t/delete.test29
-rw-r--r--mysql-test/t/having.test26
-rw-r--r--mysql-test/t/innodb_mysql.test12
-rw-r--r--mysql-test/t/join.test13
-rw-r--r--scripts/Makefile.am3
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item_cmpfunc.h18
-rw-r--r--sql/share/Makefile.am8
-rw-r--r--sql/sql_select.cc35
-rw-r--r--storage/ndb/src/common/util/Makefile.am2
18 files changed, 242 insertions, 52 deletions
diff --git a/configure.in b/configure.in
index 1cf686dad47..3261c2df279 100644
--- a/configure.in
+++ b/configure.in
@@ -2752,7 +2752,7 @@ case $SYSTEM_TYPE in
fi
# if there is no readline, but we want to build with readline, we fail
- if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
+ if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
then
AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index b1d0e85c70e..31770592d53 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -130,12 +130,12 @@ uninstall-local:
# mtr - a shortcut for executing mysql-test-run.pl
mtr:
$(RM) -f mtr
- $(LN_S) mysql-test-run.pl mtr
+ $(LN_S) $(srcdir)/mysql-test-run.pl mtr
# mysql-test-run - a shortcut for executing mysql-test-run.pl
mysql-test-run:
$(RM) -f mysql-test-run
- $(LN_S) mysql-test-run.pl mysql-test-run
+ $(LN_S) $(srcdir)/mysql-test-run.pl mysql-test-run
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 6b0954655e9..47a45efa5fd 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -404,3 +404,37 @@ describe t1;
Field Type Null Key Default Extra
bi decimal(19,0) NO 0
drop table t1;
+#
+# Bug #45360: wrong results
+#
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
+a BIGINT(20) UNSIGNED,
+b VARCHAR(20));
+INSERT INTO t1 (a) VALUES
+(0),
+(CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
+(CAST(0x8000000000000000 AS UNSIGNED)),
+(CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
+UPDATE t1 SET b = a;
+# FFFFFFFFFFFFFFFF
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 18446744073709551615 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and ('18446744073709551615' = `test`.`t1`.`b`))
+# 8000000000000000
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775808 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775808) and ('9223372036854775808' = `test`.`t1`.`b`))
+# 7FFFFFFFFFFFFFFF
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775807 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775807) and ('9223372036854775807' = `test`.`t1`.`b`))
+# 0
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 0 AND TRIM(a) = b;
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
+DROP TABLE t1;
+# End of 5.1 tests
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 58278492985..77b2071494d 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -278,6 +278,18 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
DROP TABLE t1;
DROP FUNCTION f1;
+#
+# Bug #49552 : sql_buffer_result cause crash + not found records
+# in multitable delete/subquery
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET SESSION SQL_BUFFER_RESULT=1;
+DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
+SET SESSION SQL_BUFFER_RESULT=DEFAULT;
+SELECT * FROM t1;
+a
+DROP TABLE t1;
End of 5.0 tests
#
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
@@ -337,16 +349,4 @@ END |
DELETE IGNORE FROM t1;
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
DROP TABLE t1;
-#
-# Bug #49552 : sql_buffer_result cause crash + not found records
-# in multitable delete/subquery
-#
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-SET SESSION SQL_BUFFER_RESULT=1;
-DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
-SET SESSION SQL_BUFFER_RESULT=DEFAULT;
-SELECT * FROM t1;
-a
-DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index f0b934ebd3a..28e798f5475 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -430,4 +430,24 @@ SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
b COUNT(DISTINCT a)
NULL 1
DROP TABLE t1;
+#
+# Bug#50995 Having clause on subquery result produces incorrect results.
+#
+CREATE TABLE t1
+(
+id1 INT,
+id2 INT NOT NULL,
+INDEX id1(id2)
+);
+INSERT INTO t1 SET id1=1, id2=1;
+INSERT INTO t1 SET id1=2, id2=1;
+INSERT INTO t1 SET id1=3, id2=1;
+SELECT t1.id1,
+(SELECT 0 FROM DUAL
+WHERE t1.id1=t1.id1) AS amount FROM t1
+WHERE t1.id2 = 1
+HAVING amount > 0
+ORDER BY t1.id1;
+id1 amount
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index f01d13934b9..81cbfa0d94f 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2281,6 +2281,20 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
1
DROP TABLE t1;
+#
+# Bug#50843: Filesort used instead of clustered index led to
+# performance degradation.
+#
+create table t1(f1 int not null primary key, f2 int) engine=innodb;
+create table t2(f1 int not null, key (f1)) engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3);
+insert into t2 values (1),(2),(3);
+explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 3
+1 SIMPLE t2 ref f1 f1 4 test.t1.f1 1 Using index
+drop table t1,t2;
+#
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 22218861ebc..d1234ecbd56 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1145,3 +1145,14 @@ NULL
NULL
1
DROP TABLE t1, t2, mm1;
+#
+# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+a b a b
+0 0 0 0
+1 1 1 1
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 5a589816dcd..e19bba971f9 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -327,3 +327,38 @@ drop table t1;
create table t1 select -9223372036854775809 bi;
describe t1;
drop table t1;
+
+--echo #
+--echo # Bug #45360: wrong results
+--echo #
+
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
+ a BIGINT(20) UNSIGNED,
+ b VARCHAR(20));
+
+INSERT INTO t1 (a) VALUES
+ (0),
+ (CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
+ (CAST(0x8000000000000000 AS UNSIGNED)),
+ (CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
+
+UPDATE t1 SET b = a;
+
+let $n = `SELECT MAX(id) FROM t1`;
+while($n) {
+ let $x = `SELECT a FROM t1 WHERE id = $n`;
+ dec $n;
+ let $hex = `SELECT HEX($x)`;
+ echo # $hex;
+
+ --disable_result_log
+ eval EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = $x AND TRIM(a) = b;
+ --enable_result_log
+ SHOW WARNINGS;
+}
+
+DROP TABLE t1;
+
+--echo # End of 5.1 tests
+
+
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 2f51fafd6a6..7bbc470137a 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -291,6 +291,21 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
DROP TABLE t1;
DROP FUNCTION f1;
+
+--echo #
+--echo # Bug #49552 : sql_buffer_result cause crash + not found records
+--echo # in multitable delete/subquery
+--echo #
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET SESSION SQL_BUFFER_RESULT=1;
+DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
+
+SET SESSION SQL_BUFFER_RESULT=DEFAULT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 5.0 tests
--echo #
@@ -360,18 +375,4 @@ DELETE IGNORE FROM t1;
DROP TABLE t1;
---echo #
---echo # Bug #49552 : sql_buffer_result cause crash + not found records
---echo # in multitable delete/subquery
---echo #
-
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-SET SESSION SQL_BUFFER_RESULT=1;
-DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
-
-SET SESSION SQL_BUFFER_RESULT=DEFAULT;
-SELECT * FROM t1;
-DROP TABLE t1;
-
--echo End of 5.1 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index af9af4fe1fc..185ca4bdddb 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -442,4 +442,30 @@ INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#50995 Having clause on subquery result produces incorrect results.
+--echo #
+
+CREATE TABLE t1
+(
+ id1 INT,
+ id2 INT NOT NULL,
+ INDEX id1(id2)
+);
+
+INSERT INTO t1 SET id1=1, id2=1;
+INSERT INTO t1 SET id1=2, id2=1;
+INSERT INTO t1 SET id1=3, id2=1;
+
+SELECT t1.id1,
+(SELECT 0 FROM DUAL
+ WHERE t1.id1=t1.id1) AS amount FROM t1
+WHERE t1.id2 = 1
+HAVING amount > 0
+ORDER BY t1.id1;
+
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index 4e2e46a3809..8432a209154 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -545,6 +545,18 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
DROP TABLE t1;
+--echo #
+--echo # Bug#50843: Filesort used instead of clustered index led to
+--echo # performance degradation.
+--echo #
+create table t1(f1 int not null primary key, f2 int) engine=innodb;
+create table t2(f1 int not null, key (f1)) engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3);
+insert into t2 values (1),(2),(3);
+explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
+drop table t1,t2;
+--echo #
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 645321a3a5e..761121313e5 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -816,3 +816,16 @@ CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
ENGINE=MERGE UNION=(t1,t2);
SELECT t1.a FROM mm1,t1;
DROP TABLE t1, t2, mm1;
+
+--echo #
+--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
+--echo #
+
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
+INSERT INTO t1 VALUES (0,0), (1,1);
+
+SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index cd758370388..1859dfce64a 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -112,7 +112,8 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh
mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
mysql_system_tables_fix.sql
@echo "Building $@";
- @cat $(srcdir)/mysql_system_tables.sql $(srcdir)/mysql_system_tables_fix.sql > $@
+ @cat $(srcdir)/mysql_system_tables.sql \
+ $(srcdir)/mysql_system_tables_fix.sql > $@
#
# Build mysql_fix_privilege_tables_sql.c from
diff --git a/sql/item.cc b/sql/item.cc
index a30c1dafac8..ced3afcc1c6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2210,14 +2210,14 @@ String *Item_int::val_str(String *str)
{
// following assert is redundant, because fixed=1 assigned in constructor
DBUG_ASSERT(fixed == 1);
- str->set(value, &my_charset_bin);
+ str->set_int(value, unsigned_flag, &my_charset_bin);
return str;
}
void Item_int::print(String *str, enum_query_type query_type)
{
// my_charset_bin is good enough for numbers
- str_value.set(value, &my_charset_bin);
+ str_value.set_int(value, unsigned_flag, &my_charset_bin);
str->append(str_value);
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index f498873a7ad..c3afeebb577 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1477,9 +1477,21 @@ public:
Item_cond(THD *thd, Item_cond *item);
Item_cond(List<Item> &nlist)
:Item_bool_func(), list(nlist), abort_on_null(0) {}
- bool add(Item *item) { return list.push_back(item); }
- bool add_at_head(Item *item) { return list.push_front(item); }
- void add_at_head(List<Item> *nlist) { list.prepand(nlist); }
+ bool add(Item *item)
+ {
+ DBUG_ASSERT(item);
+ return list.push_back(item);
+ }
+ bool add_at_head(Item *item)
+ {
+ DBUG_ASSERT(item);
+ return list.push_front(item);
+ }
+ void add_at_head(List<Item> *nlist)
+ {
+ DBUG_ASSERT(nlist->elements);
+ list.prepand(nlist);
+ }
bool fix_fields(THD *, Item **ref);
enum Type type() const { return COND_ITEM; }
diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am
index 06b349d5de2..b7a9e4ca78b 100644
--- a/sql/share/Makefile.am
+++ b/sql/share/Makefile.am
@@ -22,7 +22,7 @@ dist-hook:
test -d $(distdir)/$$dir || mkdir $(distdir)/$$dir; \
$(INSTALL_DATA) $(srcdir)/$$dir/*.* $(distdir)/$$dir; \
done; \
- sleep 1 ; touch $(srcdir)/*/errmsg.sys
+ sleep 1 ; touch $(builddir)/*/errmsg.sys
$(INSTALL_DATA) $(srcdir)/charsets/README $(distdir)/charsets
$(INSTALL_DATA) $(srcdir)/charsets/Index.xml $(distdir)/charsets
@@ -39,11 +39,11 @@ install-data-local:
for lang in @AVAILABLE_LANGUAGES@; \
do \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$$lang; \
- $(INSTALL_DATA) $(srcdir)/$$lang/errmsg.sys \
+ $(INSTALL_DATA) $(builddir)/$$lang/errmsg.sys \
$(DESTDIR)$(pkgdatadir)/$$lang/errmsg.sys; \
done
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/charsets
- $(INSTALL_DATA) $(srcdir)/errmsg-utf8.txt \
+ $(INSTALL_DATA) $(builddir)/errmsg-utf8.txt \
$(DESTDIR)$(pkgdatadir)/errmsg-utf8.txt; \
$(INSTALL_DATA) $(srcdir)/charsets/README $(DESTDIR)$(pkgdatadir)/charsets/README
$(INSTALL_DATA) $(srcdir)/charsets/*.xml $(DESTDIR)$(pkgdatadir)/charsets
@@ -53,7 +53,7 @@ uninstall-local:
@RM@ -f -r $(DESTDIR)$(pkgdatadir)
distclean-local:
- @RM@ -f */errmsg.sys
+ @RM@ -f $(builddir)/*/errmsg.sys
# Do nothing
link_sources:
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b79ab3e9699..272ee7b00fa 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7135,9 +7135,11 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
}
if (order)
{
- found++;
- DBUG_ASSERT(!(order->used & map));
- order->used|=map;
+ if (!(order->used & map))
+ {
+ found++;
+ order->used|= map;
+ }
continue; // Used in ORDER BY
}
if (!only_eq_ref_tables(join,start_order, (*ref_item)->used_tables()))
@@ -8305,7 +8307,8 @@ static Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels,
else
{
DBUG_ASSERT(cond->type() == Item::COND_ITEM);
- ((Item_cond *) cond)->add_at_head(&eq_list);
+ if (eq_list.elements)
+ ((Item_cond *) cond)->add_at_head(&eq_list);
}
cond->quick_fix_field();
@@ -13424,12 +13427,6 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/
if (select_limit >= table_records)
{
- /*
- filesort() and join cache are usually faster than reading in
- index order and not using join cache
- */
- if (tab->type == JT_ALL && tab->join->tables > tab->join->const_tables + 1)
- DBUG_RETURN(0);
keys= *table->file->keys_to_use_for_scanning();
keys.merge(table->covering_keys);
@@ -13579,6 +13576,19 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
}
}
}
+
+ /*
+ filesort() and join cache are usually faster than reading in
+ index order and not using join cache, except in case that chosen
+ index is clustered primary key.
+ */
+ if ((select_limit >= table_records) &&
+ (tab->type == JT_ALL &&
+ tab->join->tables > tab->join->const_tables + 1) &&
+ ((unsigned) best_key != table->s->primary_key ||
+ !table->file->primary_key_is_clustered()))
+ DBUG_RETURN(0);
+
if (best_key >= 0)
{
bool quick_created= FALSE;
@@ -15790,7 +15800,7 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
Item_cond_and *cond=new Item_cond_and();
TABLE *table=join_tab->table;
- int error;
+ int error= 0;
if (!cond)
DBUG_RETURN(TRUE);
@@ -15808,7 +15818,8 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
cond->fix_fields(thd, (Item**)&cond);
if (join_tab->select)
{
- error=(int) cond->add(join_tab->select->cond);
+ if (join_tab->select->cond)
+ error=(int) cond->add(join_tab->select->cond);
join_tab->select_cond=join_tab->select->cond=cond;
}
else if ((join_tab->select= make_select(join_tab->table, 0, 0, cond, 0,
diff --git a/storage/ndb/src/common/util/Makefile.am b/storage/ndb/src/common/util/Makefile.am
index 5379a425c49..5cf02fed12f 100644
--- a/storage/ndb/src/common/util/Makefile.am
+++ b/storage/ndb/src/common/util/Makefile.am
@@ -37,7 +37,7 @@ testBitmask_LDFLAGS = @ndb_bin_am_ldflags@ \
testBitmask.cpp : Bitmask.cpp
rm -f testBitmask.cpp
- @LN_CP_F@ Bitmask.cpp testBitmask.cpp
+ @LN_CP_F@ $(srcdir)/Bitmask.cpp testBitmask.cpp
testBitmask.o: $(testBitmask_SOURCES)
$(CXXCOMPILE) -c $(INCLUDES) -D__TEST_BITMASK__ $<