ZF-7585: query failed on very large sql statement

Issue Type: Bug Created: 2009-08-13T11:09:37.000+0000 Last Updated: 2011-10-17T01:10:15.000+0000 Status: Closed Fix version(s): Reporter: Zijin Huang (zijin) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Db

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: - ZF-7911



Query would fail if the sql statement is very long. preg_match crashes on Zend/Db/Statement.php line 188 in the _stripQuoted function.

Perharps it's php limitation? any workaround?

See for full script to re-produce the problem.

setFallbackAutoloader(true); $dbconfig = array ( 'host' => '', 'username' => 'root', 'password' => '', 'dbname' => 'test' ); $db = Zend\_Db::factory('Mysqli', $dbconfig); Zend\_Db\_Table::setDefaultAdapter($db); Zend\_Registry::set('db', $db); $sql = "SELECT `books`.\* FROM `books` WHERE (MATCH (author1) AGAINST ('(+paul +martin) .... very long query...... (+jacobi +jaques) (+jacobi +giacopo) (+jacobi +yakov) (+jacobi +iakov) (+jacobi +jakov) (+jacobi +jakow) (+jacobi +diogo) (+jacobi +dieguus) (+jacobi +jacobi) ' IN BOOLEAN MODE) ) ORDER BY `books`.`author1` asc LIMIT 20"; $db->query($sql); echo 'we dont reach here!' ?>


Posted by Zijin Huang (zijin) on 2009-08-13T11:31:06.000+0000

Sorry this issue would be a duplicate of ZF-5063 I guess ZF can not do anything about this.

My PHP environment is Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g .

Even with a large PCRE limit set, preg_match still fails.

Posted by Adam Lundrigan (adamlundrigan) on 2011-10-17T01:09:59.000+0000

This issue duplicates ZF-5063 and is related to ZF-7911

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

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