aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-08 15:28:49 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-08 15:28:49 +0000
commit9ffeba70be27809a86c648b8afd95a1f880e9d48 (patch)
tree8e815b1abf3f6959e7265a9205667ea86b6579c6 /cdr
parent1168715eacfcfd3593e5f4d7438ac2feb41ab30c (diff)
Reduce startup time for cdr_tds with large CDR tables.
Since we are just checking for table existence, add a WHERE clause that will return no rows but will raise an error if the table doesn't exist. (closes issue #17380) Reported by: kkwong Patches: issue17380-01.patch uploaded by seanbright (license 71) Tested by: kkwong git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@269006 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_tds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c
index 4e44e4ee1..6e2c4412b 100644
--- a/cdr/cdr_tds.c
+++ b/cdr/cdr_tds.c
@@ -477,7 +477,7 @@ static int mssql_connect(void)
goto connect_fail;
}
- snprintf(query, sizeof(query), "SELECT 1 FROM %s", table);
+ snprintf(query, sizeof(query), "SELECT 1 FROM %s WHERE 1 = 0", table);
#ifdef FREETDS_PRE_0_62
if ((tds_submit_query(tds, query) != TDS_SUCCEED) || (tds_process_simple_query(tds, &result_type) != TDS_SUCCEED || result_type != TDS_CMD_SUCCEED))
#else