aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-03-06 13:49:05 +0100
committerOliver Smith <osmith@sysmocom.de>2019-05-13 08:55:24 +0200
commit6b73fd9678b5b4570edc3722fda467a82b3c7ccb (patch)
tree12f680906e5d7e6b14596c8eb1d8f0f95f2ae2d4 /src/db.c
parentcd2af5ead7a6fbba3e7b3df620536619a10ef356 (diff)
db_hlr.c: add db_subscr_exists_by_imsi()
Check if a subscriber exists without generating an error log entry if it does not. This is cheaper than db_subscr_get_by_imsi(), as it does not fetch the subscriber entry. subscriber-create-on-demand will use this function. Related: OS#2542 Change-Id: I63818c0dd4fd22b41dadeeba2a07a651b5454c54
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/db.c b/src/db.c
index 770c3a4..9cad263 100644
--- a/src/db.c
+++ b/src/db.c
@@ -79,6 +79,7 @@ static const char *stmt_sql[] = {
" VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)",
[DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id",
[DB_STMT_SET_LAST_LU_SEEN] = "UPDATE subscriber SET last_lu_seen = datetime($val, 'unixepoch') WHERE id = $subscriber_id",
+ [DB_STMT_EXISTS_BY_IMSI] = "SELECT 1 FROM subscriber WHERE imsi = $imsi",
};
static void sql3_error_log_cb(void *arg, int err_code, const char *msg)