Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-22 Thread Lester Caine

At least trim the crap please 

Stanley Sufficool wrote:

Sent my request 2 days ago, still no answer. I will try again.
PHP lists are not particularly well 'manned' and some activity can wait a while, 
but it is also quite common for requests not to get through at all.



The PDO list has had no activity for about 2 months and the listed PDO
devs do not respond to e-mails. PHP says to send patches to the devs,
but this seems to be a no-go.
The latest thread is from last month, and is asking for help to clean up the 
wiki and agree on a way forward. The problem - as always - is that PDO is 
somewhat restricted in what it is supposed to be doing, and so at present it is 
clear that we need to maintain BOTH generic drivers and the PDO one. The current 
restrictions on PDO do not allow it to handle the a number of functions that are 
possible with the generic drivers, so this reduces the incentive to work on 
improving PDO. I had spent a bit of time looking to see if I could actually fix 
the pdo_firebird driver so that it would work with potgress and mysql, but it 
seems that this is not practical, so personally I'm happy staying with ADOdb 
since it IS working and does a lot more than PDO is even road mapped to do.


A decision needs to be made as to the major route forward. Developers working on 
the generic drivers are adding features which would be MUCH more appropriate 
implemented in PDO and would then be standardized across all databases. But 
there is no agreement on doing that, and at present there are only a small 
number of databases working to a reasonable level in PDO.


Lukas is calling for a meeting in Europe to discuss these matters later this 
year, but I think that we need to decided where priorities are for PHP6 and 
either drop PDO in favour of an alternative method, or push PDO as a full 
replacement for the generic drivers?


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Subscribe to PDO list (was Re: [PHP-DEV] [PATCH] PDO DBLIB)

2010-01-22 Thread Joey Smith
On Fri, Jan 22, 2010 at 04:32:55AM +, Niel Archer wrote:
 Well whaddya-know! This time it worked for me, although 45 minutes wait
 seems long. I'd given up 20 minutes after the other requests had been
 answered.

I had the same problem and waited several weeks between attempts, checking
my inbox for the email to no avail. Finally, I realized Well, it's an
ezmlm list, I can just send it commands, and this worked just fine - so
if you want to subscribe to the PDO list, instead of trying to use the
web interface (which appears to be broken for that list at least), you can
just send an email to pdo-subscr...@lists.php.net

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Subscribe to PDO list (was Re: [PHP-DEV] [PATCH] PDO DBLIB)

2010-01-22 Thread Philip Olson

On Jan 22, 2010, at 1:19 PM, Joey Smith wrote:

 On Fri, Jan 22, 2010 at 04:32:55AM +, Niel Archer wrote:
 Well whaddya-know! This time it worked for me, although 45 minutes wait
 seems long. I'd given up 20 minutes after the other requests had been
 answered.
 
 I had the same problem and waited several weeks between attempts, checking
 my inbox for the email to no avail. Finally, I realized Well, it's an
 ezmlm list, I can just send it commands, and this worked just fine - so
 if you want to subscribe to the PDO list, instead of trying to use the
 web interface (which appears to be broken for that list at least), you can
 just send an email to pdo-subscr...@lists.php.net

The phpweb code had php-pdo instead of pdo so it likely never worked. This 
has been fixed in SVN.

Regards,
Philip
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Niel Archer
 Stanley Sufficool wrote:
  I have tried to contact the maintainers of PDO with this, but have yet
  to get a response. Can I get this reviewed and if possible commited?
  
  Fixes BUG # 50755:
  http://bugs.php.net/bug.php?id=50755edit=1
  
  Compiled and tested with PHP SVN 5.2
 
 PDO development has it's own list ;)
 p...@lists.php.net

although joining it seems impossible ;-) Using the page here
http://www.php.net/mailing-lists.php to try joining the PDO list gets
the usual A request has been entered into the mailing list processing
queue. You should receive an email at m...@example.com shortly describing
how to complete your request. however the mail never arrives. No such
problem with the other lists though. It's been this way for some time
now.

 Although no doubt someone will pick it up from here ...
 
 -- 
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk//
 Firebird - http://www.firebirdsql.org/index.php
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Niel Archer
  Stanley Sufficool wrote:
   I have tried to contact the maintainers of PDO with this, but have yet
   to get a response. Can I get this reviewed and if possible commited?
   
   Fixes BUG # 50755:
   http://bugs.php.net/bug.php?id=50755edit=1
   
   Compiled and tested with PHP SVN 5.2
  
  PDO development has it's own list ;)
  p...@lists.php.net
 
 although joining it seems impossible ;-) Using the page here
 http://www.php.net/mailing-lists.php to try joining the PDO list gets
 the usual A request has been entered into the mailing list processing
 queue. You should receive an email at m...@example.com shortly describing
 how to complete your request. however the mail never arrives. No such
 problem with the other lists though. It's been this way for some time
 now.

