Symptoms in server log file:
- getting max ID for a specified table from database fails, for example:
- after max ID counting has been started from 1 it is impossible to insert new records in the specified table, for example:
When function DCget_nextid() reads the max ID number from a database for a specified table then some database errors can cause resetting ID number to 1.
In DCget_nextid() the DBselect()'s result is passed without checking into DBfetch(). If the latter returns NULL, a wrong conclusion is made that the max ID for the specified table does not yet exist and counting starts from the smallest ID. DBfetch() can return NULL in case of various errors while the requested record does exist in database.