summaryrefslogtreecommitdiff
path: root/ext/oci8/tests
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2011-11-01 21:30:57 +0000
committerChristopher Jones <sixd@php.net>2011-11-01 21:30:57 +0000
commit735efbdd047efc3361af59e91637406b883df506 (patch)
tree3a48dde859000df35f97ee20ee9dc0b046e44bda /ext/oci8/tests
parent8412709f37d459d4c623b33641c93b2ef0d3422b (diff)
downloadphp-git-735efbdd047efc3361af59e91637406b883df506.tar.gz
Update for new Oracle patchset variation
Diffstat (limited to 'ext/oci8/tests')
-rw-r--r--ext/oci8/tests/bind_char_1.phpt10
-rw-r--r--ext/oci8/tests/bind_char_1_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bind_char_2.phpt10
-rw-r--r--ext/oci8/tests/bind_char_2_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bind_char_3.phpt10
-rw-r--r--ext/oci8/tests/bind_char_3_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bind_char_4.phpt10
-rw-r--r--ext/oci8/tests/bind_char_4_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bug27303_1.phpt10
-rw-r--r--ext/oci8/tests/bug27303_1_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bug27303_2.phpt10
-rw-r--r--ext/oci8/tests/bug27303_2_11gR1.phpt11
-rw-r--r--ext/oci8/tests/bug27303_4.phpt20
-rw-r--r--ext/oci8/tests/bug27303_4_11gR1.phpt21
-rw-r--r--ext/oci8/tests/password_new.phpt4
-rw-r--r--ext/oci8/tests/password_old.phpt4
16 files changed, 110 insertions, 65 deletions
diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt
index a668294d4d..91fa4b75b7 100644
--- a/ext/oci8/tests/bind_char_1.phpt
+++ b/ext/oci8/tests/bind_char_1.phpt
@@ -4,9 +4,13 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) {
+ die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases");
+ }
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bind_char_1_11gR1.phpt b/ext/oci8/tests/bind_char_1_11gR1.phpt
index 55973a61b6..a7feff9f6a 100644
--- a/ext/oci8/tests/bind_char_1_11gR1.phpt
+++ b/ext/oci8/tests/bind_char_1_11gR1.phpt
@@ -4,12 +4,15 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases");
+ }
}
?>
+--ENV--
+NLS_LANG=
--FILE--
<?php
diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt
index 53785e0665..43661a065d 100644
--- a/ext/oci8/tests/bind_char_2.phpt
+++ b/ext/oci8/tests/bind_char_2.phpt
@@ -4,9 +4,13 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) {
+ die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases");
+ }
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt
index 357a716e6d..8bb28733fe 100644
--- a/ext/oci8/tests/bind_char_2_11gR1.phpt
+++ b/ext/oci8/tests/bind_char_2_11gR1.phpt
@@ -4,12 +4,15 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases");
+ }
}
?>
+--ENV--
+NLS_LANG=
--FILE--
<?php
diff --git a/ext/oci8/tests/bind_char_3.phpt b/ext/oci8/tests/bind_char_3.phpt
index a459f616b2..25115836df 100644
--- a/ext/oci8/tests/bind_char_3.phpt
+++ b/ext/oci8/tests/bind_char_3.phpt
@@ -4,9 +4,13 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) {
+ die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases");
+ }
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt
index 1e7da47edc..4c6241ccfd 100644
--- a/ext/oci8/tests/bind_char_3_11gR1.phpt
+++ b/ext/oci8/tests/bind_char_3_11gR1.phpt
@@ -4,12 +4,15 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases");
+ }
}
?>
+--ENV--
+NLS_LANG=
--FILE--
<?php
diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt
index 34d703c521..36765f8137 100644
--- a/ext/oci8/tests/bind_char_4.phpt
+++ b/ext/oci8/tests/bind_char_4.phpt
@@ -4,9 +4,13 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) {
+ die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases");
+ }
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt
index 87b7daba88..14d5878856 100644
--- a/ext/oci8/tests/bind_char_4_11gR1.phpt
+++ b/ext/oci8/tests/bind_char_4_11gR1.phpt
@@ -4,12 +4,15 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases");
+ }
}
?>
+--ENV--
+NLS_LANG=
--FILE--
<?php
diff --git a/ext/oci8/tests/bug27303_1.phpt b/ext/oci8/tests/bug27303_1.phpt
index 028f5b7936..40ab4ebed2 100644
--- a/ext/oci8/tests/bug27303_1.phpt
+++ b/ext/oci8/tests/bug27303_1.phpt
@@ -4,9 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 &&
+ preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases");
+ // Other point releases may also work
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bug27303_1_11gR1.phpt b/ext/oci8/tests/bug27303_1_11gR1.phpt
index 20097613f4..6de9b99378 100644
--- a/ext/oci8/tests/bug27303_1_11gR1.phpt
+++ b/ext/oci8/tests/bug27303_1_11gR1.phpt
@@ -4,10 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using specific Oracle database versions");
+ }
+ }
}
?>
--FILE--
diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt
index e7564ac213..1fb2b31682 100644
--- a/ext/oci8/tests/bug27303_2.phpt
+++ b/ext/oci8/tests/bug27303_2.phpt
@@ -4,9 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 &&
+ preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases");
+ // Other point releases may also work
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
diff --git a/ext/oci8/tests/bug27303_2_11gR1.phpt b/ext/oci8/tests/bug27303_2_11gR1.phpt
index c2b5c433c4..1e3e3105ad 100644
--- a/ext/oci8/tests/bug27303_2_11gR1.phpt
+++ b/ext/oci8/tests/bug27303_2_11gR1.phpt
@@ -4,10 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using specific Oracle database versions");
+ }
+ }
}
?>
--FILE--
diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt
index 0dcfed9133..3137db8659 100644
--- a/ext/oci8/tests/bug27303_4.phpt
+++ b/ext/oci8/tests/bug27303_4.phpt
@@ -4,9 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-if (preg_match('/Release 1[01]\.2\./', oci_server_version($c), $matches) !== 1) {
- die("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
-} else if (preg_match('/^11\./', oci_client_version()) != 1) {
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 &&
+ preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases");
+ // Other point releases may also work
+}
+if (preg_match('/^11\./', oci_client_version()) != 1) {
die("skip test expected to work only with Oracle 11g or greater version of client");
}
?>
@@ -23,10 +27,7 @@ $create_st[] = "drop table mytab";
$create_st[] = "create sequence myseq";
$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)";
-foreach ($create_st as $statement) {
- $stmt = oci_parse($c, $statement);
- oci_execute($stmt);
-}
+oci8_test_sql_execute($c, $create_st);
define('MYLIMIT', 200);
@@ -50,10 +51,7 @@ $drop_st = array();
$drop_st[] = "drop sequence myseq";
$drop_st[] = "drop table mytab";
-foreach ($create_st as $statement) {
- $stmt = oci_parse($c, $statement);
- oci_execute($stmt);
-}
+oci8_test_sql_execute($c, $drop_st);
echo "Done\n";
?>
diff --git a/ext/oci8/tests/bug27303_4_11gR1.phpt b/ext/oci8/tests/bug27303_4_11gR1.phpt
index 0c88360be2..f9bc2da8a2 100644
--- a/ext/oci8/tests/bug27303_4_11gR1.phpt
+++ b/ext/oci8/tests/bug27303_4_11gR1.phpt
@@ -4,10 +4,13 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters)
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/connect.inc");
-$sv = oci_server_version($c);
-$sv = preg_match('/Release 11\.1\./', $sv, $matches);
-if ($sv !== 1) {
- die ("skip expected output only valid when using Oracle 11gR1 database");
+// The bind buffer size edge cases seem to change each DB version.
+if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) {
+ if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) {
+ die("skip expected output only valid when using specific Oracle database versions");
+ }
+ }
}
?>
--FILE--
@@ -21,10 +24,7 @@ $create_st[] = "drop table mytab";
$create_st[] = "create sequence myseq";
$create_st[] = "create table mytab (mydata varchar2(20), seqcol number)";
-foreach ($create_st as $statement) {
- $stmt = oci_parse($c, $statement);
- oci_execute($stmt);
-}
+oci8_test_sql_execute($c, $create_st);
define('MYLIMIT', 200);
@@ -48,10 +48,7 @@ $drop_st = array();
$drop_st[] = "drop sequence myseq";
$drop_st[] = "drop table mytab";
-foreach ($create_st as $statement) {
- $stmt = oci_parse($c, $statement);
- oci_execute($stmt);
-}
+oci8_test_sql_execute($c, $drop_st);
echo "Done\n";
?>
diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt
index 8041699f92..c218d904fa 100644
--- a/ext/oci8/tests/password_new.phpt
+++ b/ext/oci8/tests/password_new.phpt
@@ -17,6 +17,10 @@ if (preg_match('/Release (11|12)\./', oci_server_version($c), $matches) === 1 &&
--FILE--
<?php
+// This test will diff if either the client or the server is 11.2.0.3
+// (or greater) and the other is 11.2.0.2 (or earlier). Both client
+// and server must be upgraded at the same time.
+
require dirname(__FILE__)."/connect.inc";
$new_password = "test";
diff --git a/ext/oci8/tests/password_old.phpt b/ext/oci8/tests/password_old.phpt
index 3ff726d2b7..fdbb1f9e89 100644
--- a/ext/oci8/tests/password_old.phpt
+++ b/ext/oci8/tests/password_old.phpt
@@ -19,6 +19,10 @@ if (preg_match('/Release (11|12)\./', oci_server_version($c), $matches) === 1 &&
--FILE--
<?php
+// This test will diff if either the client or the server is 11.2.0.3
+// (or greater) and the other is 11.2.0.2 (or earlier). Both client
+// and server must be upgraded at the same time.
+
require dirname(__FILE__)."/connect.inc";
$new_password = "test";