|
From: Florin C B. <ory...@us...> - 2014-05-16 18:02:08
|
Update of /cvsroot/mxbb/core/includes/db In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14790/includes/db Modified Files: mysql.php mysql4.php mysqli.php Log Message: Some fixes for internal Backend Index: mysql.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mysql.php 28 Jun 2013 15:33:26 -0000 1.26 --- mysql.php 16 May 2014 18:02:05 -0000 1.27 *************** *** 48,54 **** $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; ! $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link); ! if ($this->db_connect_id && $this->dbname != '') { --- 48,54 ---- $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; ! $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link); ! if ($this->db_connect_id && $this->dbname != '') { *************** *** 57,71 **** // Determine what version we are using and if it natively supports UNICODE $this->mysql_version = mysql_get_server_info($this->db_connect_id); ! if (version_compare($this->mysql_version, '4.1.3', '>=')) { $this->sql_layer = 'mysql4'; ! ! if (UTF_STATUS === 'phpbb3') { @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); // enforce strict mode on databases that support it } ! if (version_compare($this->mysql_version, '5.0.2', '>=')) { --- 57,71 ---- // Determine what version we are using and if it natively supports UNICODE $this->mysql_version = mysql_get_server_info($this->db_connect_id); ! if (version_compare($this->mysql_version, '4.1.3', '>=')) { $this->sql_layer = 'mysql4'; ! ! if (DBCHARACTER_SET === 'uft8') { @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); // enforce strict mode on databases that support it } ! if (version_compare($this->mysql_version, '5.0.2', '>=')) { *************** *** 74,78 **** @mysql_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); ! // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES if (!in_array('TRADITIONAL', $modes)) --- 74,78 ---- @mysql_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); ! // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES if (!in_array('TRADITIONAL', $modes)) *************** *** 82,86 **** $modes[] = 'STRICT_ALL_TABLES'; } ! if (!in_array('STRICT_TRANS_TABLES', $modes)) { --- 82,86 ---- $modes[] = 'STRICT_ALL_TABLES'; } ! if (!in_array('STRICT_TRANS_TABLES', $modes)) { *************** *** 88,92 **** } } ! $mode = implode(',', $modes); @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id); --- 88,92 ---- } } ! $mode = implode(',', $modes); @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id); *************** *** 101,105 **** $this->sql_layer = 'mysql'; } - return $this->db_connect_id; } --- 101,104 ---- Index: mysql4.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql4.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** mysql4.php 28 Jun 2013 15:33:26 -0000 1.24 --- mysql4.php 16 May 2014 18:02:05 -0000 1.25 *************** *** 51,59 **** $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; ! $this->sql_layer = 'mysql4'; $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link); ! if ($this->db_connect_id && $this->dbname != '') { --- 51,59 ---- $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; ! $this->sql_layer = 'mysql4'; $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link); ! if ($this->db_connect_id && $this->dbname != '') { *************** *** 62,74 **** // Determine what version we are using and if it natively supports UNICODE $this->mysql_version = mysql_get_server_info($this->db_connect_id); ! if (version_compare($this->mysql_version, '4.1.3', '>=')) { ! if (defined('UTF_STATUS') && (UTF_STATUS === 'phpbb3')) { @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); // enforce strict mode on databases that support it } ! if (version_compare($this->mysql_version, '5.0.2', '>=')) { --- 62,74 ---- // Determine what version we are using and if it natively supports UNICODE $this->mysql_version = mysql_get_server_info($this->db_connect_id); ! if (version_compare($this->mysql_version, '4.1.3', '>=')) { ! if (defined('DBCHARACTER_SET') && (DBCHARACTER_SET === 'uft8')) { @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); // enforce strict mode on databases that support it } ! if (version_compare($this->mysql_version, '5.0.2', '>=')) { *************** *** 77,81 **** @mysql_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); - // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES if (!in_array('TRADITIONAL', $modes)) --- 77,80 ---- *************** *** 85,89 **** $modes[] = 'STRICT_ALL_TABLES'; } - if (!in_array('STRICT_TRANS_TABLES', $modes)) { --- 84,87 ---- *************** *** 91,99 **** } } - $mode = implode(',', $modes); @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id); } - } else if (version_compare($this->mysql_version, '4.0.0', '>=')) --- 89,95 ---- *************** *** 105,113 **** $this->sql_layer = 'mysql'; } - return $this->db_connect_id; } } - return $this->sql_error(''); } --- 101,107 ---- Index: mysqli.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysqli.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** mysqli.php 28 Jun 2013 15:33:26 -0000 1.27 --- mysqli.php 16 May 2014 18:02:06 -0000 1.28 *************** *** 49,60 **** $this->dbname = $database; $port = (!$port) ? NULL : $port; ! // Persistant connections not supported by the mysqli extension? $this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port); - if ($this->db_connect_id && $this->dbname != '') { ! // mysqli only supported by phpBB3 ! if (defined('UTF_STATUS') && (UTF_STATUS === 'phpbb3')) { mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); // enforce strict mode on databases that support it --- 49,59 ---- $this->dbname = $database; $port = (!$port) ? NULL : $port; ! // Persistant connections not supported by the mysqli extension? $this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port); if ($this->db_connect_id && $this->dbname != '') { ! // mysqli extension is only supported by mysql v. 4.1+ ! if (defined('DBCHARACTER_SET') && (DBCHARACTER_SET === 'utf8')) { mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); // enforce strict mode on databases that support it *************** *** 66,70 **** mysqli_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); - // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES if (!in_array('TRADITIONAL', $modes)) --- 65,68 ---- *************** *** 74,78 **** $modes[] = 'STRICT_ALL_TABLES'; } - if (!in_array('STRICT_TRANS_TABLES', $modes)) { --- 72,75 ---- *************** *** 80,84 **** } } - $mode = implode(',', $modes); @mysqli_query($this->db_connect_id, "SET SESSION sql_mode='{$mode}'"); --- 77,80 ---- *************** *** 86,90 **** return $this->db_connect_id; } - return $this->sql_error(''); } --- 82,85 ---- |