Core database upgrade fails from 1.4.2 to 1.5rc1

Bug #961728 reported by Rich Trott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Richard Mansfield

Bug Description

Now that the CREATE LANGUAGE issue is resolved, another issue has come up migrating from 1.4.2 to 1.5rc1 on Red Hat Enterprise Linux 5.8, PostgreSQL 8.1.23, PHP 5.3.5.

I will attach a pair of snapshots of the upgrade screen.

The relevant lines from the error_log would appear to be these (with the last one truncated for obvious reasons):

[Wed Mar 21 15:35:37 2012] [error] [client 10.0.15.246] [DBG] a0 (lib/ddl.php:486) Function find_index_name called on an index usr_fir_ix with no columns. Attempting match on index names of all indexes on usr without columns., referer: https://mahara.example.edu/admin/upgrade.php
[Wed Mar 21 15:35:38 2012] [error] [client 10.0.15.246] [DBG] a0 (lib/dml.php:159) postgres7 error: [-1: ERROR: syntax error at or near "," at character 230] in adodb_throw(, referer: https://mahara.example.edu/admin/upgrade.php
[Wed Mar 21 15:35:38 2012] [error] [client 10.0.15.246] [DBG] a0 (lib/dml.php:159) INSERT INTO "artefact", referer: https://mahara.example.edu/admin/upgrade.php
[Wed Mar 21 15:35:38 2012] [error] [client 10.0.15.246] [DBG] a0 (lib/dml.php:159) (artefacttype, ctime, mtime, atime, title, description, owner, "group", institution, author, authorname, note), referer: https://mahara.example.edu/admin/upgrade.php
[Wed Mar 21 15:35:38 2012] [error] [client 10.0.15.246] [DBG] a0 (lib/dml.php:159) VALUES (?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?),[SNIP]

Revision history for this message
Rich Trott (richard-trott) wrote :
description: updated
Revision history for this message
Rich Trott (richard-trott) wrote :
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Ouch, Postgres 8.1 doesn't allow more than one row to be inserted using INSERT INTO. I'll have a look for an easy way to rewrite that query, but maybe we can just up the Mahara 1.5 requirement to be pg 8.2+.

Changed in mahara:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.5.0
Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Given the end of life dates at http://www.postgresql.org/support/versioning/ it's pretty reasonable for us to change the required pg version to 8.3 which is the easy way to fix this bug!

Changed in mahara:
status: Triaged → In Progress
Revision history for this message
Rich Trott (richard-trott) wrote :

Again, anything I say about PostgreSQL should be viewed with some suspicion, but I guess this change in version requirements would also mean that bug #960631 would be fixed too and the changes you made to accommodate that wouldn't need to go in either, perhaps.

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

I think the other fix for the CREATE LANGUAGE stuff should stay in, because it's always possible to configure postgres 8.3+ so that even the db owner doesn't have the relevant permission (but the default was changed in 8.2 or 8.3).

Also, I don't know what happens if you start with a pg 8.1 db and then you upgrade it to pg 8.3. The upgrade probably doesn't change those permissions under your nose, but I'm guessing there.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1115
Committed: http://gitorious.org/mahara/mahara/commit/9b432eade0f6bf28e73af04f170e4ee32f61b692
Submitter: Richard Mansfield (<email address hidden>)
Branch: 1.5_STABLE

commit 9b432eade0f6bf28e73af04f170e4ee32f61b692
Author: Richard Mansfield <email address hidden>
Date: Fri Mar 23 11:15:14 2012 +1300

    Change postgres requirement to version 8.3+

    Earlier versions of postgres are now unsupported, and this change will
    fix the upgrade failure in bug #961728.

    Change-Id: I2b7ea46515142d0d3fc601cf8ec99e15a85bc933
    Signed-off-by: Richard Mansfield <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/1114
Committed: http://gitorious.org/mahara/mahara/commit/906572ffbf23a6bf6e73e14587baa69324746b91
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 906572ffbf23a6bf6e73e14587baa69324746b91
Author: Richard Mansfield <email address hidden>
Date: Fri Mar 23 11:15:14 2012 +1300

    Change postgres requirement to version 8.3+

    Earlier versions of postgres are now unsupported, and this change will
    fix the upgrade failure in bug #961728.

    Change-Id: I2b7ea46515142d0d3fc601cf8ec99e15a85bc933
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.