[Vtigercrm-commits] [vtiger development] #6174: unsupported dbtype "mysqlt" exception @ sql_concat

vtiger development vtiger-tickets at trac.vtiger.com
Fri Jul 17 12:15:00 EDT 2009


#6174: unsupported dbtype "mysqlt" exception @ sql_concat
------------------------+---------------------------------------------------
 Reporter:  R.Cohen     |       Owner:  developer
     Type:  defect      |      Status:  new      
 Priority:  unassigned  |   Milestone:  5.1.0    
Component:  vtigercrm   |     Version:  5.1.0-rc 
 Keywords:              |  
------------------------+---------------------------------------------------
 Bug in code, does not test for dbtype correctly. PearDatabase.php Line 773

 {{{
     function sql_concat($list) {
             switch ($this->dbType) {
                     case 'mysql':
                             return 'concat('.implode(',',$list).')';
                     case 'pgsql':
                             return '('.implode('||',$list).')';
                     default:
                             throw new Exception("unsupported dbtype
 \"".$this->dbType."\"");
             }
 }}}

 should be more like:


 {{{
  function sql_concat($list) {
         if ($this->isMySQL())
                 return 'concat('.implode(',',$list).')';
         if ($this->isPostgres())
                 return '('.implode('||',$list).')';

         // For others (Oracle?)
         return 'concat('.implode(',',$list).')';
     }
 }}}

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6174>
vtiger development <http://trac.vtiger.com/>
vtigerCRM




More information about the vtigercrm-commits mailing list