Bug #80083 [Opn]: Optimizer pass 6 removes variables used for data binding

From: Date: Thu, 10 Sep 2020 15:39:17 +0000
Subject: Bug #80083 [Opn]: Optimizer pass 6 removes variables used for data binding
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228955@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80083&edit=1 ID: 80083 Updated by: nikic@php.net Reported by: calvin at cmpct dot info Summary: Optimizer pass 6 removes variables used for data binding Status: Open Type: Bug Package: opcache Operating System: IBM i 7.2 PHP Version: 7.4.10 Block user comment: N Private report: N New Comment: The db2 extension needs to change its API to not work on variable names -- it needs to accept variables by reference instead. Previous Comments: ------------------------------------------------------------------------ [2020-09-10 15:24:44] calvin at cmpct dot info Description: ------------ I'm not sure if this is an ibm_db2 module bug or an opcache bug, but I figured I'd report here first. Script, debug output at different optimization levels, and a diff between them available in this gist (let me know if anything else is needed for repro and I can add to it): https://gist.github.com/NattyNarwhal/09679e177b11de22aeceaaffdc62012b The summary is when optimizer pass 6 (DFA) runs through the program, it elides the variables used for a data bound stored procedure call using the ibm_db2 extension, resulting in failure. Masking the bit for pass 6 out (that is, setting optimization level 0x7FFEBFFF to 0x7FFEBFDF) is enough to mitigate the failure. Expected result: ---------------- Résultat : bar (or whatever the stored procedure used sets) Actual result: -------------- PHP Warning: db2_execute(): Value Not Bound in /home/calvin/test/gautier.php on line 31 PHP Warning: db2_execute(): Binding Error 3 in /home/calvin/test/gautier.php on line 31 Résultat : ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80083&edit=1

« previous php.bugs (#228955) next »