small medium large xlarge

Generic-user-small
04 Jul 2010, 18:17
Filipe Fernandes (1 post)

I’ve posted an errata, but in hindsight, it would have been better to discuss this in the forum.

The query presented in page 205 of v1.0 of the pdf is described as producing a Cartesian product because the two Bugs table references are not constrained to each-other.

But they are constrained (each) to one possible row in the BugsProducts table. The first ‘left outer join’, should join those rows in ‘Bugs f’ to BugsProducts, producing an intermediate table at which point the second ‘left outer join’ for ‘Bugs o’ is again constrained to the bug_id values found in the intermediate table.

Ignore the intermediate table, that’s just how I think about it; but when trying out the query locally, I get the intended results.

+------------+-------------+--------------+
| product_id | count_fixed | count_opened |
+------------+-------------+--------------+
|          1 |          12 |            7 |
+------------+-------------+--------------+
1 row in set (0.00 sec)

Incidentally, the diagram in page 206 only shows 11 bugs fixed (but that’s neither here nor there).

Bk2_pragsmall
21 Jun 2012, 17:28
Bill Karwin (19 posts)

Thanks Filipe, I think I have corrected the examples in recent reprintings of the book.

Generic-user-small
31 Aug 2012, 05:00
Pete Keller (1 post)

Still not fully fixed in 3.0.

PDF page 193, Each of the twelve rows for FIXED bugs is paired with all seven rows for OPEN bugs. twelve should be eleven.

further down page 193: The result produces twelve times seven rows. again twelve should be eleven.

  You must be logged in to comment