Well whaddya-know! This time it worked for me, although 45 minutes wait
seems long. I'd given up 20 minutes after the other requests had been
answered.

  Although no doubt someone will pick it up from here ...
  
  -- 
  Lester Caine - G8HFL
  -
  Contact - http://lsces.co.uk/wiki/?page=contact
  L.S.Caine Electronic Services - http://lsces.co.uk
  EnquirySolve - http://enquirysolve.com/
  Model Engineers Digital Workshop - http://medw.co.uk//
  Firebird - http://www.firebirdsql.org/index.php
  
  -- 
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Stanley Sufficool
On Thu, Jan 21, 2010 at 8:32 PM, Niel Archer spam-f...@blueyonder.co.uk wrote:
  Stanley Sufficool wrote:
   I have tried to contact the maintainers of PDO with this, but have yet
   to get a response. Can I get this reviewed and if possible commited?
  
   Fixes BUG # 50755:
   http://bugs.php.net/bug.php?id=50755edit=1
  
   Compiled and tested with PHP SVN 5.2
 
  PDO development has it's own list ;)
  p...@lists.php.net

 although joining it seems impossible ;-) Using the page here
 http://www.php.net/mailing-lists.php to try joining the PDO list gets
 the usual A request has been entered into the mailing list processing
 queue. You should receive an email at m...@example.com shortly describing
 how to complete your request. however the mail never arrives. No such
 problem with the other lists though. It's been this way for some time
 now.

 Well whaddya-know! This time it worked for me, although 45 minutes wait
 seems long. I'd given up 20 minutes after the other requests had been
 answered.

Sent my request 2 days ago, still no answer. I will try again.

The PDO list has had no activity for about 2 months and the listed PDO
devs do not respond to e-mails. PHP says to send patches to the devs,
but this seems to be a no-go.


  Although no doubt someone will pick it up from here ...
 
  --
  Lester Caine - G8HFL
  -
  Contact - http://lsces.co.uk/wiki/?page=contact
  L.S.Caine Electronic Services - http://lsces.co.uk
  EnquirySolve - http://enquirysolve.com/
  Model Engineers Digital Workshop - http://medw.co.uk//
  Firebird - http://www.firebirdsql.org/index.php
 
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] [PATCH] PDO DBLIB

2010-01-20 Thread Stanley Sufficool
I have tried to contact the maintainers of PDO with this, but have yet
to get a response. Can I get this reviewed and if possible commited?

Fixes BUG # 50755:
http://bugs.php.net/bug.php?id=50755edit=1

Compiled and tested with PHP SVN 5.2
Index: ext/pdo_dblib/dblib_stmt.c
===
--- ext/pdo_dblib/dblib_stmt.c	(revision 293600)
+++ ext/pdo_dblib/dblib_stmt.c	(working copy)
@@ -32,35 +32,24 @@
 #include php_pdo_dblib_int.h
 #include zend_exceptions.h
 
-static void free_rows(pdo_dblib_stmt *S TSRMLS_DC)
+static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
 {
-	int i, j;
-	
-	for (i = 0; i  S-nrows; i++) {
-		for (j = 0; j  S-ncols; j++) {
-			pdo_dblib_colval *val = S-rows[i] + j;
-			if (val-data) {
-efree(val-data);
-val-data = NULL;
-			}
-		}
-	}
-	efree(S-rows);
-	S-rows = NULL;
-	S-nrows = 0;
-}
-
-static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
-{
 	pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt-driver_data;
+	pdo_dblib_db_handle *H = S-H;
 
-	if (S-rows) {
-		free_rows(S TSRMLS_CC);
-	}
+	int i;
+
+	/* Cancel any pending results */
+	dbcancel(H-link);
+
+	for (i = 0; i  stmt-column_count; i++)
+		if (S-cols[i].data)
+			efree(S-cols[i].data);
+
 	if (S-cols) {
 		efree(S-cols);
+		S-cols = NULL;
 	}
-	efree(S);
 
 	return 1;
 }
@@ -72,157 +61,163 @@
 	pdo_dblib_db_handle *H = S-H;
 	RETCODE resret, ret;
 	int i, j;
-	int arows;
 	unsigned int size;
-	
-	dbsetuserdata(H-link, S-err);
 
-	if (S-rows) {
-		/* clean them up */
-		free_rows(S TSRMLS_CC);
-	}
+	/* clean up previous columns and values */
+	pdo_dblib_stmt_cursor_closer(stmt);
 
+	dbsetuserdata(H-link, (BYTE*) S-err);
+
 	if (FAIL == dbcmd(H-link, stmt-active_query_string)) {
 		return 0;
 	}
 	if (FAIL == dbsqlexec(H-link)) {
 		return 0;
 	}
-	
+
 	resret = dbresults(H-link);
