diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-05-10 21:20:35 +0500 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-05-10 21:20:35 +0500 |
commit | 3c08b9b1ab0cea89ea5211c0609166a3b3a726ae (patch) | |
tree | ab1e1975f6a29f1effedef4204037622123e750f /sql/item_func.cc | |
parent | 034a8f143d094cfa879dcedb15dd6f02a833cf6f (diff) | |
parent | d615a11bd5d3572f51c6341c02338e7c742e29c0 (diff) | |
download | mariadb-git-3c08b9b1ab0cea89ea5211c0609166a3b3a726ae.tar.gz |
Manual merge.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 876aee719a3..6f40298f8cf 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4178,6 +4178,41 @@ Item_func_set_user_var::check(bool use_result_field) /** + @brief Evaluate and store item's result. + This function is invoked on "SELECT ... INTO @var ...". + + @param item An item to get value from. +*/ + +void Item_func_set_user_var::save_item_result(Item *item) +{ + DBUG_ENTER("Item_func_set_user_var::save_item_result"); + + switch (cached_result_type) { + case REAL_RESULT: + save_result.vreal= item->val_result(); + break; + case INT_RESULT: + save_result.vint= item->val_int_result(); + unsigned_flag= item->unsigned_flag; + break; + case STRING_RESULT: + save_result.vstr= item->str_result(&value); + break; + case DECIMAL_RESULT: + save_result.vdec= item->val_decimal_result(&decimal_buff); + break; + case ROW_RESULT: + default: + // Should never happen + DBUG_ASSERT(0); + break; + } + DBUG_VOID_RETURN; +} + + +/** This functions is invoked on SET \@variable or \@variable:= expression. |