Bug#25126: Reference to non-existant column in UPDATE...ORDER BY... crashes server
"update existingtable set anycolumn=nonexisting order by nonexisting" would crash the server. Though we would find the reference to a field, that doesn't mean we can then use it to set some values. It could be a reference to another field. If it is NULL, don't try to use it to set values in the Item_field and instead return an error. Over the previous patch, this signals an error at the location of the error, rather than letting the subsequent deref signal it. mysql-test/r/order_by.result: Verify that all permutations work. mysql-test/t/order_by.test: Verify that all permutations work. sql/item.cc: When the field is NULL, don't dereference it when we set_field(). Instead, raise an error.
Showing
Please register or sign in to comment