]> git.mjollnir.org Git - moodle.git/commitdiff
XMLDB_UNSIGNED only applicable to number types. MDL-11662
authorstronk7 <stronk7>
Sat, 8 Dec 2007 18:20:15 +0000 (18:20 +0000)
committerstronk7 <stronk7>
Sat, 8 Dec 2007 18:20:15 +0000 (18:20 +0000)
Merged from MOODLE_19_STABLE

lib/xmldb/classes/XMLDBField.class.php

index b99a48c14123c603355fc7123ccdf02119ae6564..309d5c7d3d6abdddb712ff4f5574148c9d1397bb 100644 (file)
@@ -789,9 +789,10 @@ class XMLDBField extends XMLDBObject {
         } else {
             $result .= 'null, ';
         }
-    /// Unsigned
+    /// Unsigned (only applicable to numbers)
         $unsigned = $this->getUnsigned();
-        if (!empty($unsigned)) {
+        if (!empty($unsigned) &&
+           ($this->getType() == XMLDB_TYPE_INTEGER || $this->getType() == XMLDB_TYPE_NUMBER || $this->getType() == XMLDB_TYPE_FLOAT)) {
             $result .= 'XMLDB_UNSIGNED' . ', ';
         } else {
             $result .= 'null, ';