Databases: Oracle error on upgrade

Databases: Oracle error on upgrade

by mark hedley -
Number of replies: 4

I have tried to upgrade (a copy of) our

Moodle 1.9.10+ (Build: 20110125)

site to 2.1, unsuccessfully.

 

I get an error during the upgrade, quite early on:

ORA-01400: cannot insert NULL into ("RESTOREDMOODLEDB"."MDBLOCK_POSITIONS"."SUBPAGE")

( see : http://www.pastebucket.com/Code/Details/195)

 

We are using Oracle as a backend for this system.  We tested 2.0 with Oracle and had numerous issues, so have remained on 1.9.

 

a little more digging suggests that Oracle's stellar approach to ansi means that

'' is interpreted as NULL in a varchar field

(http://stackoverflow.com/questions/203493/why-does-oracle-9i-treat-an-empty-string-as-null)

hence the ELSE clause is trying to put NULL into a NOT NULL field in the database

 

I am unsure what behaviour is looked for from

MDBLOCK_POSITIONS.SUBPAGE = ''

so I am not comfortable trying to replace this to see if it would move things along.

 

any thoughts gratefully received

Average of ratings: -
In reply to mark hedley

Re: Databases: Oracle error on upgrade

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Quite by co-incidence, earlier today I re-found MDL-26618 - which I think is the problem you are seeing. Ages ago, Longfei and I came up with a proposed fix, and put it out to peer review. Then I forgot all about it. I jsut submitted it for integration, so it may be fixed in this week's weekly build.

In reply to Tim Hunt

Re: Databases: Oracle error on upgrade

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Ah, no. Sadly, the fix I did for MDL-26618 will not fix your error. It is basically the same error, but in a different part of the code.

Please create a new MDL Tracker issue. Copy and paste the error message from above, and also mention this forum thread and MDL-26618 as giving clues to the solution.

In reply to mark hedley

Re: Databases: Oracle error on upgrade

by Samone Conyers -

Tim/Mark,

I am currently installing Moodle on an Oracle backend.  Can you tell me some of the lessons learned that you have working with Moodle 2.0.  I am expecting some issues but knowing what other have encountered would be great.

Thanks.