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

create_temp_table() errors out with indexes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.9.14, 1.9.15
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Database:
      Any
    • Workaround:
      Hide

      See patch

      Show
      See patch
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      When passing an XMLDBTable table object with indexes to function create_temp_table() (lib/ddllib.php), errors are encountered.

      This is because of:
      $sqlarr = preg_replace('/^CREATE/', "CREATE $temporary", $sqlarr)
      which will also cause index creation statements to be changed to something like "CREATE TEMPORARY INDEX..." to "CREATE GLOBAL TEMPORARY INDEX...".

      This will be an issue with all db types, except for mssql where $temporary variable is set to ''.

      Please see the attached patch that might fix the issue.

      Cheers,
      Eugene.

        Attachments

        1. fix.patch
          0.5 kB
          Eugene Venter

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            binare Eugene Venter
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: