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