Annotation of embedaddon/php/ext/oci8/tests/null_byte_3.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Null bytes in SQL statements
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
! 5: --INI--
! 6: display_errors = On
! 7: error_reporting = E_WARNING
! 8: --FILE--
! 9: <?php
! 10:
! 11: require(dirname(__FILE__).'/connect.inc');
! 12:
! 13: // Run Test
! 14:
! 15: echo "Test 1: Invalid use of a null byte\n";
! 16:
! 17: $s = oci_parse($c, "select * from du\0al");
! 18: oci_execute($s);
! 19:
! 20: echo "Test 2: Using a null byte in a bind variable value causing WHERE clause to fail\n";
! 21:
! 22: $s = oci_parse($c, "select * from dual where :bv = 'abc'");
! 23: $bv = 'abc\0abc';
! 24: oci_bind_by_name($s, ":bv", $bv);
! 25: oci_execute($s);
! 26: oci_fetch_all($s, $res);
! 27: var_dump($res);
! 28:
! 29: ?>
! 30: ===DONE===
! 31: <?php exit(0); ?>
! 32: --EXPECTF--
! 33: Test 1: Invalid use of a null byte
! 34:
! 35: Warning: oci_execute(): ORA-00942: %s in %snull_byte_3.php on line %d
! 36: Test 2: Using a null byte in a bind variable value causing WHERE clause to fail
! 37: array(1) {
! 38: ["DUMMY"]=>
! 39: array(0) {
! 40: }
! 41: }
! 42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>