From af7bffbb3d2d4aeac3040337dd27db5407e68833 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 21 Jul 2015 12:53:48 +0000 Subject: [PATCH] catch SQL error "Illegal mix of collations" caused by non-ascii chars compared with ascii field uid --- addressbook/inc/class.addressbook_sql.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 911d333377..51ab7830c2 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -740,7 +740,15 @@ class addressbook_sql extends so_sql_cf { $keys = array('uid' => $keys); } - $contact = parent::read($keys,$extra_cols,$join); + try { + $contact = parent::read($keys,$extra_cols,$join); + } + // catch Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (1267) + // caused by non-ascii chars compared with ascii field uid + catch(egw_exception_db $e) { + _egw_log_exception($e); + return false; + } // enforce a minium uid strength if (is_array($contact) && (!isset($contact['uid'])