From: stronk7 Date: Mon, 9 Oct 2006 22:55:55 +0000 (+0000) Subject: Add odbc_msql dbtype to a bunch of places. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=97ab73aad4ce7d7913b1642233eb3eb5261e2496;p=moodle.git Add odbc_msql dbtype to a bunch of places. --- diff --git a/admin/environment.xml b/admin/environment.xml index 36f41e67b3..90f4dc0de2 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -44,6 +44,7 @@ + diff --git a/lib/dmllib.php b/lib/dmllib.php index d8d06a41f7..b1709ff0d1 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1424,6 +1424,7 @@ function sql_order_by_text($fieldname, $numchars=32) { switch ($CFG->dbtype) { case 'mssql': + case 'odbc_mssql': return 'CONVERT(varchar, ' . $fieldname . ', ' . $numchars . ')'; break; case 'oci8po': @@ -1574,6 +1575,7 @@ function configure_dbconnection() { } break; case 'mssql': + case 'odbc_mssql': /// No need to set charset. It must be specified in the driver conf /// Allow quoted identifiers $db->Execute('SET QUOTED_IDENTIFIER ON'); diff --git a/lib/setuplib.php b/lib/setuplib.php index 4ac9ef33af..5820ebf26e 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -118,6 +118,7 @@ function setup_is_unicodedb() { } break; case 'mssql': + case 'odbc_mssql': /// MSSQL only runs under UTF8 + the proper ODBTP driver (both for Unix and Win32) $unicodedb = true; break; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 722b83c56a..5f3507f9e3 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1577,7 +1577,7 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC", } //TODO: there must be a nice way to do this that keeps both postgres and mysql 3.2x happy but I can't find it right now. - if ($CFG->dbtype == 'postgres7' || $CFG->dbtype == 'mssql' || $CFG->dbtype == 'oci8po') { + if ($CFG->dbtype == 'postgres7' || $CFG->dbtype == 'mssql' || $CFG->dbtype == 'odbc_mssql' || $CFG->dbtype == 'oci8po') { return get_records_sql("SELECT $postdata, d.name, d.timemodified, d.usermodified, d.groupid, u.firstname, u.lastname, u.email, u.picture $umfields FROM {$CFG->prefix}forum_discussions d