mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
delete repeat keys in db
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6882 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
09e842f831
commit
86da61bc8f
@ -425,17 +425,21 @@ SWITCH_STANDARD_APP(db_function)
|
|||||||
|
|
||||||
|
|
||||||
if (!strcasecmp(argv[0], "insert")) {
|
if (!strcasecmp(argv[0], "insert")) {
|
||||||
|
sql = switch_mprintf("delete from db_data where realm='%q' and data_key='%q'", argv[1], argv[2]);
|
||||||
|
switch_assert(sql);
|
||||||
|
limit_execute_sql(sql, globals.mutex);
|
||||||
|
switch_safe_free(sql);
|
||||||
|
|
||||||
sql = switch_mprintf("insert into db_data values('%q','%q','%q','%q');", globals.hostname, argv[1], argv[2], argv[3]);
|
sql = switch_mprintf("insert into db_data values('%q','%q','%q','%q');", globals.hostname, argv[1], argv[2], argv[3]);
|
||||||
} else if (!strcasecmp(argv[0], "delete")) {
|
} else if (!strcasecmp(argv[0], "delete")) {
|
||||||
sql = switch_mprintf("delete from db_data where realm='%q' and data_key='%q'", argv[1], argv[2]);
|
sql = switch_mprintf("delete from db_data where realm='%q' and data_key='%q'", argv[1], argv[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_assert(sql);
|
||||||
if (sql) {
|
|
||||||
limit_execute_sql(sql, globals.mutex);
|
limit_execute_sql(sql, globals.mutex);
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE);
|
||||||
@ -470,6 +474,7 @@ SWITCH_STANDARD_API(group_api_function)
|
|||||||
}
|
}
|
||||||
sql = switch_mprintf("delete from group_data where groupname='%q' and url='%q';", argv[1], argv[2]);
|
sql = switch_mprintf("delete from group_data where groupname='%q' and url='%q';", argv[1], argv[2]);
|
||||||
assert(sql);
|
assert(sql);
|
||||||
|
|
||||||
limit_execute_sql(sql, NULL);
|
limit_execute_sql(sql, NULL);
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
sql = switch_mprintf("insert into group_data values('%q','%q','%q');", globals.hostname, argv[1], argv[2]);
|
sql = switch_mprintf("insert into group_data values('%q','%q','%q');", globals.hostname, argv[1], argv[2]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user