Doc #81376 [NEW]: fetchArray refuses to work with UPDATE ... RETURNING

From: Date: Sat, 21 Aug 2021 19:39:40 +0000
Subject: Doc #81376 [NEW]: fetchArray refuses to work with UPDATE ... RETURNING
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-19090@lists.php.net to get a copy of this message
From:             abrahin dot andrei at yandex dot ru
Operating system: Arch Linux
PHP version:      8.0.9
Package:          SQLite related
Bug Type:         Documentation Problem
Bug description:fetchArray refuses to work with UPDATE ... RETURNING

Description:
------------
---
From manual page: https://php.net/sqlite3result.fetcharray
---


SQLite3Result::fetchArray() returns FALSE on 'UPDATE ... RETURNING ...'
even if some rows were affected.

Please note that this interface is fully supported since v3.35, and i
have v3.36 installed (as evidenced by output of SQLite3::version()).

https://www.sqlite.org/lang_returning.html
https://www.sqlite.org/lang_update.html

Test script:
---------------
$GLOBALS['db'] = new SQLite3('testdb.sqlite');

$db->exec('CREATE TABLE IF NOT EXISTS cron (time INTEGER, type INTEGER,
private TEXT');
$db->exec('INSERT INTO cron (time, type, private) VALUES (3, 1, 0)');

$stmt = $db->prepare('UPDATE cron SET time = 10 WHERE time < 10
RETURNING *;');
$res = $stmt->execute();

var_dump($res->fetchArray()); # <-- returns false, should instead return
a row




Expected result:
----------------
I expected to see a row full of data and enjoy the possibilities
provided by the SQLite v3.36.0

Actual result:
--------------
bool(false)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=81376&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81376&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81376&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81376&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81376&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81376&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81376&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81376&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81376&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81376&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81376&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81376&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81376&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81376&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81376&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81376&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81376&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81376&r=mysqlcfg


Thread (1 message)

  • abrahin dot andrei at yandex dot ru
« previous php.doc.bugs (#19090) next »