felipe Mon Nov 3 15:41:36 2008 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/pdo_mysql/tests bug44327.phpt
Modified files:
/php-src/ext/pdo pdo_stmt.c
/php-src NEWS
Log:
- MFH: Fixed bug #44327 (PDORow::queryString property & numeric offsets /
Crash)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.41&r2=1.118.2.38.2.42&diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.41
php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.42
--- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.41 Tue Oct 14 17:43:19 2008
+++ php-src/ext/pdo/pdo_stmt.c Mon Nov 3 15:41:35 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.118.2.38.2.41 2008/10/14 17:43:19 felipe Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.42 2008/11/03 15:41:35 felipe Exp $ */
/* The PDO Statement Handle Class */
@@ -2595,6 +2595,9 @@
pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object
TSRMLS_CC);
int colno = -1;
+ if (Z_TYPE_P(member) == IS_STRING && strcmp(Z_STRVAL_P(member),
"queryString") == 0) {
+ return std_object_handlers.read_property(object, member,
IS_STRING TSRMLS_CC);
+ }
MAKE_STD_ZVAL(return_value);
if (Z_TYPE_P(member) == IS_LONG) {
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1293&r2=1.2027.2.547.2.1294&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1293 php-src/NEWS:1.2027.2.547.2.1294
--- php-src/NEWS:1.2027.2.547.2.1293 Mon Nov 3 11:39:34 2008
+++ php-src/NEWS Mon Nov 3 15:41:35 2008
@@ -23,6 +23,8 @@
different). (Derick)
- Fixed bug #44938 (gettext functions crash with overly long domain).
(Christian Schneider, Ilia)
+- Fixed bug #44327 (PDORow::queryString property & numeric offsets / Crash).
+ (Felipe)
- Fixed bug #43452 (strings containing a weekday, or a number plus weekday
behaved incorrect of the current day-of-week was the same as the one in the
phrase).(Derick)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/bug44327.phpt?view=markup&rev=1.1
Index: php-src/ext/pdo_mysql/tests/bug44327.phpt
+++ php-src/ext/pdo_mysql/tests/bug44327.phpt
--TEST--
Bug #44327 (PDORow::queryString property & numeric offsets / Crash)
--SKIPIF--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR .
'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$stmt = $db->prepare("SELECT 1 AS \"one\"");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_LAZY);
var_dump($row);
var_dump($row->{0});
var_dump($row->one);
var_dump($row->queryString);
print "----------------------------------\n";
@$db->exec("DROP TABLE test");
$db->exec("CREATE TABLE test (id INT)");
$db->exec("INSERT INTO test(id) VALUES (1)");
$stmt = $db->prepare("SELECT id FROM test");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_LAZY);
var_dump($row);
var_dump($row->queryString);
@$db->exec("DROP TABLE test");
print "----------------------------------\n";
$stmt = $db->prepare('foo');
@$stmt->execute();
$row = $stmt->fetch();
var_dump($row->queryString);
?>
--EXPECTF--
object(PDORow)#%d (2) {
["queryString"]=>
string(17) "SELECT 1 AS "one""
["one"]=>
string(1) "1"
}
string(1) "1"
string(1) "1"
string(17) "SELECT 1 AS "one""
----------------------------------
object(PDORow)#%d (2) {
["queryString"]=>
string(19) "SELECT id FROM test"
["id"]=>
string(1) "1"
}
string(19) "SELECT id FROM test"
----------------------------------
Notice: Trying to get property of non-object in %s on line %d
NULL
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php