1
0
mirror of synced 2025-02-01 13:01:45 +03:00

unitialized or typo variables

This commit is contained in:
gnat 2007-03-20 23:22:51 +00:00
parent 04d0993a35
commit 1fbb8b6c08
4 changed files with 11 additions and 14 deletions

View File

@ -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;
}
}

View File

@ -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']);
}
}

View File

@ -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], "<EFBFBD>") & 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], "<EFBFBD>") & 1)
) { $i++; }
}
}

View File

@ -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;