Author: ralfbecker
New Revision: 31998
URL: http://www.egroupware.org/viewvc/egroupware?rev=31998&view=rev
Log:
fix for postgreSQL bug reported by Anthony Messina (amessina-at-messinet.com): sync_contentid is varchar(60) and need explicit cast: added egw_db->to_int($expr)
Modified:
trunk/calendar/setup/tables_update.inc.php
trunk/phpgwapi/inc/class.egw_db.inc.php
Modified: trunk/calendar/setup/tables_update.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/calendar/setup/tables_update.inc.php?rev=31998&r1=31997&r2=31998&view=diff
— trunk/calendar/setup/tables_update.inc.php (original)
+++ trunk/calendar/setup/tables_update.inc.php Fri Sep 10 09:11:22 2010
@@ -2145,7 +2145,7 @@
),array(
‘cal_deleted’ => 'CASE cal_deleted WHEN ‘.$GLOBALS[‘egw_setup’]->db->quote(true,‘bool’).’ THEN ‘.
’(SELECT '.$GLOBALS[‘egw_setup’]->db->unix_timestamp(‘sync_deleted’).
-
" FROM egw_api_content_history WHERE sync_appname='calendar' AND sync_contentid=cal_id)".
-
));" FROM egw_api_content_history WHERE sync_appname='calendar' AND ".$GLOBALS['egw_setup']->db->to_int('sync_contentid').'=cal_id)'. ' ELSE NULL END',
Modified: trunk/phpgwapi/inc/class.egw_db.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/inc/class.egw_db.inc.php?rev=31998&r1=31997&r2=31998&view=diff
— trunk/phpgwapi/inc/class.egw_db.inc.php (original)
+++ trunk/phpgwapi/inc/class.egw_db.inc.php Fri Sep 10 09:11:22 2010
@@ -1312,6 +1312,22 @@
}
return false;
}
+
-
/**
-
- Cast a column or sql expression to integer, necessary at least for postgreSQL
-
-
- @param string $expr
-
- @return string
-
*/
-
function to_int($expr)
-
{
-
switch($this->Type) -
{ -
case 'pgsql': -
return $expr.'::integer'; -
} -
return $expr; -
}
/**
- Correctly Quote Identifiers like table- or colmnnames for use in SQL-statements
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs