Bug #78227 [Com]: Prepared statements ignore RENAME COLUMN

From: Date: Thu, 11 Feb 2021 06:20:15 +0000
Subject: Bug #78227 [Com]: Prepared statements ignore RENAME COLUMN
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232051@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78227&edit=1 ID: 78227 Comment by: johnwilliamjw3214 at gmail dot com Reported by: cmb@php.net Summary: Prepared statements ignore RENAME COLUMN Status: Open Type: Bug Package: PDO SQLite Operating System: * PHP Version: 7.2.19 Block user comment: N Private report: N New Comment: Thanks for sharing this Great post, this is very helpful. If you are facing any glitches with your chase credit card so don’t worry visit Chase.com verify card. Contact us our experts chase bank customer care team always ready to help customers and resolve issues as soon as possible. More info :-https://sites.google.com/view/chasecomverifycards/ Previous Comments: ------------------------------------------------------------------------ [2019-06-28 10:32:03] cmb@php.net Description: ------------ As of SQLite 3.25.0, ALTER TABLE RENAME COLUMN queries are supported. However, already prepared statements ignore such changes, and report the old column names when fetching. ext/sqlite3 behaves like expected. Test script: --------------- <?php $db = new PDO('sqlite::memory:'); $db->exec("CREATE TABLE user (id INTEGER PRIMARY KEY NOT NULL, foo VARCHAR(255) NOT NULL)"); $db->exec("INSERT INTO user (id, foo) VALUES (10, 'test')"); $stmt = $db->prepare("SELECT * FROM user WHERE id = :id"); $stmt->execute(['id' => 10]); print_r($stmt->fetch(PDO::FETCH_ASSOC)); $db->exec("ALTER TABLE user RENAME COLUMN foo TO bar"); $res = $stmt->execute(['id' => 10]); print_r($stmt->fetch(PDO::FETCH_ASSOC)); Expected result: ---------------- Array ( [id] => 10 [foo] => test ) Array ( [id] => 10 [bar] => test ) Actual result: -------------- Array ( [id] => 10 [foo] => test ) Array ( [id] => 10 [foo] => test ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78227&edit=1

« previous php.bugs (#232051) next »