Commit 1fbb8b6c authored by gnat's avatar gnat

unitialized or typo variables

parent 04d0993a
......@@ -43,12 +43,12 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection
public function modifyLimitQuery($query, $limit, $offset)
{
if ($limit <= 0)
return $sql;
return $query;
if ($offset == 0) {
return $sql . ' FETCH FIRST '. $count .' ROWS ONLY';
return $query . ' FETCH FIRST '. $limit .' ROWS ONLY';
} else {
$sqlPieces = explode('from', $sql);
$sqlPieces = explode('from', $query);
$select = $sqlPieces[0];
$table = $sqlPieces[1];
......@@ -57,7 +57,7 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection
$sql = 'WITH OFFSET AS(' . $select . ', ROW_NUMBER() ' .
'OVER(ORDER BY ' . $col[1] . ') AS dctrn_rownum FROM ' . $table . ')' .
$select . 'FROM OFFSET WHERE dctrn_rownum BETWEEN ' . $offset .
'AND ' . ($offset + $count - 1);
'AND ' . ($offset + $limit - 1);
return $sql;
}
}
......
......@@ -303,7 +303,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
} else {
$oldFieldName = $fieldName;
}
$oldFieldName = $this->conn->quoteIdentifier($old_field_name, true);
$oldFieldName = $this->conn->quoteIdentifier($oldFieldName, true);
$query .= "CHANGE $oldFieldName " . $this->getDeclaration($field['definition']['type'], $fieldName, $field['definition']);
}
}
......
......@@ -135,7 +135,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$tableAlias = $this->getTableAlias($componentAlias);
if ( ! isset($this->tables[$tableAlias]))
throw new Doctrine_Query_Exception('Unknown component path '.$componentPath);
throw new Doctrine_Query_Exception('Unknown component path '.$componentAlias);
$table = $this->tables[$tableAlias];
......@@ -247,7 +247,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$tableAlias = $this->getTableAlias($componentAlias);
if ( ! isset($this->tables[$tableAlias])) {
throw new Doctrine_Query_Exception('Unknown component path ' . $componentPath);
throw new Doctrine_Query_Exception('Unknown component path ' . $componentAlias);
}
$root = current($this->tables);
......@@ -491,7 +491,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
{
$class = 'Doctrine_Query_Having';
$parser = new $class($this);
$this->parts['having'][] = $parser->parse($orderby);
$this->parts['having'][] = $parser->parse($having);
return $this;
}
......@@ -1216,7 +1216,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
} else {
if ( ! (substr_count($term[$i], "'") & 1) &&
! (substr_count($term[$i], "\"") & 1) &&
! (substr_count($term[$i], "") & 1)
! (substr_count($term[$i], "") & 1)
) { $i++; }
}
} else {
......@@ -1231,7 +1231,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
} else {
if ( ! (substr_count($term[$i], "'") & 1) &&
! (substr_count($term[$i], "\"") & 1) &&
! (substr_count($term[$i], "") & 1)
! (substr_count($term[$i], "") & 1)
) { $i++; }
}
}
......
......@@ -227,11 +227,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate
if ($table) {
$tableName = $table->getAliasName($component);
$table = $this->conn->getTable($tableName);
} else {
$table = $this->conn->getTable($component);
}
$table = $this->conn->getTable($component);
$this->tables[$alias] = $table;
$this->fetchModes[$alias] = Doctrine::FETCH_IMMEDIATE;
$this->tableAliases[$currPath] = $alias;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment