reduce random/rand tsts to absolute minimum stmnt required

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12619 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Rupa Schomaker 2009-03-16 15:35:10 +00:00
parent 12d0918cda
commit 7b7f354f8d
1 changed files with 2 additions and 2 deletions

View File

@ -247,13 +247,13 @@ static switch_bool_t set_db_random()
{ {
char *sql = NULL; char *sql = NULL;
if (globals.odbc_dsn) { if (globals.odbc_dsn) {
sql = "SELECT * FROM lcr ORDER BY rand() LIMIT 1"; sql = "SELECT rand()";
if (switch_odbc_handle_exec(globals.master_odbc, sql, NULL) if (switch_odbc_handle_exec(globals.master_odbc, sql, NULL)
== SWITCH_ODBC_SUCCESS) { == SWITCH_ODBC_SUCCESS) {
db_random = "rand()"; db_random = "rand()";
return SWITCH_TRUE; return SWITCH_TRUE;
} }
sql = "SELECT * FROM lcr ORDER BY random() LIMIT 1"; sql = "SELECT random()";
if (switch_odbc_handle_exec(globals.master_odbc, sql, NULL) if (switch_odbc_handle_exec(globals.master_odbc, sql, NULL)
== SWITCH_ODBC_SUCCESS) { == SWITCH_ODBC_SUCCESS) {
db_random = "random()"; db_random = "random()";