[asterisk-commits] rmudgett: trunk r349821 - in /trunk: ./ cel/cel_sqlite3_custom.c

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


Author: rmudgett
Date: Thu Jan  5 17:47:11 2012
New Revision: 349821

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349821
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
........

Merged revisions 349820 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/cel/cel_sqlite3_custom.c

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

Modified: trunk/cel/cel_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_sqlite3_custom.c?view=diff&rev=349821&r1=349820&r2=349821
==============================================================================
--- trunk/cel/cel_sqlite3_custom.c (original)
+++ trunk/cel/cel_sqlite3_custom.c Thu Jan  5 17:47:11 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