Derby
  1. Derby
  2. DERBY-6580

Document the new SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.11.1.1
    • Fix Version/s: 10.11.1.1
    • Component/s: Documentation
    • Labels:
      None
    • Urgency:
      Blocker

      Description

      The work on DERBY-6542 has introduced a new system function. This function is used to check the next value which will be issued for an identity column. It is similar to the existing SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE function for sequences. We need to document this new function:

      BIGINT SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY
      ( IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128) )

      All users have permission to run this function.

      1. DERBY-6580.diff
        4 kB
        Kim Haase
      2. DERBY-6580.stat
        0.1 kB
        Kim Haase
      3. rrefsyscspeekidentity.html
        5 kB
        Kim Haase
      4. DERBY-6580-2.diff
        4 kB
        Kim Haase
      5. rrefsyscspeekidentity.html
        5 kB
        Kim Haase
      6. rrefsistabs22441.html
        8 kB
        Kim Haase
      7. DERBY-6580-3.diff
        0.9 kB
        Kim Haase

        Issue Links

          Activity

          Hide
          Kim Haase added a comment -

          Thanks again, Rick.

          Committed patch DERBY-6580-3.diff to documentation trunk at revision 1598713.

          Show
          Kim Haase added a comment - Thanks again, Rick. Committed patch DERBY-6580 -3.diff to documentation trunk at revision 1598713.
          Hide
          ASF subversion and git services added a comment -

          Commit 1598713 from Kim Haase in branch 'docs/trunk'
          [ https://svn.apache.org/r1598713 ]

          DERBY-6580 Document the new SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function

          Modified Reference Manual topic on SYSCOLUMNS system table.

          Patches: DERBY-6580-3.diff

          Show
          ASF subversion and git services added a comment - Commit 1598713 from Kim Haase in branch 'docs/trunk' [ https://svn.apache.org/r1598713 ] DERBY-6580 Document the new SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function Modified Reference Manual topic on SYSCOLUMNS system table. Patches: DERBY-6580 -3.diff
          Hide
          Rick Hillegas added a comment -

          Looks great. Thanks, Kim. +1

          Show
          Rick Hillegas added a comment - Looks great. Thanks, Kim. +1
          Hide
          Kim Haase added a comment -

          Attaching DERBY-6580-3.diff and rrefsistabs22441.html, with upgrade info for the SYSCOLUMNS topic:

          M src/ref/rrefsistabs22441.dita

          Please let me know if this is correct. Thanks!

          Show
          Kim Haase added a comment - Attaching DERBY-6580 -3.diff and rrefsistabs22441.html, with upgrade info for the SYSCOLUMNS topic: M src/ref/rrefsistabs22441.dita Please let me know if this is correct. Thanks!
          Hide
          Kim Haase added a comment -

          Committed patch DERBY-6580-2.diff to documentation trunk at revision 1598692.

          Leaving issue open because I realized I need to add a note to the SYSCOLUMNS topic to mention that the AUTOINCREMENTVALUE column has no meaning after a full upgrade to 10.11. Will file another patch, which should probably be reviewed.

          Show
          Kim Haase added a comment - Committed patch DERBY-6580 -2.diff to documentation trunk at revision 1598692. Leaving issue open because I realized I need to add a note to the SYSCOLUMNS topic to mention that the AUTOINCREMENTVALUE column has no meaning after a full upgrade to 10.11. Will file another patch, which should probably be reviewed.
          Hide
          ASF subversion and git services added a comment -

          Commit 1598692 from Kim Haase in branch 'docs/trunk'
          [ https://svn.apache.org/r1598692 ]

          DERBY-6580 Document the new SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function

          Added a new Reference Manual topic, modified the map file.

          Patches: DERBY-6580-2.diff

          Show
          ASF subversion and git services added a comment - Commit 1598692 from Kim Haase in branch 'docs/trunk' [ https://svn.apache.org/r1598692 ] DERBY-6580 Document the new SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function Added a new Reference Manual topic, modified the map file. Patches: DERBY-6580 -2.diff
          Hide
          Rick Hillegas added a comment -

          Looks good. Thanks Kim. +1

          Show
          Rick Hillegas added a comment - Looks good. Thanks Kim. +1
          Hide
          Kim Haase added a comment -

          Attaching DERBY-6580-2.diff and an updated version of rrefsyscspeekidentity.html, with a few minor tweaks to the upgrade language. I plan to commit this patch shortly.

          Show
          Kim Haase added a comment - Attaching DERBY-6580 -2.diff and an updated version of rrefsyscspeekidentity.html, with a few minor tweaks to the upgrade language. I plan to commit this patch shortly.
          Hide
          Kim Haase added a comment -

          Thanks, Rick. I'm going to file another patch to make a couple of small changes –

          1) We usually say "Release" not "version" for Derby.
          2) We usually say "full upgrade" rather than "hard upgrade".
          3) I'd like to add a pointer to the "Upgrading a database" topic in the Developer's Guide.

          After that I'll commit unless I hear otherwise. Also planning to reopen some doc issues to add upgrade language for other new features for which that is suitable.

          Show
          Kim Haase added a comment - Thanks, Rick. I'm going to file another patch to make a couple of small changes – 1) We usually say "Release" not "version" for Derby. 2) We usually say "full upgrade" rather than "hard upgrade". 3) I'd like to add a pointer to the "Upgrading a database" topic in the Developer's Guide. After that I'll commit unless I hear otherwise. Also planning to reopen some doc issues to add upgrade language for other new features for which that is suitable.
          Hide
          Rick Hillegas added a comment -

          Thanks, Kim. Looks good. +1

          Show
          Rick Hillegas added a comment - Thanks, Kim. Looks good. +1
          Hide
          Kim Haase added a comment -

          Attaching DERBY-6580.diff, DERBY-6580.stat, and rrefsyscspeekidentity.html, adding the new topic to the Reference Manual:

          M src/ref/refderby.ditamap
          A src/ref/rrefsyscspeekidentity.dita

          Please let me know what changes are needed.

          Show
          Kim Haase added a comment - Attaching DERBY-6580 .diff, DERBY-6580 .stat, and rrefsyscspeekidentity.html, adding the new topic to the Reference Manual: M src/ref/refderby.ditamap A src/ref/rrefsyscspeekidentity.dita Please let me know what changes are needed.
          Hide
          Dag H. Wanvik added a comment -

          A priori I would expect Derby to limit access to system tables to object for which the user has read and/or execute privileges. But probably that would entail different visibility for different rows of some system tables, behooving us to make wrappers instead of allowing direct access to the system tables. I wonder how the visibility/access is defined for the information schema in the standard...

          Show
          Dag H. Wanvik added a comment - A priori I would expect Derby to limit access to system tables to object for which the user has read and/or execute privileges. But probably that would entail different visibility for different rows of some system tables, behooving us to make wrappers instead of allowing direct access to the system tables. I wonder how the visibility/access is defined for the information schema in the standard...
          Hide
          Rick Hillegas added a comment -

          Hi Dag,

          That's an interesting question. The SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function is the new, concurrent way to get the information which customers used to get by querying SYS.SYSCOLUMNS.AUTOINCREMENTVALUE, just as SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE is the concurrent way to get the information bounded by querying SYS.SYSSEQUENCES.CURRENTVALUE. Since you can get a fuzzy approximation of this information by querying the system tables directly (and we don't want people to do that), I don't see a great deal of value in restricting the execute privilege on these functions.

          Derby and JDBC treat metadata as world-readable. Maybe Derby and JDBC are wrong here and we should explore whether we could tighten up the access controls on metadata in general.

          Thanks,
          -Rick

          Show
          Rick Hillegas added a comment - Hi Dag, That's an interesting question. The SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY function is the new, concurrent way to get the information which customers used to get by querying SYS.SYSCOLUMNS.AUTOINCREMENTVALUE, just as SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE is the concurrent way to get the information bounded by querying SYS.SYSSEQUENCES.CURRENTVALUE. Since you can get a fuzzy approximation of this information by querying the system tables directly (and we don't want people to do that), I don't see a great deal of value in restricting the execute privilege on these functions. Derby and JDBC treat metadata as world-readable. Maybe Derby and JDBC are wrong here and we should explore whether we could tighten up the access controls on metadata in general. Thanks, -Rick
          Hide
          Dag H. Wanvik added a comment -

          Is it correct/reasonable that all users be able to peek? I'd think a read and/or write privilege to the table be required...?

          Show
          Dag H. Wanvik added a comment - Is it correct/reasonable that all users be able to peek? I'd think a read and/or write privilege to the table be required...?

            People

            • Assignee:
              Kim Haase
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development