]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 334453 via svnmerge from
authorGregory Nietsky <gregory@distrotech.co.za>
Tue, 6 Sep 2011 13:58:56 +0000 (13:58 +0000)
committerGregory Nietsky <gregory@distrotech.co.za>
Tue, 6 Sep 2011 13:58:56 +0000 (13:58 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r334453 | irroot | 2011-09-06 15:48:03 +0200 (Tue, 06 Sep 2011) | 13 lines

  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/10@334455 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index eec7d7f71f1025bb47a71e6050920b7a0eb4a76f..d89d581fdeec64591af8dfdd777e03b8b025be79 100644 (file)
@@ -3483,7 +3483,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) {