Annotation of embedaddon/php/ext/pdo_mysql/tests/bug_41698.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PDO MySQL Bug #41698 (float parameters truncated to integer in prepared statements)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
! 6: require dirname(__FILE__) . '/config.inc';
! 7: require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
! 8: PDOTest::skip();
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12: require dirname(__FILE__) . '/config.inc';
! 13: require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
! 14: $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
! 15:
! 16: setlocale(LC_ALL, "de","de_DE","de_DE.ISO8859-1","de_DE.ISO_8859-1","de_DE.UTF-8");
! 17:
! 18: $db->exec('CREATE TABLE test(floatval DECIMAL(8,6))');
! 19: $db->exec('INSERT INTO test VALUES(2.34)');
! 20: $value=4.56;
! 21: $stmt = $db->prepare('INSERT INTO test VALUES(?)');
! 22: $stmt->execute(array($value));
! 23: var_dump($db->query('SELECT * from test')->fetchAll(PDO::FETCH_ASSOC));
! 24: ?>
! 25: --EXPECTF--
! 26: array(2) {
! 27: [0]=>
! 28: array(1) {
! 29: [%u|b%"floatval"]=>
! 30: %unicode|string%(8) "2.340000"
! 31: }
! 32: [1]=>
! 33: array(1) {
! 34: [%u|b%"floatval"]=>
! 35: %unicode|string%(8) "4.560000"
! 36: }
! 37: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>