[DBAL-384] Missing TIMESTAMP support Created: 16/Nov/12  Updated: 27/Apr/13  Resolved: 27/Apr/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.0, 2.1, 2.2, 2.3
Fix Version/s: 2.2.2

Type: Improvement Priority: Minor
Reporter: Harrie Bos Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: None

Attachments: Text File timestamp.patch    

 Description   

Here's a fix to add support for a TIMESTAMP field in the database.



 Comments   
Comment by Florin Patan [ 18/Nov/12 ]

@Benjamin should I create a PR for this on GH?

Comment by Harrie Bos [ 18/Nov/12 ]

I think it should be fixed in one of the next releases

Comment by frank [ 26/Apr/13 ]

this aint working.. further more i used... http://www.doctrine-project.org/jira/secure/attachment/11350/timestamp.patch

which includes a bit more.. like the actual timestamp.php

but still getting error

Could not convert database value "0000000016E2BCF7" to Doctrine Type timestamp. Expected format: Y-m-d H:i:s

500 Internal Server Error - ConversionException

Comment by Benjamin Eberlei [ 27/Apr/13 ]

Please add this as a custom type to your own project if you need it, this is not going to be part of DBAL Core





[DBAL-238] Disable MultipleActiveResultSets in SQL Server (pdo_sqlsrv) not possible Created: 19/Mar/12  Updated: 05/May/12  Resolved: 05/May/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

http://msdn.microsoft.com/en-us/library/ee376925%28v=sql.90%29.aspx






[DBAL-245] [GH-124] Connection quote() ignores returned value from getBindingInfo() Created: 28/Mar/12  Updated: 30/Mar/12  Resolved: 30/Mar/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jimcottrell:

Url: https://github.com/doctrine/dbal/pull/124

Message:

Maybe I'm missing something here, but this simple change seems to be necessary to allow for proper type management in quote(). For example, without this change passing a DateTime object as $input with $type = 'date' will resolve the proper string value in getBindingInfo, but then still attempt to pass the DateTime to PDO, which of course doesn't work.



 Comments   
Comment by Benjamin Eberlei [ 29/Mar/12 ]

A related Github Pull-Request [GH-124] was closed
https://github.com/doctrine/dbal/pull/124

Comment by Benjamin Eberlei [ 30/Mar/12 ]

Fixed and merged





[DBAL-219] wrong schema hadTable and getTable return when table name contains quote Created: 12/Feb/12  Updated: 24/Mar/12  Resolved: 24/Mar/12

Status: Resolved
Project: Doctrine DBAL
Component/s: Schema Managers
Affects Version/s: None
Fix Version/s: 2.2.2

Type: Bug Priority: Minor
Reporter: Alexandru Patranescu Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

wrong schema hadTable and getTable return when table name contains quote.

I bump into this when useing a ManyToMany replation and one Entity was named Group with tablename `Group`
In RemoveNamespacedAssets the FK from The Join Table to Group was removed because in acceptForeignKey() $this->schema->hasTable($fkConstraint->getForeignTableName()) returned false



 Comments   
Comment by Benjamin Eberlei [ 24/Mar/12 ]

Fixed and merged into 2.2





[DBAL-240] SQL Parser Utils trigger error when uing with Type instances Created: 24/Mar/12  Updated: 24/Mar/12  Resolved: 24/Mar/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.1.6, 2.2.1
Fix Version/s: 2.1.7, 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

https://github.com/doctrine/dbal/pull/120



 Comments   
Comment by Benjamin Eberlei [ 24/Mar/12 ]

Fixed and merged into 2.1 and 2.2





[DBAL-228] OCI8Statement' fetchAll method can not do with PDO::FETCH_BOTH Created: 02/Mar/12  Updated: 14/Mar/12  Resolved: 14/Mar/12

Status: Resolved
Project: Doctrine DBAL
Component/s: Drivers
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Critical
Reporter: zhouhero Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

/**

  • {@inheritdoc}

    */

private static $fetchStyleMap = array(
PDO::FETCH_BOTH => OCI_BOTH,
PDO::FETCH_ASSOC => OCI_ASSOC,
PDO::FETCH_NUM => OCI_NUM
);

public function fetchAll($fetchStyle = PDO::FETCH_BOTH)
{
if ( ! isset(self::$fetchStyleMap[$fetchStyle]))

{ throw new \InvalidArgumentException("Invalid fetch style: " . $fetchStyle); }

$result = array();
oci_fetch_all($this->_sth, $result, 0, -1,
self::$fetchStyleMap[$fetchStyle] | OCI_RETURN_NULLS | OCI_FETCHSTATEMENT_BY_ROW | OCI_RETURN_LOBS);

return $result;
}

oci_fetch_all method can only surport

  • OCI_NUM
  • OCI_ASSOC

in $fetchStyleMap, OCI_BOTH is included!!!!



 Comments   
Comment by Benjamin Eberlei [ 14/Mar/12 ]

Fixed





