Commit a88c86f6 authored by Tatiana A. Nurnberg's avatar Tatiana A. Nurnberg

auto-merge

parents e8d45e1b b1dbd5c5
...@@ -23,7 +23,7 @@ EXTRA_DIST = $(man1_MANS) $(man8_MANS) ...@@ -23,7 +23,7 @@ EXTRA_DIST = $(man1_MANS) $(man8_MANS)
# "make_win_*" are not needed in Unix binary packages, # "make_win_*" are not needed in Unix binary packages,
install-data-hook: install-data-hook:
rm -f $(DESTDIR)$(manlibdir)/man1/make_win_* rm -f $(DESTDIR)$(mandir)/man1/make_win_*
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --embedded --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
...@@ -4383,6 +4383,34 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -4383,6 +4383,34 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY C ALL NULL NULL NULL NULL 20 100.00 Using where 1 PRIMARY C ALL NULL NULL NULL NULL 20 100.00 Using where
DROP TABLE C; DROP TABLE C;
# End of test for bug#45061. # End of test for bug#45061.
#
# Bug #46749: Segfault in add_key_fields() with outer subquery level
# field references
#
CREATE TABLE t1 (
a int,
b int,
UNIQUE (a), KEY (b)
);
INSERT INTO t1 VALUES (1,1), (2,1);
CREATE TABLE st1 like t1;
INSERT INTO st1 VALUES (1,1), (2,1);
CREATE TABLE st2 like t1;
INSERT INTO st2 VALUES (1,1), (2,1);
EXPLAIN
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
FROM t1
WHERE a = 230;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY st1 index NULL a 5 NULL 2 Using index
2 DEPENDENT SUBQUERY st2 index b b 5 NULL 2 Using where; Using index; Using join buffer
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
FROM t1
WHERE a = 230;
MAX(b) (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
NULL 0
DROP TABLE t1, st1, st2;
End of 5.0 tests. End of 5.0 tests.
CREATE TABLE t1 (a INT, b INT); CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22); INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
......
...@@ -3699,117 +3699,6 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; ...@@ -3699,117 +3699,6 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
ERROR 42000: Key 'c2' doesn't exist in table 'v1' ERROR 42000: Key 'c2' doesn't exist in table 'v1'
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #45806 crash when replacing into a view with a join!
#
CREATE TABLE t1(a INT UNIQUE);
CREATE VIEW v1 AS SELECT t1.a FROM t1, t1 AS a;
INSERT INTO t1 VALUES (1), (2);
REPLACE INTO v1(a) SELECT 1 FROM t1,t1 AS c;
SELECT * FROM v1;
a
1
2
1
2
REPLACE INTO v1(a) SELECT 3 FROM t1,t1 AS c;
SELECT * FROM v1;
a
1
2
3
1
2
3
1
2
3
DELETE FROM t1 WHERE a=3;
INSERT INTO v1(a) SELECT 1 FROM t1,t1 AS c
ON DUPLICATE KEY UPDATE `v1`.`a`= 1;
SELECT * FROM v1;
a
1
2
1
2
CREATE VIEW v2 AS SELECT t1.a FROM t1, v1 AS a;
REPLACE INTO v2(a) SELECT 1 FROM t1,t1 AS c;
SELECT * FROM v2;
a
1
2
1
2
1
2
1
2
REPLACE INTO v2(a) SELECT 3 FROM t1,t1 AS c;
SELECT * FROM v2;
a
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
INSERT INTO v2(a) SELECT 1 FROM t1,t1 AS c
ON DUPLICATE KEY UPDATE `v2`.`a`= 1;
SELECT * FROM v2;
a
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
DROP VIEW v1;
DROP VIEW v2;
DROP TABLE t1;
# -- End of test case for Bug#45806
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- Bug#40825: Error 1356 while selecting from a view # -- Bug#40825: Error 1356 while selecting from a view
# -- with a "HAVING" clause though query works # -- with a "HAVING" clause though query works
......
...@@ -3336,6 +3336,38 @@ EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); ...@@ -3336,6 +3336,38 @@ EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`);
DROP TABLE C; DROP TABLE C;
--echo # End of test for bug#45061. --echo # End of test for bug#45061.
--echo #
--echo # Bug #46749: Segfault in add_key_fields() with outer subquery level
--echo # field references
--echo #
CREATE TABLE t1 (
a int,
b int,
UNIQUE (a), KEY (b)
);
INSERT INTO t1 VALUES (1,1), (2,1);
CREATE TABLE st1 like t1;
INSERT INTO st1 VALUES (1,1), (2,1);
CREATE TABLE st2 like t1;
INSERT INTO st2 VALUES (1,1), (2,1);
# should have "impossible where"
EXPLAIN
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
FROM t1
WHERE a = 230;
# should not crash
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
FROM t1
WHERE a = 230;
DROP TABLE t1, st1, st2;
--echo End of 5.0 tests. --echo End of 5.0 tests.
# #
......
...@@ -3680,38 +3680,6 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; ...@@ -3680,38 +3680,6 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug #45806 crash when replacing into a view with a join!
--echo #
CREATE TABLE t1(a INT UNIQUE);
CREATE VIEW v1 AS SELECT t1.a FROM t1, t1 AS a;
INSERT INTO t1 VALUES (1), (2);
REPLACE INTO v1(a) SELECT 1 FROM t1,t1 AS c;
SELECT * FROM v1;
REPLACE INTO v1(a) SELECT 3 FROM t1,t1 AS c;
SELECT * FROM v1;
DELETE FROM t1 WHERE a=3;
INSERT INTO v1(a) SELECT 1 FROM t1,t1 AS c
ON DUPLICATE KEY UPDATE `v1`.`a`= 1;
SELECT * FROM v1;
CREATE VIEW v2 AS SELECT t1.a FROM t1, v1 AS a;
REPLACE INTO v2(a) SELECT 1 FROM t1,t1 AS c;
SELECT * FROM v2;
REPLACE INTO v2(a) SELECT 3 FROM t1,t1 AS c;
SELECT * FROM v2;
INSERT INTO v2(a) SELECT 1 FROM t1,t1 AS c
ON DUPLICATE KEY UPDATE `v2`.`a`= 1;
SELECT * FROM v2;
DROP VIEW v1;
DROP VIEW v2;
DROP TABLE t1;
--echo # -- End of test case for Bug#45806
--echo # ----------------------------------------------------------------- --echo # -----------------------------------------------------------------
--echo # -- Bug#40825: Error 1356 while selecting from a view --echo # -- Bug#40825: Error 1356 while selecting from a view
--echo # -- with a "HAVING" clause though query works --echo # -- with a "HAVING" clause though query works
......
...@@ -232,10 +232,13 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, ...@@ -232,10 +232,13 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
buffer_block= cachesize; buffer_block= cachesize;
if (type == SEQ_READ_APPEND) if (type == SEQ_READ_APPEND)
buffer_block *= 2; buffer_block *= 2;
if ((info->buffer= /*
(uchar*) my_malloc(buffer_block, Unset MY_WAIT_IF_FULL bit if it is set, to prevent conflict with
MYF((cache_myflags & ~ MY_WME) | MY_ZEROFILL.
(cachesize == min_cache ? MY_WME : 0)))) != 0) */
myf flag = MYF((cache_myflags & ~ (MY_WME | MY_WAIT_IF_FULL)) |
(cachesize == min_cache ? MY_WME : 0));
if ((info->buffer= (uchar*) my_malloc(buffer_block, flag)) != 0)
{ {
info->write_buffer=info->buffer; info->write_buffer=info->buffer;
if (type == SEQ_READ_APPEND) if (type == SEQ_READ_APPEND)
......
...@@ -3299,6 +3299,28 @@ add_key_equal_fields(KEY_FIELD **key_fields, uint and_level, ...@@ -3299,6 +3299,28 @@ add_key_equal_fields(KEY_FIELD **key_fields, uint and_level,
} }
} }
/**
Check if an expression is a non-outer field.
Checks if an expression is a field and belongs to the current select.
@param field Item expression to check
@return boolean
@retval TRUE the expression is a local field
@retval FALSE it's something else
*/
inline static bool
is_local_field (Item *field)
{
field= field->real_item();
return field->type() == Item::FIELD_ITEM &&
!((Item_field *)field)->depended_from;
}
static void static void
add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
COND *cond, table_map usable_tables, COND *cond, table_map usable_tables,
...@@ -3374,13 +3396,12 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3374,13 +3396,12 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
{ {
Item **values; Item **values;
// BETWEEN, IN, NE // BETWEEN, IN, NE
if (cond_func->key_item()->real_item()->type() == Item::FIELD_ITEM && if (is_local_field (cond_func->key_item()) &&
!(cond_func->used_tables() & OUTER_REF_TABLE_BIT)) !(cond_func->used_tables() & OUTER_REF_TABLE_BIT))
{ {
values= cond_func->arguments()+1; values= cond_func->arguments()+1;
if (cond_func->functype() == Item_func::NE_FUNC && if (cond_func->functype() == Item_func::NE_FUNC &&
cond_func->arguments()[1]->real_item()->type() == Item::FIELD_ITEM && is_local_field (cond_func->arguments()[1]))
!(cond_func->arguments()[0]->used_tables() & OUTER_REF_TABLE_BIT))
values--; values--;
DBUG_ASSERT(cond_func->functype() != Item_func::IN_FUNC || DBUG_ASSERT(cond_func->functype() != Item_func::IN_FUNC ||
cond_func->argument_count() != 2); cond_func->argument_count() != 2);
...@@ -3396,9 +3417,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3396,9 +3417,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
for (uint i= 1 ; i < cond_func->argument_count() ; i++) for (uint i= 1 ; i < cond_func->argument_count() ; i++)
{ {
Item_field *field_item; Item_field *field_item;
if (cond_func->arguments()[i]->real_item()->type() == Item::FIELD_ITEM if (is_local_field (cond_func->arguments()[i]))
&&
!(cond_func->arguments()[i]->used_tables() & OUTER_REF_TABLE_BIT))
{ {
field_item= (Item_field *) (cond_func->arguments()[i]->real_item()); field_item= (Item_field *) (cond_func->arguments()[i]->real_item());
add_key_equal_fields(key_fields, *and_level, cond_func, add_key_equal_fields(key_fields, *and_level, cond_func,
...@@ -3414,8 +3433,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3414,8 +3433,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
bool equal_func=(cond_func->functype() == Item_func::EQ_FUNC || bool equal_func=(cond_func->functype() == Item_func::EQ_FUNC ||
cond_func->functype() == Item_func::EQUAL_FUNC); cond_func->functype() == Item_func::EQUAL_FUNC);
if (cond_func->arguments()[0]->real_item()->type() == Item::FIELD_ITEM && if (is_local_field (cond_func->arguments()[0]))
!(cond_func->arguments()[0]->used_tables() & OUTER_REF_TABLE_BIT))
{ {
add_key_equal_fields(key_fields, *and_level, cond_func, add_key_equal_fields(key_fields, *and_level, cond_func,
(Item_field*) (cond_func->arguments()[0])->real_item(), (Item_field*) (cond_func->arguments()[0])->real_item(),
...@@ -3423,9 +3441,8 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3423,9 +3441,8 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
cond_func->arguments()+1, 1, usable_tables, cond_func->arguments()+1, 1, usable_tables,
sargables); sargables);
} }
if (cond_func->arguments()[1]->real_item()->type() == Item::FIELD_ITEM && if (is_local_field (cond_func->arguments()[1]) &&
cond_func->functype() != Item_func::LIKE_FUNC && cond_func->functype() != Item_func::LIKE_FUNC)
!(cond_func->arguments()[1]->used_tables() & OUTER_REF_TABLE_BIT))
{ {
add_key_equal_fields(key_fields, *and_level, cond_func, add_key_equal_fields(key_fields, *and_level, cond_func,
(Item_field*) (cond_func->arguments()[1])->real_item(), (Item_field*) (cond_func->arguments()[1])->real_item(),
...@@ -3437,7 +3454,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3437,7 +3454,7 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
} }
case Item_func::OPTIMIZE_NULL: case Item_func::OPTIMIZE_NULL:
/* column_name IS [NOT] NULL */ /* column_name IS [NOT] NULL */
if (cond_func->arguments()[0]->real_item()->type() == Item::FIELD_ITEM && if (is_local_field (cond_func->arguments()[0]) &&
!(cond_func->used_tables() & OUTER_REF_TABLE_BIT)) !(cond_func->used_tables() & OUTER_REF_TABLE_BIT))
{ {
Item *tmp=new Item_null; Item *tmp=new Item_null;
......
...@@ -31,6 +31,20 @@ ...@@ -31,6 +31,20 @@
%{?_with_yassl:%define YASSL_BUILD 1} %{?_with_yassl:%define YASSL_BUILD 1}
%{!?_with_yassl:%define YASSL_BUILD 0} %{!?_with_yassl:%define YASSL_BUILD 0}
# ----------------------------------------------------------------------
# use "rpmbuild --with bundled_zlib" or "rpm --define '_with_bundled_zlib 1'"
# (for RPM 3.x) to build using the bundled zlib (off by default)
# ----------------------------------------------------------------------
%{?_with_bundled_zlib:%define WITH_BUNDLED_ZLIB 1}
%{!?_with_bundled_zlib:%define WITH_BUNDLED_ZLIB 0}
# ----------------------------------------------------------------------
# use "rpmbuild --without innodb_plugin" or "rpm --define '_without_innodb_plugin 1'"
# (for RPM 3.x) to not build the innodb plugin (on by default with innodb builds)
# ----------------------------------------------------------------------
%{?_without_innodb_plugin:%define WITHOUT_INNODB_PLUGIN 1}
%{!?_without_innodb_plugin:%define WITHOUT_INNODB_PLUGIN 0}
# use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x) # use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x)
# to build with cluster support (off by default) # to build with cluster support (off by default)
%{?_with_cluster:%define CLUSTER_BUILD 1} %{?_with_cluster:%define CLUSTER_BUILD 1}
...@@ -292,6 +306,9 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ ...@@ -292,6 +306,9 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--enable-thread-safe-client \ --enable-thread-safe-client \
--with-readline \ --with-readline \
--with-innodb \ --with-innodb \
%if %{WITHOUT_INNODB_PLUGIN}
--without-plugin-innodb_plugin \
%endif
%if %{CLUSTER_BUILD} %if %{CLUSTER_BUILD}
--with-ndbcluster \ --with-ndbcluster \
%else %else
...@@ -301,8 +318,13 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ ...@@ -301,8 +318,13 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--with-csv-storage-engine \ --with-csv-storage-engine \
--with-blackhole-storage-engine \ --with-blackhole-storage-engine \
--with-federated-storage-engine \ --with-federated-storage-engine \
--without-plugin-daemon_example \
--without-plugin-example \
--with-partition \ --with-partition \
--with-big-tables \ --with-big-tables \
%if %{WITH_BUNDLED_ZLIB}
--with-zlib-dir=bundled \
%endif
--enable-shared \ --enable-shared \
" "
make make
...@@ -426,7 +448,7 @@ install -d $RBR%{_sbindir} ...@@ -426,7 +448,7 @@ install -d $RBR%{_sbindir}
# Install all binaries # Install all binaries
(cd $MBD && make install DESTDIR=$RBR benchdir_root=%{_datadir}) (cd $MBD && make install DESTDIR=$RBR testroot=%{_datadir})
# Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do # Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do
# the same here. # the same here.
mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/ mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/
...@@ -693,6 +715,8 @@ fi ...@@ -693,6 +715,8 @@ fi
%attr(755, root, root) %{_bindir}/resolve_stack_dump %attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/resolveip %attr(755, root, root) %{_bindir}/resolveip
%attr(755, root, root) %{_libdir}/plugin/*.so*
%attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqld-debug
%attr(755, root, root) %{_sbindir}/mysqlmanager %attr(755, root, root) %{_sbindir}/mysqlmanager
...@@ -818,6 +842,8 @@ fi ...@@ -818,6 +842,8 @@ fi
%{_libdir}/mysql/libvio.a %{_libdir}/mysql/libvio.a
%{_libdir}/mysql/libz.a %{_libdir}/mysql/libz.a
%{_libdir}/mysql/libz.la %{_libdir}/mysql/libz.la
%{_libdir}/plugin/*.a
%{_libdir}/plugin/*.la
%files shared %files shared
%defattr(-, root, root, 0755) %defattr(-, root, root, 0755)
...@@ -847,6 +873,19 @@ fi ...@@ -847,6 +873,19 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %changelog
* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
- Add conditionals for bundled zlib and innodb plugin
* Fri Aug 21 2009 Jonathan Perkin <jperkin@sun.com>
- Install plugin libraries in appropriate packages.
- Disable example plugins.
* Thu Aug 20 2009 Jonathan Perkin <jperkin@stripped>
- Update variable used for mysql-test suite location to match source.
* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com> * Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
- Correct yesterday's fix, so that it also works for the last flag, - Correct yesterday's fix, so that it also works for the last flag,
......
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