Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-18 Thread Andi Gutmans

Why do you need that SEPARATE_ZVAL()? You seem to be using pv_row as read-only.
Also can you please try not to commit \r\n but only \n?

Thanks,

Andi

At 02:31 AM 4/19/2001 +, Dan Kalowsky wrote:
kalowskyWed Apr 18 19:31:23 2001 EDT

   Modified files:
 /php4/ext/odbc  php_odbc.c
   Log:
   corrects bug #7488, patch supplied by submitter ([EMAIL PROTECTED]).
   quick local tests show it to work.


Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.78 php4/ext/odbc/php_odbc.c:1.79
--- php4/ext/odbc/php_odbc.c:1.78   Mon Apr 16 19:02:36 2001
+++ php4/ext/odbc/php_odbc.cWed Apr 18 19:31:23 2001
@@ -15,11 +15,12 @@
 | Authors: Stig Sther Bakken [EMAIL PROTECTED]|
 |  Andreas Karajannis [EMAIL PROTECTED]  |
 |  Frank M. Kromann [EMAIL PROTECTED] Support for DB/2 CLI |
-   | Kevin N. Shallow [EMAIL PROTECTED] Velocis Support |
+   | Kevin N. Shallow [EMAIL PROTECTED] Velocis Support |
+   | Daniel R. Kalowsky 
[EMAIL PROTECTED]   |
 +--+
   */

-/* $Id: php_odbc.c,v 1.78 2001/04/17 02:02:36 kalowsky Exp $ */
+/* $Id: php_odbc.c,v 1.79 2001/04/19 02:31:23 kalowsky Exp $ */

  #include "php.h"
  #include "php_globals.h"
@@ -64,7 +65,7 @@

  #define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0))

-static unsigned char a3_arg3_force_ref[] = { 3, BYREF_NONE, BYREF_ALLOW, 
BYREF_FORCE };
+static unsigned char a3_arg3_and_3_force_ref[] = { 3, BYREF_NONE, 
BYREF_FORCE, BYREF_FORCE };

  function_entry odbc_functions[] = {
  PHP_FE(odbc_error, NULL)
@@ -85,7 +86,7 @@
 PHP_FE(odbc_prepare, NULL)
 PHP_FE(odbc_execute, NULL)
 PHP_FE(odbc_fetch_row, NULL)
-   PHP_FE(odbc_fetch_into, a3_arg3_force_ref)
+   PHP_FE(odbc_fetch_into, a3_arg3_and_3_force_ref)
 PHP_FE(odbc_field_len, NULL)
 PHP_FE(odbc_field_scale, NULL)
 PHP_FE(odbc_field_name, NULL)
@@ -1363,7 +1364,8 @@
 break;
 case 3:
 if (zend_get_parameters_ex(3, pv_res, pv_row, 
 pv_res_arr) == FAILURE)
-   WRONG_PARAM_COUNT;
+   WRONG_PARAM_COUNT;
+   SEPARATE_ZVAL(pv_row);
 convert_to_long_ex(pv_row);
 rownum = (*pv_row)-value.lval;
 break;
@@ -1380,11 +1382,6 @@
 WRONG_PARAM_COUNT;
 }
  #endif
-
-   if (!ParameterPassedByReference(ht, numArgs)) {
-   php_error(E_WARNING, "Array not passed by reference in 
call to odbc_fetch_into()");
-   RETURN_FALSE;
-   }

 ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC 
 result", le_result);

@@ -1922,7 +1919,11 @@
 return FALSE;
 }
 }
