diff options
author | Felipe Pena <felipe@php.net> | 2008-11-03 20:48:51 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-11-03 20:48:51 +0000 |
commit | 27965c932f06310ed2040595cc9b8c4a9ebb5920 (patch) | |
tree | e39a979e4609008067aff6238b14309758fcc5ad /ext | |
parent | 850f9567b8df31b5173f381b925af477f164a977 (diff) | |
download | php-git-27965c932f06310ed2040595cc9b8c4a9ebb5920.tar.gz |
MFH:
- Fixed endless loop in PDOStatement::debugDumpParams()
patch by: Jonah H. Harris <jonah.harris at gmail dot com>
Diffstat (limited to 'ext')
-rwxr-xr-x | ext/pdo/pdo_stmt.c | 1 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/debugdumpparams_001.phpt | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index b87e545a89..841a362f64 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2208,6 +2208,7 @@ static PHP_METHOD(PDOStatement, debugDumpParams) param->is_param, param->param_type); + zend_hash_move_forward_ex(stmt->bound_params, &pos); } } diff --git a/ext/pdo_sqlite/tests/debugdumpparams_001.phpt b/ext/pdo_sqlite/tests/debugdumpparams_001.phpt new file mode 100644 index 0000000000..d85784a4f1 --- /dev/null +++ b/ext/pdo_sqlite/tests/debugdumpparams_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing PDOStatement::debugDumpParams() with bound params +--SKIPIF-- +<?php +if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; +?> +--FILE-- +<?php + +$db = new pdo('sqlite:memory'); + +$x= $db->prepare('select :a, :b'); +$x->bindValue(':a', 1, PDO::PARAM_INT); +$x->bindValue(':b', 'foo'); +var_dump($x->debugDumpParams()); + +?> +--EXPECT-- +SQL: [13] select :a, :b +Params: 2 +Key: Position #0: +paramno=-1 +name=[2] :a +is_param=1 +param_type=1 +Key: Position #0: +paramno=-1 +name=[2] :b +is_param=1 +param_type=2 +NULL |