cvs: pear /MDB2 package.php package_ibase.php package_mssql.php package_mysql.php package_mysqli.php package_oci8.php package_pgsql.php
package_sqlite.php /MDB2/MDB2/Driver/Reverse Common.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php
| From: | Lorenzo Alberton | Date: | Fri, 23 Feb 2007 19:57:36 +0000 |
| Subject: | cvs: pear /MDB2 package.php package_ibase.php package_mssql.php package_mysql.php package_mysqli.php package_oci8.php package_pgsql.php package_sqlite.php /MDB2/MDB2/Driver/Reverse Common.php 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-44849@lists.php.net to get a copy of this message | ||
quipo Fri Feb 23 19:57:36 2007 UTC
Modified files:
/pear/MDB2/MDB2/Driver/Reverse Common.php ibase.php mssql.php
mysql.php mysqli.php oci8.php
pgsql.php sqlite.php
/pear/MDB2 package.php package_ibase.php package_mssql.php
package_mysql.php package_mysqli.php package_oci8.php
package_pgsql.php package_sqlite.php
Log:
added a new boolean parameter to getTableIndexDefinition() and getTableConstraintDefinition() in
the Reverse module to disable the 'idxname_format' option and use the index name as
provided
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/Common.php?r1=1.32&r2=1.33&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/Common.php diff -u pear/MDB2/MDB2/Driver/Reverse/Common.php:1.32 pear/MDB2/MDB2/Driver/Reverse/Common.php:1.33 --- pear/MDB2/MDB2/Driver/Reverse/Common.php:1.32 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/Common.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.32 2006/12/19 23:08:39 quipo Exp $ +// $Id: Common.php,v 1.33 2007/02/23 19:57:35 quipo Exp $ // /** @@ -102,6 +102,8 @@ * * @param string $table name of table that should be used in method * @param string $index name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * The returned array has this structure: * </pre> @@ -117,7 +119,7 @@ * </pre> * @access public */ - function getTableIndexDefinition($table, $index) + function getTableIndexDefinition($table, $index, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { @@ -136,6 +138,8 @@ * * @param string $table name of table that should be used in method * @param string $index name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * The returned array has this structure: * <pre> @@ -152,7 +156,7 @@ * </pre> * @access public */ - function getTableConstraintDefinition($table, $index) + function getTableConstraintDefinition($table, $index, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { @@ -211,7 +215,7 @@ * * EXPERIMENTAL * - * WARNING: this function is experimental and may change the returned value + * WARNING: this function is experimental and may change the returned value * at any time until labelled as non-experimental * * @param string $trigger name of trigger that should be used in method @@ -244,6 +248,36 @@ } // }}} + // {{{ getViewDefinition() + + /** + * Get the structure of a view into an array + * + * @param string $view name of view that should be used in method + * @return mixed data array on success, a MDB2 error on failure + * The returned array has this structure: + * <pre> + * array ( + * [view_name] => 'view name', + * [fields] => array([field names]), + * [view_def] => 'view definition', + * ); + * </pre> + * + * @access public + function getViewDefinition($view) + { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + + return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, + 'method not implemented', __FUNCTION__); + } + */ + + // }}} // {{{ tableInfo() /** http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/ibase.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/ibase.php diff -u pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.63 pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.64 --- pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.63 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/ibase.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.63 2006/12/19 23:08:39 quipo Exp $ +// $Id: ibase.php,v 1.64 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -223,17 +223,22 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } $table = $db->quote(strtoupper($table), 'text'); - $index_name = $db->quote(strtoupper($db->getIndexName($index_name)), 'text'); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } + $index_name = $db->quote(strtoupper($index_name), 'text'); $query = "SELECT RDB\$INDEX_SEGMENTS.RDB\$FIELD_NAME AS field_name, RDB\$INDICES.RDB\$UNIQUE_FLAG AS unique_flag, RDB\$INDICES.RDB\$FOREIGN_KEY AS foreign_key, @@ -289,17 +294,22 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } $table = $db->quote(strtoupper($table), 'text'); - $index_name = $db->quote(strtoupper($db->getIndexName($index_name)), 'text'); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } + $index_name = $db->quote(strtoupper($index_name), 'text'); $query = "SELECT RDB\$INDEX_SEGMENTS.RDB\$FIELD_NAME AS field_name, RDB\$INDICES.RDB\$UNIQUE_FLAG AS unique_flag, RDB\$INDICES.RDB\$FOREIGN_KEY AS foreign_key, http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mssql.php?r1=1.31&r2=1.32&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mssql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.31 pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.32 --- pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.31 Sun Jan 14 13:28:45 2007 +++ pear/MDB2/MDB2/Driver/Reverse/mssql.php Fri Feb 23 19:57:35 2007 @@ -39,10 +39,11 @@ // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | // | POSSIBILITY OF SUCH DAMAGE. | // +----------------------------------------------------------------------+ -// | Author: Lukas Smith <smith@pooteeweet.org> | +// | Authors: Lukas Smith <smith@pooteeweet.org> | +// | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.31 2007/01/14 13:28:45 quipo Exp $ +// $Id: mssql.php,v 1.32 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +54,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@dybnet.de> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common { @@ -181,17 +183,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); //$idxname = $db->quoteIdentifier($index_name, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.63 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.64 --- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.63 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.63 2006/12/19 23:08:39 quipo Exp $ +// $Id: mysql.php,v 1.64 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +53,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@pooteeweet.org> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common { @@ -161,17 +162,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); $query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = ".$db->quote($index_name)." */"; $result = $db->query($query); @@ -225,17 +230,19 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } $table = $db->quoteIdentifier($table, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysqli.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysqli.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.54 pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/mysqli.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: mysqli.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +53,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@pooteeweet.org> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common { @@ -215,17 +216,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); $query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = ".$db->quote($index_name)." */"; $result = $db->query($query); @@ -279,17 +284,19 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } $table = $db->quoteIdentifier($table, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.54 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: oci8.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -155,17 +155,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $definition = array(); $query = 'SELECT * FROM user_ind_columns'; @@ -207,20 +211,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } - $query = 'SELECT "all".constraint_type, cols.column_name'; $query.= ' FROM all_constraints "all", all_cons_columns cols'; $query.= ' WHERE ("all".table_name='.$db->quote($table, 'text').' OR "all".table_name='.$db->quote(strtoupper($table), 'text').')'; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/pgsql.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/pgsql.php diff -u pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.54 pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/pgsql.php Fri Feb 23 19:57:35 2007 @@ -43,7 +43,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: pgsql.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ require_once 'MDB2/Driver/Reverse/Common.php'; @@ -159,17 +159,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = 'SELECT relname, indkey FROM pg_index, pg_class'; $query.= ' WHERE pg_class.oid = pg_index.indexrelid'; $query.= " AND indisunique != 't' AND indisprimary != 't'"; @@ -206,17 +210,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = 'SELECT relname, indisunique, indisprimary, indkey FROM pg_index, pg_class'; $query.= ' WHERE pg_class.oid = pg_index.indexrelid'; $query.= " AND (indisunique = 't' OR indisprimary = 't')"; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/sqlite.php?r1=1.61&r2=1.62&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/sqlite.php diff -u pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.61 pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.62 --- pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.61 Thu Nov 16 09:36:15 2006 +++ pear/MDB2/MDB2/Driver/Reverse/sqlite.php Fri Feb 23 19:57:36 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.61 2006/11/16 09:36:15 quipo Exp $ +// $Id: sqlite.php,v 1.62 2007/02/23 19:57:36 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -121,9 +121,12 @@ /** * Get the stucture of a field into an array * - * @param string $table name of table that should be used in method - * @param string $field_name name of field that should be used in method - * @return mixed data array on success, a MDB2 error on failure + * @param string $table name of table that should be used in method + * @param string $field_name name of field that should be used in method + * @return mixed data array on success, a MDB2 error on failure. + * The returned array contains an array for each field definition, + * with (some of) these indices: + * [notnull] [nativetype] [length] [fixed] [default] [type] [mdb2type] * @access public */ function getTableFieldDefinition($table, $field_name) @@ -223,17 +226,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = "SELECT sql FROM sqlite_master WHERE type='index' AND "; if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $query.= "LOWER(name)=".$db->quote(strtolower($index_name), 'text')." AND LOWER(tbl_name)=".$db->quote(strtolower($table), 'text'); @@ -288,17 +295,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = "SELECT sql FROM sqlite_master WHERE type='index' AND "; if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $query.= "LOWER(name)=".$db->quote(strtolower($index_name), 'text')." AND LOWER(tbl_name)=".$db->quote(strtolower($table), 'text'); http://cvs.php.net/viewvc.cgi/pear/MDB2/package.php?r1=1.233&r2=1.234&diff_format=u Index: pear/MDB2/package.php diff -u pear/MDB2/package.php:1.233 pear/MDB2/package.php:1.234 --- pear/MDB2/package.php:1.233 Fri Feb 16 17:09:11 2007 +++ pear/MDB2/package.php Fri Feb 23 19:57:36 2007 @@ -20,6 +20,9 @@ - fixed bug #4854: Oracle Easy Connect syntax only works with array DSN - fixed bug #10105: inTransaction() was returning an incorrect value after a call to disconnect() or __destruct() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes - added tests http://cvs.php.net/viewvc.cgi/pear/MDB2/package_ibase.php?r1=1.111&r2=1.112&diff_format=u Index: pear/MDB2/package_ibase.php diff -u pear/MDB2/package_ibase.php:1.111 pear/MDB2/package_ibase.php:1.112 --- pear/MDB2/package_ibase.php:1.111 Thu Jan 25 19:09:07 2007 +++ pear/MDB2/package_ibase.php Fri Feb 23 19:57:36 2007 @@ -13,6 +13,9 @@ (thanks to Adam Harvey) - fixed bug #9943: MDB2_Driver_ibase install failing because wrong extension name (ibase instead of interbase) +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes EOT; http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mssql.php?r1=1.73&r2=1.74&diff_format=u Index: pear/MDB2/package_mssql.php diff -u pear/MDB2/package_mssql.php:1.73 pear/MDB2/package_mssql.php:1.74 --- pear/MDB2/package_mssql.php:1.73 Fri Jan 12 11:29:12 2007 +++ pear/MDB2/package_mssql.php Fri Feb 23 19:57:36 2007 @@ -42,6 +42,9 @@ - implemented getTableIndexDefinition() in the Reverse module - implemented getTriggerDefinition() in the Reverse module - implemented guid() in the Function module [globally unique identifier] +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysql.php?r1=1.96&r2=1.97&diff_format=u Index: pear/MDB2/package_mysql.php diff -u pear/MDB2/package_mysql.php:1.96 pear/MDB2/package_mysql.php:1.97 --- pear/MDB2/package_mysql.php:1.96 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/package_mysql.php Fri Feb 23 19:57:36 2007 @@ -17,6 +17,9 @@ - fixed bug #10033: beginTransaction() does not know server capabilities - fixed bug #10057: createConstraint() returns an error when the definition is incomplete - request #9451: you can set charset, collation, engine and comments in createSequence() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes note: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysqli.php?r1=1.99&r2=1.100&diff_format=u Index: pear/MDB2/package_mysqli.php diff -u pear/MDB2/package_mysqli.php:1.99 pear/MDB2/package_mysqli.php:1.100 --- pear/MDB2/package_mysqli.php:1.99 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/package_mysqli.php Fri Feb 23 19:57:36 2007 @@ -17,6 +17,9 @@ - fixed bug #10033: beginTransaction() does not know server capabilities - fixed bug #10057: createConstraint() returns an error when the definition is incomplete - request #9451: you can set charset, collation, engine and comments in createSequence() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_oci8.php?r1=1.100&r2=1.101&diff_format=u Index: pear/MDB2/package_oci8.php diff -u pear/MDB2/package_oci8.php:1.100 pear/MDB2/package_oci8.php:1.101 --- pear/MDB2/package_oci8.php:1.100 Sun Feb 4 00:00:50 2007 +++ pear/MDB2/package_oci8.php Fri Feb 23 19:57:36 2007 @@ -12,6 +12,9 @@ - added missing error code (bug #9780) - fixed bug #10003: integer length problem in getTypeDeclaration() in the Datatype module (thanks to priyadi at priyadi dot net) +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided note: - please use the latest ext/oci8 version from pecl.php.net/oci8 http://cvs.php.net/viewvc.cgi/pear/MDB2/package_pgsql.php?r1=1.98&r2=1.99&diff_format=u Index: pear/MDB2/package_pgsql.php diff -u pear/MDB2/package_pgsql.php:1.98 pear/MDB2/package_pgsql.php:1.99 --- pear/MDB2/package_pgsql.php:1.98 Wed Dec 20 07:30:03 2006 +++ pear/MDB2/package_pgsql.php Fri Feb 23 19:57:36 2007 @@ -10,6 +10,9 @@ - implemented getTriggerDefinition() in the Reverse module [experimental] - implemented listTableTriggers() in the Manager module - don't show catalog views in listViews() in the Manager module +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_sqlite.php?r1=1.78&r2=1.79&diff_format=u Index: pear/MDB2/package_sqlite.php diff -u pear/MDB2/package_sqlite.php:1.78 pear/MDB2/package_sqlite.php:1.79 --- pear/MDB2/package_sqlite.php:1.78 Sun Jan 21 08:48:13 2007 +++ pear/MDB2/package_sqlite.php Fri Feb 23 19:57:36 2007 @@ -8,6 +8,9 @@ $notes = <<<EOT - propagate errors in getTableFieldDefinition() in the Reverse module - fixed bug #9895: Error mapping broken since 5.2.0 +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes note:
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/Common.php?r1=1.32&r2=1.33&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/Common.php diff -u pear/MDB2/MDB2/Driver/Reverse/Common.php:1.32 pear/MDB2/MDB2/Driver/Reverse/Common.php:1.33 --- pear/MDB2/MDB2/Driver/Reverse/Common.php:1.32 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/Common.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.32 2006/12/19 23:08:39 quipo Exp $ +// $Id: Common.php,v 1.33 2007/02/23 19:57:35 quipo Exp $ // /** @@ -102,6 +102,8 @@ * * @param string $table name of table that should be used in method * @param string $index name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * The returned array has this structure: * </pre> @@ -117,7 +119,7 @@ * </pre> * @access public */ - function getTableIndexDefinition($table, $index) + function getTableIndexDefinition($table, $index, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { @@ -136,6 +138,8 @@ * * @param string $table name of table that should be used in method * @param string $index name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * The returned array has this structure: * <pre> @@ -152,7 +156,7 @@ * </pre> * @access public */ - function getTableConstraintDefinition($table, $index) + function getTableConstraintDefinition($table, $index, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { @@ -211,7 +215,7 @@ * * EXPERIMENTAL * - * WARNING: this function is experimental and may change the returned value + * WARNING: this function is experimental and may change the returned value * at any time until labelled as non-experimental * * @param string $trigger name of trigger that should be used in method @@ -244,6 +248,36 @@ } // }}} + // {{{ getViewDefinition() + + /** + * Get the structure of a view into an array + * + * @param string $view name of view that should be used in method + * @return mixed data array on success, a MDB2 error on failure + * The returned array has this structure: + * <pre> + * array ( + * [view_name] => 'view name', + * [fields] => array([field names]), + * [view_def] => 'view definition', + * ); + * </pre> + * + * @access public + function getViewDefinition($view) + { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + + return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, + 'method not implemented', __FUNCTION__); + } + */ + + // }}} // {{{ tableInfo() /** http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/ibase.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/ibase.php diff -u pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.63 pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.64 --- pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.63 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/ibase.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.63 2006/12/19 23:08:39 quipo Exp $ +// $Id: ibase.php,v 1.64 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -223,17 +223,22 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } $table = $db->quote(strtoupper($table), 'text'); - $index_name = $db->quote(strtoupper($db->getIndexName($index_name)), 'text'); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } + $index_name = $db->quote(strtoupper($index_name), 'text'); $query = "SELECT RDB\$INDEX_SEGMENTS.RDB\$FIELD_NAME AS field_name, RDB\$INDICES.RDB\$UNIQUE_FLAG AS unique_flag, RDB\$INDICES.RDB\$FOREIGN_KEY AS foreign_key, @@ -289,17 +294,22 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } $table = $db->quote(strtoupper($table), 'text'); - $index_name = $db->quote(strtoupper($db->getIndexName($index_name)), 'text'); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } + $index_name = $db->quote(strtoupper($index_name), 'text'); $query = "SELECT RDB\$INDEX_SEGMENTS.RDB\$FIELD_NAME AS field_name, RDB\$INDICES.RDB\$UNIQUE_FLAG AS unique_flag, RDB\$INDICES.RDB\$FOREIGN_KEY AS foreign_key, http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mssql.php?r1=1.31&r2=1.32&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mssql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.31 pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.32 --- pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.31 Sun Jan 14 13:28:45 2007 +++ pear/MDB2/MDB2/Driver/Reverse/mssql.php Fri Feb 23 19:57:35 2007 @@ -39,10 +39,11 @@ // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | // | POSSIBILITY OF SUCH DAMAGE. | // +----------------------------------------------------------------------+ -// | Author: Lukas Smith <smith@pooteeweet.org> | +// | Authors: Lukas Smith <smith@pooteeweet.org> | +// | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.31 2007/01/14 13:28:45 quipo Exp $ +// $Id: mssql.php,v 1.32 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +54,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@dybnet.de> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common { @@ -181,17 +183,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); //$idxname = $db->quoteIdentifier($index_name, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.63 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.64 --- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.63 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.63 2006/12/19 23:08:39 quipo Exp $ +// $Id: mysql.php,v 1.64 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +53,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@pooteeweet.org> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common { @@ -161,17 +162,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); $query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = ".$db->quote($index_name)." */"; $result = $db->query($query); @@ -225,17 +230,19 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } $table = $db->quoteIdentifier($table, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mysqli.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/mysqli.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.54 pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/mysqli.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: mysqli.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -53,6 +53,7 @@ * @package MDB2 * @category Database * @author Lukas Smith <smith@pooteeweet.org> + * @author Lorenzo Alberton <l.alberton@quipo.it> */ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common { @@ -215,17 +216,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $table = $db->quoteIdentifier($table, true); $query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = ".$db->quote($index_name)." */"; $result = $db->query($query); @@ -279,17 +284,19 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } $table = $db->quoteIdentifier($table, true); http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.54 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Fri Feb 23 19:57:35 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: oci8.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -155,17 +155,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $definition = array(); $query = 'SELECT * FROM user_ind_columns'; @@ -207,20 +211,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - if (strtolower($index_name) != 'primary') { + if (strtolower($index_name) != 'primary' && $format_index_name) { $index_name = $db->getIndexName($index_name); } - $query = 'SELECT "all".constraint_type, cols.column_name'; $query.= ' FROM all_constraints "all", all_cons_columns cols'; $query.= ' WHERE ("all".table_name='.$db->quote($table, 'text').' OR "all".table_name='.$db->quote(strtoupper($table), 'text').')'; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/pgsql.php?r1=1.54&r2=1.55&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/pgsql.php diff -u pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.54 pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.55 --- pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.54 Tue Dec 19 23:08:39 2006 +++ pear/MDB2/MDB2/Driver/Reverse/pgsql.php Fri Feb 23 19:57:35 2007 @@ -43,7 +43,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.54 2006/12/19 23:08:39 quipo Exp $ +// $Id: pgsql.php,v 1.55 2007/02/23 19:57:35 quipo Exp $ require_once 'MDB2/Driver/Reverse/Common.php'; @@ -159,17 +159,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = 'SELECT relname, indkey FROM pg_index, pg_class'; $query.= ' WHERE pg_class.oid = pg_index.indexrelid'; $query.= " AND indisunique != 't' AND indisprimary != 't'"; @@ -206,17 +210,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = 'SELECT relname, indisunique, indisprimary, indkey FROM pg_index, pg_class'; $query.= ' WHERE pg_class.oid = pg_index.indexrelid'; $query.= " AND (indisunique = 't' OR indisprimary = 't')"; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/sqlite.php?r1=1.61&r2=1.62&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/sqlite.php diff -u pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.61 pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.62 --- pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.61 Thu Nov 16 09:36:15 2006 +++ pear/MDB2/MDB2/Driver/Reverse/sqlite.php Fri Feb 23 19:57:36 2007 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.61 2006/11/16 09:36:15 quipo Exp $ +// $Id: sqlite.php,v 1.62 2007/02/23 19:57:36 quipo Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -121,9 +121,12 @@ /** * Get the stucture of a field into an array * - * @param string $table name of table that should be used in method - * @param string $field_name name of field that should be used in method - * @return mixed data array on success, a MDB2 error on failure + * @param string $table name of table that should be used in method + * @param string $field_name name of field that should be used in method + * @return mixed data array on success, a MDB2 error on failure. + * The returned array contains an array for each field definition, + * with (some of) these indices: + * [notnull] [nativetype] [length] [fixed] [default] [type] [mdb2type] * @access public */ function getTableFieldDefinition($table, $field_name) @@ -223,17 +226,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableIndexDefinition($table, $index_name) + function getTableIndexDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = "SELECT sql FROM sqlite_master WHERE type='index' AND "; if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $query.= "LOWER(name)=".$db->quote(strtolower($index_name), 'text')." AND LOWER(tbl_name)=".$db->quote(strtolower($table), 'text'); @@ -288,17 +295,21 @@ * * @param string $table name of table that should be used in method * @param string $index_name name of index that should be used in method + * @param boolean $format_index_name if FALSE, the 'idxname_format' option + * is not applied and the index name is used as-is * @return mixed data array on success, a MDB2 error on failure * @access public */ - function getTableConstraintDefinition($table, $index_name) + function getTableConstraintDefinition($table, $index_name, $format_index_name = true) { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; } - $index_name = $db->getIndexName($index_name); + if ($format_index_name) { + $index_name = $db->getIndexName($index_name); + } $query = "SELECT sql FROM sqlite_master WHERE type='index' AND "; if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $query.= "LOWER(name)=".$db->quote(strtolower($index_name), 'text')." AND LOWER(tbl_name)=".$db->quote(strtolower($table), 'text'); http://cvs.php.net/viewvc.cgi/pear/MDB2/package.php?r1=1.233&r2=1.234&diff_format=u Index: pear/MDB2/package.php diff -u pear/MDB2/package.php:1.233 pear/MDB2/package.php:1.234 --- pear/MDB2/package.php:1.233 Fri Feb 16 17:09:11 2007 +++ pear/MDB2/package.php Fri Feb 23 19:57:36 2007 @@ -20,6 +20,9 @@ - fixed bug #4854: Oracle Easy Connect syntax only works with array DSN - fixed bug #10105: inTransaction() was returning an incorrect value after a call to disconnect() or __destruct() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes - added tests http://cvs.php.net/viewvc.cgi/pear/MDB2/package_ibase.php?r1=1.111&r2=1.112&diff_format=u Index: pear/MDB2/package_ibase.php diff -u pear/MDB2/package_ibase.php:1.111 pear/MDB2/package_ibase.php:1.112 --- pear/MDB2/package_ibase.php:1.111 Thu Jan 25 19:09:07 2007 +++ pear/MDB2/package_ibase.php Fri Feb 23 19:57:36 2007 @@ -13,6 +13,9 @@ (thanks to Adam Harvey) - fixed bug #9943: MDB2_Driver_ibase install failing because wrong extension name (ibase instead of interbase) +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes EOT; http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mssql.php?r1=1.73&r2=1.74&diff_format=u Index: pear/MDB2/package_mssql.php diff -u pear/MDB2/package_mssql.php:1.73 pear/MDB2/package_mssql.php:1.74 --- pear/MDB2/package_mssql.php:1.73 Fri Jan 12 11:29:12 2007 +++ pear/MDB2/package_mssql.php Fri Feb 23 19:57:36 2007 @@ -42,6 +42,9 @@ - implemented getTableIndexDefinition() in the Reverse module - implemented getTriggerDefinition() in the Reverse module - implemented guid() in the Function module [globally unique identifier] +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysql.php?r1=1.96&r2=1.97&diff_format=u Index: pear/MDB2/package_mysql.php diff -u pear/MDB2/package_mysql.php:1.96 pear/MDB2/package_mysql.php:1.97 --- pear/MDB2/package_mysql.php:1.96 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/package_mysql.php Fri Feb 23 19:57:36 2007 @@ -17,6 +17,9 @@ - fixed bug #10033: beginTransaction() does not know server capabilities - fixed bug #10057: createConstraint() returns an error when the definition is incomplete - request #9451: you can set charset, collation, engine and comments in createSequence() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes note: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysqli.php?r1=1.99&r2=1.100&diff_format=u Index: pear/MDB2/package_mysqli.php diff -u pear/MDB2/package_mysqli.php:1.99 pear/MDB2/package_mysqli.php:1.100 --- pear/MDB2/package_mysqli.php:1.99 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/package_mysqli.php Fri Feb 23 19:57:36 2007 @@ -17,6 +17,9 @@ - fixed bug #10033: beginTransaction() does not know server capabilities - fixed bug #10057: createConstraint() returns an error when the definition is incomplete - request #9451: you can set charset, collation, engine and comments in createSequence() +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_oci8.php?r1=1.100&r2=1.101&diff_format=u Index: pear/MDB2/package_oci8.php diff -u pear/MDB2/package_oci8.php:1.100 pear/MDB2/package_oci8.php:1.101 --- pear/MDB2/package_oci8.php:1.100 Sun Feb 4 00:00:50 2007 +++ pear/MDB2/package_oci8.php Fri Feb 23 19:57:36 2007 @@ -12,6 +12,9 @@ - added missing error code (bug #9780) - fixed bug #10003: integer length problem in getTypeDeclaration() in the Datatype module (thanks to priyadi at priyadi dot net) +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided note: - please use the latest ext/oci8 version from pecl.php.net/oci8 http://cvs.php.net/viewvc.cgi/pear/MDB2/package_pgsql.php?r1=1.98&r2=1.99&diff_format=u Index: pear/MDB2/package_pgsql.php diff -u pear/MDB2/package_pgsql.php:1.98 pear/MDB2/package_pgsql.php:1.99 --- pear/MDB2/package_pgsql.php:1.98 Wed Dec 20 07:30:03 2006 +++ pear/MDB2/package_pgsql.php Fri Feb 23 19:57:36 2007 @@ -10,6 +10,9 @@ - implemented getTriggerDefinition() in the Reverse module [experimental] - implemented listTableTriggers() in the Manager module - don't show catalog views in listViews() in the Manager module +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/package_sqlite.php?r1=1.78&r2=1.79&diff_format=u Index: pear/MDB2/package_sqlite.php diff -u pear/MDB2/package_sqlite.php:1.78 pear/MDB2/package_sqlite.php:1.79 --- pear/MDB2/package_sqlite.php:1.78 Sun Jan 21 08:48:13 2007 +++ pear/MDB2/package_sqlite.php Fri Feb 23 19:57:36 2007 @@ -8,6 +8,9 @@ $notes = <<<EOT - propagate errors in getTableFieldDefinition() in the Reverse module - fixed bug #9895: Error mapping broken since 5.2.0 +- added a new boolean parameter to getTableIndexDefinition() and + getTableConstraintDefinition() in the Reverse module to disable the 'idxname_format' + option and use the index name as provided - phpdoc fixes note: