]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 269007 via svnmerge from
authorSean Bright <sean@malleable.com>
Tue, 8 Jun 2010 15:45:57 +0000 (15:45 +0000)
committerSean Bright <sean@malleable.com>
Tue, 8 Jun 2010 15:45:57 +0000 (15:45 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r269007 | seanbright | 2010-06-08 11:39:52 -0400 (Tue, 08 Jun 2010) | 18 lines

  Merged revisions 269006 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r269006 | seanbright | 2010-06-08 11:28:49 -0400 (Tue, 08 Jun 2010) | 11 lines

    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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@269010 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_tds.c

index 408b255a47bbd9e6d23d1abbeb01738f7744c253..1248649ab1a7447e3705b215b31c6a136fc63609 100644 (file)
@@ -359,7 +359,7 @@ static int mssql_connect(void)
                goto failed;
        }
 
-       if (execute_and_consume(settings->dbproc, "SELECT 1 FROM [%s]", settings->table)) {
+       if (execute_and_consume(settings->dbproc, "SELECT 1 FROM [%s] WHERE 1 = 0", settings->table)) {
                ast_log(LOG_ERROR, "Unable to find table '%s'\n", settings->table);
                goto failed;
        }