Commit 501409f3 authored by webchick's avatar webchick

Issue #2443655 by daffie, bzrudi71: PostgreSQL: Fix system\Tests\Entity\EntityReferenceFieldTest

parent c069f5f9
......@@ -188,7 +188,10 @@ protected function refreshServices() {
protected function generateRandomEntityId($string = FALSE) {
srand(time());
do {
$id = $string ? $this->randomMachineName() : mt_rand(1, 0xFFFFFFFF);
// 0x7FFFFFFF is the maximum allowed value for integers that works for all
// Drupal supported databases and is known to work for other databases
// like SQL Server 2014 and Oracle 10 too.
$id = $string ? $this->randomMachineName() : mt_rand(1, 0x7FFFFFFF);
}
while (isset($this->generatedIds[$id]));
$this->generatedIds[$id] = $id;
......
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