#define SELECT_RESTRICTION_ID "SELECT restriction_id FROM restrictions " \
" WHERE binpath = ? AND iftype = ? AND imsi = ? AND " \
- " data_limit = ? AND data_warn_limit = ? AND " \
" rst_state = ? AND roaming = ? AND ifname = ?"
/* UPDATE statement */
DB_ACTION(sqlite3_bind_int(stmt, 2, info->iftype));
DB_ACTION(sqlite3_bind_text(stmt, 3, info->imsi ? info->imsi : "",
-1, SQLITE_TRANSIENT));
- DB_ACTION(sqlite3_bind_int64(stmt, 4, info->data_limit));
- DB_ACTION(sqlite3_bind_int64(stmt, 5, info->data_warn_limit));
- DB_ACTION(sqlite3_bind_int(stmt, 6, info->rst_state));
- DB_ACTION(sqlite3_bind_int(stmt, 7, info->roaming));
- DB_ACTION(sqlite3_bind_text(stmt, 8, info->ifname ? info->ifname : "",
+ DB_ACTION(sqlite3_bind_int(stmt, 4, info->rst_state));
+ DB_ACTION(sqlite3_bind_int(stmt, 5, info->roaming));
+ DB_ACTION(sqlite3_bind_text(stmt, 6, info->ifname ? info->ifname : "",
-1, SQLITE_TRANSIENT));
rc = sqlite3_step(stmt);
goto handle_error;
}
+ __get_restriction_id(info);
if (info->restriction_id)
stmt = update_net_restrictions;
DB_ACTION(sqlite3_bind_int64(stmt, 8, info->data_warn_limit));
if (info->restriction_id)
- DB_ACTION(sqlite3_bind_int64(stmt, 11, info->restriction_id));
+ DB_ACTION(sqlite3_bind_int64(stmt, 9, info->restriction_id));
if (sqlite3_step(stmt) != SQLITE_DONE) {
STC_LOGE("Failed to set network restriction: %s\n",