Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1918

INCREMENT of IDENTITY column described as allowing a value of zero in reference manual

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
    • 10.3.1.4
    • Documentation
    • None

    Description

      In the description of how INCREMENT work with IDENTITY columns, th
      reference manual is out of step with the implementation in the following respect
      (quote from http://db.apache.org/derby/docs/10.2/ref/rrefsqlj37836.html):

      > By default, the initial value of an identity column is 1, and the
      > amount of the increment is 1. You can specify non-default values for
      > both the initial value and the interval amount when you define the
      > column with the key words STARTS WITH and INCREMENT BY. And if you
      > specify a negative number for the increment value, Derby decrements
      > the value with each insert. If this value is 0, or positive, Derby
      ******************
      > increments the value with each insert.

      In fact, the implementation does not allow a value of zero, but gives
      error 42Z21 (LANG_AI_INVALID_INCREMENT):

      ij> create table f (i int generated by default as identity (start with 1, increment by 0), j int);

      ERROR 42Z21: Invalid increment specified for identity for column 'I'. Increment cannot be zero.

      Attachments

        1. derby1918.diff
          1 kB
          Dag H. Wanvik
        2. derby1918.stat
          0.0 kB
          Dag H. Wanvik

        Activity

          People

            dagw Dag H. Wanvik
            dagw Dag H. Wanvik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: