protected static function semicolonTerminate( $sql ) {
		$lines = explode("\n", $sql);
		$lastLineK = null;
		foreach( $lines as $k=>$line ) {
			$line = trim($line);
			if( !preg_match('/^$|^--$|^--\s+/', $line) ) $lastLineK = $k;
		}
		if( $lastLineK !== null and !preg_match('/;$/', $lines[$lastLineK]) ) {
			$lines[$lastLineK] .= ";";
			return implode("\n", $lines);
		} else {
			return $sql;
		}
	}