Issues

ZF-10631: Zend_Queue_Adapter_Db is missing SQL Server table definition file.

Description

There are no Zend_Queue_Adapter_Db table definitions for Microsoft SQL Server.

Comments

Here is a Zend_Queue_Adapter_Db table definition file for MS SQL Server 2008. I have not tested it on earlier versions of SQL, but it may work for them as well.

The difference between this and the MySQL database definitions is that there is no UNIQUE constraint on the the 'handle' column, but that constraint is not necessary with a minimal change to the Zend_Queue_Db_Adapter::deleteMessage() method. Namely, change:

public function deleteMessage(Zend_Queue_Message $message)
{
    $db    = $this->_messageTable->getAdapter();

- $where = $db->quoteInto('handle=?', $message->handle); + $where = array(); + $where[] = $db->quoteInto('message_id=?', $message->message_id); + $where[] = $db->quoteInto('handle=?', $message->handle);

    if ($this->_messageTable->delete($where)) {
        return true;
    }

    return false;
}

Added to trunk and 1.11 release branch

Thanks for accepting my patch. However, with out the mentioned change to Zend_Queue_Db_Adapter::deleteMessage(), the provided SQL file will not work with Zend_Queue.