From a31795b82d9b2f40cb2b489c99d6d03e036f039f Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Wed, 24 Dec 2008 19:24:11 +0400 Subject: Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error Table could be marked dependent because it is either 1) an inner table of an outer join, or 2) it is a part of STRAIGHT_JOIN. In case of STRAIGHT_JOIN table->maybe_null should not be assigned. The fix is to set st_table::maybe_null to 'true' only for those tables which are used in outer join. --- sql/sql_select.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_select.h') diff --git a/sql/sql_select.h b/sql/sql_select.h index c2f0780f5be..8ece01d3286 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -235,7 +235,11 @@ public: fetching data from a cursor */ bool resume_nested_loop; - table_map const_table_map,found_const_table_map,outer_join; + table_map const_table_map,found_const_table_map; + /* + Bitmap of all inner tables from outer joins + */ + table_map outer_join; ha_rows send_records,found_records,examined_rows,row_limit, select_limit; /* Used to fetch no more than given amount of rows per one -- cgit v1.2.1