activerecord-jdbcmysql-adapter doesn't translate Boolean fields correctly
-------------------------------------------------------------------------
Key: JRUBY-4853
URL: http://jira.codehaus.org/browse/JRUBY-4853
Project: JRuby
Issue Type: Bug
Components: Application Error
Affects Versions: JRuby 1.5
Environment: Solaris 10: jruby 1.5.0 (ruby 1.8.7 patchlevel 249)
(2010-05-12 6769999) (Java HotSpot(TM) Client VM 1.6.0_20) [x86-java]
Problem occurs during Redmine 0.9.4.stable (JDBC)
Reporter: Ronald de Boer
Priority: Critical
mysql> describe projects;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(30) | NO | | | |
| description | text | YES | | NULL | |
| homepage | varchar(255) | YES | | | |
| is_public | tinyint(1) | NO | | 1 | |
| parent_id | int(10) | YES | | NULL | |
| created_on | datetime | YES | | NULL | |
| updated_on | datetime | YES | | NULL | |
| identifier | varchar(20) | YES | | NULL | |
| status | int(10) | NO | | 1 | |
| lft | int(10) | YES | MUL | NULL | |
| rgt | int(10) | YES | MUL | NULL | |
+-------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)
mysql>
Column "is_public" is a tinyint(1) which should be treated as Boolean.
ActiveRecord::StatementInvalid (ActiveRecord::ActiveRecordError: Incorrect
integer value: 'f' for column 'is_public' at row 1: INSERT INTO projects (name,
description, homepage, is_public, parent_id, created_on, updated_on,
identifier, status, lft, rgt) VALUES('bladibladibla', '', '', 'f', NULL,
'2010-06-07 12:21:19', '2010-06-07 12:21:19', 'cco', 1, 47, 48)):
gems/gems/activerecord-jdbc-adapter-0.9.7-java/lib/active_record/connection_adapters/jdbc_adapter.rb:582:in
`execute'
gems/gems/activerecord-jdbc-adapter-0.9.7-java/lib/active_record/connection_adapters/jdbc_adapter.rb:606:in
`jdbc_insert'
app/controllers/projects_controller.rb:76:in `add'
classpath:/rack/adapter/rails.rb:36:in `serve_rails'
classpath:/rack/adapter/rails.rb:41:in `call'
classpath:/jruby/rack/rails.rb:180:in `call'
classpath:/rack/handler/servlet.rb:19:in `call'
:1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email