[asterisk-commits] rmudgett: branch 10 r349820 - in /branches/10: ./ cel/cel_sqlite3_custom.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 5 17:46:05 CST 2012


Author: rmudgett
Date: Thu Jan  5 17:46:01 2012
New Revision: 349820

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349820
Log:
Make not assume that the cel_sqlite3_custom SQL table primary key is AcctId.

If a table is created by some other application and the primary key is not
named "AcctId", cel/cel_sqlite3_custom.c will always try to create the
table and fail because it already exists.

* Change the SQL table query to not require AcctId as the primary key.

(closes issue ASTERISK-18963)
Reported by: socketpair
Patches:
      fix.patch (license #6337) patch uploaded by socketpair
........

Merged revisions 349819 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/cel/cel_sqlite3_custom.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/cel/cel_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/cel/cel_sqlite3_custom.c?view=diff&rev=349820&r1=349819&r2=349820
==============================================================================
--- branches/10/cel/cel_sqlite3_custom.c (original)
+++ branches/10/cel/cel_sqlite3_custom.c Thu Jan  5 17:46:01 2012
@@ -321,7 +321,7 @@
 	}
 
 	/* is the table there? */
-	sql = sqlite3_mprintf("SELECT COUNT(AcctId) FROM %q;", table);
+	sql = sqlite3_mprintf("SELECT COUNT(*) FROM %q;", table);
 	res = sqlite3_exec(db, sql, NULL, NULL, NULL);
 	sqlite3_free(sql);
 	if (res != SQLITE_OK) {




More information about the asterisk-commits mailing list