cvs: /php3 ChangeLog /php3/functions oci8.c
| From: | Thies C . Arntzen | Date: | Tue, 14 Sep 1999 10:29:47 +0000 |
| Subject: | cvs: /php3 ChangeLog /php3/functions oci8.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10888@lists.php.net to get a copy of this message | ||
thies Tue Sep 14 06:29:47 1999 EDT
Modified files:
/php3 ChangeLog
/php3/functions oci8.c
Log:
support for positioning when writing into LOBs
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.761 php3/ChangeLog:1.762
--- php3/ChangeLog:1.761 Mon Sep 13 11:48:58 1999
+++ php3/ChangeLog Tue Sep 14 06:29:46 1999
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
???? ??, 1999, Version 3.0.13
+- OCI8 supports appending and positioning when saving LOBs (Thies)
- Added Mcal support (Mark Musone)
- OCI8 doesn't use define callbacks any longer. (Thies)
- Safe-Mode fix for oci8 savefile() function. (Thies)
Index: php3/functions/oci8.c
diff -u php3/functions/oci8.c:1.123 php3/functions/oci8.c:1.124
--- php3/functions/oci8.c:1.123 Mon Sep 13 11:19:27 1999
+++ php3/functions/oci8.c Tue Sep 14 06:29:47 1999
@@ -33,7 +33,7 @@
#define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */
-/* $Id: oci8.c,v 1.123 1999/09/13 15:19:27 thies Exp $ */
+/* $Id: oci8.c,v 1.124 1999/09/14 10:29:47 thies Exp $ */
/* TODO list:
*
@@ -239,6 +239,7 @@
PHP_FUNCTION(oci8_savedesc);
PHP_FUNCTION(oci8_savedescfile);
PHP_FUNCTION(oci8_loaddesc);
+PHP_FUNCTION(oci8_lobsize);
PHP_FUNCTION(oci8_commit);
PHP_FUNCTION(oci8_rollback);
PHP_FUNCTION(oci8_newdescriptor);
@@ -2517,11 +2518,14 @@
PHP_FUNCTION(oci8_savedesc)
{
- pval *id, *tmp, *conn, *arg;
+ pval *id, *tmp, *conn, *arg, *oarg;
OCILobLocator *mylob;
oci8_connection *connection;
oci8_descriptor *descr;
+ int offparam;
ub4 loblen;
+ ub4 curloblen;
+ ub4 offset;
OCI8_TLS_VARS;
@@ -2556,10 +2560,32 @@
RETURN_FALSE;
}
- if (getParameters(ht, 1, &arg) == FAILURE) {
+ offset = 0;
+ if (getParameters(ht, 2, &arg, &oarg) == SUCCESS) {
+ convert_to_long(oarg);
+ offparam = oarg->value.lval;
+
+ connection->error =
+ OCILobGetLength(connection->pServiceContext,
+ connection->pError,
+ mylob,
+ &curloblen);
+
+ oci8_debug("OCIsavedesc: curloblen=%d",curloblen);
+
+ if (offparam == -1) {
+ offset = curloblen;
+ } else if (offparam >= curloblen) {
+ php3_error(E_WARNING, "Offset smaller than current LOB-Size - appending");
+ offset = curloblen;
+ } else {
+ offset = offparam;
+ }
+ } else if (getParameters(ht, 1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ offset++;
loblen = arg->value.str.len;
if (loblen < 1) {
@@ -2572,7 +2598,7 @@
connection->pError,
mylob,
&loblen,
- (ub4) 1,
+ (ub4) offset,
(dvoid *) arg->value.str.val,
(ub4) loblen,
OCI_ONE_PIECE,
@@ -2581,7 +2607,7 @@
(ub2) 0,
(ub1) SQLCS_IMPLICIT );
- oci8_debug("OCIsavedesc: size=%d",loblen);
+ oci8_debug("OCIsavedesc: size=%d offset=%d",loblen,offset);
if (connection->error) {
oci8_error(connection->pError, "OCILobWrite", connection->error);