Permalink
Browse files

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

  • Loading branch information...
1 parent 1a76bbe commit d9edd25111a4447ec6212c44eb44175ae4682afd @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
@@ -331,7 +331,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);
@@ -426,7 +426,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
@@ -439,7 +439,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 d9edd25

Please sign in to comment.