SQLite Notifier has no table information #1687 (#2540)

This commit is contained in:
Aleksandar Fabijanic
2018-11-13 07:23:37 -06:00
committed by GitHub
parent 9f53d07d4c
commit 8d95644bad
3 changed files with 36 additions and 16 deletions

View File

@@ -23,9 +23,7 @@ namespace SQLite {
Notifier::Notifier(const Session& session, EnabledEventType enabled):
_session(session),
_row(),
_enabledEvents()
_session(session)
{
if (enabled & SQLITE_NOTIFY_UPDATE) enableUpdate();
if (enabled & SQLITE_NOTIFY_COMMIT) enableCommit();
@@ -35,9 +33,7 @@ Notifier::Notifier(const Session& session, EnabledEventType enabled):
Notifier::Notifier(const Session& session, const Any& value, EnabledEventType enabled):
_session(session),
_value(value),
_row(),
_enabledEvents()
_value(value)
{
if (enabled & SQLITE_NOTIFY_UPDATE) enableUpdate();
if (enabled & SQLITE_NOTIFY_COMMIT) enableCommit();
@@ -158,18 +154,22 @@ void Notifier::sqliteUpdateCallbackFn(void* pVal, int opCode, const char* pDB, c
{
poco_check_ptr(pVal);
Notifier* pV = reinterpret_cast<Notifier*>(pVal);
if (opCode == Utility::OPERATION_INSERT)
{
pV->_table = pTable;
pV->_row = row;
pV->insert.notify(pV);
}
else if (opCode == Utility::OPERATION_UPDATE)
{
pV->_table = pTable;
pV->_row = row;
pV->update.notify(pV);
}
else if (opCode == Utility::OPERATION_DELETE)
{
pV->_table = pTable;
pV->_row = row;
pV->erase.notify(pV);
}