Annotation of embedaddon/php/ext/pdo/tests/bug65946.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #65946 (pdo_sql_parser.c permanently converts values bound to strings)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('pdo')) die('skip');
! 6: $dir = getenv('REDIR_TEST_DIR');
! 7: if (false == $dir) die('skip no driver');
! 8: require_once $dir . 'pdo_test.inc';
! 9: PDOTest::skip();
! 10: ?>
! 11: --FILE--
! 12: <?php
! 13: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
! 14: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
! 15: $db = PDOTest::factory();
! 16: $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
! 17: $db->exec('CREATE TABLE test(id int)');
! 18: $db->exec('INSERT INTO test VALUES(1)');
! 19: $stmt = $db->prepare('SELECT * FROM test LIMIT :limit');
! 20: $stmt->bindValue('limit', 1, PDO::PARAM_INT);
! 21: if(!($res = $stmt->execute())) var_dump($stmt->errorInfo());
! 22: if(!($res = $stmt->execute())) var_dump($stmt->errorInfo());
! 23: var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
! 24: ?>
! 25: --EXPECTF--
! 26: array(1) {
! 27: [0]=>
! 28: array(1) {
! 29: ["id"]=>
! 30: string(1) "1"
! 31: }
! 32: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>