summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-06-22 19:38:07 +0200
committerunknown <pem@mysql.comhem.se>2004-06-22 19:38:07 +0200
commit3df8b829b6054da7f0e275b5f5edd33f1456ec33 (patch)
tree0ec3a45a9e2b366990567cba2d2b6b9848869dd1 /sql/item_func.cc
parent84afec5bfa6ae2a675667ed0399592bb1e2bbe86 (diff)
downloadmariadb-git-3df8b829b6054da7f0e275b5f5edd33f1456ec33.tar.gz
Fixed BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement].
mysql-test/r/ps.result: New test case for BUG#3486. mysql-test/t/ps.test: New test case for BUG#3486. sql/item_create.cc: Create an Item_func_found_rows() at parse time, not an Item_int. sql/item_func.cc: Added val_int() method for new Item_func_found_rows class. sql/item_func.h: New class Item_func_found_rows for FOUND_ROWS() function. sql/sql_select.cc: Don't reset thd->limit_found_rows too early, or FOUND_ROWS() wont work.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 192ed118766..e3874d8e4fa 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3234,3 +3234,12 @@ longlong Item_func_is_used_lock::val_int()
null_value=0;
return ull->thread_id;
}
+
+
+longlong Item_func_found_rows::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ THD *thd= current_thd;
+
+ return thd->found_rows();
+}