I have this build.xml file:
<?xml version="1.0"?>
<project name="pdlt" basedir="/var/xinc/projects/Corylus" default="build">
<property name="database.data" value="pdlt_data.sql"/>
<target name="updateData">
<pdo url="mysql:host=localhost;dbname=test" userid="root" password="">
<transaction src="${database.data}" />
</pdo>
</target>
</project>
And this is the content of the sql file pdlt_data.sql:
CREATE TABLE IF NOT EXISTS `atributos` (
`id` int(11) NOT NULL default '0',
`idioma_id` varchar(255) NOT NULL default '',
`nombre_atributo` varchar(255) NOT NULL default '',
`creador_ip` varchar(255) default NULL,
`modificador_ip` varchar(255) NOT NULL default '',
`creador` varchar(255) NOT NULL default '',
`modificador` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`,`idioma_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
When I run phing updateData I get the following error:
[pdo] Error processing reults: SQLSTATE[HY000]: General error: 2053
[pdo] Failed to execute: CREATE TABLE IF NOT EXISTS atributos ( id int(11) NOT NULL default '0', idioma_id varchar(255) NOT NULL default , nombre_atributo varchar(255) NOT NULL default , creador_ip varchar(255) default NULL, modificador_ip varchar(255) NOT NULL default , creador varchar(255) NOT NULL default , modificador varchar(255) NOT NULL default , PRIMARY KEY (id,idioma_id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1
Execution of target "updateData" failed for the following reason: /var/xinc/projects/Corylus/build.xml:6:26: Failed to execute SQL [wrapped: 'SQLSTATE[HY000]: General error: 2053' ]
I have installed pdo and pdo_mysql through pecl and these are the versions installed in my pc:
PDO 1.0.3 stable
PDO_MYSQL 1.0.2 stable
I guess this problem is caused because in file tasks/ext/pdo/PDOSQLExecTask.php line 454, $this->processResults() is always being executed, even when there are no results from the queries, like in this case.
I think that if a formatter isn't defined, it shouldn't process any result, so I've solved this situation just replacing previous line for:
if(count($this->getConfiguredFormatters())>0)
$this->processResults();