Commit Graph

24 Commits

Author SHA1 Message Date
Eric Wong fa213c9892 wrap mysql_real_connect with rb_thread_blocking_region
mysql_real_connect() is a blocking function that issues
blocking-but-interruptible connect(), read(), and write() system
calls.  So we'll allow other threads in the VM to run while
calling it since it can block indefinitely.

This introduces a rb_thread_blocking_region() wrapper for 1.8
which ensures any received signals can be handled gracefully
while inside blocking function calls.
2010-05-05 11:57:37 -07:00
Brian Lopez 61e748ddc4 add another check for valid datetime/timestamps. move to sscanf for datetime parsing 2010-04-29 00:45:22 -07:00
Brian Lopez c05138e328 build and use a cache of field names for results 2010-04-22 11:56:18 -07:00
Brian Lopez eefa443c2e Implement a local resultset cache so we can free the mysql C result once we've cached it's rows in ruby land.
This allows the caller to iterate over the Mysql2::Result instance as many times as they want, lazily pulling what rows are needed from the mysql C result.
2010-04-21 01:40:28 -07:00
Brian Lopez 8f93f830c1 add affected_rows method (mysql_affected_rows) 2010-04-07 09:47:45 -07:00
Brian Lopez e20df5c140 add last_id method (last_insert_id) 2010-04-07 09:36:36 -07:00
Brian Lopez 7131752757 add initial async query support 2010-04-07 09:16:30 -07:00
Brian Lopez 80a8602fbb borrow the more flexible extconf from the mysqlplus project 2010-04-07 07:03:31 -07:00
Brian Lopez ec40ee8f06 add ssl support 2010-04-05 23:30:36 -07:00
Brian Lopez 7bac2c520a add Mysql2::Error exception type, use it 2010-04-04 23:46:42 -07:00
Brian Lopez 9b59478cf6 allow access to file descriptor in C, EventMachine anyone? ;) 2010-04-04 23:31:32 -07:00
Brian Lopez 0a733a1f02 finally add real date/time/datetime parsing 2010-04-03 16:51:10 -07:00
Brian Lopez b820100249 add Mysql2::Client#info and Mysql2::Client#server_info methods 2010-04-03 12:15:16 -07:00
Brian Lopez 1b9e35712f add support for setting MYSQL_OPT_CONNECT_TIMEOUT setting 2010-04-03 01:36:30 -07:00
Brian Lopez 82e2a1de21 add initial support for connecting with options 2010-04-02 20:14:29 -07:00
Brian Lopez 559bd3d426 reorg vars 2010-04-02 16:14:03 -07:00
Brian Lopez 872bdb0caf rename method to each, seek dataset to beginning on each call of #each 2010-04-02 15:32:58 -07:00
Brian Lopez bbf7585d09 use binary encoding on fields that have the binary flag set 2010-04-01 14:29:20 -07:00
Brian Lopez 858523d7a9 force string encoding to utf8 in 1.9 2010-04-01 12:56:49 -07:00
Brian Lopez 953f547f79 some misc cleanup 2010-04-01 12:04:48 -07:00
Brian Lopez 631456fc58 add escape method 2010-04-01 11:44:59 -07:00
Brian Lopez 1848b0da4a mostly flesh out mysql type to ruby type conversion mapping 2010-03-30 23:30:06 -07:00
Brian Lopez 736c0d6cd3 result hash keys can be symbols using the :symbolize_keys option with #fetch_row, #fetch_rows or #each. Renamed extension from MySQL to Mysql2. Initial Rakefile and spec dir 2010-03-30 09:56:24 -07:00
Brian Lopez 8713288574 renaming again ;) 2010-03-30 09:20:55 -07:00