summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorpem@mysql.comhem.se <>2004-03-25 17:42:13 +0100
committerpem@mysql.comhem.se <>2004-03-25 17:42:13 +0100
commit6395822932ab4830d80b4d90fbb3faa4b0ee8723 (patch)
treeb848643a5a893df72a10e6264bc0406b6c9ec236 /sql/item_func.h
parent403001ff1ced529761f9737ad831c1be0b0740de (diff)
downloadmariadb-git-6395822932ab4830d80b4d90fbb3faa4b0ee8723.tar.gz
Fixed BUG#3117: LAST_INSERT_ID() works incorrectly inside stored procedure.
This turned out to be a problem for prepared statements as well; the id was evaluated once, at parse time.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 4558c1c6f62..4142498af6c 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -729,13 +729,14 @@ public:
};
-class Item_func_set_last_insert_id :public Item_int_func
+class Item_func_last_insert_id :public Item_int_func
{
public:
- Item_func_set_last_insert_id(Item *a) :Item_int_func(a) {}
+ Item_func_last_insert_id() :Item_int_func() {}
+ Item_func_last_insert_id(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "last_insert_id"; }
- void fix_length_and_dec() { max_length=args[0]->max_length; }
+ void fix_length_and_dec() { if (arg_count) max_length= args[0]->max_length; }
};
class Item_func_benchmark :public Item_int_func