From 9ac919dad1b02042493d765f85511ab0221671c3 Mon Sep 17 00:00:00 2001
From: Christian Weber
Date: Fri, 30 Dec 2011 17:49:19 +0000
Subject: check return code of mysql_set_charset()

---
 it_dbi.class | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/it_dbi.class b/it_dbi.class
index 09ff18d..04206ca 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -226,7 +226,8 @@ function _connect($p = array())
 		
 		# set charset used for this connection
 		if ($p['charset'])
-			mysql_set_charset($p['charset'], $this->_link);
+			if (!mysql_set_charset($p['charset'], $this->_link))
+				$this->_fatal("_connect(): can't set charset \"{$p['charset']}\"");
 
 		# NOTE: This overwrites old state but that is on purpose. New link means we should refetch all info about connection
 		$state['link'] = $this->_link;
-- 
cgit v1.2.3