Skip to content

Instantly share code, notes, and snippets.

#0 0x100f4eae in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#1 0x1000bede in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#2 0x101a14c0 in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#3 0x1000f092 in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#4 0x0258d600 in ?? ()
#5 0x63b4138a in nogvl_connect (ptr=0x28ead0) at ../../../../ext/mysql2/client.c:101
#6 0x62e55cc4 in rb_thread_blocking_region () from C:\Ruby192\bin\msvcrt-ruby191.dll
#7 0x63b4160a in rb_connect (self=42271608, user=4, pass=4, host=42271440, port=6613, database=4, socket=4, flags=1) at ../../../../ext/mysql2/client.c:170
#8 0x62e3e5f1 in rb_vm_mark () from C:\Ruby192\bin\msvcrt-ruby191.dll
#9 0x62e4d8d7 in rb_remove_method_id () from C:\Ruby192\bin\msvcrt-ruby191.dll
0x100f4eae in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
(gdb) bt
#0 0x100f4eae in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#1 0x1000bede in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#2 0x101a14c0 in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#3 0x1000f092 in mysql_thread_init () from C:\Ruby192\bin\libmysql.dll
#4 0x0259d600 in ?? ()
#5 0x63b412ac in ?? () from C:\mysql2\lib\mysql2\mysql2.so
#6 0x62e55cc4 in rb_thread_blocking_region () from C:\Ruby192\bin\msvcrt-ruby191.dl
#7 0x63b41de7 in ?? () from C:\mysql2\lib\mysql2\mysql2.so
C:\mysql2>gdb ruby
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
irb(main):005:0> require 'mysql2'
=> true
irb(main):006:0> Mysql2::Client.new
C:/mysql2/lib/mysql2/client.rb:36: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
-- control frame ----------
c:0027 p:---- s:0108 b:0108 l:000107 d:000107 CFUNC :connect
c:0026 p:0201 s:0098 b:0098 l:000097 d:000097 METHOD C:/mysql2/lib/mysql2/client.rb:36
c:0025 p:---- s:0087 b:0087 l:000086 d:000086 FINISH
Mysql2::EM::Client
- should support async queries
Mysql2::Client
- should accept connect flags and pass them to #connect
- should default flags to 0
- should have a global default_query_options hash
- should be able to connect via SSL options (PENDING: DON'T WORRY, THIS TEST PASSES :) - but is machine-specific. You need to have MySQL running with SSL configured and enabled. Then update the paths in this test to your needs and remove the pending state.)
- should respond to #close
- should be able to close properly
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
c:/Ruby187/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
Loaded suite /Users/brianmario/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index ba0051d..ef4b90f 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -7,6 +7,8 @@ module ActiveRecord
class Base
# Establishes a connection to the database that's used by all Active Record objects.
def self.mysql_connection(config) # :nodoc:
+ return ActiveRecord::Base.mysql2_connection(config) if defined? ::Mysql2
+
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index a90f109..b345298 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -394,6 +394,7 @@ module Rails
when "postgresql" then "pg"
when "sqlite3" then "sqlite3-ruby"
when "frontbase" then "ruby-frontbase"
+ when "mysql" then "mysql2"
else options[:database]
Brians-MacBookPro:sequel brianmario$ SEQUEL_MY_SPEC_DB=mysql2://root@localhost/sandbox rake spec_mysql
(in /Users/brianmario/Downloads/sequel)
..........................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 95.182063 seconds
394 examples, 0 failures