summaryrefslogtreecommitdiff
path: root/alarm-svc
diff options
context:
space:
mode:
authorEugene Kurzberg <i.kurtsberg@samsung.com>2017-02-13 11:18:05 +0200
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>2017-02-14 22:30:49 -0800
commitcebb8004569ce6346fcb2a0b1b0b61b8d537a2c9 (patch)
tree44f52bdfaec774670c350a901d938098b3eebb3d /alarm-svc
parent72e47b8e10178b2f7ab54a607afd708b9dedcf77 (diff)
downloadalarm-cebb8004569ce6346fcb2a0b1b0b61b8d537a2c9.tar.gz
alarm-cebb8004569ce6346fcb2a0b1b0b61b8d537a2c9.tar.bz2
alarm-cebb8004569ce6346fcb2a0b1b0b61b8d537a2c9.zip
Fix system alarm duplication issue.
Change-Id: I59b6dc638be0bfb17c98a6562859543fb1ddcf92 Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
Diffstat (limited to 'alarm-svc')
-rwxr-xr-xalarm-svc/src/AlarmService.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/alarm-svc/src/AlarmService.cpp b/alarm-svc/src/AlarmService.cpp
index 55db3f3..1ae5769 100755
--- a/alarm-svc/src/AlarmService.cpp
+++ b/alarm-svc/src/AlarmService.cpp
@@ -60,22 +60,23 @@ namespace
"END;"
"CREATE TRIGGER alarm_enabled "
- "AFTER UPDATE OF " COLUMN_ENABLED " ON " TABLE_ALARMS " "
- "WHEN new." COLUMN_ENABLED " <> 0 "
+ "AFTER UPDATE ON " TABLE_ALARMS " "
+ "WHEN old." COLUMN_ENABLED " <> new." COLUMN_ENABLED " AND new." COLUMN_ENABLED " <> 0 "
"BEGIN "
STATEMENT_SET_ALARM(COLUMN_ALARM_ID)
"END;"
"CREATE TRIGGER alarm_disabled "
- "AFTER UPDATE OF " COLUMN_ENABLED " ON " TABLE_ALARMS " "
- "WHEN new." COLUMN_ENABLED " = 0 "
+ "AFTER UPDATE ON " TABLE_ALARMS " "
+ "WHEN old." COLUMN_ENABLED " <> new." COLUMN_ENABLED " AND new." COLUMN_ENABLED " = 0 "
"BEGIN "
STATEMENT_UNSET_ALARM(COLUMN_ALARM_ID)
"END;"
"CREATE TRIGGER alarm_updated "
- "AFTER UPDATE OF " COLUMN_DATE ", " COLUMN_REPEAT " ON " TABLE_ALARMS " "
+ "AFTER UPDATE ON " TABLE_ALARMS " "
"WHEN old." COLUMN_ENABLED " <> 0 AND new." COLUMN_ENABLED " <> 0 "
+ "AND (old." COLUMN_DATE " <> new." COLUMN_DATE " OR old." COLUMN_REPEAT " <> new." COLUMN_REPEAT ") "
"BEGIN "
"SELECT " FUNCTION_UNSET_ALARM "(old." COLUMN_ALARM_ID ");"
STATEMENT_SET_ALARM(COLUMN_ALARM_ID)