Hi All,
I've started writing my first webapp using Zend_Framework, i am using
preview version 1.5 and i spotted a annoying problem when
Zend_Db_Table_Abstract class is start talking to table with longtext
columns
Unfortunately i haven't place to report that as issue within issue
tracker, so maybe you will be interested in problem what i got (for
saving your time:)
I have table content with following structure:
CREATE TABLE IF NOT EXISTS `content` (
`content_id` int(11) NOT NULL auto_increment,
`title` tinytext NOT NULL,
`author` tinytext NOT NULL,
`content` longtext NOT NULL,
`template` varchar(255) NOT NULL,
`updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
PRIMARY KEY (`content_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table storing all html
content' ;
And my DB Model looks like that:
class Content extends Zend_Db_Table_Abstract{
protected $_name = 'content';
protected $_primary = 'content_id';
}
When i try to that within my Zend_Controller_Action
class ContentController extends Zend_Controller_Action {
function indexAction() {
$ct = new Content();
$id = $this->_getParam('id');
$id = 1;
$page = $ct->fetchAll($ct->select()->where('content_id = ?',
$id)) ;
return;
}
}
It is making my apache dead with following error_log message:
[Thu Feb 21 00:18:19 2008] [notice] child pid 36005 exit signal
Segmentation fault (11)
However when i change the code by adding var_dump function for
datamodel like here:
class ContentController extends Zend_Controller_Action {
function indexAction() {
$ct = new Content();
$id = $this->_getParam('id');
$id = 1;
var_dump($ct);
$page = $ct->fetchAll($ct->select()->where('content_id = ?',
$id)) ;
return;
}
}
Then there is no apache error.
Finnaly i've changed 'content' column's type to mediumtext which stop
this situation happens.
My testing enviroment was:
MAC OS.X 10.5.2 (leopard) with MAMP 1.0 / PHP 5.2.4 (cli) (built: Sep
23 2007 22:34:35) Apache/2.0.59
and
Ubuntu 6.3 PHP 5.2.3-1ubuntu6.3 / Apache/2.2.4 (Ubuntu)
Thank you for reading till end ;)
Marek Wawro