cvs: pear /DB DB.php /DB/tests/driver 06prepexec.phpt 18get.phpt
| From: | Daniel Convissor | Date: | Wed, 18 Feb 2004 05:38:12 +0000 |
| Subject: | cvs: pear /DB DB.php /DB/tests/driver 06prepexec.phpt 18get.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-16637@lists.php.net to get a copy of this message | ||
danielc Wed Feb 18 00:38:12 2004 EDT
Modified files:
/pear/DB DB.php
/pear/DB/tests/driver 06prepexec.phpt 18get.phpt
Log:
Add DB_PORTABILITY_NULL_TO_EMPTY mode.
http://cvs.php.net/diff.php/pear/DB/DB.php?r1=1.52&r2=1.53&ty=u
Index: pear/DB/DB.php
diff -u pear/DB/DB.php:1.52 pear/DB/DB.php:1.53
--- pear/DB/DB.php:1.52 Tue Feb 10 21:00:28 2004
+++ pear/DB/DB.php Wed Feb 18 00:38:11 2004
@@ -18,7 +18,7 @@
// | Maintainer: Daniel Convissor <danielc@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.52 2004/02/11 02:00:28 danielc Exp $
+// $Id: DB.php,v 1.53 2004/02/18 05:38:11 danielc Exp $
//
// Database independent query interface.
@@ -220,10 +220,17 @@
define('DB_PORTABILITY_ERRORS', 16);
/**
+ * Portability: convert null values to empty strings in data output by
+ * get*() and fetch*().
+ * @see DB_common::setOption()
+ */
+define('DB_PORTABILITY_NULL_TO_EMPTY', 32);
+
+/**
* Portability: turn on all portability features.
* @see DB_common::setOption()
*/
-define('DB_PORTABILITY_ALL', 31);
+define('DB_PORTABILITY_ALL', 63);
// }}}
@@ -256,7 +263,7 @@
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @since PHP 4.0
- * @version $Id: DB.php,v 1.52 2004/02/11 02:00:28 danielc Exp $
+ * @version $Id: DB.php,v 1.53 2004/02/18 05:38:11 danielc Exp $
* @category Database
*/
class DB
http://cvs.php.net/diff.php/pear/DB/tests/driver/06prepexec.phpt?r1=1.12&r2=1.13&ty=u
Index: pear/DB/tests/driver/06prepexec.phpt
diff -u pear/DB/tests/driver/06prepexec.phpt:1.12 pear/DB/tests/driver/06prepexec.phpt:1.13
--- pear/DB/tests/driver/06prepexec.phpt:1.12 Fri Jan 23 17:04:33 2004
+++ pear/DB/tests/driver/06prepexec.phpt Wed Feb 18 00:38:11 2004
@@ -67,4 +67,4 @@
------------5------------
insert: okay
-a = 11, b = three, d = NULL
+a = 11, b = three, d = string
http://cvs.php.net/diff.php/pear/DB/tests/driver/18get.phpt?r1=1.2&r2=1.3&ty=u
Index: pear/DB/tests/driver/18get.phpt
diff -u pear/DB/tests/driver/18get.phpt:1.2 pear/DB/tests/driver/18get.phpt:1.3
--- pear/DB/tests/driver/18get.phpt:1.2 Tue Feb 17 21:03:50 2004
+++ pear/DB/tests/driver/18get.phpt Wed Feb 18 00:38:11 2004
@@ -10,7 +10,7 @@
* DB_Common::getListOf(), DB_Common::getOne(), DB_Common::getRow()
*
* @package DB
- * @version $Id: 18get.phpt,v 1.2 2004/02/18 02:03:50 danielc Exp $
+ * @version $Id: 18get.phpt,v 1.3 2004/02/18 05:38:11 danielc Exp $
* @category Database
* @author Daniel Convissor <danielc@analysisandsolutions.com>
* @internal
@@ -23,7 +23,7 @@
--FILE--
<?php
-// $Id: 18get.phpt,v 1.2 2004/02/18 02:03:50 danielc Exp $
+// $Id: 18get.phpt,v 1.3 2004/02/18 05:38:11 danielc Exp $
/**
* Connect to the database and make the <kbd>phptest</kbd> table.
@@ -235,8 +235,8 @@
$dbh->query("INSERT INTO phptest VALUES (9, 'nine', '', NULL)");
$ret =& $dbh->getOne('SELECT d FROM phptest WHERE a = 9');
-if ($ret === null) {
- print "null\n";
+if ($ret === '') {
+ print "empty string\n";
} else {
print 'type=' . gettype($ret) . ", value=$ret\n";
}
@@ -624,7 +624,7 @@
)
===================================================
-testing getOne with null value in column: null
+testing getOne with null value in column: empty string
testing getOne with empty string in column: empty string
===================================================