[DBAL-530] sqlite: foreignKey - definition wrong when tables has databasename as prefix Created: 24/May/13  Updated: 24/May/13

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

Type: Bug Priority: Major
Reporter: Andy Rosslau Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Because of the fact that SQLite doesn't support multiple databases in one file, Doctrine handles definitions like that:

/**
 * @ORM\Entity()
 * @ORM\Table(name="database.table")
 */

in this way:

CREATE TABLE database__table[...]

But when another Tabele references a table defined like the one above, the foreignkey definition is generated wrong:

[...]FOREIGN KEY (table_id) REFERENCES database.table (id) NOT DEFER[...]

SQLSTATE[HY000]: General error: 1 near ".": syntax error

I guess this would be the right query:

[...]FOREIGN KEY (table_id) REFERENCES database__table (id) NOT DEFER[...]





[DBAL-529] databasenames including dashes not correctly supported Created: 24/May/13  Updated: 24/May/13

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

Type: Bug Priority: Major
Reporter: Andy Rosslau Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: annotationdriver, mapping, yml


 Description   

I'm having a legacy Database including a dash in its name:

"my-db"

which includes tables I want to work with.

The EntityMapping would be the following:

yml

My\TestBundle\Entity\Stuff:
    type: entity
    table: my-db.stuff
    fields:
        id:
...

annotation

/**
 * @ORM\Entity()
 * @ORM\Table(name="my-db.stuff")
 */

Both concludes in a Query (SELECT, INSERT etc.) which won't work:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-db.stuff t0 WHERE[...]

I found a simple fix by trial and Error. Just put a "`" in front of the databasename:

yml

My\TestBundle\Entity\Stuff:
    type: entity
    table: `my-db.stuff
    fields:
        id:
...

annotation

/**
 * @ORM\Entity()
 * @ORM\Table(name="`my-db.stuff")
 */

Although this fix works, it feels wrong.
Moreover, to prevent confusing other developers, this should be fixed to one the following styles.

annotation

/**
 * @ORM\Entity()
 * @ORM\Table(name="`my-db`.stuff")
 */

OR

annotation

/**
 * @ORM\Entity()
 * @ORM\Table(name="my-db.stuff")
 */





[DBAL-528] [GH-324] Update SQLServer2008Platform.php (support MS SQL Server type datetimeoffset(6)) Created: 23/May/13  Updated: 23/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Added support of maps a Doctrine datetimetz type to a MS SQL SERVER type datetimeoffset(6)






[DBAL-527] [GH-323] Update MasterSlaveConnection.php Created: 22/May/13  Updated: 22/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of ananda-agrawal:

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

Message:

check $this->keepSlave before enforcing master as slave






[DBAL-526] Doctrine\DBAL\Connection::executeQuery changes passed clause Created: 22/May/13  Updated: 22/May/13

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

Type: Bug Priority: Major
Reporter: Covie X Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

PHP 5.4.15-pl0-gentoo
doctrine/annotations v1.1.1
doctrine/cache v1.0
doctrine/collections v1.1
doctrine/common 2.4.0-RC2
doctrine/dbal 2.4.0-BETA2
doctrine/doctrine-bundle v1.2.0
doctrine/inflector v1.0
doctrine/lexer v1.0
doctrine/orm 2.4.0-BETA2



 Description   

>> var_dump(get_class($db));

string(24) "Doctrine\DBAL\Connection"

>> var_dump($params);

array(2)

{ [0] => int(18) [1] => int(0) }

>> $stmt = $db->executeQuery('SELECT l0_.id AS id0 FROM link l0_ WHERE l0_.user_id = ? AND l0_.is_deleted = ?', array($params), array(\Doctrine\DBAL\Connection::PARAM_INT_ARRAY));

An exception occurred while executing 'SELECT l0_.id AS id0 FROM link l0_ WHERE l0_.user_id = ?, ? AND l0_.is_deleted = ?' with params [18, 0]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

>> $stmt = $db->executeQuery('SELECT l0_.id AS id0 FROM link l0_ WHERE l0_.user_id = ? AND l0_.is_deleted = ?', $params, array(\PDO::PARAM_INT, \PDO::PARAM_INT));
>> var_dump($stmt->fetchAll());

array(0) {
}






[DBAL-525] PostgreSQL - getDateTimeFormatString() missing Created: 22/May/13  Updated: 22/May/13

Status: Open
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: 2.3.4
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Jan Pecek Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: datetime, format, postgresql
Environment:

PostgreSQL Database



 Description   

Using PostgreSQL and column with "timestamp without time zone" returns datetime in format Y-m-d H:i:s.u but not always. If u is zero the PHP driver returns Y-m-d H:i:s format only. Specification of function getDateTimeFormatString is missing for this case too. It's required to resolve described different two formats and add getDateTimeFormatString with usec to postgres platform
It's similar as DBAL-397 but for not time zone datetimes. It throws the same exception as in linked issue.






[DBAL-524] [GH-322] DBAL-522 Created: 20/May/13  Updated: 21/May/13  Resolved: 21/May/13

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

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


 Description   

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

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

Message:

Hotfix for DBAL-522(http://www.doctrine-project.org/jira/browse/DBAL-522)

Demonstrates that NULL parameters are handled incorrectly by `Doctrine\DBAL\SqlParserUtils` as of 2.3.4.

Basically, following usage always throws an exception:

$conn->executeQuery(
    'INSERT INTO FOO (foo, bar) values (:foo, :bar)', 
    array('foo' => 1, 'bar' => null)
);


 Comments   
Comment by Doctrine Bot [ 21/May/13 ]

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





[DBAL-523] [GH-321] Changed property visibility to protected Created: 20/May/13  Updated: 20/May/13  Resolved: 20/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

The main reason being to allow QueryBuilder to be subclassed ��� for example so that we can fix issues like problematic shallow cloning locally and use them without having to wait for a pull request to be merged.



 Comments   
Comment by Doctrine Bot [ 20/May/13 ]

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

Comment by Marco Pivetta [ 20/May/13 ]

Enforces BC on the internals of the QueryBuilder, which is a no-go given the complexity of the QueryBuilder itself





[DBAL-522] BC break : executeQuery with an array containing null value(s). Created: 20/May/13  Updated: 21/May/13  Resolved: 21/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.3.4
Fix Version/s: 2.4, 2.3.5

Type: Bug Priority: Blocker
Reporter: lemeunier Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: dbal
Environment:

Mac OSX 10.8.3, Mysql 5.5.28, PHP5.4



 Description   

Hello, i have got an error with doctrine 2.3.4 when i try to run the following code :

 
    $conn->executeQuery(
        'INSERT INTO FOO (foo, bar) values (:foo, :bar)', 
         array('foo' => 1, 'bar' => null)
     );

Error : Value for :bar not found in params array. Params array key should be "bar"

This code worked with doctrine 2.3.3.

I think the error comes from the function 'extractParam' in SQLParserUtils.php (DBAL)

line 215 : if (isset($paramsOrTypes[$paramName]))

The key exists even if the value is null.
So it should be:

  if (array_key_exists($paramName, $paramsOrTypes)) 

I am not enough confident to try a PR.
Thanks in advance!



 Comments   
Comment by Marco Pivetta [ 20/May/13 ]

I suggested a hotfix at https://github.com/doctrine/dbal/pull/322

Comment by lemeunier [ 21/May/13 ]

Thanks for the hotfix.





Generated at Sat May 25 14:24:58 UTC 2013 using JIRA 5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5.