diff options
author | igor@rurik.mysql.com <> | 2005-09-26 20:18:59 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2005-09-26 20:18:59 -0700 |
commit | a43b341c8a126508742b2793fe8caff80f0003a5 (patch) | |
tree | 3d21c3b8e104c64adbcf835836f9de21355a342c /sql/item.cc | |
parent | 0061782cd0b193bc23d81fe1c6e2dade258374b6 (diff) | |
download | mariadb-git-a43b341c8a126508742b2793fe8caff80f0003a5.tar.gz |
sql_base.cc, item.cc:
Fixed bug #13411.
Fixed name resolution for non-qualified reference to a view column
in the HAVING clause.
view.result, view.test:
Added a test case for bug #13411.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index 45c12d3840f..012c389b939 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1687,7 +1687,7 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const return 0; Item_field *item_field= (Item_field*) item; - if (item_field->field) + if (item_field->field && field) return item_field->field == field; /* We may come here when we are trying to find a function in a GROUP BY @@ -1701,10 +1701,10 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const */ return (!my_strcasecmp(system_charset_info, item_field->name, field_name) && - (!item_field->table_name || + (!item_field->table_name || !table_name || (!my_strcasecmp(table_alias_charset, item_field->table_name, table_name) && - (!item_field->db_name || + (!item_field->db_name || !db_name || (item_field->db_name && !strcmp(item_field->db_name, db_name)))))); } |