ZF-7585: query failed on very large sql statement


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 http://www.zijin-huang.com/test/long_query.txt for full script to re-produce the problem.

<?php error_reporting(E_ALL|E_STRICT); ini_set('display_errors', 1); ini_set('pcre.backtrack_limit',10000000); ini_set('pcre.recursion_limit',10000000); set_include_path('.' . PATH_SEPARATOR . './library/' . PATH_SEPARATOR . get_include_path()); include "Zend/Loader/Autoloader.php"; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->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!' ?>


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.

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