summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <cmiller@calliope.local.cmiller/calliope.local>2007-02-14 11:27:37 -0500
committerunknown <cmiller@calliope.local.cmiller/calliope.local>2007-02-14 11:27:37 -0500
commit48be0a2ff17af54aab36b0b554175ae5756e3690 (patch)
tree7c9fd27030b35104266e24d59e4c21c5a445468b /sql/item.cc
parent9d66be72b0ee079cecc39e09d4f4c0f7e1849dbc (diff)
parent4c4f50623896f43873420d6c8d8e2a320653d57a (diff)
downloadmariadb-git-48be0a2ff17af54aab36b0b554175ae5756e3690.tar.gz
Merge calliope.local.cmiller:/Volumes/Source/src/mysql-4.1-maint--bug25126
into calliope.local.cmiller:/Volumes/Source/src/mysql-5.0-maint sql/item.cc: Auto merged mysql-test/r/order_by.result: Manual merge. mysql-test/t/order_by.test: Manual merge.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index b4a7820eabf..050171b8fbe 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3724,7 +3724,18 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
use the field from the Item_field in the select list and leave
the Item_field instance in place.
*/
- set_field((*((Item_field**)res))->field);
+
+ Field *field= (*((Item_field**)res))->field;
+
+ if (field == NULL)
+ {
+ /* The column to which we link isn't valid. */
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), (*res)->name,
+ current_thd->where);
+ return(1);
+ }
+
+ set_field(field);
return 0;
}
else