+
 	if (resret == FAIL) {
 		return 0;
 	}
 
-	ret = dbnextrow(H-link);
-
 	stmt-row_count = DBCOUNT(H-link);
+	stmt-column_count = dbnumcols(H-link);
 
-if (ret == NO_MORE_ROWS) {
-   return 1;
-}
-
-	if (!S-cols) {
-		S-ncols = dbnumcols(H-link);
+	if (stmt-column_count = 0) {
+		return 1;
+	}
 
-		if (S-ncols = 0) {
-			return 1;
-		}
+	S-cols = ecalloc(stmt-column_count, sizeof(pdo_dblib_col));
 
-		S-cols = ecalloc(S-ncols, sizeof(pdo_dblib_col));
-		stmt-column_count = S-ncols;
-	
-		for (i = 0, j = 0; i  S-ncols; i++) {
-			char *tmp = NULL;
+	for (i = 0, j = 0; i  stmt-column_count; i++) {
+		char *tmp = NULL;
 
-			S-cols[i].coltype = dbcoltype(H-link, i+1);
-			S-cols[i].name = (char*)dbcolname(H-link, i+1);
+		S-cols[i].coltype = dbcoltype(H-link, i+1);
+		S-cols[i].name = (char*)dbcolname(H-link, i+1);
 
-			if (!strlen(S-cols[i].name)) {
-if (j) {
-	spprintf(tmp, 0, computed%d, j++);
-	strlcpy(S-cols[i].name, tmp, strlen(tmp)+1);
-	efree(tmp);
-} else {
-	S-cols[i].name = computed;
-	j++;
-}
+		if (!strlen(S-cols[i].name)) {
+			if (j) {
+spprintf(tmp, 0, computed%d, j++);
+strlcpy(S-cols[i].name, tmp, strlen(tmp)+1);
+efree(tmp);
+			} else {
+S-cols[i].name = computed;
+j++;
 			}
+		}
 
-			S-cols[i].source = (char*)dbcolsource(H-link, i+1);
-			tmp = estrdup(S-cols[i].source ? S-cols[i].source : );
-			S-cols[i].source = tmp;
-			efree(tmp);
+		S-cols[i].source = (char*)dbcolsource(H-link, i+1);
+		tmp = estrdup(S-cols[i].source ? S-cols[i].source : );
+		S-cols[i].source = tmp;
+		efree(tmp);
 
-			S-cols[i].maxlen = dbcollen(H-link, i+1);
-		}
+		S-cols[i].maxlen = dbcollen(H-link, i+1);
 	}
 
-	arows = 100;
-	size = S-ncols * sizeof(pdo_dblib_colval);
-	S-rows = safe_emalloc(arows, size, 0);
+	return 1;
+}
 
-	/* let's fetch all the data */
-	do {
-		if (S-nrows = arows) {
-			arows *= 2;
-			S-rows = erealloc(S-rows, arows * size);
-		}
-		for (i = 0; i  S-ncols; i++) {
-			pdo_dblib_colval *val = S-rows[S-nrows * S-ncols + i];
 
-			if (dbdatlen(H-link, i+1) == 0  dbdata(H-link, i+1) == NULL) {
-val-len = 0;
-val-data = NULL;
-			} else {
-switch (S-cols[i].coltype) {
-	case SQLCHAR:
-	case SQLTEXT:
-	case SQLVARBINARY:
-	case SQLBINARY:
-	case SQLIMAGE:
-		val-len = dbdatlen(H-link, i+1);
-		val-data = emalloc(val-len + 1);
-		memcpy(val-data, dbdata(H-link, i+1), val-len);
-		val-data[val-len] = '\0';
-		break;
+static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt) {
+	/*
+	 * PHP.NET:
+	 * Each rowset can have a different set of columns from the preceding rowset. 
+	 *
+	 * BUG: segfault due to not reading the new columns
+	 *
+	 */
 
-	default:
-		if (dbwillconvert(S-cols[i].coltype, SQLCHAR)) {
-			val-len = 32 + (2 * dbdatlen(H-link, i+1));
-			val-data = emalloc(val-len);
+	pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt-driver_data;
+	pdo_dblib_db_handle *H = S-H;
+	RETCODE resret;
 
-			val-len = dbconvert(NULL, S-cols[i].coltype, dbdata(H-link, i+1),
-	dbdatlen(H-link, i+1), SQLCHAR, val-data, val-len);

Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-20 Thread Lester Caine

Stanley Sufficool wrote:

I have tried to contact the maintainers of PDO with this, but have yet
to get a response. Can I get this reviewed and if possible commited?

Fixes BUG # 50755:
http://bugs.php.net/bug.php?id=50755edit=1

Compiled and tested with PHP SVN 5.2


PDO development has it's own list ;)
p...@lists.php.net

Although no doubt someone will pick it up from here ...

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php