Annotation of embedaddon/php/ext/sqlite3/tests/bug63921-32bit.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #63921 sqlite3::bindvalue and relative PHP functions aren't using sqlite3_*_int64 API
        !             3: --SKIPIF--
        !             4: <?php
        !             5: if (!extension_loaded('sqlite3')) die('skip');
        !             6: if (PHP_INT_SIZE > 4) die('skip'); // skip for 64bit builds - there is another test for that
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: $num = PHP_INT_MAX; // 32 bits
        !            11: $conn = new sqlite3(':memory:');
        !            12: $conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
        !            13: 
        !            14: $stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
        !            15: $stmt->bindValue(':id', 1, SQLITE3_INTEGER);
        !            16: $stmt->bindValue(':num', $num, SQLITE3_INTEGER);
        !            17: $stmt->execute();
        !            18: 
        !            19: $stmt = $conn->query('SELECT num FROM users');
        !            20: $result = $stmt->fetchArray();
        !            21: 
        !            22: var_dump($num,$result[0]);
        !            23: 
        !            24: ?>
        !            25: --EXPECT--
        !            26: int(2147483647)
        !            27: string(10) "2147483647"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>