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

IDENTITY_VAL_LOCAL() returned value is modified incorrectly by a multi-row INSERT statement.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6
    • 10.1.3.2, 10.2.1.6
    • SQL
    • None
    • Urgent
    • Regression

    Description

      Changes made in DERBY-353 break the documented behaviour of IDENTITY_VAL_LOCAL(). Now the returned value is modified when a multi-row insert is performed.
      IDENTITY_VAL_LOCAL() should not be updated when this occurs.

      For this script the last value returned should be 2 (as in 10.1) but in 10.2 is 4

      create table ta (a int, b int generated always as identity);
      insert into ta(a) values 100;
      values IDENTITY_VAL_LOCAL();
      insert into ta(a) values 200;
      values IDENTITY_VAL_LOCAL();
      insert into ta(a) values 300,400;
      values IDENTITY_VAL_LOCAL();

      Attachments

        1. DERBY-1554.diff
          0.7 kB
          V.Narayanan
        2. DERBY-1554.stat
          0.2 kB
          V.Narayanan
        3. derby1554trunkdiff01.txt
          2 kB
          Yip Ng
        4. derby1554trunkdiff02.txt
          25 kB
          Yip Ng
        5. derby1554trunkstat01.txt
          0.2 kB
          Yip Ng
        6. derby1554trunkstat02.txt
          0.6 kB
          Yip Ng

        Issue Links

          Activity

            People

              yipng Yip Ng
              djd Daniel John Debrunner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: