Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/datadict/datadict-mysql.inc.php

    r2 r34  
    22 
    33/** 
    4   V4.51 29 July 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved. 
     4  V4.94 23 Jan 2007  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 
    55  Released under both BSD license and Lesser GPL library license.  
    66  Whenever there is any discrepancy between the two licenses,  
     
    2121         
    2222        var $dropIndex = 'DROP INDEX %s ON %s'; 
     23        var $renameColumn = 'ALTER TABLE %s CHANGE COLUMN %s %s %s';    // needs column-definition! 
    2324         
    2425        function MetaType($t,$len=-1,$fieldobj=false) 
     
    2930                        $len = $fieldobj->max_length; 
    3031                } 
     32                $is_serial = is_object($fieldobj) && $fieldobj->primary_key && $fieldobj->auto_increment; 
    3133                 
    3234                $len = -1; // mysql max_length is not accurate 
     
    6668                         
    6769                case 'INT':  
    68                 case 'INTEGER': return (!empty($fieldobj->primary_key)) ? 'R' : 'I'; 
    69                 case 'TINYINT': return (!empty($fieldobj->primary_key)) ? 'R' : 'I1'; 
    70                 case 'SMALLINT': return (!empty($fieldobj->primary_key)) ? 'R' : 'I2'; 
    71                 case 'MEDIUMINT': return (!empty($fieldobj->primary_key)) ? 'R' : 'I4'; 
    72                 case 'BIGINT':  return (!empty($fieldobj->primary_key)) ? 'R' : 'I8'; 
     70                case 'INTEGER': return $is_serial ? 'R' : 'I'; 
     71                case 'TINYINT': return $is_serial ? 'R' : 'I1'; 
     72                case 'SMALLINT': return $is_serial ? 'R' : 'I2'; 
     73                case 'MEDIUMINT': return $is_serial ? 'R' : 'I4'; 
     74                case 'BIGINT':  return $is_serial ? 'R' : 'I8'; 
    7375                default: return 'N'; 
    7476                } 
     
    7981                switch(strtoupper($meta)) { 
    8082                case 'C': return 'VARCHAR'; 
    81                 case 'XL': 
    82                 case 'X': return 'LONGTEXT'; 
     83                case 'XL':return 'LONGTEXT'; 
     84                case 'X': return 'TEXT'; 
    8385                 
    8486                case 'C2': return 'VARCHAR'; 
     
    9294                 
    9395                case 'R': 
     96                case 'I4': 
    9497                case 'I': return 'INTEGER'; 
    9598                case 'I1': return 'TINYINT'; 
    9699                case 'I2': return 'SMALLINT'; 
    97                 case 'I4': return 'MEDIUMINT'; 
    98100                case 'I8': return 'BIGINT'; 
    99101                 
Note: See TracChangeset for help on using the changeset viewer.