ZF-7734: Too many columns in Pdo_Mysql query crashes Zend Studio Unit Test.

Issue Type: Bug Created: 2009-08-31T07:47:32.000+0000 Last Updated: 2010-08-25T06:33:47.000+0000 Status: Resolved Fix version(s): Reporter: Onno Lissenberg (orlissenberg) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Db

Related issues: Attachments:


If I run the following "bad" code snippet in a unit test it grinds to a halt with the following messages: "CGI / FastCGI has stopped working" (windows pop-up) and "Test case was unexpectedly terminated". I can resolve it by removing columns. The error does not occur outside Zend Studio (i.e. when I call the controller which uses this "bad" code).

I'm using the Pdo_Mysql adapter and it seems to fail at the lowest level, on various Windows based environments (Vista & XP).

--- bad code (too many columns?)---

$sql = "select * from auth_view_privileges where privilege_id = " . $filter->filter($id);
$result = $this->db->fetchRow($sql);

--- good code (less columns) ---

$sql = "select privilege_id, load_dts, status, privilege_name from auth_view_privileges where privilege_id = " . $filter->filter($id);
$result = $this->db->fetchRow($sql);

p.s. using a latest trial version, we're evaluating the framework and IDE with the goal to adopt it as primary tech. stack here.

Best Regards, Onno


Posted by Matthew Weier O'Phinney (matthew) on 2009-08-31T08:11:13.000+0000

This is not a ZF issue, but an issue with your RDBMS.

One way you can use ZF to protect you in such situations is to use Zend_Db_Select to create your queries. For example, try this:

<pre class="highlight">
$columns = array(
$select = $this->db->select();
$select->from('auth_view_privileges', $columns)
       ->where('privilege_id = ?', $id);
$result = $this->db->fetchRow($select);

The above code will ensure that all input is properly escaped for you RDMBS solution, and also quote all table and column names to ensure you do not have issues with reserved keywords.

Posted by Onno Lissenberg (orlissenberg) on 2009-08-31T13:10:23.000+0000

It's not the description column, it's the amount of columns that causes the crashes, was a bit too hasty in my reporting, it actually doesn't matter which column I exclude ...

I used to have: "select * from auth_view_privileges"

which initially crashed my unit tests (and still does for that matter on my work (Vista 64bit) and private machine (XP Pro)). It's driving me nuts, should prob. get a real OS :D

Any thoughts?

'php-cgi.exe': Loaded 'H:\Zend\Zend Studio - 7.0.0\plugins\org.zend.php.debug.debugger.win32.x86_5.2.26.v20090806\resources\php5\php-cgi.exe'

Posted by Margus Koiduste (marguskoiduste) on 2010-08-25T06:33:40.000+0000


I had similar issue with Zend Studio 7.2.0 Build ID: 20100421 on Windows XP. While running unittest, the PHP binary crashed when making SELECT query containing wildcard (*).

The problem seems to be the php_pdo_mysql.dll PHP extension included in Zend Studio debugger plugin.

I managed to resolve the issue by adding ZendDebugger PHP extension do my XAMPP 1.7.1 installation (…) and configuring Zend Studio to use XAMPP php-cgi.exe binary for debugging (Window > Preferences > PHP > PHP Executeables).

Hope this saves someone's day, Margus

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.