cvs: pear /MDB2 package.php /MDB2/MDB2/Driver/Datatype ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php /MDB2/MDB2/Driver/Reverse
ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php

From: Date: Sun, 04 Mar 2007 23:40:51 +0000
Subject: cvs: pear /MDB2 package.php /MDB2/MDB2/Driver/Datatype ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php /MDB2/MDB2/Driver/Reverse
ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44965@lists.php.net to get a copy of this message
quipo Sun Mar 4 23:40:51 2007 UTC Modified files: /pear/MDB2/MDB2/Driver/Datatype ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php /pear/MDB2/MDB2/Driver/Reverse ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php /pear/MDB2 package.php Log: fixed bug #10234 and bug #10233: MDB2_Driver_Datatype_Common::mapNativeDatatype() must ensure that it returns the correct length value, or null

http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/ibase.php?r1=1.87&r2=1.88&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/ibase.php diff -u pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.87 pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.88 --- pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.87 Thu Mar 1 11:25:34 2007 +++ pear/MDB2/MDB2/Driver/Datatype/ibase.php Sun Mar 4 23:40:51 2007 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith, Lorenzo Alberton | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -44,7 +44,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.87 2007/03/01 11:25:34 quipo Exp $ +// $Id: ibase.php,v 1.88 2007/03/04 23:40:51 quipo Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -409,11 +409,14 @@ if (PEAR::isError($db)) { return $db; } - return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/mssql.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/mssql.php diff -u pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.54 pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.55 --- pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.54 Sun Mar 4 19:35:43 2007 +++ pear/MDB2/MDB2/Driver/Datatype/mssql.php Sun Mar 4 23:40:51 2007 @@ -44,7 +44,7 @@ // | Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.54 2007/03/04 19:35:43 quipo Exp $ +// $Id: mssql.php,v 1.55 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -397,9 +397,6 @@ // todo: handle length of various int variations $db_type = preg_replace('/\d/','', strtolower($field['type'])); $length = $field['length']; - if ((int)$length <= 0) { - $length = null; - } $type = array(); // todo: unsigned handling seems to be missing $unsigned = $fixed = null; @@ -462,11 +459,14 @@ if (PEAR::isError($db)) { return $db; } - return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } // }}} http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/mysql.php?r1=1.58&r2=1.59&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/mysql.php diff -u pear/MDB2/MDB2/Driver/Datatype/mysql.php:1.58 pear/MDB2/MDB2/Driver/Datatype/mysql.php:1.59 --- pear/MDB2/MDB2/Driver/Datatype/mysql.php:1.58 Wed Feb 28 16:05:45 2007 +++ pear/MDB2/MDB2/Driver/Datatype/mysql.php Sun Mar 4 23:40:51 2007 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.58 2007/02/28 16:05:45 quipo Exp $ +// $Id: mysql.php,v 1.59 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -455,6 +455,10 @@ 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/mysqli.php?r1=1.57&r2=1.58&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/mysqli.php diff -u pear/MDB2/MDB2/Driver/Datatype/mysqli.php:1.57 pear/MDB2/MDB2/Driver/Datatype/mysqli.php:1.58 --- pear/MDB2/MDB2/Driver/Datatype/mysqli.php:1.57 Wed Feb 28 16:05:45 2007 +++ pear/MDB2/MDB2/Driver/Datatype/mysqli.php Sun Mar 4 23:40:51 2007 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.57 2007/02/28 16:05:45 quipo Exp $ +// $Id: mysqli.php,v 1.58 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -455,6 +455,10 @@ 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } @@ -498,5 +502,4 @@ // }}} } - ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/oci8.php?r1=1.70&r2=1.71&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/oci8.php diff -u pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.70 pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.71 --- pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.70 Thu Mar 1 11:25:34 2007 +++ pear/MDB2/MDB2/Driver/Datatype/oci8.php Sun Mar 4 23:40:51 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.70 2007/03/01 11:25:34 quipo Exp $ +// $Id: oci8.php,v 1.71 2007/03/04 23:40:51 quipo Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -470,6 +470,10 @@ 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } } http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/pgsql.php?r1=1.81&r2=1.82&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/pgsql.php diff -u pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.81 pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.82 --- pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.81 Thu Mar 1 11:25:35 2007 +++ pear/MDB2/MDB2/Driver/Datatype/pgsql.php Sun Mar 4 23:40:51 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.81 2007/03/01 11:25:35 quipo Exp $ +// $Id: pgsql.php,v 1.82 2007/03/04 23:40:51 quipo Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -398,9 +398,6 @@ if ($length == '-1' && !empty($field['atttypmod'])) { $length = $field['atttypmod'] - 4; } - if ((int)$length <= 0) { - $length = null; - } $type = array(); $unsigned = $fixed = null; switch ($db_type) { @@ -503,11 +500,14 @@ if (PEAR::isError($db)) { return $db; } - return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'unknown database attribute type: '.$db_type, __FUNCTION__); } + if ((int)$length <= 0) { + $length = null; + } + return array($type, $length, $unsigned, $fixed); } http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/ibase.php?r1=1.65&r2=1.66&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/ibase.php diff -u pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.65 pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.66 --- pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.65 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/ibase.php Sun Mar 4 23:40:51 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith, Frank M. Kromann, Lorenzo Alberton | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.65 2007/02/25 11:14:34 quipo Exp $ +// $Id: ibase.php,v 1.66 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -192,7 +192,7 @@ } $definition[0] = array('notnull' => $notnull, 'nativetype' => $column['type']); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mssql.php?r1=1.36&r2=1.37&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mssql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.36 pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.37 --- pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.36 Sun Mar 4 19:56:26 2007 +++ pear/MDB2/MDB2/Driver/Reverse/mssql.php Sun Mar 4 23:40:51 2007 @@ -43,7 +43,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.36 2007/03/04 19:56:26 quipo Exp $ +// $Id: mssql.php,v 1.37 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -145,7 +145,7 @@ 'notnull' => $notnull, 'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type']) ); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.65&r2=1.66&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.65 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.66 --- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.65 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Sun Mar 4 23:40:51 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.65 2007/02/25 11:14:34 quipo Exp $ +// $Id: mysql.php,v 1.66 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -123,7 +123,7 @@ 'notnull' => $notnull, 'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type']) ); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysqli.php?r1=1.56&r2=1.57&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysqli.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.56 pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.57 --- pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.56 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/mysqli.php Sun Mar 4 23:40:51 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.56 2007/02/25 11:14:34 quipo Exp $ +// $Id: mysqli.php,v 1.57 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -177,7 +177,7 @@ 'notnull' => $notnull, 'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type']) ); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.56&r2=1.57&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.56 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.57 --- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.56 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Sun Mar 4 23:40:51 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.56 2007/02/25 11:14:34 quipo Exp $ +// $Id: oci8.php,v 1.57 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -123,7 +123,7 @@ } $definition[0] = array('notnull' => $notnull, 'nativetype' => $column['type']); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/pgsql.php?r1=1.56&r2=1.57&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/pgsql.php diff -u pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.56 pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.57 --- pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.56 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/pgsql.php Sun Mar 4 23:40:51 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -43,7 +43,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.56 2007/02/25 11:14:34 quipo Exp $ +// $Id: pgsql.php,v 1.57 2007/03/04 23:40:51 quipo Exp $ require_once 'MDB2/Driver/Reverse/Common.php'; @@ -126,7 +126,7 @@ $autoincrement = true; } $definition[0] = array('notnull' => $notnull, 'nativetype' => $column['type']); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/sqlite.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/sqlite.php diff -u pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.63 pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.64 --- pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.63 Sun Feb 25 11:14:34 2007 +++ pear/MDB2/MDB2/Driver/Reverse/sqlite.php Sun Mar 4 23:40:51 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.63 2007/02/25 11:14:34 quipo Exp $ +// $Id: sqlite.php,v 1.64 2007/03/04 23:40:51 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -187,7 +187,7 @@ 'notnull' => $notnull, 'nativetype' => preg_replace('/^([a-z]+)[^a-z].*/i', '\\1', $column['type']) ); - if ($length > 0) { + if (!is_null($length)) { $definition[0]['length'] = $length; } if (!is_null($unsigned)) { http://cvs.php.net/viewvc.cgi/pear/MDB2/package.php?r1=1.238&r2=1.239&diff_format=u Index: pear/MDB2/package.php diff -u pear/MDB2/package.php:1.238 pear/MDB2/package.php:1.239 --- pear/MDB2/package.php:1.238 Fri Mar 2 16:39:22 2007 +++ pear/MDB2/package.php Sun Mar 4 23:40:51 2007 @@ -26,6 +26,8 @@ an error - added a 'nativetype_map_callback' option to map native data declarations back to custom data types (thanks to Andrew Hill). +- fixed bug #10234 and bug #10233: MDB2_Driver_Datatype_Common::mapNativeDatatype() + must ensure that it returns the correct length value, or null - phpdoc fixes - fixed tests to be compatible with PHP4 - added new tests, including some MDB2 internals tests by Andrew Hill and Monique Szpak
« previous php.pear.cvs (#44965) next »