
Variable 'sql_mode' can't be set to the value of 'TRADITIONAL'
Reported by quinn shanahan | December 19th, 2009 @ 03:57 PM
I get this error after I've established the connection to the database and when I try to use one of the models I've created. I think it could be due to some incompatibility with mysql4.
stack trace:
DataObjects::SyntaxError: Variable 'sql_mode' can't be set to
the value of 'TRADITIONAL' (code: 1231, sql state: 42000, query:
SET SESSION sql_mode =
'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL',
uri: )
from vendor/gems/gems/data_objects-0.10.0/lib/data_objects/connection.rb:59:in `initialize'
from vendor/gems/gems/data_objects-0.10.0/lib/data_objects/connection.rb:59:in `send'
from vendor/gems/gems/data_objects-0.10.0/lib/data_objects/connection.rb:59:in `__new'
from vendor/gems/gems/extlib-0.9.14/lib/extlib/pooling.rb:162:in `new'
from vendor/gems/gems/extlib-0.9.14/lib/extlib/pooling.rb:157:in `synchronize'
from vendor/gems/gems/extlib-0.9.14/lib/extlib/pooling.rb:157:in `new'
from vendor/gems/gems/extlib-0.9.14/lib/extlib/pooling.rb:104:in `new'
from vendor/gems/gems/data_objects-0.10.0/lib/data_objects/connection.rb:48:in `new'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:233:in `open_connection'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/transaction.rb:412:in `open_connection'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:269:in `with_connection'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:136:in `read'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/repository.rb:145:in `read'
from vendor/gems/gems/dm-core-0.10.2/lib/dm-core/model.rb:317:in `first'
Comments and changes to this ticket
-
Dan Kubb (dkubb) February 2nd, 2010 @ 04:15 AM
- State changed from new to unconfirmed
- Assigned user set to Dirkjan Bussink
@Dirkjan: Is it possible that we could alter the sql-mode when connecting to older versions of MySQL?
-
yawniek March 4th, 2010 @ 05:33 PM
i can confirm this bug. we currently cant switch version.
+-------------------------+------------------------------+ | protocol_version | 10 | | version | 4.1.22-log | | version_comment | Gentoo Linux mysql-4.1.22-r1 | | version_compile_machine | i686 | | version_compile_os | pc-linux-gnu |
-
yawniek March 4th, 2010 @ 06:05 PM
cCommand_execute(self, db, rb_str_new2("SET SESSION sql_mode = 'ANSI,NO_DIR_IN_CREATE,NO_UNSIGNED_SUBTRACTION'"));
works here.
, NO_ENGINE_SUBSTITUTION and TRADITIONAL are not valid on 4.x
-
Dan Kubb (dkubb) April 7th, 2010 @ 03:12 PM
- State changed from unconfirmed to resolved
(from [55ff0bff0fa8811f8f9ee0963a7daa57eb176b02]) fixes #1159 removed sql_mode settings for old (<5.0) server versions http://github.com/datamapper/do/commit/55ff0bff0fa8811f8f9ee0963a7d...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
-
1159 Variable 'sql_mode' can't be set to the value of 'TRADITIONAL' (from [55ff0bff0fa8811f8f9ee0963a7daa57eb176b02]) fixes #...