MDL-29313 enforce varchar size limit

This commit is contained in:
Petr Skoda
2011-09-11 20:30:42 +02:00
parent b2cfdcf697
commit 257ad88f89
7 changed files with 119 additions and 8 deletions

View File

@ -280,7 +280,7 @@ class postgres_sql_generator extends sql_generator {
$results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' DROP DEFAULT'; /// Drop default clause
}
$alterstmt = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $this->getEncQuoted($xmldb_field->getName()) .
' TYPE' . $this->getFieldSQL($xmldb_field, null, true, true, null, false);
' TYPE' . $this->getFieldSQL($xmldb_table, $xmldb_field, null, true, true, null, false);
/// Some castings must be performed explicity (mainly from text|char to numeric|integer)
if (($oldmetatype == 'C' || $oldmetatype == 'X') &&
($xmldb_field->getType() == XMLDB_TYPE_NUMBER || $xmldb_field->getType() == XMLDB_TYPE_FLOAT)) {