Commit Graph

55 Commits

Author SHA1 Message Date
Brian Lopez
8aa1e9bb65 Merge branch 'master' into stmt
* master:
  remove Sequel adapter as it's now in Sequel core :)
  move -Wextra to development flags area
  update AR adapter to reflect timezone setting update
  application_timezone is allowed to be nil
  default application_timezone to nil
  sync up with sequel adapter from my Sequel fork until it's officially merged in
  convert :timezone option into two new ones :database_timezone - the timezone (:utc or :local) Mysql2 will assume time/datetime fields are stored in the db. This modifies what initial timezone your Time objects will be in when creating them from libmysql in C and :application_timezone - the timezone (:utc or :local) you'd finally like the Time objects converted to before you get them
  can't call literal here because it'll try to join it's own thread
  Mysql2::Client uses the :username key, set it to :user if that was used instead
  heh
  fix typo in comment
  major refactor of Sequel adapter - it's now green in Sequel
  add :cast_booleans option for automatically casting tinyint(1) fields into true/false for ruby
  move most previously global symbols to static to prevent conflicts (thanks for catching this Eric)
  respect :symbolize_keys option for Mysql2::Result#fields if it's called before the first row is built
  initialize @active early on to prevent warnings later
  let's try that again - libmysql only allows one query be sent at a time per connection, bail early if that's attempted
  Revert "libmysql only allows one query be sent at a time per connection, bail early if that's attempted"
  libmysql only allows one query be sent at a time per connection, bail early if that's attempted
  no need to carry over options twice as we're already doing it up in rb_mysql_client_async_result
