Annotation of embedaddon/php/ext/pdo_sqlite/tests/bug44327_2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #44327.2 (PDORow::queryString property & numeric offsets / Crash)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9:
! 10: $db = new pdo('sqlite::memory:');
! 11:
! 12: $x = $db->query('select 1 as queryString');
! 13: var_dump($x, $x->queryString);
! 14:
! 15: $y = $x->fetch();
! 16: var_dump($y, @$y->queryString);
! 17:
! 18: print "--------------------------------------------\n";
! 19:
! 20: $x = $db->query('select 1 as queryString');
! 21: var_dump($x, $x->queryString);
! 22:
! 23: $y = $x->fetch(PDO::FETCH_LAZY);
! 24: var_dump($y, $y->queryString);
! 25:
! 26: ?>
! 27: --EXPECTF--
! 28: object(PDOStatement)#%d (1) {
! 29: ["queryString"]=>
! 30: string(23) "select 1 as queryString"
! 31: }
! 32: string(23) "select 1 as queryString"
! 33: array(2) {
! 34: ["queryString"]=>
! 35: string(1) "1"
! 36: [0]=>
! 37: string(1) "1"
! 38: }
! 39: NULL
! 40: --------------------------------------------
! 41: object(PDOStatement)#%d (1) {
! 42: ["queryString"]=>
! 43: string(23) "select 1 as queryString"
! 44: }
! 45: string(23) "select 1 as queryString"
! 46: object(PDORow)#%d (1) {
! 47: ["queryString"]=>
! 48: string(1) "1"
! 49: }
! 50: string(1) "1"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>