Ticket #413: delimiter.diff

File delimiter.diff, 1.3 KB (added by mmalone@…, 2 years ago)

Patch

  • classes/phing/tasks/ext/pdo/PDOSQLExecTask.php

     
    407407                $line = ProjectConfigurator::replaceProperties($this->project, $line, 
    408408                        $this->project->getProperties()); 
    409409 
    410                 if (StringHelper::startsWith("//", $line) || 
     410                if (($line != $this->delimiter) && ( 
     411                    StringHelper::startsWith("//", $line) || 
    411412                    StringHelper::startsWith("--", $line) || 
    412                     StringHelper::startsWith("#", $line)) { 
     413                    StringHelper::startsWith("#", $line))) { 
    413414                    continue; 
    414415                } 
    415416 
     
    418419                    continue; 
    419420                } 
    420421 
     422                // MySQL supports defining new delimiters 
     423                if (preg_match('/DELIMITER [\'"]?([^\'" $]+)[\'"]?/i', $line, $matches)) { 
     424                    $this->setDelimiter($matches[1]); 
     425                    continue; 
     426                } 
     427 
    421428                if ($sqlBacklog !== "") { 
    422429                    $sql = $sqlBacklog; 
    423430                    $sqlBacklog = "";