Skip to content

Commit

Permalink
MDL-29314 syntax - fix switch() statement
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Sep 18, 2011
1 parent 2b834a1 commit b1c1eea
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/xmldb/xmldb_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,39 +311,39 @@ function validateDefinition(xmldb_table $xmldb_table=null) {
switch ($field->getType()) {
case XMLDB_TYPE_INTEGER:
$total += 8; // big int
break;
break;

case XMLDB_TYPE_NUMBER:
$total += 12; // this is just a guess
break;
break;

case XMLDB_TYPE_FLOAT:
$total += 8; // double precision
break;
break;

case XMLDB_TYPE_CHAR:
if ($field->getLength() > self::INDEX_MAX_BYTES / 3) {
return 'Invalid index definition in table {'.$xmldb_table->getName(). '}: XMLDB_TYPE_CHAR field "'.$field->getName().'" can not be indexed because it is too long.'
.' Limit is '.(self::INDEX_MAX_BYTES/3).' chars.';
}
$total += ($field->getLength() * 3); // the most complex utf-8 chars have 3 bytes
break;
break;

case XMLDB_TYPE_TEXT:
return 'Invalid index definition in table {'.$xmldb_table->getName(). '}: XMLDB_TYPE_TEXT field "'.$field->getName().'" can not be indexed';
break;
break;

case XMLDB_TYPE_BINARY:
return 'Invalid index definition in table {'.$xmldb_table->getName(). '}: XMLDB_TYPE_BINARY field "'.$field->getName().'" can not be indexed';
break;
break;

case XMLDB_TYPE_DATETIME:
$total += 8; // this is just a guess
break;
break;

case XMLDB_TYPE_TIMESTAMP:
$total += 8; // this is just a guess
break;
break;
}
}

Expand Down

0 comments on commit b1c1eea

Please sign in to comment.