diff options
| author | Georgi Kodinov <joro@sun.com> | 2009-09-18 12:34:08 +0300 |
|---|---|---|
| committer | Georgi Kodinov <joro@sun.com> | 2009-09-18 12:34:08 +0300 |
| commit | 2e5b082867c0b4026d2a53acc84d9e432ed8e348 (patch) | |
| tree | 986527e0fa7cde7d85e94755be640f875822a88b /sql/sql_select.cc | |
| parent | d77f5b33afdbcce622282d62874545ee186b6b6c (diff) | |
| download | mariadb-git-2e5b082867c0b4026d2a53acc84d9e432ed8e348.tar.gz | |
Bug #47106: Crash / segfault on adding EXPLAIN to a non-crashing
query
The fix for bug 46749 removed the check for OUTER_REF_TABLE_BIT
and substituted it for a check on the presence of
Item_ident::depended_from.
Removing it altogether was wrong : OUTER_REF_TABLE_BIT should
still be checked in addition to depended_from (because it's not
set in all cases and doesn't contradict to the check of depended_from).
Fixed by returning the old condition back as a compliment to the
new one.
Diffstat (limited to 'sql/sql_select.cc')
| -rw-r--r-- | sql/sql_select.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 84b5b61c941..76d6833de5c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3216,12 +3216,12 @@ add_key_equal_fields(KEY_FIELD **key_fields, uint and_level, @retval FALSE it's something else */ -inline static bool +static bool is_local_field (Item *field) { - field= field->real_item(); - return field->type() == Item::FIELD_ITEM && - !((Item_field *)field)->depended_from; + return field->real_item()->type() == Item::FIELD_ITEM + && !(field->used_tables() & OUTER_REF_TABLE_BIT) + && !((Item_field *)field->real_item())->depended_from; } |
