cvs: pear /MDB2/MDB2/Driver/Datatype ibase.php
| From: | Lorenzo Alberton | Date: | Wed, 27 Oct 2004 20:01:43 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Datatype ibase.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25303@lists.php.net to get a copy of this message | ||
quipo Wed Oct 27 16:01:43 2004 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Datatype ibase.php
Log:
fixed _quoteLOB()
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/ibase.php?r1=1.15&r2=1.16&ty=u
Index: pear/MDB2/MDB2/Driver/Datatype/ibase.php
diff -u pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.15 pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.16
--- pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.15 Wed Oct 27 12:56:57 2004
+++ pear/MDB2/MDB2/Driver/Datatype/ibase.php Wed Oct 27 16:01:42 2004
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: ibase.php,v 1.15 2004/10/27 16:56:57 lsmith Exp $
+// $Id: ibase.php,v 1.16 2004/10/27 20:01:42 quipo Exp $
//
require_once 'MDB2/Driver/Datatype/Common.php';
@@ -71,12 +71,12 @@
{
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
switch ($type) {
- case 'decimal':
- return
sprintf('%.'.$db->options['decimal_places'].'f',
doubleval($value)/pow(10.0, $db->options['decimal_places']));
- case 'timestamp':
- return substr($value, 0, strlen('YYYY-MM-DD HH:MM:SS'));
- default:
- return $this->_baseConvertResult($value, $type);
+ case 'decimal':
+ return
sprintf('%.'.$db->options['decimal_places'].'f',
doubleval($value)/pow(10.0, $db->options['decimal_places']));
+ case 'timestamp':
+ return substr($value, 0, strlen('YYYY-MM-DD HH:MM:SS'));
+ default:
+ return $this->_baseConvertResult($value, $type);
}
}
@@ -428,14 +428,12 @@
@rewind($fp);
$value = $fp;
}
-/*
- $prepared_query = $GLOBALS['_MDB2_LOBs'][$lob]->prepared_query;
- $parameter = $GLOBALS['_MDB2_LOBs'][$lob]->parameter;
-*/
- if (($handle = @ibase_blob_create($db->auto_commit ? $db->connection :
$db->transaction_id))) {
+ $handle = @ibase_blob_create($db->auto_commit ? $db->connection :
$db->transaction_id);
+ if ($handle) {
while (!@feof($value)) {
$data = @fread($value, $db->options['lob_buffer_length']);
- if (@ibase_blob_add($handle, $data) === false) {
+ $result = @ibase_blob_add($handle, $data);
+ if ($result === false) {
$result = $db->raiseError(MDB2_ERROR, null, null,
'Could not add data to a large object: '.ibase_errmsg());
break;
@@ -452,16 +450,7 @@
} else {
$result = $db->raiseError();
}
-/*
- if (!isset($db->query_parameters[$prepared_query])) {
- $db->query_parameters[$prepared_query] = array(0, '');
- $db->query_parameter_values[$prepared_query] = array();
- }
- $query_parameter = count($db->query_parameters[$prepared_query]);
- $db->query_parameters[$prepared_query][$query_parameter] = $value;
- $db->query_parameter_values[$prepared_query][$parameter] = $query_parameter;
- $value = '?';
-*/
+
if (!$db->auto_commit) {
$db->commit();
}
@@ -501,9 +490,9 @@
{
return $this->_quoteLOB($value);
}
-
+
// }}}
- // {{{ _quoteFloat()
+ // {{{ _quoteBoolean()
/**
* Convert a text value into a DBMS specific format that is suitable to
@@ -511,12 +500,12 @@
*
* @param string $value text string value that is intended to be converted.
* @return string text string that represents the given argument value in
- * a DBMS specific format.
+ * a DBMS specific format.
* @access private
*/
- function _quoteFloat($value)
+ function _quoteBoolean($value)
{
- return $value;
+ return ($value ? "'Y'" : "'N'");
}
// }}}