Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8237

"access" is a reserved word under oracle

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Assigning to Martín L.

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

            Please fix this ASAP so I can branch

            Show
            dougiamas Martin Dougiamas added a comment - Please fix this ASAP so I can branch
            Hide
            donal@catalyst.net.nz 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@catalyst.net.nz 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
            dougiamas 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
            dougiamas 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
            dougiamas Martin Dougiamas added a comment -

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

            Show
            dougiamas 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:
                  Fix Release Date:
                  31/Mar/07