From 82f082743cd53398957310498596f37d8d5f5aac Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 10 Feb 2020 12:42:11 +0100 Subject: return 0 for no modified records if query was optimized away --- it_dbi.class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index 45a321d..633974e 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -514,7 +514,7 @@ function clear($pp = true) /** * Semi-internal: send a raw SQL query and return mysql result value * @param $query complete SQL query string - * @return raw MySQL result. May die if query fails and safety is big enough + * @return MySQL result which is false for errors. May die on error if safety is big enough */ function query($query, $p = array()) { @@ -805,13 +805,13 @@ function store($tags = array()) * Update current record or a number of records given by where condition * @param $tags key => value pairs (these have priority over changes in member vars) * @param $where condition to select records to be modified (if not current record) - * @return number of updated records (or false on error). WARNING: read LIMIT docs before using it + * @return number of modified records (or false on error). WARNING: read LIMIT docs before using it * Does not destroy internal state of last select() call */ function update($tags = array(), $where = null) { $this->_connect(); - $result = true; + $result = 0; # in case we optimize away the query /* Pre-processing, $tags is passed by reference and may be modified here */ $this->_write_pre_process($tags, 'UPDATE'); -- cgit v1.2.3