8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 10:03:03 +01:00

Rollback frontend transaction after getting login and role names

This commit is contained in:
alexpeshkoff 2015-09-04 10:53:02 +00:00
parent cf94ca3e74
commit 80daf8d8ed

View File

@ -5916,6 +5916,21 @@ static bool printUser(const char* dbName)
if (!frontendTransaction())
return false;
class FbTransCommit
{
public:
~FbTransCommit()
{
if (DB && fbTrans)
{
fbTrans->rollback(fbStatus);
if (succeeded())
fbTrans = NULL;
}
}
};
FbTransCommit fbTransCommit;
const char* sql = "SELECT CURRENT_USER, CURRENT_ROLE FROM RDB$DATABASE";
Firebird::RefPtr<Firebird::IStatement> st(Firebird::REF_NO_INCR,