Details
-
Task
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
The return value for Type_handler::Item_save_in_value() is misleading. It currently returns:
- true if the value evaluated to SQL NULL
- false otherwise
Similar functions return true if some error happened. So the code looks confusing.
Let's change the return type from bool to void.
Let's also add a new method st_value::is_null(), to make SQL NULL tests simpler, as follows:
bool is_null() const |
{
|
return m_type == DYN_COL_NULL; |
}
|
so the callers, instead of testing the return value, can test value.is_null().
The caller code will change, for example, like this:
st_value tmp;
|
- if (!item->save_in_value(thd, &tmp)) |
+ item->save_in_value(thd, &tmp);
|
+ if (!tmp.is_null()) |