Permalink
Browse files

MDL-34081 dml: mssql driver was using case insensitve sql

  • Loading branch information...
1 parent 50dfe52 commit 4a9727aa23a763024b736ff1deee636e855de649 @danpoltawski danpoltawski committed with stronk7 Jun 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/dml/mssql_native_moodle_database.php
@@ -335,7 +335,7 @@ public function get_tables($usecache=true) {
}
$this->tables = array();
$sql = "SELECT table_name
- FROM information_schema.tables
+ FROM INFORMATION_SCHEMA.TABLES
WHERE table_name LIKE '$this->prefix%'
AND table_type = 'BASE TABLE'";
$this->query_start($sql, null, SQL_QUERY_AUX);
@@ -427,7 +427,7 @@ public function get_columns($table, $usecache=true) {
columnproperty(object_id(quotename(table_schema) + '.' +
quotename(table_name)), column_name, 'IsIdentity') AS auto_increment,
column_default AS default_value
- FROM information_schema.columns
+ FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = '{" . $table . "}'
ORDER BY ordinal_position";
} else { // temp table, get metadata from tempdb schema
@@ -440,7 +440,7 @@ public function get_columns($table, $usecache=true) {
columnproperty(object_id(quotename(table_schema) + '.' +
quotename(table_name)), column_name, 'IsIdentity') AS auto_increment,
column_default AS default_value
- FROM tempdb.information_schema.columns
+ FROM tempdb.INFORMATION_SCHEMA.COLUMNS
JOIN tempdb..sysobjects ON name = table_name
WHERE id = object_id('tempdb..{" . $table . "}')
ORDER BY ordinal_position";

0 comments on commit 4a9727a

Please sign in to comment.