From: Gregory Nietsky Date: Tue, 6 Sep 2011 13:48:03 +0000 (+0000) Subject: Make SQL query in app_voicemail.c portable LIMIT is not portable. X-Git-Tag: 1.8.7.0-rc1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b1398a82d53949fa35cbf7c1daf4ee0f0b99c6a;p=thirdparty%2Fasterisk.git Make SQL query in app_voicemail.c portable LIMIT is not portable. Regression from r312212 (closes issue ASTERISK-18255) Reported by: Leif Madsen Tested by: Leif Madsen Review: https://reviewboard.asterisk.org/r/1415/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334453 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index a0071042a9..cdb2df1a49 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3489,7 +3489,7 @@ static int last_message_index(struct ast_vm_user *vmu, char *dir) struct odbc_obj *obj; obj = ast_odbc_request_obj(odbc_database, 0); if (obj) { - snprintf(sql, sizeof(sql), "SELECT msgnum FROM %s WHERE dir=? order by msgnum desc limit 1", odbc_table); + snprintf(sql, sizeof(sql), "SELECT msgnum FROM %s WHERE dir=? order by msgnum desc", odbc_table); stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps); if (!stmt) {