[PATCH v2 2/6] lib/database: add field for last error string