diff options
author | kroki/tomash@moonlight.intranet <> | 2006-10-06 13:34:07 +0400 |
---|---|---|
committer | kroki/tomash@moonlight.intranet <> | 2006-10-06 13:34:07 +0400 |
commit | ee0cebf9a7fa364df44aeb0579bdaa80d11f0125 (patch) | |
tree | 9d3af9e4d1ede2e842e8a4a18d1a01c0d66cf0ea /sql/item_func.h | |
parent | acaa584c5523753cab5b3a50ed3c95672b462541 (diff) | |
download | mariadb-git-ee0cebf9a7fa364df44aeb0579bdaa80d11f0125.tar.gz |
BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID.
Note: bug#21726 does not directly apply to 4.1, as it doesn't have stored
procedures. However, 4.1 had some bugs that were fixed in 5.0 by the
patch for bug#21726, and this patch is a backport of those fixes.
Namely, in 4.1 it fixes:
- LAST_INSERT_ID(expr) didn't return value of expr (4.1 specific).
- LAST_INSERT_ID() could return the value generated by current
statement if the call happens after the generation, like in
CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY, j INT);
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
- Redundant binary log LAST_INSERT_ID_EVENTs could be generated.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index bc6c955b99f..467b88eda76 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -758,6 +758,7 @@ public: longlong val_int(); const char *func_name() const { return "last_insert_id"; } void fix_length_and_dec() { if (arg_count) max_length= args[0]->max_length; } + bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); }; class Item_func_benchmark :public Item_int_func |