MINOR: MSSQL stub function created for Postgres-specific functionality

This commit is contained in:
Geoff Munn 2011-01-12 02:05:32 +00:00
parent c104222019
commit 7ea6652e56

View File

@ -569,6 +569,7 @@ class MSSQLDatabase extends SS_Database {
and c.name = '$colName'")->value();
}
/**
* Get enum values from a constraint check clause.
* @param string $clause Check clause to parse values from
@ -581,6 +582,7 @@ class MSSQLDatabase extends SS_Database {
$bits = preg_split('/ *= */', $segment);
for($i = 1; $i < sizeof($bits); $i += 2) {
array_unshift($constraints, substr(rtrim($bits[$i], ')'), 1, -1));
}
}
return $constraints;
@ -637,6 +639,8 @@ class MSSQLDatabase extends SS_Database {
//NOTE: 'with nocheck' seems to solve a few problems I've been having for modifying existing tables.
$alterCol .= ";\n$prefix WITH NOCHECK ADD CONSTRAINT \"{$tableName}_{$colName}_check\" $matches[4]";
}
}
}
@ -778,6 +782,18 @@ class MSSQLDatabase extends SS_Database {
return $output;
}
/**
*
* This is a stub function. Postgres caches the fieldlist results.
*
* @param string $tableName
*
* @return boolean
*/
function clear_cached_fieldlist($tableName=false){
return true;
}
/**
* Create an index on a table.
* @param string $tableName The name of the table.
@ -1254,6 +1270,7 @@ class MSSQLDatabase extends SS_Database {
function addslashes($value){
$value=str_replace("'","''",$value);
$value=str_replace("\0","[NULL]",$value);
return $value;
}
@ -1692,7 +1709,6 @@ class MSSQLQuery extends SS_Query {
public function numRecords() {
if(!is_resource($this->handle)) return false;
if($this->mssql) {
return mssql_num_rows($this->handle);
} else {
@ -1706,6 +1722,7 @@ class MSSQLQuery extends SS_Query {
}
public function nextRecord() {
if(!is_resource($this->handle)) return false;
// Coalesce rather than replace common fields.