From 2cc81ba3d32015ae89ef43cb88adbf542ba0eb49 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 Jun 2003 18:36:52 +0300 Subject: [PATCH] Fix for a bug which results in "Unknown Error". Query should actually return empty result set, but currently can't, as it attempts to store NULL in NOT NULL field, because that is a match made by self join conditions. --- sql/sql_select.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0e8b191e4ef..c2c4070956c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -969,7 +969,14 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, group ? group : order, select_limit, thd->select_limit)) - goto err; /* purecov: inspected */ + { + if (!join.join_tab[join.const_tables].select->quick) + error= return_zero_rows(&join, result, tables, fields, + 0, select_options, + "Impossible WHERE noticed after reading const tables", + having,procedure); + goto err; + } } join.having=having; // Actually a parameter thd->proc_info="Sending data";