summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-12-17 00:44:35 +0100
committerAndreas Fischer <bantu@owncloud.com>2013-12-21 19:36:14 +0100
commit63a2bea7ec0171595f2a96639827e9d477fc6878 (patch)
treef93a3d5b2d1ba445b1a1a04d18d6f29e686f6f46 /tests
parentcd26631a6dd4de996480c2da2f4873b416b559f5 (diff)
downloadnextcloud-server-63a2bea7ec0171595f2a96639827e9d477fc6878.tar.gz
nextcloud-server-63a2bea7ec0171595f2a96639827e9d477fc6878.zip
Remove OC_DB_StatementWrapper::numRows().
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.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions