diff options
-rw-r--r-- | .bzrignore | 9 | ||||
-rw-r--r-- | BitKeeper/etc/logging_ok | 1 | ||||
-rw-r--r-- | Docs/manual.texi | 3 | ||||
-rw-r--r-- | mysql-test/r/3.23/sel000100.result | 2 | ||||
-rw-r--r-- | mysql-test/t/3.23/sel000100.test | 30 | ||||
-rw-r--r-- | sql/sql_select.cc | 4 |
6 files changed, 48 insertions, 1 deletions
diff --git a/.bzrignore b/.bzrignore index d0f97026511..682518d38ce 100644 --- a/.bzrignore +++ b/.bzrignore @@ -392,3 +392,12 @@ Docs/manual.tp Docs/manual.vr Docs/manual_a4.ps Docs/manual_letter.ps +mysql-test/var/lib/test/test1.frm +mysql-test/var/lib/test/test1.MYD +mysql-test/var/lib/test/test1.MYI +mysql-test/var/lib/test/test2.frm +mysql-test/var/lib/test/test2.MYD +mysql-test/var/lib/test/test2.MYI +mysql-test/var/run/mysqld.pid +mysql-test/var/tmp/mysql.sock +mysql-test/var/lib/mysql-bin.008 diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 7ab610f0263..c2a3da12247 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -14,3 +14,4 @@ tim@threads.polyesthetic.msg tim@work.mysql.com yfaktoro@nbyfaktoro.bedford.progress.com yfaktoro@nslinuxw2.bedford.progress.com +sasha@donna.mysql.com diff --git a/Docs/manual.texi b/Docs/manual.texi index cf21ce894b5..80e3386e4a3 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -39275,6 +39275,9 @@ though, so Version 3.23 is not released as a stable version yet. @appendixsubsec Changes in release 3.23.29 @itemize @bullet @item +Fixed bug when doing a @code{SELECT DISTINCT ... table1 LEFT JOIN +table2..} when table2 was empty. +@item Added @code{--abort-slave-event-count} and @code{--disconnect-slave-event-count} options to @code{mysqld} for debugging and testing of replication diff --git a/mysql-test/r/3.23/sel000100.result b/mysql-test/r/3.23/sel000100.result new file mode 100644 index 00000000000..6c204279c28 --- /dev/null +++ b/mysql-test/r/3.23/sel000100.result @@ -0,0 +1,2 @@ +key_link_id link +NULL NULL diff --git a/mysql-test/t/3.23/sel000100.test b/mysql-test/t/3.23/sel000100.test new file mode 100644 index 00000000000..cd3f7005445 --- /dev/null +++ b/mysql-test/t/3.23/sel000100.test @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS test1; +DROP TABLE IF EXISTS test2; + +CREATE TABLE test1 ( + ID int(11) NOT NULL auto_increment, + NAME varchar(75) DEFAULT '' NOT NULL, + LINK_ID int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (ID), + KEY NAME (NAME), + KEY LINK_ID (LINK_ID) +); + +INSERT INTO test1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); +INSERT INTO test1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); +INSERT INTO test1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); + +CREATE TABLE test2 ( + ID int(11) NOT NULL auto_increment, + NAME varchar(150) DEFAULT '' NOT NULL, + PRIMARY KEY (ID), + KEY NAME (NAME) +); + +@r/3.23/sel000100.result SELECT DISTINCT + test2.id AS key_link_id, + test2.name AS link +FROM test1 +LEFT JOIN test2 ON test1.link_id=test2.id +GROUP BY test1.id +ORDER BY link; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8856d31645c..31fc3f28099 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5218,8 +5218,10 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields) List_iterator<Item> it(fields); Item *item; while ((item=it++)) - if (item->tmp_table_field()) + { + if (item->tmp_table_field() && ! item->const_item()) field_count++; + } if (!field_count) { // only const items |