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 ...@@ -43,12 +43,12 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection
public function modifyLimitQuery($query, $limit, $offset) public function modifyLimitQuery($query, $limit, $offset)
{ {
if ($limit <= 0) if ($limit <= 0)
return $sql; return $query;
if ($offset == 0) { if ($offset == 0) {
return $sql . ' FETCH FIRST '. $count .' ROWS ONLY'; return $query . ' FETCH FIRST '. $limit .' ROWS ONLY';
} else { } else {
$sqlPieces = explode('from', $sql); $sqlPieces = explode('from', $query);
$select = $sqlPieces[0]; $select = $sqlPieces[0];
$table = $sqlPieces[1]; $table = $sqlPieces[1];
...@@ -57,7 +57,7 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection ...@@ -57,7 +57,7 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection
$sql = 'WITH OFFSET AS(' . $select . ', ROW_NUMBER() ' . $sql = 'WITH OFFSET AS(' . $select . ', ROW_NUMBER() ' .
'OVER(ORDER BY ' . $col[1] . ') AS dctrn_rownum FROM ' . $table . ')' . 'OVER(ORDER BY ' . $col[1] . ') AS dctrn_rownum FROM ' . $table . ')' .
$select . 'FROM OFFSET WHERE dctrn_rownum BETWEEN ' . $offset . $select . 'FROM OFFSET WHERE dctrn_rownum BETWEEN ' . $offset .
'AND ' . ($offset + $count - 1); 'AND ' . ($offset + $limit - 1);
return $sql; return $sql;
} }
} }
......
...@@ -303,7 +303,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export ...@@ -303,7 +303,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
} else { } else {
$oldFieldName = $fieldName; $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']); $query .= "CHANGE $oldFieldName " . $this->getDeclaration($field['definition']['type'], $fieldName, $field['definition']);
} }
} }
......
...@@ -135,7 +135,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -135,7 +135,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$tableAlias = $this->getTableAlias($componentAlias); $tableAlias = $this->getTableAlias($componentAlias);
if ( ! isset($this->tables[$tableAlias])) 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]; $table = $this->tables[$tableAlias];
...@@ -247,7 +247,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -247,7 +247,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$tableAlias = $this->getTableAlias($componentAlias); $tableAlias = $this->getTableAlias($componentAlias);
if ( ! isset($this->tables[$tableAlias])) { 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); $root = current($this->tables);
...@@ -491,7 +491,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -491,7 +491,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
{ {
$class = 'Doctrine_Query_Having'; $class = 'Doctrine_Query_Having';
$parser = new $class($this); $parser = new $class($this);
$this->parts['having'][] = $parser->parse($orderby); $this->parts['having'][] = $parser->parse($having);
return $this; return $this;
} }
...@@ -1216,7 +1216,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -1216,7 +1216,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
} else { } else {
if ( ! (substr_count($term[$i], "'") & 1) && if ( ! (substr_count($term[$i], "'") & 1) &&
! (substr_count($term[$i], "\"") & 1) && ! (substr_count($term[$i], "\"") & 1) &&
! (substr_count($term[$i], "") & 1) ! (substr_count($term[$i], "") & 1)
) { $i++; } ) { $i++; }
} }
} else { } else {
...@@ -1231,7 +1231,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -1231,7 +1231,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
} else { } else {
if ( ! (substr_count($term[$i], "'") & 1) && if ( ! (substr_count($term[$i], "'") & 1) &&
! (substr_count($term[$i], "\"") & 1) && ! (substr_count($term[$i], "\"") & 1) &&
! (substr_count($term[$i], "") & 1) ! (substr_count($term[$i], "") & 1)
) { $i++; } ) { $i++; }
} }
} }
......
...@@ -227,11 +227,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate ...@@ -227,11 +227,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate
if ($table) { if ($table) {
$tableName = $table->getAliasName($component); $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->tables[$alias] = $table;
$this->fetchModes[$alias] = Doctrine::FETCH_IMMEDIATE; $this->fetchModes[$alias] = Doctrine::FETCH_IMMEDIATE;
$this->tableAliases[$currPath] = $alias; $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