tchandy/octopus — Issue #75: Syntax error with Mysql and Rails 3.1
Author: grigio
Created: 2012-01-25 16:04:22+00:00
State: open

I get this error:
```ruby
1.8.7 :014 > u = User.new
=> #
1.8.7 :015 > u.first_name = "ciao"
=> "ciao"
1.8.7 :016 > u.save
(58.0ms) BEGIN
SQL (67.8ms) INSERT INTO "users" ("created_at", "first_name", "updated_at") VALUES ('2012-01-25 15:52:22', 'ciao', '2012-01-25 15:52:22')
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"users" ("created_at", "first_name", "updated_at") VALUES ('2012-01-25 15:52:22'' at line 1: INSERT INTO "users" ("created_at", "first_name", "updated_at") VALUES ('2012-01-25 15:52:22', 'ciao', '2012-01-25 15:52:22')
(57.7ms) ROLLBACK
ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"users" ("created_at", "first_name", "updated_at") VALUES ('2012-01-25 15:52:22'' at line 1: INSERT INTO "users" ("created_at", "first_name", "updated_at") VALUES ('2012-01-25 15:52:22', 'ciao', '2012-01-25 15:52:22')
```

setup:

shards.yml
```ruby
octopus:
environments:
- development
- production
development:
shards:
admin:
# adapter: sqlite3
# database: db/admin_production.sqlite3
# pool: 5
# timeout: 5000
#
adapter: mysql2
username: xxx
password: xxxx
host: xxx
database: admin_development
```

user.rb
```ruby
class User < ActiveRecord::Base
#using('admin')
octopus_establish_connection(
:adapter => "mysql2",
:host => "xxx",
:username => "xx",
:password => "xx",
:database => "admin_development"
)
```