php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78227 Prepared statements ignore RENAME COLUMN
Submitted: 2019-06-28 10:32 UTC Modified: 2021-09-15 10:06 UTC
From: cmb@php.net Assigned:
Status: Open Package: PDO Core
PHP Version: 7.2.19 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2019-06-28 10:32 UTC] 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
)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-15 10:06 UTC] cmb@php.net
-Package: PDO SQLite +Package: PDO Core
 [2021-09-15 10:06 UTC] cmb@php.net
This is not particular to PDO_SQLite, but rather a general PDO
issue; at least PDO_MySQL exhibits the same behavior.
 [2021-09-15 10:07 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix bug #78227 Prepared statements ignore RENAME COLUMN
On GitHub:  https://github.com/php/php-src/pull/7495
Patch:      https://github.com/php/php-src/pull/7495.patch
 [2023-04-07 18:33 UTC] moroccantour1 at gmail dot com
wonderful blog full of value thanks for the sharing


(https://morocco-itinerary.com/es/tour/2-dias-desde-marrakech-al-desierto-2/)github.com

(https://morocco-itinerary.com/es/tour/recomendaciones-para-viajar-a-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/escapada-marrakech-3-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-4-dias-que-hacer/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-viaje-5-dias/)github.com

(https://morocco-itinerary.com/es/tour/vacaciones-en-marruecos-5-dias/)github.com

(https://morocco-itinerary.com/es/tour/6-dias-en-marruecos-viajes/)github.com

(https://morocco-itinerary.com/es/tour/itinerario-marruecos-7-dias/)github.com

(https://morocco-itinerary.com/es/tour/visitar-marruecos-en-7-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-8-dias/)github.com

(https://morocco-itinerary.com/es/tour/tour-marruecos-de-9-dias/)github.com

(https://morocco-itinerary.com/es/tour/visitar-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-marruecos-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/gran-vuelta-a-marruecos-en-11-dias/)github.com

(https://morocco-itinerary.com/es/tour/tour-por-marruecos-12-dias/)github.com

(https://morocco-itinerary.com/es/tour/2-dias-viajes-en-marruecos-desde-fez-al-desierto/)github.com

(https://morocco-itinerary.com/es/tour/3-dias-desde-fez-al-desierto-de-merzouga/)github.com

(https://morocco-itinerary.com/es/tour/3-dias-de-fez-a-marrakech-por-el-desierto/)github.com

(https://morocco-itinerary.com/es/tour/4-dias-desde-fez-al-desierto-y-marrakech-2/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-4-dias-desde-fez-al-desierto/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-5-dias-4-noches-desde-marrakech/)github.com

(https://morocco-itinerary.com/es/tour/circuito-marruecos-6-dias/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-en-marruecos-desde-fez/)github.com


(https://morocco-itinerary.com/es/tour/viaje-marruecos-7-dias/)github.com


(https://morocco-itinerary.com/es/tour/circuito-por-marruecos-8-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-9-dias/)github.com

(https://morocco-itinerary.com/es/tour/mejor-10-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/recorrer-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-10-dias-en-marruecos-desde-fez/)github.com

(https://morocco-itinerary.com/es/tour/11-dias-en-marruecos-desierto-y-ciudades-imperiales/)github.com


(https://morocco-itinerary.com/es/tour/tour-de-12-dias-en-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/tour-de-13-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/tour-norte-de-marruecos-4-dias/)github.com

(https://morocco-itinerary.com/es/tour/5-dias-de-viaje-a-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-por-marruecos-en-6-dias-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-al-norte-de-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-alrededor-de-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/excursion-desde-casablanca-8-dias/)github.com

(hhttps://morocco-itinerary.com/es/tour/viaje-privado-de-9-dias-por-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-viaje-por-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/descubra-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-11-dias-por-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/tour-de-12-dias-por-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-13-dias-en-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-13-dias-de-viaje-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-14-dias-en-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/5-dias-en-el-norte-de-marruecos-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-6-dias-desde-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/ruta-7-dias-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/itinerario-de-7-dias-en-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/viaje-de-8-dias-desde-tanger-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/9-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-10-dias-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/10-dias-de-vacaciones-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-11-dias-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-12-dias/)github.com


(https://morocco-itinerary.com/es/marruecos-viajes/)github.com


(https://morocco-itinerary.com/es/terminos-condiciones/)github.com

(https://morocco-itinerary.com/es/sobre-nosotros-el-equipo/)github.com

(https://morocco-itinerary.com/es/resenas/)github.com

(https://morocco-itinerary.com/es/resenas/)github.com

(https://morocco-itinerary.com/es/tour-destination/tanger-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/marrakech-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/fez-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/casablanca-es/)github.com

(https://morocco-itinerary.com/es/marruecos-viajes/contacto/contacto-1/)github.com

(https://morocco-itinerary.com/es/marruecos-viajes/)github.com

(https://morocco-itinerary.com/)github.com

(https://morocco-itinerary.com/who-we-are/)github.com

(https://morocco-itinerary.com/reviews/)github.com

(https://morocco-itinerary.com/contact-2/)github.com

(https://morocco-itinerary.com/terms-conditions/)github.com

(https://morocco-itinerary.com/morocco-tours-packages-2/)github.com

(https://morocco-itinerary.com/can-i-travel-to-morocco-from-usa/)github.com

(https://morocco-itinerary.com/are-4-or-5-or-7-or-10-days-enough-in-morocco/)github.com

(https://morocco-itinerary.com/what-to-do-in-morocco-for-1-week/)github.com

(https://morocco-itinerary.com/morocco-travel-itinerary-5-days/)github.com

(https://morocco-itinerary.com/moroccan-tour-morocco-trips/)github.com

(https://morocco-itinerary.com/whats-morocco-flag-history/)github.com

(https://morocco-itinerary.com/tour/full-day-tour-from-marrakech-to-ait-benhaddou-kasbah/)github.com

(https://morocco-itinerary.com/tour/private-1-day-excursion-to-essaouira-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/private-1-day-excursion-to-imlil-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/1-day-trip-to-ouzoud-waterfalls/)github.com

(https://morocco-itinerary.com/merzouga-quad-biking-around-desert/)github.com

(https://morocco-itinerary.com/tour-destination/tangier/)github.com

(https://morocco-itinerary.com/tour-destination/marrakech/)github.com

(https://morocco-itinerary.com/tour-destination/fes/)github.com

(https://morocco-itinerary.com/tour/)github.com

(https://morocco-itinerary.com/tour-destination/casablanca/)github.com

(https://morocco-itinerary.com/who-we-are/)github.com

(https://morocco-itinerary.com/reviews/)github.com

(https://morocco-itinerary.com/contact-2/)github.com

(https://morocco-itinerary.com/terms-conditions/)github.com

(https://morocco-itinerary.com/hsb/marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/uber-uns-team/)github.com

(https://morocco-itinerary.com/hsb/marokko-reise/kontakt/)github.com

(https://morocco-itinerary.com/hsb/bewertungen/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/tanger/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/fes-hsb/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/casablanca-hsb/)github.com

(https://morocco-itinerary.com/it/casa/viaggi-in-marocco/)github.com

(https://morocco-itinerary.com/it/chi-siamo-il-team/)github.com

(https://morocco-itinerary.com/it/itinerario-di-10-giorni-in-marocco/)github.com

(https://morocco-itinerary.com/it/tour-individuale-7-giorni-in-marocco/)github.com

(https://morocco-itinerary.com/it/tour-marocco-9-giorni/)github.com

(https://morocco-itinerary.com/it/viaggio-in-marocco-5-giorni/)github.com

(https://morocco-itinerary.com/it/casa/contattateci/)github.com

(https://morocco-itinerary.com/it/recensioni/)github.com

(https://morocco-itinerary.com/it/tour-destination/tanger-it/)github.com

(https://morocco-itinerary.com/it/tour-destination/marrakech-it/)github.com

(https://morocco-itinerary.com/it/tour-destination/fez-2/)github.com

(https://morocco-itinerary.com/it/tour-destination/casablanca-it/)github.com

(https://morocco-itinerary.com/it/tour/)github.com

(https://morocco-itinerary.com/tour/5-days-morocco-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/6-days-morocco-desert-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/morocco-itinerary-7-days/)github.com

(https://morocco-itinerary.com/tour/7-days-tour-in-morocco-from-marrakech-to-fes-via-sahara-desert/)github.com

(https://morocco-itinerary.com/tour/marrakech-trip-itinerary-in-7-days/)github.com

(https://morocco-itinerary.com/tour/8-days-morocco-tour/)github.com

(https://morocco-itinerary.com/tour/9-days-tour-in-morocco/)github.com

(https://morocco-itinerary.com/tour/10-days-in-morocco-in-november-may-april-december-september/)github.com

(https://morocco-itinerary.com/tour/10-days-tour-in-morocco/)github.com

(https://morocco-itinerary.com/tour/11-days-tour-in-morocco-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/morocco-12-days-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/13-days-around-morocco-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/hsb/tour/2-tage-marrakesch-wustentour/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-wustentour-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-rundreise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-4-tage-ab-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-5-tage-von-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-1-woche/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise/)github.com

(https://morocco-itinerary.com/hsb/tour/12-tage-4-konigsstadte-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/2-tage-in-marokko-ab-fes-nach-merzouga/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reiseprogramm/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-rundreise-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/4-tage-marokko-reise-ab-fes-nach-sahara/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-wustenreise-5-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-7-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/13-tage-urlaub-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/kleine-rundreise-ab-rabat/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/rundreise-marokko-mit-badeverlangerung/)github.com

(https://morocco-itinerary.com/hsb/tour/6-tage-marokko-urlaubsreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-individuell-erfahrungen/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise-kleingruppe/)github.com

(https://morocco-itinerary.com/hsb/tour/8-tage-privatreise-in-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-12-tage-ab-tanger/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-selbstfahrer/)github.com

(https://morocco-itinerary.com/hsb/tour/nord-marokko-tour-2-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-nordreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-individuell-reise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/bester-reiseanbieter-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-urlaub-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/morokko-rundreise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-12-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-14-tage/)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 00:01:28 2024 UTC