-#ifdef HAVE_EMPRESS
+/*  Possible fix for bug #
+ *  Needs testing on UnixODBC  2.0.5 though.
+ * #if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC)
+ *  Uncomment the line above, and comment line below to fully test */
+#ifdef HAVE_EMPRESS
 {
 int direct = 0;
 chardsnbuf[300];



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-17 Thread Sterling Hughes

On Tue, 17 Apr 2001, Jani Taskinen wrote:

 On Mon, 16 Apr 2001, Sterling Hughes wrote:

 
  -#ifndef HAVE_DBMAKER
  -  if ((*pv_onoff)) {
  -#else
 if (pv_onoff  (*pv_onoff)) {
  -#endif
 convert_to_long_ex(pv_onoff);
 rc = SQLSetConnectOption(conn-hdbc, SQL_AUTOCOMMIT,
  
((*pv_onoff)-value.lval) ?
 
 
 This should be breaking something, no?
 
 Either way an "if" statement is started therefore it needs to be finished.
 

 Maybe you should get thicker glasses? :)

 #ifndef -- see this ? :-p


Maybe *you* need glasses :)

#ifndef HAVE_DBMAKER
if ((*pv_onoff)) {
#else
if (pv_onoff  (*pv_onoff)) {
#else

Either way an "if" block is started but not finished.

As Dan pointed out, it looks as if the diff got truncated.

-Sterling


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-16 Thread Sterling Hughes

On Tue, 17 Apr 2001, Dan Kalowsky wrote:

 kalowsky  Mon Apr 16 19:02:36 2001 EDT

   Modified files:
 /php4/ext/odbcphp_odbc.c
   Log:
   This change seems to fix bugs 7158, 7807, 8531, and 8636.  After asking why this 
patch was applied no one seemed to respond with anything useful.  If you find this 
change in error, sorry, I tested it on as many systems as I could.



 Index: php4/ext/odbc/php_odbc.c
 diff -u php4/ext/odbc/php_odbc.c:1.77 php4/ext/odbc/php_odbc.c:1.78
 --- php4/ext/odbc/php_odbc.c:1.77 Tue Apr 10 09:26:27 2001
 +++ php4/ext/odbc/php_odbc.c  Mon Apr 16 19:02:36 2001
 @@ -19,7 +19,7 @@
 +--+
   */

 -/* $Id: php_odbc.c,v 1.77 2001/04/10 16:26:27 kevin Exp $ */
 +/* $Id: php_odbc.c,v 1.78 2001/04/17 02:02:36 kalowsky Exp $ */

  #include "php.h"
  #include "php_globals.h"
 @@ -2435,11 +2435,7 @@

   ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", 
le_conn, le_pconn);

 -#ifndef HAVE_DBMAKER
 - if ((*pv_onoff)) {
 -#else
   if (pv_onoff  (*pv_onoff)) {
 -#endif
   convert_to_long_ex(pv_onoff);
   rc = SQLSetConnectOption(conn-hdbc, SQL_AUTOCOMMIT,

((*pv_onoff)-value.lval) ?


This should be breaking something, no?

Either way an "if" statement is started therefore it needs to be finished.

-Sterling


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-16 Thread Dan Kalowsky

 This should be breaking something, no?
 
 Either way an "if" statement is started therefore it needs to be finished.

it's there, it's just the next line down (didn't make it into the cvs
diff as i didn't change it) honest!  

it should be seen in the file as:

rc = SQLSetConnectOption(conn-hdbc, SQLAUTOCOMMIT,
((*pv_onoff)-value.lval) ?
SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF);

---
 Dan Kalowsky  http://www.deadmime.org/~dank
 DEADmime INTERnational, http://www.deadmime.org
 Project Lead


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-16 Thread Jani Taskinen

On Mon, 16 Apr 2001, Sterling Hughes wrote:


 -#ifndef HAVE_DBMAKER
 -if ((*pv_onoff)) {
 -#else
  if (pv_onoff  (*pv_onoff)) {
 -#endif
  convert_to_long_ex(pv_onoff);
  rc = SQLSetConnectOption(conn-hdbc, SQL_AUTOCOMMIT,
   
((*pv_onoff)-value.lval) ?


This should be breaking something, no?

Either way an "if" statement is started therefore it needs to be finished.


Maybe you should get thicker glasses? :)

#ifndef -- see this ? :-p

--Jani


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c php_odbc.h

2001-01-14 Thread Sebastian Bergmann

Stig Bakken wrote:
 ssb Sun Jan 14 17:11:06 2001 EDT
 
   Modified files:
 /php4/ext/odbc  php_odbc.c php_odbc.h
   Log:
   @- Added odbc_error() and odbc_errormsg() functions (Stig)

  PHP 4 does not build on Win32 after this patch:

php_odbc.c
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2445) :
error C2065: 'odbc_globals' : nichtdeklarierter Bezeichner
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2445) :
error C2223: Der linke Teil von '-laststate' muss auf eine Struktur/Union
zeigen
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2445) :
warning C4047: 'function' : Anzahl der Dereferenzierungen bei 'const char *'
und 'int ' unterschiedlich
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2445) :
warning C4024: 'strncpy' : Unterschiedliche Typen fuer formalen und
uebergebenen Parameter 2
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2445) :
error C2198: 'strncpy' : Nicht genuegend Parameter uebergeben
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2447) :
error C2223: Der linke Teil von '-lasterrormsg' muss auf eine
Struktur/Union zeigen
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2447) :
warning C4047: 'function' : Anzahl der Dereferenzierungen bei 'const char *'
und 'int ' unterschiedlich
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2447) :
warning C4024: 'strncpy' : Unterschiedliche Typen fuer formalen und
uebergebenen Parameter 2
D:\Programme\MS Visual Studio\Projekte\php\php4\ext\odbc\php_odbc.c(2447) :
error C2198: 'strncpy' : Nicht genuegend Parameter uebergeben

-- 
 sebastian bergmann e-mail :  [EMAIL PROTECTED]
  homepage :  http://www.sebastian-bergmann.de
   make a gift : http://wishlist.sebastian-bergmann.de
 measure the usability of your web application - http://phpOpenTracker.de

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]