Commit 1483ef10 authored by catch's avatar catch

Issue #2443665 by grom358, bzrudi71: PostgreSQL: Fix node\Tests\NodeCreationTest

parent bdb618db
......@@ -195,7 +195,17 @@ function testNodeAddWithoutContentTypes () {
* @return array
*/
protected static function getWatchdogIdsForTestExceptionRollback() {
return db_query("SELECT wid FROM {watchdog} WHERE variables LIKE '%Test exception for rollback.%'")->fetchAll();
// PostgreSQL doesn't support bytea LIKE queries, so we need to unserialize
// first to check for the rollback exception message.
$matches = array();
$query = db_query("SELECT wid, variables FROM {watchdog}");
foreach ($query as $row) {
$variables = (array) unserialize($row->variables);
if (isset($variables['!message']) && $variables['!message'] === 'Test exception for rollback.') {
$matches[] = $row->wid;
}
}
return $matches;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment