Annotation of embedaddon/php/ext/oci8/tests/bug27303_1_11gR1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #27303 (OCIBindByName binds numeric PHP values as characters)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('oci8')) die ("skip no oci8 extension");
! 6: require(dirname(__FILE__)."/connect.inc");
! 7: // The bind buffer size edge cases seem to change each DB version.
! 8: if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
! 9: if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) {
! 10: if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
! 11: die("skip expected output only valid when using specific Oracle database versions");
! 12: }
! 13: }
! 14: }
! 15: ?>
! 16: --FILE--
! 17: <?php
! 18:
! 19: require(dirname(__FILE__).'/connect.inc');
! 20:
! 21: $stmtarray = array(
! 22: "drop sequence myseq",
! 23: "drop table mytab",
! 24: "create sequence myseq",
! 25: "create table mytab (mydata varchar2(20), seqcol number)"
! 26: );
! 27:
! 28: oci8_test_sql_execute($c, $stmtarray);
! 29:
! 30: define('MYLIMIT', 200);
! 31:
! 32: $stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
! 33:
! 34: $stid = OCIParse($c, $stmt);
! 35: if (!$stid) { echo "Parse error"; die; }
! 36:
! 37: $r = OCIBindByName($stid, ':MYBV', $mybv);
! 38: if (!$r) { echo "Bind error"; die; }
! 39:
! 40: for ($i = 1; $i < MYLIMIT; $i++) {
! 41: $r = OCIExecute($stid, OCI_DEFAULT);
! 42: if (!$r) { echo "Execute error"; die; }
! 43: var_dump($mybv);
! 44: }
! 45:
! 46: OCICommit($c);
! 47:
! 48: $stmtarray = array(
! 49: "drop sequence myseq",
! 50: "drop table mytab"
! 51: );
! 52:
! 53: oci8_test_sql_execute($c, $stmtarray);
! 54:
! 55: echo "Done\n";
! 56: ?>
! 57: --EXPECT--
! 58: string(1) "1"
! 59: string(1) "2"
! 60: string(1) "3"
! 61: string(1) "4"
! 62: string(1) "5"
! 63: string(1) "6"
! 64: string(1) "7"
! 65: string(1) "8"
! 66: string(1) "9"
! 67: string(1) "1"
! 68: string(1) "1"
! 69: string(1) "1"
! 70: string(1) "1"
! 71: string(1) "1"
! 72: string(1) "1"
! 73: string(1) "1"
! 74: string(1) "1"
! 75: string(1) "1"
! 76: string(1) "1"
! 77: string(1) "2"
! 78: string(1) "2"
! 79: string(1) "2"
! 80: string(1) "2"
! 81: string(1) "2"
! 82: string(1) "2"
! 83: string(1) "2"
! 84: string(1) "2"
! 85: string(1) "2"
! 86: string(1) "2"
! 87: string(1) "3"
! 88: string(1) "3"
! 89: string(1) "3"
! 90: string(1) "3"
! 91: string(1) "3"
! 92: string(1) "3"
! 93: string(1) "3"
! 94: string(1) "3"
! 95: string(1) "3"
! 96: string(1) "3"
! 97: string(1) "4"
! 98: string(1) "4"
! 99: string(1) "4"
! 100: string(1) "4"
! 101: string(1) "4"
! 102: string(1) "4"
! 103: string(1) "4"
! 104: string(1) "4"
! 105: string(1) "4"
! 106: string(1) "4"
! 107: string(1) "5"
! 108: string(1) "5"
! 109: string(1) "5"
! 110: string(1) "5"
! 111: string(1) "5"
! 112: string(1) "5"
! 113: string(1) "5"
! 114: string(1) "5"
! 115: string(1) "5"
! 116: string(1) "5"
! 117: string(1) "6"
! 118: string(1) "6"
! 119: string(1) "6"
! 120: string(1) "6"
! 121: string(1) "6"
! 122: string(1) "6"
! 123: string(1) "6"
! 124: string(1) "6"
! 125: string(1) "6"
! 126: string(1) "6"
! 127: string(1) "7"
! 128: string(1) "7"
! 129: string(1) "7"
! 130: string(1) "7"
! 131: string(1) "7"
! 132: string(1) "7"
! 133: string(1) "7"
! 134: string(1) "7"
! 135: string(1) "7"
! 136: string(1) "7"
! 137: string(1) "8"
! 138: string(1) "8"
! 139: string(1) "8"
! 140: string(1) "8"
! 141: string(1) "8"
! 142: string(1) "8"
! 143: string(1) "8"
! 144: string(1) "8"
! 145: string(1) "8"
! 146: string(1) "8"
! 147: string(1) "9"
! 148: string(1) "9"
! 149: string(1) "9"
! 150: string(1) "9"
! 151: string(1) "9"
! 152: string(1) "9"
! 153: string(1) "9"
! 154: string(1) "9"
! 155: string(1) "9"
! 156: string(1) "9"
! 157: string(1) "1"
! 158: string(1) "1"
! 159: string(1) "1"
! 160: string(1) "1"
! 161: string(1) "1"
! 162: string(1) "1"
! 163: string(1) "1"
! 164: string(1) "1"
! 165: string(1) "1"
! 166: string(1) "1"
! 167: string(1) "1"
! 168: string(1) "1"
! 169: string(1) "1"
! 170: string(1) "1"
! 171: string(1) "1"
! 172: string(1) "1"
! 173: string(1) "1"
! 174: string(1) "1"
! 175: string(1) "1"
! 176: string(1) "1"
! 177: string(1) "1"
! 178: string(1) "1"
! 179: string(1) "1"
! 180: string(1) "1"
! 181: string(1) "1"
! 182: string(1) "1"
! 183: string(1) "1"
! 184: string(1) "1"
! 185: string(1) "1"
! 186: string(1) "1"
! 187: string(1) "1"
! 188: string(1) "1"
! 189: string(1) "1"
! 190: string(1) "1"
! 191: string(1) "1"
! 192: string(1) "1"
! 193: string(1) "1"
! 194: string(1) "1"
! 195: string(1) "1"
! 196: string(1) "1"
! 197: string(1) "1"
! 198: string(1) "1"
! 199: string(1) "1"
! 200: string(1) "1"
! 201: string(1) "1"
! 202: string(1) "1"
! 203: string(1) "1"
! 204: string(1) "1"
! 205: string(1) "1"
! 206: string(1) "1"
! 207: string(1) "1"
! 208: string(1) "1"
! 209: string(1) "1"
! 210: string(1) "1"
! 211: string(1) "1"
! 212: string(1) "1"
! 213: string(1) "1"
! 214: string(1) "1"
! 215: string(1) "1"
! 216: string(1) "1"
! 217: string(1) "1"
! 218: string(1) "1"
! 219: string(1) "1"
! 220: string(1) "1"
! 221: string(1) "1"
! 222: string(1) "1"
! 223: string(1) "1"
! 224: string(1) "1"
! 225: string(1) "1"
! 226: string(1) "1"
! 227: string(1) "1"
! 228: string(1) "1"
! 229: string(1) "1"
! 230: string(1) "1"
! 231: string(1) "1"
! 232: string(1) "1"
! 233: string(1) "1"
! 234: string(1) "1"
! 235: string(1) "1"
! 236: string(1) "1"
! 237: string(1) "1"
! 238: string(1) "1"
! 239: string(1) "1"
! 240: string(1) "1"
! 241: string(1) "1"
! 242: string(1) "1"
! 243: string(1) "1"
! 244: string(1) "1"
! 245: string(1) "1"
! 246: string(1) "1"
! 247: string(1) "1"
! 248: string(1) "1"
! 249: string(1) "1"
! 250: string(1) "1"
! 251: string(1) "1"
! 252: string(1) "1"
! 253: string(1) "1"
! 254: string(1) "1"
! 255: string(1) "1"
! 256: string(1) "1"
! 257: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>