Derby
  1. Derby
  2. DERBY-3947

Cannot insert 994 character long string into indexed column

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.6.1.0
    • Component/s: Store
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix, Repro attached, Workaround attached
    • Bug behavior facts:
      Seen in production

      Description

      Inserting a 994 character string into a varchar(1000) column with an index fails.

      These steps

      1. "create table t (x varchar(1000) primary key)"
      2. "insert into t values " where ? holds a 994 character string

      produce the following error:

      ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page. Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
      at org.apache.derby.impl.store.access.btree.BTreeController.doIns(BTreeController.java:845)
      at org.apache.derby.impl.store.access.btree.BTreeController.insert(BTreeController.java:1264)
      at org.apache.derby.impl.store.access.btree.index.B2IController.insert(B2IController.java:210)
      at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(IndexChanger.java:439)
      at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(IndexChanger.java:383)
      at org.apache.derby.impl.sql.execute.IndexChanger.insert(IndexChanger.java:589)
      at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(IndexSetChanger.java:268)
      at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:453)
      at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1011)
      at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:487)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:372)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1235)

      The page size should be set sufficiently high at index creation time to hold columns with the specified maximum size.

      1. VarcharIndex.java
        0.6 kB
        Knut Anders Hatlen
      2. moreTests.diff
        6 kB
        Bryan Pendleton
      3. firstTry.diff
        5 kB
        Bryan Pendleton

        Activity

        Knut Anders Hatlen created issue -
        Knut Anders Hatlen made changes -
        Field Original Value New Value
        Attachment VarcharIndex.java [ 12393870 ]
        Kathey Marsden made changes -
        Derby Categories [High Value Fix]
        Dag H. Wanvik made changes -
        Issue & fix info [High Value Fix]
        Kristian Waagan made changes -
        Bug behavior facts [Seen in production]
        Urgency Normal
        Issue & fix info [High Value Fix] [High Value Fix, Repro attached, Workaround attached]
        Bryan Pendleton made changes -
        Assignee Bryan Pendleton [ bryanpendleton ]
        Bryan Pendleton made changes -
        Attachment firstTry.diff [ 12426330 ]
        Bryan Pendleton made changes -
        Attachment moreTests.diff [ 12426369 ]
        Bryan Pendleton made changes -
        Issue & fix info [Workaround attached, Repro attached, High Value Fix] [High Value Fix, Patch Available, Repro attached, Workaround attached]
        Bryan Pendleton made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Issue & fix info [Workaround attached, Repro attached, Patch Available, High Value Fix] [High Value Fix, Repro attached, Workaround attached]
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Resolution Fixed [ 1 ]
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 12446227 ] Default workflow, editable Closed status [ 12799608 ]

          People

          • Assignee:
            Bryan Pendleton
            Reporter:
            Knut Anders Hatlen
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development