gkodinov/kgeorge@macbook.gmz
16d2d68257
BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
...
Two problems here:
Problem 1:
While constructing the join columns list the optimizer does as follows:
1. Sets the join_using_fields/natural_join members of the right JOIN
operand.
2. Makes a "table reference" (TABLE_LIST) to parent the two tables.
3. Assigns the join_using_fields/is_natural_join of the wrapper table
using join_using_fields/natural_join of the rightmost table
4. Sets join_using_fields to NULL for the right JOIN operand.
5. Passes the parent table up to the same procedure on the upper
level.
Step 1 overrides the the join_using_fields that are set for a nested
join wrapping table in step 4.
Fixed by making a designated variable SELECT_LEX::prev_join_using to
pass the data from step 1 to step 4 without destroying the wrapping
table data.
Problem 2:
The optimizer checks for ambiguous columns while transforming
NATURAL JOIN/JOIN USING to JOIN ON. While doing that there was no
distinction between columns that are used in the generated join
condition (where ambiguity can be checked) and the other columns
(where ambiguity can be checked only when resolving references
coming from outside the JOIN construct itself).
Fixed by allowing the non-USING columns to be present in multiple
copies in both sides of the join and moving the ambiguity check
to the place where unqualified references to the join columns are
resolved (find_field_in_natural_join()).
2007-01-31 16:04:38 +02:00
..
2006-12-13 16:29:33 +04:00
2006-09-28 14:32:30 -04:00
2006-05-29 16:27:45 +02:00
2006-05-04 18:35:58 +03:00
2006-06-17 02:57:50 +04:00
2006-08-02 17:15:50 +05:00
2006-11-13 20:06:45 +04:00
2006-11-15 12:23:07 -05:00
2006-07-10 20:46:05 +02:00
2006-05-04 11:55:09 +05:00
2006-09-13 15:18:14 +04:00
2006-07-12 13:22:38 -07:00
2006-10-03 16:14:23 +02:00
2006-09-29 16:29:39 +05:00
2006-11-28 15:44:11 +02:00
2006-05-31 22:55:45 -07:00
2006-10-03 15:33:44 +02:00
2006-06-04 21:27:41 +03:00
2006-10-19 01:01:54 +02:00
2006-10-13 08:48:47 +02:00
2006-03-21 14:35:49 +01:00
2006-11-20 22:42:06 +02:00
2006-03-23 14:03:39 +04:00
2006-09-29 16:24:11 +05:00
2006-04-06 10:51:23 +05:00
2006-04-18 18:10:47 +02:00
2006-10-30 10:14:03 +04:00
2006-05-24 00:55:53 +02:00
2006-08-11 13:19:44 +05:00
2006-10-03 14:17:12 +05:00
2006-03-23 14:03:39 +04:00
2006-11-09 14:41:34 +04:00
2006-11-22 14:06:37 +04:00
2006-11-09 18:33:58 -05:00
2006-09-20 11:05:11 +02:00
2007-01-12 16:43:52 +03:00
2006-07-19 22:33:19 +04:00
2007-01-05 14:02:50 +02:00
2006-05-09 23:01:31 +03:00
2006-10-04 13:09:37 +02:00
2006-09-27 14:42:56 -04:00
2006-05-31 18:10:02 -07:00
2006-11-29 13:56:59 -05:00
2006-11-29 12:04:29 +01:00
2006-11-29 12:04:29 +01:00
2006-12-01 09:49:19 +01:00
2007-01-03 03:35:57 +04:00
2006-12-08 15:22:46 +04:00
2006-10-04 13:09:37 +02:00
2006-10-04 13:09:37 +02:00
2006-07-18 16:04:18 -07:00
2006-06-16 09:49:18 +02:00
2006-07-18 16:04:18 -07:00
2006-10-30 10:14:03 +04:00
2006-10-13 19:09:22 +05:00
2006-06-15 01:48:41 +04:00
2006-10-02 12:37:01 +02:00
2006-11-30 18:47:59 +02:00
2006-11-30 18:47:59 +02:00
2006-09-13 15:18:14 +04:00
2007-01-15 19:15:52 +02:00
2006-06-27 21:28:32 +04:00
2006-11-27 14:58:57 -05:00
2006-04-13 15:07:50 +03:00
2006-10-11 14:16:30 +04:00
2007-01-12 17:35:24 +03:00
2006-06-27 21:28:32 +04:00
2006-11-06 23:02:40 -05:00
2006-11-29 13:41:03 +04:00
2006-06-22 20:50:38 +02:00
2006-12-19 15:04:26 +02:00
2006-12-07 15:22:43 +04:00
2006-10-04 13:09:37 +02:00
2006-08-30 01:48:15 +04:00
2007-01-11 23:18:01 +03:00
2006-11-28 18:06:47 +02:00
2006-10-04 13:09:37 +02:00
2006-03-20 16:28:25 +04:00
2006-11-13 16:55:05 +01:00
2006-04-24 13:25:50 +02:00
2006-07-24 18:05:00 +02:00
2006-04-27 16:32:40 +02:00
2006-04-12 15:13:16 +02:00
2006-05-16 22:19:44 -07:00
2006-09-01 05:00:32 +02:00
2006-09-07 11:06:37 -07:00
2006-05-10 21:50:04 +05:00
2006-11-23 22:55:36 +03:00
2006-11-23 22:55:36 +03:00
2006-08-29 15:46:40 +04:00
2006-08-29 15:46:40 +04:00
2006-10-05 00:00:34 +02:00
2006-04-13 16:05:32 +04:00
2006-12-26 17:47:30 +04:00
2006-12-26 17:47:30 +04:00
2006-05-04 17:47:25 +02:00
2006-08-08 12:50:05 +05:00
2006-12-01 18:00:45 +01:00
2006-11-15 10:23:27 +01:00
2006-10-03 15:48:41 +02:00
2006-12-19 16:57:51 -07:00
2006-10-04 13:09:37 +02:00
2006-12-19 16:57:51 -07:00
2006-10-09 19:51:41 +04:00
2006-11-13 20:06:45 +04:00
2006-11-13 20:06:45 +04:00
2006-09-15 14:14:38 +02:00
2006-11-13 20:06:45 +04:00
2007-01-31 16:04:38 +02:00
2006-09-01 04:23:04 -07:00
2007-01-11 19:10:01 +02:00
2006-11-15 10:23:27 +01:00
2006-08-02 17:15:50 +05:00
2006-10-04 13:09:37 +02:00
2006-11-14 19:45:52 +01:00
2006-09-05 16:52:05 +02:00
2006-09-05 16:52:05 +02:00
2006-07-20 13:41:12 +05:00
2006-10-04 13:09:37 +02:00
2006-11-14 19:45:52 +01:00
2006-06-06 11:25:31 +05:00
2006-09-29 19:00:52 +05:00
2006-10-30 14:40:15 +04:00
2006-10-19 14:37:49 +02:00
2006-11-09 16:55:42 +02:00
2006-10-03 16:14:23 +02:00
2006-10-04 13:09:37 +02:00
2006-10-20 11:02:56 +02:00
2006-10-03 15:48:41 +02:00
2006-11-13 13:39:49 +01:00
2006-11-28 13:08:41 -05:00
2006-11-10 13:25:10 +01:00
2006-05-31 12:51:21 +02:00
2006-07-24 13:31:20 -07:00
2006-10-24 17:54:45 +02:00
2006-11-15 10:23:27 +01:00
2006-07-21 20:29:25 -07:00
2006-11-30 10:57:40 +01:00
2006-05-08 15:19:17 +02:00
2006-05-15 17:16:21 +02:00
2006-07-31 13:11:21 +02:00
2006-04-20 12:06:22 +02:00
2006-05-21 11:04:57 +02:00
2006-10-16 11:54:54 +02:00
2006-09-12 16:24:39 +02:00
2006-09-13 23:19:18 +02:00
2006-07-06 18:50:44 +02:00
2006-12-07 15:51:16 +01:00
2006-03-28 10:01:23 +02:00
2006-06-14 20:16:32 +02:00
2006-08-15 13:37:39 +02:00
2006-10-31 16:09:31 +01:00
2006-03-28 14:38:16 +02:00
2006-05-05 17:18:47 +02:00
2006-07-02 01:51:10 +04:00
2006-07-06 18:50:44 +02:00
2006-07-02 01:51:10 +04:00
2006-06-02 07:26:45 +02:00
2006-11-30 15:02:33 +01:00
2006-04-24 10:21:09 +02:00
2006-08-02 17:15:50 +05:00
2006-08-02 17:15:50 +05:00
2006-07-10 16:44:05 +03:00
2006-10-19 15:04:12 +02:00
2006-11-07 17:42:15 +01:00
2007-01-10 08:55:55 -08:00
2006-05-12 12:31:22 +02:00
2006-08-01 11:29:10 +02:00
2006-05-31 22:55:45 -07:00
2006-08-02 16:48:17 +04:00
2006-10-03 15:33:44 +02:00
2006-10-03 15:33:44 +02:00
2006-10-03 15:33:44 +02:00
2006-10-03 15:33:44 +02:00
2006-10-03 15:33:44 +02:00
2006-10-03 15:33:44 +02:00
2006-10-04 11:19:23 -04:00
2006-12-13 21:08:25 -08:00
2006-10-04 13:09:37 +02:00
2006-11-17 10:30:16 +04:00
2007-01-15 14:01:36 -08:00
2006-11-20 17:35:23 +03:00
2006-11-10 15:05:38 +03:00
2006-10-19 18:48:37 +05:00
2006-06-07 16:17:56 +04:00
2006-07-20 13:41:12 +05:00
2006-09-01 04:23:04 -07:00
2006-10-03 16:14:23 +02:00
2006-11-27 19:56:04 +01:00
2006-05-22 12:18:18 +09:30
2006-07-06 14:37:09 +02:00
2006-10-19 10:54:23 +02:00
2006-10-04 22:52:44 +02:00
2006-11-28 20:59:57 +01:00
2006-11-15 10:23:27 +01:00
2006-10-19 10:54:23 +02:00
2006-06-27 21:28:32 +04:00
2006-11-15 10:23:27 +01:00
2006-11-01 12:30:01 +04:00
2006-11-15 10:23:27 +01:00
2006-10-06 13:34:07 +04:00
2006-10-19 10:54:23 +02:00
2006-10-05 18:29:59 +02:00
2006-10-19 10:54:23 +02:00
2006-10-03 16:14:23 +02:00
2006-11-15 10:23:27 +01:00
2006-09-05 16:52:05 +02:00
2006-04-18 18:10:47 +02:00
2006-11-15 12:53:07 +02:00
2006-04-13 20:42:48 +02:00
2006-10-19 10:54:23 +02:00
2006-07-20 13:41:12 +05:00
2006-12-01 18:00:45 +01:00
2006-05-16 09:26:57 +02:00
2006-11-15 10:23:27 +01:00
2006-11-13 15:40:22 -07:00
2006-05-11 16:29:02 +02:00
2006-05-07 19:54:57 +03:00
2006-11-15 10:23:27 +01:00
2006-11-03 15:27:37 +04:00
2006-10-19 14:37:49 +02:00
2006-11-28 00:47:21 +02:00
2006-10-04 13:09:37 +02:00
2006-07-07 21:24:54 +04:00
2006-04-25 04:27:23 +04:00
2006-10-12 18:33:07 +04:00
2006-06-21 01:50:20 +04:00
2006-07-13 17:12:31 +04:00
2006-10-04 13:09:37 +02:00
2006-10-19 11:39:51 -07:00
2006-11-14 20:48:48 +01:00
2006-04-27 21:59:04 +09:30
2006-06-01 16:51:19 -07:00
2006-09-25 16:44:15 +02:00
2006-06-01 16:51:19 -07:00
2006-04-12 17:37:57 +04:00
2006-10-30 10:14:03 +04:00
2006-10-30 10:14:03 +04:00
2006-10-30 10:14:03 +04:00
2006-10-30 10:14:03 +04:00
2006-10-30 10:14:03 +04:00
2006-10-03 14:24:43 +02:00
2006-07-26 19:23:44 +03:00
2006-10-31 20:51:09 +03:00
2006-12-12 11:53:09 -08:00
2006-06-30 02:03:09 +04:00
2006-10-03 16:14:23 +02:00
2006-06-09 19:29:39 -07:00
2006-09-29 12:36:12 +04:00
2006-11-01 17:35:35 +03:00
2006-11-01 16:47:40 +03:00
2006-04-22 11:54:25 +04:00
2006-11-01 16:47:40 +03:00
2006-05-12 13:55:21 +04:00
2006-03-24 14:58:18 +03:00
2007-01-12 13:43:25 -08:00
2007-01-09 22:35:30 +03:00
2006-04-04 17:54:58 -07:00
2006-11-28 00:47:21 +02:00
2006-10-04 13:09:37 +02:00
2006-09-15 14:14:38 +02:00
2006-10-25 20:14:39 +05:00
2006-10-11 19:44:12 +04:00
2006-10-12 13:50:22 +05:00
2006-11-08 20:35:51 +03:00
2006-11-17 10:30:16 +04:00
2006-08-10 14:50:54 +05:00
2006-08-08 13:34:27 +05:00
2006-12-04 14:29:51 +02:00
2006-12-15 11:38:30 +02:00
2006-10-12 17:10:34 -06:00
2007-01-09 23:24:56 +03:00
2006-11-09 12:00:27 +01:00
2006-08-15 18:41:21 +02:00
2006-12-04 19:28:38 +01:00
2007-01-02 11:01:48 +01:00
2006-07-06 23:49:09 +02:00
2006-10-03 14:24:43 +02:00