Skip to content
Browse files

MDL-21868 mssql generator - be a bot more specific (both must be inte…

…gers)
  • Loading branch information...
1 parent 32feeb0 commit 68323795b89f7f9920a469fee0861ccf379b3bf1 @stronk7 stronk7 committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/xmldb/classes/generators/mssql/mssql.class.php
View
4 lib/xmldb/classes/generators/mssql/mssql.class.php
@@ -304,9 +304,9 @@ function getAlterFieldSQL($xmldb_table, $xmldb_field) {
$typechanged = false;
}
- /// If the new field specs are for integer, lett's be a bit more specific diferentiating
+ /// If the new (and old) field specs are for integer, let's be a bit more specific diferentiating
/// types of integers. Else, some combinations can cause things like MDL-21868
- if ($xmldb_field->getType() == XMLDB_TYPE_INTEGER) {
+ if ($xmldb_field->getType() == XMLDB_TYPE_INTEGER && substr($oldmetatype, 0, 1) == 'I') {
if ($xmldb_field->getLength() > 9) { // Convert our new lenghts to detailed meta types
$newmssqlinttype = 'I8';
} else if ($xmldb_field->getLength() > 4) {

0 comments on commit 6832379

Please sign in to comment.
Something went wrong with that request. Please try again.