Moodle
  1. Moodle
  2. MDL-8237

"access" is a reserved word under oracle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Component/s: MNet
    • Labels:
      None
    • Environment:
      Oracle
    • Database:
      Oracle
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE
    • Rank:
      29274

      Description

      "access" is being used my the mnet_sso_access_control table and it's a reserved word under Oracle. Should be fixed ASAP.

      Ciao

        Activity

        Hide
        Eloy Lafuente (stronk7) added a comment -

        Assigning to Martín L.

        Show
        Eloy Lafuente (stronk7) added a comment - Assigning to Martín L.
        Hide
        Martin Dougiamas added a comment -

        Please fix this ASAP so I can branch

        Show
        Martin Dougiamas added a comment - Please fix this ASAP so I can branch
        Hide
        Donal McMullan added a comment -

        Thanks Eloy - should be ok now. The XMLDB tool for generating DB upgrade code is pretty cool... haven't used that before.

        Show
        Donal McMullan added a comment - Thanks Eloy - should be ok now. The XMLDB tool for generating DB upgrade code is pretty cool... haven't used that before.
        Hide
        Martin Dougiamas added a comment -

        Eloy, can you take a quick look at this? The change for this field looks OK:

        if ($result && $oldversion < 2007012400)

        { /// Rename field access on table mnet_sso_access_control to accessctrl $table = new XMLDBTable('mnet_sso_access_control'); $field = new XMLDBField('access'); /// Launch rename field accessctrl $result = $result && rename_field($table, $field, 'accessctrl'); }

        But the SQL fails during upgrade on MySQL 5.0.22 like this (the prefix for this site was "poo_")

        (mysql): ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL' at line 1

        ADOConnection._Execute(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL, false) % line 889, file: adodb.inc.php
        ADOConnection.Execute(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL) % line 75, file: dmllib.php
        execute_sql(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL, true) % line 1766, file: dmllib.php
        execute_sql_arr(Array[1], true, true) % line 921, file: ddllib.php
        rename_field(Object:XMLDBTable, Object:XMLDBField, accessctrl) % line 588, file: upgrade.php

        Show
        Martin Dougiamas added a comment - Eloy, can you take a quick look at this? The change for this field looks OK: if ($result && $oldversion < 2007012400) { /// Rename field access on table mnet_sso_access_control to accessctrl $table = new XMLDBTable('mnet_sso_access_control'); $field = new XMLDBField('access'); /// Launch rename field accessctrl $result = $result && rename_field($table, $field, 'accessctrl'); } But the SQL fails during upgrade on MySQL 5.0.22 like this (the prefix for this site was "poo_") (mysql): ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL' at line 1 ADOConnection._Execute(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL, false) % line 889, file: adodb.inc.php ADOConnection.Execute(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL) % line 75, file: dmllib.php execute_sql(ALTER TABLE poo_mnet_sso_access_control CHANGE access accessctrl DEFAULT NULL, true) % line 1766, file: dmllib.php execute_sql_arr(Array [1] , true, true) % line 921, file: ddllib.php rename_field(Object:XMLDBTable, Object:XMLDBField, accessctrl) % line 588, file: upgrade.php
        Hide
        Martin Dougiamas added a comment -

        Eloy gave me the quick fix, which I implemented (attached).

        Show
        Martin Dougiamas added a comment - Eloy gave me the quick fix, which I implemented (attached).

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: