<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - After renaming Primary Key AutoValue feature fails"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=108058">108058</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After renaming Primary Key AutoValue feature fails
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.3.3.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Base
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>BridgeportContractor@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=133517" name="attach_133517" title="screen shot with table and error message">attachment 133517</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=133517&action=edit" title="screen shot with table and error message">[details]</a></span>
screen shot with table and error message

In a simple table after renaming the Primary Key the AutoValue feature fails
when trying to insert a new record.  Error message is "Error inserting the new
rocord", and "Attempt to insert null into a non-nullable column: column: ID2
table: Table1 in statement [INSERT INTO "Table1" ("text") VALUES (?)]"

How to recreate this:

Step 1 create a simple table:

  Open LibreOffice and select:
    File
       New
          Database
            * Create a new database
                Select: HSQLDB Embedded
                Next>>
                Select either:
                   * No, do not register the database, OR
                   * Yes, ...

                Click Finish
                Click Save

  Then select: Create a Table in Design View...

  On line 1 enter: Field Name = "ID"   | Field Type = "Integer"
  On line 2 enter: Fidld Name = "Test" | Field Type = "Text"

  Right click on green arrow left of ID and select Primary Key

  Below set AutoValue to Yes

  Close the window
    Do you want to save the changes?  Save to table name "Table1".
    Click Yes


Step 2 test the table:
  Double click on "Table1" to open it.
  Type something in text and hit return.
  ID becomes "0".
  If you do this again ID becomes "1".

Step 3 edit the table and rename the primary key:
  Now close the table.
  Right click on "Table 1" and select "Edit".
  Rename "ID" to "ID2".
  Close the design and save.

Step 4 test the table again:
  Again click on "Table1" to open it.
  on line#2 type something in the text field and hit enter.

  Expected result is that ID2 increments to the next value.

  Result is the attached error message.


The only way I have found to fix this is to delete the table and start over. 

This is a very basic malfunction that a new Base user will likely run into.  I
ran into this when I first started using base and it made me feel like Base was
probably a pile of junk.  I know better now, but this issue is still not
resolved and I just ran into it again myself a few days ago.

Thanks for looking into this.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>