|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-02 15:54 UTC] stas@php.net
Description: ------------ The extension uses global error state __php_stmt_err_state and __php_stmt_err_msg which is used when db2_stmt_error() is used without parameters. This state is cleaned only when db2_prepare() and db2_exec() is called and is never cleaned otherwise - not on connection and not on new request. This lead to the situation when if you connect to a new connection and call db2_stmt_error() it will give you the error state of the last query of the last connection run in this process. This is obviously wrong and may also be a security problem as last connection's error message could contain parts of the query which may contain sensitive data and it will be available to an application in a new request that may belong to somebody else. What should be done is at least to clean all error states at the beginning of the request (RINIT phase) and it also may make sense to clean it on new connection. It would also make sense to give some way to clear the error state - right now, unlike most other DB APIs, db2_stmt_error() does not clean the error state when called, so there's no way to remove the error once it is in __php_stmt_err_state without connecting and doing a query. Patchesdb2-bugfix (last revision 2014-07-09 07:52 UTC by stas@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 16:00:01 2025 UTC |
I’m having similar problem with the global memory, in the apache shared mod environment. Worker process starts and calls:- PHP_MINT_FUNCITON() { EXTENSION_NAME_G(global_variable) = 5;} PHP_RINT_FUNCTION(); PHP_METHOD(Class, __construct){ EXTENSION_NAME_G(global_variable) += 1;} PHP_RSHUTDOWN_FUNCTION (); Repeat page request over & over, and the global_variable will start at 5 and increment up until something happens and from no real reason it’s set back to its original value of 5. I have added a log file code in MINT function and it’s not being called more than once, the using ps –u apache, the worker process has not been replaced, but for some reason the global memory has been reset back to its original state without calling MINT. I have not tried using standard C style static global memory, tried dynamically allocating memory on the heap, no matter what I do all global memory eventually gets reset back to the MINT state. Mostly happens when there is a 10 second delay between page requests, but not always.