Anyone using Oracle?

Added by Mark Thomas over 9 years ago

I was wondering if anyone got Oracle to work. I see several fixed bugs related to Oracle issues, but I just installed Redmine 0.6.4 and the first time I tried to access the welcome page, an Oracle exception is thrown. Here's the relevant part of the log:

----------------
Processing WelcomeController#index (for 146.142.45.188 at 2008-03-24 15:49:19) [GET]
Session ID: a2b8e8fa0e7083e4f825cafee9ecbbdf
Parameters: {"action"=>"index", "controller"=>"welcome"}

ActiveRecord::StatementInvalid (OCIError: ORA-01400: cannot insert NULL into ("REACT"."USERS"."LOGIN"): INSERT INTO users (created_on, status, last_login_on, hashed_password, language, updated_on, admin, type, firstname, id, lastname, mail, auth_source_id, mail_notification, login) VALUES):
----------------

But all the NULL values correspond to nullable columns. Any ideas?

Replies (4)

RE: Anyone using Oracle? - Added by Mark Thomas over 9 years ago

BTW, I'm using Oracle 10g, ruby-oci 1.0.0. If I switch to MySQL, everything works. But I'd like to make it work on Oracle.

RE: Anyone using Oracle? - Added by Stuart George over 9 years ago

If its ActiveRecord which is Rails it may not be a redmine issue. Anything but mysql is a second class citizen inside Rails unfortunatly. Are you using Rails 2 or Rails 1?

RE: Anyone using Oracle? - Added by Mark Thomas over 9 years ago

I'm using Rails 1.2.6.

I've got more information after spending a few hours trying to track this one down. Oracle treats the empty string '' as NULL in a VARCHAR2. Therefore the migrations that create a table with a :string field with :default => "" and :null => false will not work.

The migrations containing this combination are 001,007,010,013,015,017,035,042,045,046.

One solution, which may not be the best solution, is to simply remove the :null => false constraint on those fields.

RE: Anyone using Oracle? - Added by Thomas Lecavelier over 9 years ago

I hadn't found a bug in rails database about NULL and ruby-oci 1.0.0, but your work is interesting. Could you freeze in your redmine rails 2 to find out if this solve your issue?

(1-4/4)