Below is the list of changes that have just been committed into a local
5.0 repository of patg. When patg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1907 05/05/25 02:15:09 patg@stripped +4 -0
changes to fix joins not working (bug #10848). New tests, as well as table->status
being set in index_read_idx
BitKeeper/etc/logging_ok
1.318 05/05/25 02:15:08 patg@stripped +1 -0
Logging to logging@stripped accepted
sql/ha_federated.cc
1.26 05/05/25 02:12:40 patg@stripped +2 -0
This fixes joins not working. Monty discussed that having to deal
with table->status needs to be moved from the handler/storage engine
to a higher level
mysql-test/t/federated.test
1.9 05/05/25 02:12:40 patg@stripped +32 -2
new simple join tests (more to come with subsequent commits)
mysql-test/r/federated.result
1.11 05/05/25 02:12:40 patg@stripped +50 -2
new join test results
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: patg
# Host: radha.local
# Root: /Users/patg/mysql-5.0
--- 1.317/BitKeeper/etc/logging_ok Tue May 24 00:31:13 2005
+++ 1.318/BitKeeper/etc/logging_ok Wed May 25 02:15:08 2005
@@ -205,6 +205,7 @@
patg@stripped
patg@stripped
patg@stripped
+patg@stripped
paul@stripped
paul@stripped
paul@stripped
--- 1.10/mysql-test/r/federated.result Mon Mar 21 08:10:02 2005
+++ 1.11/mysql-test/r/federated.result Wed May 25 02:12:40 2005
@@ -906,9 +906,57 @@
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1, federated.countries WHERE
+federated.t1.country_id = federated.countries.id;
+name country_id other country
+Kumar 1 11111 India
+Lenz 2 22222 Germany
+Marizio 3 33333 Italy
+Monty 4 33333 Finland
+Sanja 5 33333 Ukraine
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1 INNER JOIN federated.countries ON
+federated.t1.country_id = federated.countries.id;
+name country_id other country
+Kumar 1 11111 India
+Lenz 2 22222 Germany
+Marizio 3 33333 Italy
+Monty 4 33333 Finland
+Sanja 5 33333 Ukraine
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1 INNER JOIN federated.countries ON
+federated.t1.country_id = federated.countries.id
+WHERE federated.t1.name = 'Monty';
+name country_id other country
+Monty 4 33333 Finland
SELECT federated.t1.*, federated.countries.country
-FROM federated.t1 left join federated.countries
-ON federated.t1.country_id = federated.countries.id;
+FROM federated.t1 LEFT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.countries.id;
+id country_id name other country
+1 1 Kumar 11111 India
+2 2 Lenz 22222 Germany
+3 3 Marizio 33333 Italy
+4 4 Monty 33333 Finland
+5 5 Sanja 33333 Ukraine
+SELECT federated.t1.*, federated.countries.country
+FROM federated.t1 LEFT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.countries.country;
+id country_id name other country
+4 4 Monty 33333 Finland
+2 2 Lenz 22222 Germany
+1 1 Kumar 11111 India
+3 3 Marizio 33333 Italy
+5 5 Sanja 33333 Ukraine
+SELECT federated.t1.*, federated.countries.country
+FROM federated.t1 RIGHT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.t1.country_id;
id country_id name other country
1 1 Kumar 11111 India
2 2 Lenz 22222 Germany
--- 1.8/mysql-test/t/federated.test Mon Mar 21 08:10:02 2005
+++ 1.9/mysql-test/t/federated.test Wed May 25 02:12:40 2005
@@ -861,9 +861,39 @@
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
+#inner join
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1, federated.countries WHERE
+federated.t1.country_id = federated.countries.id;
+
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1 INNER JOIN federated.countries ON
+federated.t1.country_id = federated.countries.id;
+
+SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
+federated.t1.other AS other, federated.countries.country AS country
+FROM federated.t1 INNER JOIN federated.countries ON
+federated.t1.country_id = federated.countries.id
+WHERE federated.t1.name = 'Monty';
+
+#left join
SELECT federated.t1.*, federated.countries.country
-FROM federated.t1 left join federated.countries
-ON federated.t1.country_id = federated.countries.id;
+FROM federated.t1 LEFT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.countries.id;
+
+SELECT federated.t1.*, federated.countries.country
+FROM federated.t1 LEFT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.countries.country;
+
+#right join
+SELECT federated.t1.*, federated.countries.country
+FROM federated.t1 RIGHT JOIN federated.countries
+ON federated.t1.country_id = federated.countries.id
+ORDER BY federated.t1.country_id;
DROP TABLE federated.countries;
--- 1.25/sql/ha_federated.cc Mon May 23 20:55:04 2005
+++ 1.26/sql/ha_federated.cc Wed May 25 02:12:40 2005
@@ -1526,6 +1526,8 @@
table->status= STATUS_NOT_FOUND;
DBUG_RETURN(mysql_errno(mysql));
}
+ /* very important - joins will not work without this! */
+ table->status=0;
DBUG_RETURN(rnd_next(buf));
}
| Thread |
|---|
| • bk commit into 5.0 tree (patg:1.1907) BUG#10848 | Patrick Galbraith | 25 May |