summaryrefslogtreecommitdiff
path: root/ext/oci8/tests/prefetch.phpt
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-09-06 19:33:18 +0000
committerAntony Dovgal <tony2001@php.net>2005-09-06 19:33:18 +0000
commite0ed2b45ffc89b3b89746be4c0743d0710abde85 (patch)
treec16e4be5ccdc7f77cfb2c3a56702be450523f25d /ext/oci8/tests/prefetch.phpt
parent3df94e11125a5001984ef1d6209fbd21162b9d10 (diff)
downloadphp-git-e0ed2b45ffc89b3b89746be4c0743d0710abde85.tar.gz
new tests
Diffstat (limited to 'ext/oci8/tests/prefetch.phpt')
-rw-r--r--ext/oci8/tests/prefetch.phpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/oci8/tests/prefetch.phpt b/ext/oci8/tests/prefetch.phpt
new file mode 100644
index 0000000000..45d51bd4c3
--- /dev/null
+++ b/ext/oci8/tests/prefetch.phpt
@@ -0,0 +1,56 @@
+--TEST--
+oci_set_prefetch()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--ENV--
+return "
+ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')."
+NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')."
+";
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+require dirname(__FILE__).'/create_table.inc';
+
+$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
+
+if (!($s = oci_parse($c, $insert_sql))) {
+ die("oci_parse(insert) failed!\n");
+}
+
+for ($i = 0; $i<3; $i++) {
+ if (!oci_execute($s)) {
+ die("oci_execute(insert) failed!\n");
+ }
+}
+
+if (!oci_commit($c)) {
+ die("oci_commit() failed!\n");
+}
+
+$select_sql = "SELECT * FROM ".$schema.$table_name."";
+
+if (!($s = oci_parse($c, $select_sql))) {
+ die("oci_parse(select) failed!\n");
+}
+
+var_dump(oci_set_prefetch($s, 10));
+
+if (!oci_execute($s)) {
+ die("oci_execute(select) failed!\n");
+}
+
+var_dump(oci_fetch($s));
+
+var_dump(oci_num_rows($s));
+
+require dirname(__FILE__).'/drop_table.inc';
+
+echo "Done\n";
+?>
+--EXPECT--
+bool(true)
+bool(true)
+int(1)
+Done