1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

development: Fix pool index when the first insert fails

This commit is contained in:
Ruben S. Montero 2019-01-21 17:58:05 +01:00
parent f174b71b4b
commit 5d9c92d0d9

View File

@ -148,7 +148,14 @@ int PoolSQL::allocate(PoolObjectSQL *objsql, string& error_str)
if( rc == -1 )
{
_set_lastOID(--lastOID, db, table);
lastOID = lastOID - 1;
if ( lastOID < 0 )
{
lastOID = 0;
}
_set_lastOID(lastOID, db, table);
}
unlock();