mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

abobrov
14.27.2009 8d3eacff7dea9916c3157b734d243b89e40233a5
- respect bounds for operational attributes.
1 files modified
10 ■■■■ changed files
opends/src/server/org/opends/server/backends/ndb/BackendImpl.java 10 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/ndb/BackendImpl.java
@@ -376,8 +376,8 @@
  private int getAttributeBound(AttributeType attrType) {
    // HACK: This should be done by Directory Server
    // Schema parser and available in AttributeSyntax.
    String attrDefinition = attrType.getDefinition();
    try {
      String attrDefinition = attrType.getDefinition();
      int boundOpenIndex = attrDefinition.indexOf("{");
      if (boundOpenIndex == -1) {
        return 0;
@@ -719,7 +719,13 @@
      attrsBuffer.append(attrName);
      attrsBuffer.append("`");
      attrsBuffer.append(" VARCHAR(");
      attrsBuffer.append(ATTRLEN_STRING);
      int attrBound = getAttributeBound(
        DirectoryServer.getAttributeType(attrName.toLowerCase()));
      if ((attrBound > 0) && (attrBound < NDB_MAXROWSIZE)) {
        attrsBuffer.append(Integer.toString(attrBound));
      } else {
        attrsBuffer.append(ATTRLEN_STRING);
      }
      attrsBuffer.append(")");
      nColumns++;
    }