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

Wrong MySQL syntax causes error while synchronizing LDAP users

    XMLWordPrintable

Details

    • MySQL
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Hide

      Modify line #566 of script "moodle\auth\ldap\auth.php", because in MySQL 5.5 doesn't support "type" table option, instead it uses ENGINE option.

      From:
      $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) TYPE=MyISAM';

      To:
      $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) ENGINE=MyISAM';

      Show
      Modify line #566 of script "moodle\auth\ldap\auth.php", because in MySQL 5.5 doesn't support "type" table option, instead it uses ENGINE option. From: $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) TYPE=MyISAM'; To: $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) ENGINE=MyISAM';
    • Easy
    • Hide

      Run Moodle 1.9.12 with MySQL version where 'TYPE' not supported as table_option
      Configure LDAP Authentication
      Run the synchronization script "moodle\auth\ldap\auth_ldap_sync_users.php"

      Show
      Run Moodle 1.9.12 with MySQL version where 'TYPE' not supported as table_option Configure LDAP Authentication Run the synchronization script "moodle\auth\ldap\auth_ldap_sync_users.php"

    Description

      I'm running Moodle 1.9.12+ (Build: 20110701) with MySQL 5.5 and after configuring LDAP Authentication i try to execute the "moodle\auth\ldap\auth_ldap_sync_users.php" script to synchronize my users. But the following error is shown:

      Configuring temp table
      Creating temp table mdl_extuser
      Failed to create temporary users table - aborting

      The problem is in line #566 of script "moodle\auth\ldap\auth.php", because in MySQL 5.5 doesn't support "type" table option, instead it uses ENGINE option. So i changed the code from:
      $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) TYPE=MyISAM';

      To:
      $createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) ENGINE=MyISAM';

      But it will probably fail on MySQL older versions.

      Attachments

        Activity

          People

            samhemelryk Sam Hemelryk
            leandrorepolho Leandro
            Aparup Banerjee Aparup Banerjee
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Aparup Banerjee Aparup Banerjee
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Oct/11