summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-06-10 17:33:38 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-10 17:33:38 +0200
commitf1b793f203d052e4b9ef05d1a2f1eec996704e48 (patch)
treed5356dd0b54d86c42aae6cf9b375b9ebc1a5612b
parent09ccb6308ed60893e0f7ab22d2731b76c8cf938b (diff)
fix PURGE_MS sqlite3 access
-rw-r--r--osmo-gsup-hlr/src/db.c2
-rw-r--r--osmo-gsup-hlr/src/db_hlr.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/osmo-gsup-hlr/src/db.c b/osmo-gsup-hlr/src/db.c
index 82c901b..9d4e99e 100644
--- a/osmo-gsup-hlr/src/db.c
+++ b/osmo-gsup-hlr/src/db.c
@@ -30,6 +30,8 @@ static const char *stmt_sql[] = {
[UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?",
[AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?",
[AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?",
+ [UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?",
+ [UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?",
};
static void sql3_error_log_cb(void *arg, int err_code, const char *msg)
diff --git a/osmo-gsup-hlr/src/db_hlr.c b/osmo-gsup-hlr/src/db_hlr.c
index ca44e8e..1b95556 100644
--- a/osmo-gsup-hlr/src/db_hlr.c
+++ b/osmo-gsup-hlr/src/db_hlr.c
@@ -146,15 +146,9 @@ int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps)
else
stmt = dbc->stmt[UPD_PURGE_CS_BY_IMSI];
- rc = sqlite3_bind_int(stmt, 1, 1);
- if (rc != SQLITE_OK) {
- LOGP(DAUC, LOGL_ERROR, "Error binding Purged: %d\n", rc);
- return -1;
- }
-
- rc = sqlite3_bind_text(stmt, 2, imsi, -1, SQLITE_STATIC);
+ rc = sqlite3_bind_text(stmt, 1, imsi, -1, SQLITE_STATIC);
if (rc != SQLITE_OK) {
- LOGP(DAUC, LOGL_ERROR, "Error binding IMSI: %d\n", rc);
+ LOGP(DAUC, LOGL_ERROR, "Error binding IMSI %s: %d\n", imsi, rc);
ret = -1;
goto out;
}