From 1d519c483466969fc3fcdc563cd12d4a2948c44a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 13 Aug 2012 13:13:57 +0000 Subject: [PATCH] MAX(CHAR_LENGTH(cal_description)) returns NULL, if there are no rows --> casting to int --- calendar/setup/tables_update.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calendar/setup/tables_update.inc.php b/calendar/setup/tables_update.inc.php index d2295eeea1..f85bb56adb 100644 --- a/calendar/setup/tables_update.inc.php +++ b/calendar/setup/tables_update.inc.php @@ -2134,7 +2134,8 @@ function calendar_upgrade1_9_005() { // only alter description to varchar(16384), if it does NOT contain longer input and it can be stored as varchar $max_description_length = $GLOBALS['egw']->db->query('SELECT MAX(CHAR_LENGTH(cal_description)) FROM egw_cal')->fetchColumn(); - if (is_numeric($max_description_length) && $max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384) + // returns NULL, if there are no rows! + if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384) { $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_description',array( 'type' => 'varchar',