Skip to content

Renaming field in a table overwrites data in that field with previous field name #1650

@chrisjlocke

Description

@chrisjlocke

Details for the issue

Guess this is linked to the recent fix to the modify table code.

What did you do?

Renamed a field

What did you expect to see?

The field renamed

What did you see instead?

Sheer horror and panic as database data was obliterated with the previous field name.

Useful extra information

Here is a screencast.
https://screencast-o-matic.com/watch/cFliDAr4lt

Shows the 'contractStandardId5' field has '48' in it. Lets remove that 5 from the end of the field name.
Did that, and flip back to the 'Browse Data' tab. Eek. The field doesn't have '48' in it anymore, but the old field name.
Just in case it was rogue screen update, I click on 'Refresh' and yes, it stays there.

This is due to the insert statement keeping the old field name
INSERT INTO "main"."sqlb_temp_table_3" ("annualValueToCA","clientId","contractStandardId","createdByUserId","dateCreated","dateModified","id","modifiedByUserId","notesPlain","notesRTF","statusId","typeId") SELECT "annualValueToCA","clientId","contractStandardId5","createdByUserId","dateCreated","dateModified","id","modifiedByUserId","notesPlain","notesRTF","statusId","typeId" FROM "main"."contracts";

Note the third field - it has "contractStandardId5" in that insert, and not "contractStandardId"

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: 10_ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • Version 3.11.99 (Dec 6 2018)
  • 3.11.0-alpha1 or 3.11.0-beta*
  • 3.10.1
  • Other: ___

Did you also

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions