ZF2-384: Error-inducing insert call from AbstractTableGateway does not fail with an exception

Issue Type: Bug Created: 2012-07-02T14:12:34.000+0000 Last Updated: 2012-08-14T15:31:28.000+0000 Status: Resolved Fix version(s): Reporter: Yonni Mendes (yonman) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

  • exception
  • sqlinsert
  • tablegateway

Related issues: Attachments:


Steps: zf2 beta4 Create a database which could not accept a particular insert (a column with NOT NULL) Attempt to insert (and specify no value for the above column)

Expected: Fail with exception that contains the db's error message (column cannot be null, etc)

Actual: Fails silently

I worked around this by actually retrieving the resource object (PDO) from the connection,driver,adapter ... and then checked errorInfo manually.


Posted by Ralph Schindler (ralph) on 2012-07-02T14:32:09.000+0000

What database is this? And, is PDO not throwing an exception?

Posted by Yonni Mendes (yonman) on 2012-07-02T14:38:36.000+0000

Sqlite, I admit I haven't investigated it further than just checking the errorInfo array of information in PDO itself. The exception part is a bit of mental gymnastics on my part - it's what I'd expect that will happen should a query fail.

Posted by Ralph Schindler (ralph) on 2012-08-14T15:31:28.000+0000

I've tried to reproduce this in sqlite and mysql (with STRICT_TRANS_TABLES), I get exceptions.

If it's still an issue, let's reopen with some code samples.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.