Zend Framework

Zend_Db_Table_Row_Abstract->save() Fail on _refresh() "Incorrect syntax near ')'"

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.0
  • Fix Version/s: 1.7.0
  • Component/s: Zend_Db_Table
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

Using SQL Server 2000, and Zend_Db_Adapter_Pdo_Mssql

Here's the application code:

try
{
	//$email_requests_table is an instance of a Zend_Db_Table_Abstract extension
	$new = $email_requests_table->createRow(array(
		'oc_id' => $input['oc_id'][$i],
		'EmailAddress' => $input['EmailAddress'],
		'PersonName' => $input['PersonName'],
	));
	$new->save();
}
catch(Zend_Db_Table_Row_Exception $e)
{
	header("content-type: text/plain"); die(print_r($new, true) . "\n" . print_r($e, true));
}

Using a SQL Profiler I was able to apprehend that the correct insert is performed, but during _refresh() the following invalid query is sent:

SELECT "vp_Email_Requests".* FROM "vp_Email_Requests" WHERE ("TblPK" = 181) SELECT * FROM (SELECT TOP 1 * FROM () AS inner_tbl) AS outer_tbl

Which is sending an error back "Incorrect syntax near ')'" (highlighted in red)

I'm certain my application code is right, because I've done similar tasks using a MySQL adapter. I'm thinking this is a Mssql adapter related bug.

Activity

Hide
Adam VanBerlo added a comment -

This is what $email_requests_table is an instance of

Show
Adam VanBerlo added a comment - This is what $email_requests_table is an instance of
Hide
Wil Sinclair added a comment -

Please evaluate and categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and categorize as necessary.
Hide
Chris Dary added a comment -

It looks like this bug may be coming from line 1044 of Zend/Db/Select.php

$this->_adapter->limit('', $count, $offset)

It's calling the limit function, but passing an empty $sql variable, so the result is that the subselect is empty.

Show
Chris Dary added a comment - It looks like this bug may be coming from line 1044 of Zend/Db/Select.php
$this->_adapter->limit('', $count, $offset)
It's calling the limit function, but passing an empty $sql variable, so the result is that the subselect is empty.
Hide
Mickael Perraud added a comment -

This has been fixed by SVN8784

Show
Mickael Perraud added a comment - This has been fixed by SVN8784
Hide
Wil Sinclair added a comment -

Changing issues in preparation for the 1.7.0 release.

Show
Wil Sinclair added a comment - Changing issues in preparation for the 1.7.0 release.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: