MDL-27982 remove unsigned support from all UIs and APIs, keep only public API for BC
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
c3dd6b01fe
commit
7e522ccbc8
@@ -23,8 +23,7 @@
|
||||
|
||||
/**
|
||||
* reporting about the ones not physically implemented as BIGINTs
|
||||
* and providing one SQL script to fix all them. Also, under MySQL,
|
||||
* it performs one check of signed bigints. MDL-11038
|
||||
* and providing one SQL script to fix all them. MDL-11038
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage xmldb
|
||||
@@ -53,7 +52,6 @@ class check_bigints extends XMLDBCheckAction {
|
||||
'wrongints' => 'tool_xmldb',
|
||||
'nowrongintsfound' => 'tool_xmldb',
|
||||
'yeswrongintsfound' => 'tool_xmldb',
|
||||
'mysqlextracheckbigints' => 'tool_xmldb',
|
||||
));
|
||||
|
||||
// Correct fields must be type bigint for MySQL and int8 for PostgreSQL
|
||||
@@ -90,8 +88,8 @@ class check_bigints extends XMLDBCheckAction {
|
||||
$metacolumn = $metacolumns[$xmldb_field->getName()];
|
||||
// Going to check this field in DB
|
||||
$o.=' <li>' . $this->str['field'] . ': ' . $xmldb_field->getName() . ' ';
|
||||
// Detect if the physical field is wrong and, under mysql, check for incorrect signed fields too
|
||||
if ($metacolumn->type != $this->correct_type || ($this->dbfamily == 'mysql' && $xmldb_field->getUnsigned() && !$metacolumn->unsigned)) {
|
||||
// Detect if the physical field is wrong
|
||||
if ($metacolumn->type != $this->correct_type) {
|
||||
$o.='<font color="red">' . $this->str['wrong'] . '</font>';
|
||||
// Add the wrong field to the list
|
||||
$obj = new stdClass();
|
||||
|
||||
@@ -88,7 +88,7 @@ class create_xml_file extends XMLDBAction {
|
||||
$c.= ' <TABLES>' . "\n";
|
||||
$c.= ' <TABLE NAME="' . $xmltable . '" COMMENT="Default comment for ' . $xmltable .', please edit me">' . "\n";
|
||||
$c.= ' <FIELDS>' . "\n";
|
||||
$c.= ' <FIELD NAME="id" TYPE="int" LENGTH="10" UNSIGNED="true" NOTNULL="true" SEQUENCE="true" />' . "\n";
|
||||
$c.= ' <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />' . "\n";
|
||||
$c.= ' </FIELDS>' . "\n";
|
||||
$c.= ' <KEYS>' . "\n";
|
||||
$c.= ' <KEY NAME="primary" TYPE="primary" FIELDS="id" />' . "\n";
|
||||
|
||||
@@ -155,11 +155,6 @@ class edit_field extends XMLDBAction {
|
||||
// xmldb_field Decimals
|
||||
$o.= ' <tr valign="top"><td><label for="decimals" accesskey="d">Decimals:</label></td>';
|
||||
$o.= ' <td colspan="2"><input name="decimals" type="text" size="6" maxlength="6" id="decimals" value="' . s($field->getDecimals()) . '" /><span id="decimalstip"></span></td></tr>';
|
||||
// xmldb_field Unsigned
|
||||
$unsignedoptions = array (0 => 'signed', 1 => 'unsigned');
|
||||
$select = html_writer::select($unsignedoptions, 'unsigned', $field->getUnsigned(), false);
|
||||
$o.= ' <tr valign="top"><td><label for="menuunsigned" accesskey="u">Unsigned:</label></td>';
|
||||
$o.= ' <td colspan="2">' . $select . '</td></tr>';
|
||||
// xmldb_field NotNull
|
||||
$notnulloptions = array (0 => 'null', 'not null');
|
||||
$select = html_writer::select($notnulloptions, 'notnull', $field->getNotNull(), false);
|
||||
|
||||
@@ -50,7 +50,6 @@ function transformForm(event) {
|
||||
var typeField = document.getElementById('menutype');
|
||||
var lengthField = document.getElementById('length');
|
||||
var decimalsField = document.getElementById('decimals');
|
||||
var unsignedField = document.getElementById('menuunsigned');
|
||||
var notnullField = document.getElementById('menunotnull');
|
||||
var sequenceField = document.getElementById('menusequence');
|
||||
var defaultField = document.getElementById('default');
|
||||
@@ -60,15 +59,12 @@ function transformForm(event) {
|
||||
|
||||
// Initially, enable everything
|
||||
decimalsField.disabled = false;
|
||||
unsignedField.disabled = false;
|
||||
notnullField.disabled = false;
|
||||
sequenceField.disabled = false;
|
||||
defaultField.disabled = false;
|
||||
|
||||
// Based on sequence, disable some items
|
||||
if (sequenceField.value == '1') {
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '1';
|
||||
notnullField.disabled = true;
|
||||
notnullField.value = '1';
|
||||
defaultField.disabled = true;
|
||||
@@ -86,22 +82,16 @@ function transformForm(event) {
|
||||
case '2': // XMLDB_TYPE_NUMBER
|
||||
lengthTip.innerHTML = ' 1...20';
|
||||
decimalsTip.innerHTML = ' 0...length or empty';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
break;
|
||||
case '3': // XMLDB_TYPE_FLOAT
|
||||
lengthTip.innerHTML = ' 1...20 or empty';
|
||||
decimalsTip.innerHTML = ' 0...length or empty';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
break;
|
||||
case '4': // XMLDB_TYPE_CHAR
|
||||
lengthTip.innerHTML = ' 1...1333'; // Hardcoded, yes!
|
||||
decimalsTip.innerHTML = '';
|
||||
decimalsField.disabled = true;
|
||||
decimalsField.value = '';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
sequenceField.disabled = true;
|
||||
sequenceField.value = '0';
|
||||
break;
|
||||
@@ -110,8 +100,6 @@ function transformForm(event) {
|
||||
decimalsTip.innerHTML = '';
|
||||
decimalsField.disabled = true;
|
||||
decimalsField.value = '';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
sequenceField.disabled = true;
|
||||
sequenceField.value = '0';
|
||||
defaultField.disabled = true;
|
||||
@@ -122,8 +110,6 @@ function transformForm(event) {
|
||||
decimalsTip.innerHTML = '';
|
||||
decimalsField.disabled = true;
|
||||
decimalsField.value = '';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
sequenceField.disabled = true;
|
||||
sequenceField.value = '0';
|
||||
defaultField.disabled = true;
|
||||
@@ -136,8 +122,6 @@ function transformForm(event) {
|
||||
decimalsTip.innerHTML = '';
|
||||
decimalsField.disabled = true;
|
||||
decimalsField.value = '';
|
||||
unsignedField.disabled = true;
|
||||
unsignedField.value = '0';
|
||||
sequenceField.disabled = true;
|
||||
sequenceField.value = '0';
|
||||
defaultField.disabled = true;
|
||||
|
||||
@@ -96,7 +96,6 @@ class edit_field_save extends XMLDBAction {
|
||||
$type = required_param('type', PARAM_INT);
|
||||
$length = strtolower(optional_param('length', NULL, PARAM_ALPHANUM));
|
||||
$decimals = optional_param('decimals', NULL, PARAM_INT);
|
||||
$unsigned = optional_param('unsigned', false, PARAM_BOOL);
|
||||
$notnull = optional_param('notnull', false, PARAM_BOOL);
|
||||
$sequence = optional_param('sequence', false, PARAM_BOOL);
|
||||
$default = optional_param('default', NULL, PARAM_PATH);
|
||||
@@ -112,7 +111,6 @@ class edit_field_save extends XMLDBAction {
|
||||
|
||||
// Perform some automatic assumptions
|
||||
if ($sequence) {
|
||||
$unsigned = true;
|
||||
$notnull = true;
|
||||
$default = NULL;
|
||||
}
|
||||
@@ -231,7 +229,6 @@ class edit_field_save extends XMLDBAction {
|
||||
$tempfield->setType($type);
|
||||
$tempfield->setLength($length);
|
||||
$tempfield->setDecimals($decimals);
|
||||
$tempfield->setUnsigned($unsigned);
|
||||
$tempfield->setNotNull($notnull);
|
||||
$tempfield->setSequence($sequence);
|
||||
$tempfield->setDefault($default);
|
||||
@@ -268,7 +265,6 @@ class edit_field_save extends XMLDBAction {
|
||||
$field->setType($type);
|
||||
$field->setLength($length);
|
||||
$field->setDecimals($decimals);
|
||||
$field->setUnsigned($unsigned);
|
||||
$field->setNotNull($notnull);
|
||||
$field->setSequence($sequence);
|
||||
$field->setDefault($default);
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<td class="cell c1" style="white-space: nowrap;">
|
||||
<xsl:value-of select="@TYPE"/>
|
||||
(<xsl:value-of select="@LENGTH"/><xsl:if test="@DECIMALS">, <xsl:value-of select="@DECIMALS"/></xsl:if>)
|
||||
<xsl:if test="@UNSIGNED='true'">unsigned </xsl:if>
|
||||
<xsl:if test="@NOTNULL='true'">not null </xsl:if>
|
||||
<xsl:if test="@DEFAULT">
|
||||
<xsl:choose>
|
||||
|
||||
@@ -90,7 +90,6 @@ class new_table extends XMLDBAction {
|
||||
$field->setType(XMLDB_TYPE_INTEGER);
|
||||
$field->setLength(10);
|
||||
$field->setNotNull(true);
|
||||
$field->setUnsigned(true);
|
||||
$field->setSequence(true);
|
||||
$field->setLoaded(true);
|
||||
$field->setChanged(true);
|
||||
|
||||
@@ -125,7 +125,6 @@ class view_table_php extends XMLDBAction {
|
||||
$optionspacer . 'rename_field',
|
||||
$optionspacer . 'change_field_type',
|
||||
$optionspacer . 'change_field_precision',
|
||||
$optionspacer . 'change_field_unsigned',
|
||||
$optionspacer . 'change_field_notnull',
|
||||
$optionspacer . 'change_field_default',
|
||||
$optionspacer . 'drop_enum_from_field', // TODO: Moodle 2.1 - Drop drop_enum_from_field
|
||||
@@ -218,13 +217,6 @@ class view_table_php extends XMLDBAction {
|
||||
$o.= $this->str['mustselectonefield'];
|
||||
}
|
||||
break;
|
||||
case 'change_field_unsigned':
|
||||
if ($fieldkeyindexinitial == 'f') { //Only if we have got one field
|
||||
$o.= s($this->change_field_unsigned_php($structure, $tableparam, $fieldkeyindexparam));
|
||||
} else {
|
||||
$o.= $this->str['mustselectonefield'];
|
||||
}
|
||||
break;
|
||||
case 'change_field_notnull':
|
||||
if ($fieldkeyindexinitial == 'f') { // Only if we have got one field
|
||||
$o.= s($this->change_field_notnull_php($structure, $tableparam, $fieldkeyindexparam));
|
||||
@@ -553,54 +545,6 @@ class view_table_php extends XMLDBAction {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will generate all the PHP code needed to
|
||||
* change the unsigned/signed of one field using XMLDB objects and functions
|
||||
*
|
||||
* @param xmldb_structure structure object containing all the info
|
||||
* @param string table table name
|
||||
* @param string field field name to change unsigned/signed
|
||||
*/
|
||||
function change_field_unsigned_php($structure, $table, $field) {
|
||||
|
||||
$result = '';
|
||||
// Validate if we can do it
|
||||
if (!$table = $structure->getTable($table)) {
|
||||
return false;
|
||||
}
|
||||
if (!$field = $table->getField($field)) {
|
||||
return false;
|
||||
}
|
||||
if ($table->getAllErrors()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calculate the unsigned tip text
|
||||
$unsigned = $field->getUnsigned() ? 'unsigned' : 'signed';
|
||||
|
||||
// Add the standard PHP header
|
||||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
// Add contents
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' // Changing sign of field ' . $field->getName() . ' on table ' . $table->getName() . ' to ' . $unsigned . XMLDB_LINEFEED;
|
||||
$result .= ' $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $field = new xmldb_field(' . "'" . $field->getName() . "', " . $field->getPHP(true) . ');' . XMLDB_LINEFEED;
|
||||
|
||||
// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' // Launch change of sign for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $dbman->change_field_unsigned($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
// Add the proper upgrade_xxxx_savepoint call
|
||||
$result .= $this->upgrade_savepoint_php ($structure);
|
||||
|
||||
// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will generate all the PHP code needed to
|
||||
* change the nullability of one field using XMLDB objects and functions
|
||||
|
||||
@@ -126,7 +126,6 @@ $string['missingindexes'] = 'Missing indexes found';
|
||||
$string['mustselectonefield'] = 'You must select one field to see field related actions!';
|
||||
$string['mustselectoneindex'] = 'You must select one index to see index related actions!';
|
||||
$string['mustselectonekey'] = 'You must select one key to see key related actions!';
|
||||
$string['mysqlextracheckbigints'] = 'Under MySQL it also looks for incorrectly signed bigints, generating the required SQL to be executed in order to fix all them.';
|
||||
$string['newfield'] = 'New field';
|
||||
$string['newindex'] = 'New index';
|
||||
$string['newkey'] = 'New key';
|
||||
|
||||
@@ -113,6 +113,7 @@ class database_column_info {
|
||||
* True if integer unsigned, false if signed.
|
||||
* Null for other types
|
||||
* @var integer
|
||||
* @deprecated since 2.3
|
||||
*/
|
||||
public $unsigned;
|
||||
|
||||
|
||||
@@ -1798,6 +1798,7 @@ abstract class moodle_database {
|
||||
* (Only MySQL needs this. MySQL things that 1 * -1 = 18446744073709551615
|
||||
* if the 1 comes from an unsigned column).
|
||||
*
|
||||
* @deprecated since 2.3
|
||||
* @param string $fieldname The name of the field to be cast
|
||||
* @return string The piece of SQL code to be used in your statement.
|
||||
*/
|
||||
|
||||
@@ -1203,6 +1203,13 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
return $positivematch ? 'REGEXP' : 'NOT REGEXP';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the SQL to be used in order to an UNSIGNED INTEGER column to SIGNED.
|
||||
*
|
||||
* @deprecated since 2.3
|
||||
* @param string $fieldname The name of the field to be cast
|
||||
* @return string The piece of SQL code to be used in your statement.
|
||||
*/
|
||||
public function sql_cast_2signed($fieldname) {
|
||||
return ' CAST(' . $fieldname . ' AS SIGNED) ';
|
||||
}
|
||||
|
||||
@@ -855,6 +855,7 @@ function filter_get_active_in_context($context) {
|
||||
) active
|
||||
LEFT JOIN {filter_config} fc ON fc.filter = active.filter AND fc.contextid = $context->id
|
||||
ORDER BY active.sortorder";
|
||||
//TODO: remove sql_cast_2signed() once we do not support upgrade from Moodle 2.2
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
|
||||
// Masssage the data into the specified format to return.
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<xs:attribute name="LENGTH" type="fieldLength" use="optional" />
|
||||
<xs:attribute name="NOTNULL" type="trueFalse" use="required" />
|
||||
<xs:attribute name="DECIMALS" type="xs:positiveInteger" use="optional" />
|
||||
<!-- TODO: Moodle 2.4 - Drop ignored UNSIGNED attribute -->
|
||||
<xs:attribute name="UNSIGNED" type="trueFalse" use="optional" />
|
||||
<!-- TODO: Moodle 2.1 - Drop ENUM and ENUMVALUES attributes -->
|
||||
<xs:attribute name="ENUM" type="trueFalse" use="optional" />
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
define ('XMLDB_STATEMENT_CUSTOM', 4); //Custom Statements
|
||||
|
||||
/// Some other useful Constants
|
||||
define ('XMLDB_UNSIGNED', true); //If the field is going to be unsigned
|
||||
define ('XMLDB_UNSIGNED', true); //If the field is going to be unsigned @deprecated since 2.3
|
||||
define ('XMLDB_NOTNULL', true); //If the field is going to be not null
|
||||
define ('XMLDB_SEQUENCE', true); //If the field is going to be a sequence
|
||||
define ('XMLDB_INDEX_UNIQUE', true); //If the index is going to be unique
|
||||
|
||||
@@ -30,7 +30,6 @@ class xmldb_field extends xmldb_object {
|
||||
|
||||
var $type;
|
||||
var $length;
|
||||
var $unsigned;
|
||||
var $notnull;
|
||||
var $default;
|
||||
var $sequence;
|
||||
@@ -53,7 +52,6 @@ class xmldb_field extends xmldb_object {
|
||||
function __construct($name, $type=null, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) {
|
||||
$this->type = NULL;
|
||||
$this->length = NULL;
|
||||
$this->unsigned = true;
|
||||
$this->notnull = false;
|
||||
$this->default = NULL;
|
||||
$this->sequence = false;
|
||||
@@ -98,7 +96,6 @@ class xmldb_field extends xmldb_object {
|
||||
$this->decimals = trim($precisionarr[1]);
|
||||
}
|
||||
$this->precision = $type;
|
||||
$this->unsigned = !empty($unsigned) ? true : false;
|
||||
$this->notnull = !empty($notnull) ? true : false;
|
||||
$this->sequence = !empty($sequence) ? true : false;
|
||||
$this->setDefault($default);
|
||||
@@ -136,9 +133,10 @@ class xmldb_field extends xmldb_object {
|
||||
|
||||
/**
|
||||
* Get the unsigned
|
||||
* @deprecated since moodle 2.3
|
||||
*/
|
||||
function getUnsigned() {
|
||||
return $this->unsigned;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,9 +176,9 @@ class xmldb_field extends xmldb_object {
|
||||
|
||||
/**
|
||||
* Set the field unsigned
|
||||
* @deprecated since moodle 2.3
|
||||
*/
|
||||
function setUnsigned($unsigned=true) {
|
||||
$this->unsigned = $unsigned;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,7 +227,7 @@ class xmldb_field extends xmldb_object {
|
||||
/// print_object ($GLOBALS['traverse_array']); //Debug
|
||||
/// $GLOBALS['traverse_array']=""; //Debug
|
||||
|
||||
/// Process table attributes (name, type, length, unsigned,
|
||||
/// Process table attributes (name, type, length
|
||||
/// notnull, sequence, decimals, comment, previous, next)
|
||||
if (isset($xmlarr['@']['NAME'])) {
|
||||
$this->name = trim($xmlarr['@']['NAME']);
|
||||
@@ -289,19 +287,6 @@ class xmldb_field extends xmldb_object {
|
||||
$this->length = $length;
|
||||
}
|
||||
|
||||
if (isset($xmlarr['@']['UNSIGNED'])) {
|
||||
$unsigned = strtolower(trim($xmlarr['@']['UNSIGNED']));
|
||||
if ($unsigned == 'true') {
|
||||
$this->unsigned = true;
|
||||
} else if ($unsigned == 'false') {
|
||||
$this->unsigned = false;
|
||||
} else {
|
||||
$this->errormsg = 'Incorrect UNSIGNED attribute (true/false allowed)';
|
||||
$this->debug($this->errormsg);
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($xmlarr['@']['NOTNULL'])) {
|
||||
$notnull = strtolower(trim($xmlarr['@']['NOTNULL']));
|
||||
if ($notnull == 'true') {
|
||||
@@ -470,7 +455,7 @@ class xmldb_field extends xmldb_object {
|
||||
$this->hash = NULL;
|
||||
} else {
|
||||
$key = $this->name . $this->type . $this->length .
|
||||
$this->unsigned . $this->notnull . $this->sequence .
|
||||
$this->notnull . $this->sequence .
|
||||
$this->decimals . $this->comment;
|
||||
$this->hash = md5($key);
|
||||
}
|
||||
@@ -492,16 +477,6 @@ class xmldb_field extends xmldb_object {
|
||||
$notnull = 'false';
|
||||
}
|
||||
$o.= ' NOTNULL="' . $notnull . '"';
|
||||
if ($this->type == XMLDB_TYPE_INTEGER ||
|
||||
$this->type == XMLDB_TYPE_NUMBER ||
|
||||
$this->type == XMLDB_TYPE_FLOAT) {
|
||||
if ($this->unsigned) {
|
||||
$unsigned = 'true';
|
||||
} else {
|
||||
$unsigned = 'false';
|
||||
}
|
||||
$o.= ' UNSIGNED="' . $unsigned . '"';
|
||||
}
|
||||
if (!$this->sequence && $this->default !== NULL) {
|
||||
$o.= ' DEFAULT="' . $this->default . '"';
|
||||
}
|
||||
@@ -624,13 +599,6 @@ class xmldb_field extends xmldb_object {
|
||||
$this->type == XMLDB_TYPE_FLOAT)) {
|
||||
$this->decimals = $adofield->scale;
|
||||
}
|
||||
/// Calculate the unsigned field
|
||||
if ($adofield->unsigned &&
|
||||
($this->type == XMLDB_TYPE_INTEGER ||
|
||||
$this->type == XMLDB_TYPE_NUMBER ||
|
||||
$this->type == XMLDB_TYPE_FLOAT)) {
|
||||
$this->unsigned = true;
|
||||
}
|
||||
/// Calculate the notnull field
|
||||
if ($adofield->not_null) {
|
||||
$this->notnull = true;
|
||||
@@ -642,8 +610,6 @@ class xmldb_field extends xmldb_object {
|
||||
/// Calculate the sequence field
|
||||
if ($adofield->auto_increment) {
|
||||
$this->sequence = true;
|
||||
/// Sequence fields are always unsigned
|
||||
$this->unsigned = true;
|
||||
}
|
||||
/// Some more fields
|
||||
$this->loaded = true;
|
||||
@@ -696,14 +662,8 @@ class xmldb_field extends xmldb_object {
|
||||
} else {
|
||||
$result .= 'null, ';
|
||||
}
|
||||
/// Unsigned (only applicable to numbers)
|
||||
$unsigned = $this->getUnsigned();
|
||||
if (!empty($unsigned) &&
|
||||
($this->getType() == XMLDB_TYPE_INTEGER || $this->getType() == XMLDB_TYPE_NUMBER || $this->getType() == XMLDB_TYPE_FLOAT)) {
|
||||
$result .= 'XMLDB_UNSIGNED' . ', ';
|
||||
} else {
|
||||
$result .= 'null, ';
|
||||
}
|
||||
/// Unsigned is not used any more since Moodle 2.3
|
||||
$result .= 'null, ';
|
||||
/// Not Null
|
||||
$notnull = $this->getNotnull();
|
||||
if (!empty($notnull)) {
|
||||
@@ -765,16 +725,6 @@ class xmldb_field extends xmldb_object {
|
||||
$this->type == XMLDB_TYPE_BINARY) {
|
||||
$o .= ' (' . $this->length . ')';
|
||||
}
|
||||
/// unsigned
|
||||
if ($this->type == XMLDB_TYPE_INTEGER ||
|
||||
$this->type == XMLDB_TYPE_NUMBER ||
|
||||
$this->type == XMLDB_TYPE_FLOAT) {
|
||||
if ($this->unsigned) {
|
||||
$o .= ' unsigned';
|
||||
} else {
|
||||
$o .= ' signed';
|
||||
}
|
||||
}
|
||||
/// not null
|
||||
if ($this->notnull) {
|
||||
$o .= ' not null';
|
||||
|
||||
Reference in New Issue
Block a user