zendframework/zf2 — pull request #2896 by voxel01 (2012-11-20 07:41:52+00:00)
Title: Constraints in Zend\Db\Metadata\Source\AbstractSource::getTable not initalised

The Constraints of a Table will always be empty as they are not set by default

With the following code you will always get an empty array.
$metadata = new Zend\Db\Metadata\Metadata($db->getAdapter());
$table = $metadata->getTable($tableName);
var_dump($table->getConstraints());

in the last line of the methode Zend\Db\Metadata\Source\AbstractSource::getTable you should add the following code:

$table->setConstraints($this->getConstraints($tableName, $schema));

that worked for me to fix it.