Using this method will result in an unneccesary extra SQL query (which also may
return an incorrect result because the underlying table changed in the
meantime).
In general:
If you are performing an UPDATE, DELETE or equivalent query,
OC_DB_StatementWrapper::execute() will already give you the number of
"affected rows" via \Doctrine\DBAL\Driver\Statement::rowCount(). This will
not work for SELECT queries, however.
If you want to know whether a table contains any rows matching your condition,
use "SELECT id FROM ... WHERE ... LIMIT 1".
If you want to know whether a table contains any rows matching your condition
and you also need the data, use "SELECT ... FROM ... WHERE ...", then use
one of the fetch() methods.
If you want to count the number of rows matching your condition, use use
"SELECT COUNT(...) AS number_of_rows FROM ... WHERE ...", then use one of the
fetch() methods.
Set 0 as default value for columns with numeric data type instead of the
empty string ''. Otherwise the database complains about an invalid
default value for this column.
To reproduce put the following in your ````appinfo/database.xml````:
````
<field>
<name>modified</name>
<type>decimal</type>
<default/>
<notnull>true</notnull>
<length>15</length>
</field>
````
See owncloud/mozilla_sync#14