[DBAL-237] schema:update fails when changing from ManyToOne to OneToOne Created: 02/Feb/12  Updated: 14/Mar/12  Resolved: 14/Mar/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.1.6
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Matt Lehner Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Symfony 2.0.9



 Description   

If a relation is changed from ManyToOne to OneToOne a Mysql exception 1025 is thrown because schema:update attempts to drop the indexes without first dropping the foreign keys. This seems to happen since the foreign keys are not deleted from the entity.. but the indexes change type (from index to unique).

Incorrect output from --dump-sql

DROP INDEX IDX_9AFB9A3755EB82D0 ON tapi_phone;
DROP INDEX IDX_9AFB9A37A6A12EC1 ON tapi_phone;
ALTER TABLE tapi_phone ADD location_id INT DEFAULT NULL, CHANGE extension extension VARCHAR(255) DEFAULT NULL, CHANGE protocol protocol VARCHAR(255) DEFAULT NULL;
ALTER TABLE tapi_phone ADD CONSTRAINT FK_9AFB9A3764D218E FOREIGN KEY (location_id) REFERENCES tapi_location(id);
CREATE UNIQUE INDEX UNIQ_9AFB9A37F85E0677 ON tapi_phone (username);
CREATE UNIQUE INDEX UNIQ_9AFB9A37B728E969 ON tapi_phone (mac_address);
CREATE UNIQUE INDEX UNIQ_9AFB9A3755EB82D0 ON tapi_phone (default_user_id);
CREATE INDEX IDX_9AFB9A3764D218E ON tapi_phone (location_id);
CREATE UNIQUE INDEX UNIQ_9AFB9A37A6A12EC1 ON tapi_phone (registered_user_id)

Expected output from --dump-sql

ALTER TABLE tapi_phone DROP FOREIGN KEY FK_9AFB9A3755EB82D0;
DROP INDEX IDX_9AFB9A3755EB82D0 ON tapi_phone;
ALTER TABLE tapi_phone DROP FOREIGN KEY FK_9AFB9A37A6A12EC1;
DROP INDEX IDX_9AFB9A37A6A12EC1 ON tapi_phone;
ALTER TABLE tapi_phone ADD location_id INT DEFAULT NULL, CHANGE extension extension VARCHAR(255) DEFAULT NULL, CHANGE protocol protocol VARCHAR(255) DEFAULT NULL;
ALTER TABLE tapi_phone ADD CONSTRAINT FK_9AFB9A3764D218E FOREIGN KEY (location_id) REFERENCES tapi_location(id);
ALTER TABLE tapi_phone ADD CONSTRAINT FK_9AFB9A3755EB82D0 FOREIGN KEY (default_user_id) REFERENCES tapi_user (id);
ALTER TABLE tapi_phone ADD CONSTRAINT FK_9AFB9A37A6A12EC1 FOREIGN KEY (registered_user_id) REFERENCES tapi_user (id);
CREATE UNIQUE INDEX UNIQ_9AFB9A37F85E0677 ON tapi_phone (username);
CREATE UNIQUE INDEX UNIQ_9AFB9A37B728E969 ON tapi_phone (mac_address);
CREATE UNIQUE INDEX UNIQ_9AFB9A3755EB82D0 ON tapi_phone (default_user_id);
CREATE INDEX IDX_9AFB9A3764D218E ON tapi_phone (location_id);
CREATE UNIQUE INDEX UNIQ_9AFB9A37A6A12EC1 ON tapi_phone (registered_user_id);



 Comments   
Comment by Aigars Gedroics [ 17/Feb/12 ]

I have solved it by extending the method inside MySqlPlatform class (based in DBAL 2.1.5-DEV):

/**
 * Fix for DROP/CREATE index after foreign key change from OneToOne to ManyToOne
 * @author Aigars Gedroics
 * @param TableDiff $diff
 * @return array
 */
protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff)
{
	$sql = array();
	$table = $diff->name;

	foreach ($diff->removedIndexes AS $remKey => $remIndex) {

		foreach ($diff->addedIndexes as $addKey => $addIndex) {
			if ($remIndex->getColumns() == $addIndex->getColumns()) {

				$columns = $addIndex->getColumns();
				$type = '';
				if ($addIndex->isUnique()) {
					$type = 'UNIQUE ';
				}

				$query = 'ALTER TABLE ' . $table . ' DROP INDEX ' . $remIndex->getName() . ', ';
				$query .= 'ADD ' . $type . 'INDEX ' . $addIndex->getName();
				$query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')';

				$sql[] = $query;

				unset($diff->removedIndexes[$remKey]);
				unset($diff->addedIndexes[$addKey]);

				break;
			}
		}
	}

	$sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff));

	return $sql;
}
Comment by Benjamin Eberlei [ 14/Mar/12 ]

Moved to dBAL

Comment by Benjamin Eberlei [ 14/Mar/12 ]

Fixed





Generated at Sun Oct 26 07:26:51 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.