2010-08-06 12:47:50 -07:00
Brian Lopez
2514fafa53 add :cast_booleans option for automatically casting tinyint(1) fields into true/false for ruby 2010-08-05 00:39:11 -07:00
Brian Lopez
c0cf2f13a0 let's try that again - libmysql only allows one query be sent at a time per connection, bail early if that's attempted 2010-08-03 20:37:49 -07:00
Brian Lopez
ee4fd98611 Merge branch 'master' into stmt 2010-08-02 10:04:07 -07:00
Brian Lopez
5f81996122 fixes for 1.9 2010-08-02 02:07:11 -07:00
Brian Lopez
fc6c24a20c add support for configuring which timezone Time objects should be created in 2010-08-02 01:20:03 -07:00
Brian Lopez
36c243be71 Add cascading options hash at Mysql2::Client.default_query_options, which can be overridden by passing options to Mysql2::Client#query and/or Mysql2::Result#each
Tune up specs, benchmarks and AR adapter to conform
2010-08-01 20:20:48 -07:00
Brian Lopez
d20bc8dc8b bring in latest from master (specifically the split out of Mysql2::Result into it's own C file) 2010-07-30 13:58:48 -07:00
Brian Lopez
9eb3917328 get rid of some warnings 2010-07-29 23:22:42 -07:00
Brian Lopez
c614c89216 remove spec checking for exception raised when closing a closed connection as we don't do that anymore 2010-07-21 13:14:43 -07:00
Brian Lopez
cd1a2bf9ff Revert "force reconnect behavior to true, remove open connection checks since libmysql will handle this for us now"
This reverts commit 70a7298dc3.
2010-07-21 12:13:27 -07:00
Brian Lopez
70a7298dc3 force reconnect behavior to true, remove open connection checks since libmysql will handle this for us now 2010-07-21 11:47:16 -07:00
Aaron Patterson
c7515a3e46 Merge branch 'master' into stmt
* master:
  check for and support field-level encodings
  on second thought, we should make sure we were given a string earlier on
  no need to Check_Type in these spots since we're using StringValuePtr as well
2010-07-12 08:45:50 -07:00
Brian Lopez
edb742fee7 check for and support field-level encodings
raise an exception for invalid encodings passed to Mysql2::Client#new
2010-07-10 23:15:54 -07:00
Aaron Patterson
45adf1e23b prepared statements can pull times 2010-07-09 11:11:31 -07:00
Aaron Patterson
d510ff675e returning ints from prepared statements works 2010-07-09 11:11:31 -07:00
Aaron Patterson
9b1789fbfc adding Stmt#fields 2010-07-09 11:11:31 -07:00
Aaron Patterson
a3cdd92a9c execute raises an exception on error 2010-07-09 11:11:31 -07:00
Aaron Patterson
7e95b543c9 execute is defined on statmenet 2010-07-09 11:11:31 -07:00
Aaron Patterson
2c86f9d72a prepared statements will tell us the field count 2010-07-09 11:11:31 -07:00
Aaron Patterson
a5d8a087a7 statements can count parameters 2010-07-09 11:11:31 -07:00
Aaron Patterson
2ad51dcac2 we can prepare statements! 2010-07-09 11:11:31 -07:00
Brian Lopez
e385e7cf6b Initial refactor of encoding support to ensure we map Ruby encodings to MySQL encodings properly. 2010-07-08 22:22:20 -07:00
Aaron Patterson
a265d36571 spec helper is in the load path, so no need for expand_path funny business 2010-07-06 15:41:44 -07:00
Aaron Patterson
04b9fe17cc made extension more rake-compiler friendly, made the spec task depend on "compile" 2010-06-30 08:20:42 +08:00
Brian Lopez
fdf3e53933 add Mysql2::Client#fields method 2010-06-19 16:24:02 -07:00
Brian Lopez
d033823b3c respect Encoding.default_internal for strings returned by Mysql2::Client#info and Mysql2::Client#server_info 2010-06-14 18:14:28 -07:00
Brian Lopez
6751a98873 use Encoding.default_internal 2010-06-13 15:50:03 -07:00
Brian Lopez
ef37f7ef76 spec fix for ruby 1.9.2+ 2010-06-13 14:50:02 -07:00
Brian Lopez
d4beaf3059 apply proper fix for timezone support, and fix specs accordingly 2010-06-08 15:16:37 -07:00
Brian Lopez
82718e6dad fix specs under 1.9.2 preview3 2010-06-01 23:40:16 -07:00
Brian Lopez
c7e9ecdcbd fix timezone handling in the AR adapter 2010-06-01 11:17:59 -07:00
Brian Lopez
ea56862ec4 add sql_state and error_number methods to Mysql2::Error 2010-05-12 23:40:18 -07:00
Brian Lopez
87f23f4db4 no need to force GC 2010-05-12 23:37:20 -07:00
Brian Lopez
46021b9351 fix boolean casts 2010-05-10 01:18:05 -07:00
Brian Lopez
6e977f756f add casting support in the AR driver specifically for handling default column values - this is a temporary (but working) fix as I'm looking into how I can do this in C 2010-05-07 00:21:54 -07:00
Eric Wong
1d92db8aab add Mysql2::Client#close method
This allows users to (manually) avoid the tricky case of hitting
a socket write during GC and potentially blocking the
interpreter during GC.  An explicit `close' is also useful in
situations where server resources are limited and a client only
needs to connect for a limited time.
2010-05-05 17:38:08 -07:00
Brian Lopez
dfca514562 make specs a little finer grained, fix a few issues found along the way 2010-04-29 10:01:25 -07:00
Brian Lopez
428eb7e79b Revert "Revert "for DATE columns, return ruby Date object instead of Time (didn't realize I could create them from y,m,d integers without ActiveSupport)""
This reverts commit 5e4080e4e5.
2010-04-25 21:45:40 -07:00
Brian Lopez
5e4080e4e5 Revert "for DATE columns, return ruby Date object instead of Time (didn't realize I could create them from y,m,d integers without ActiveSupport)"
The Date class is sooooo sllooowwww :)
Will probably look into bringing in http://github.com/rtomayko/date-performance at some point.

This reverts commit 51babb3362.
2010-04-22 12:37:05 -07:00
Brian Lopez
51babb3362 for DATE columns, return ruby Date object instead of Time (didn't realize I could create them from y,m,d integers without ActiveSupport) 2010-04-21 10:28:25 -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
1c9e94f7e9 add initial ActiveRecord driver 2010-04-15 00:56:51 -07:00
Brian Lopez
288ed22806 add initial EM Deferrable API 2010-04-14 12:55:27 -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
5a81a170be fix bad spec, add missing one 2010-04-06 01:20:49 -07:00
Brian Lopez
1dea635e09 update Mysql2::Result spec table creation to include a missing type, and properly configure another 2010-04-06 00:59:09 -07:00
Brian Lopez
ec40ee8f06 add ssl support 2010-04-05 23:30:36 -07:00