fix for corrupted utf-8 results
This commit is contained in:
parent
02e8481161
commit
8e1cd8ea20
@ -1272,7 +1272,8 @@ 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;
|
||||
}
|
||||
|
||||
@ -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", all_hashes, -1);*/
|
||||
|
||||
/* MysqlField object method */
|
||||
rb_define_method(cMysqlField, "name", field_name, 0);
|
||||
|
@ -7,3 +7,11 @@ class Mysql
|
||||
get_result
|
||||
end
|
||||
end
|
||||
|
||||
class Mysql::Result
|
||||
def all_hashes
|
||||
rows = []
|
||||
each_hash { |row| rows << row }
|
||||
rows
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user