Permalink
Browse files

rename all hashes to all_hashes_experimental, revert each_hash to its…

… previous behavior
  • Loading branch information...
1 parent 866f4cf commit c4df361449486ded2455dbe26a44ae1251edcdfe Roger Pack committed Sep 6, 2008
Showing with 5 additions and 4 deletions.
  1. +5 −4 ext/mysql.c
View
@@ -1272,12 +1272,13 @@ static VALUE each_hash(int argc, VALUE* argv, VALUE obj)
rb_scan_args(argc, argv, "01", &with_table);
if (with_table == Qnil)
with_table = Qfalse;
- process_all_hashes(obj, with_table, 0, 1);
+ while ((hash = fetch_hash2(obj, with_table)) != Qnil)
+ rb_yield(hash);
return obj;
}
-/* all_hashes(with_table=false) -- returns an array of hashes, one hash per row */
-static VALUE all_hashes(int argc, VALUE* argv, VALUE obj)
+/* all_hashes_experimental(with_table=false) -- returns an array of hashes, one hash per row */
+static VALUE all_hashes_experimental(int argc, VALUE* argv, VALUE obj)
{
VALUE with_table;
VALUE field_names;
@@ -2240,7 +2241,7 @@ void Init_mysql(void)
rb_define_method(cMysqlRes, "row_tell", row_tell, 0);
rb_define_method(cMysqlRes, "each", each, 0);
rb_define_method(cMysqlRes, "each_hash", each_hash, -1);
- rb_define_method(cMysqlRes, "all_hashes", all_hashes, -1);
+ rb_define_method(cMysqlRes, "all_hashes_experimental", all_hashes_experimental, -1);
/* MysqlField object method */
rb_define_method(cMysqlField, "name", field_name, 0);

0 comments on commit c4df361

Please sign in to comment.