New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual columns on "duplicate row"/"export Insert,Replace" error #53

Closed
lukinhaspm opened this Issue Dec 20, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@lukinhaspm

lukinhaspm commented Dec 20, 2017

Expected behavior

When we insert/update/replace data in tables with virtual columns, we don't put this columns on the statements.

Current behavior

Heidi places the virtual column in the insert when we use "Duplicate Row", or "Export Grid Rows" to Insert, Delete/Insert and Replace on grid.

I think its a good idea we have a option "Export virtual columns?" like "Include auto increment column", because sometime the server is not compatible with virtual columns.

Failure information (for bugs)

Steps to reproduce

  1. create a table with virtual columns
    24537-1-capturar3
  2. insert some data
  3. try to duplicate the row with "Duplicate" functionality
    24537-2-capturar1
  4. error log...
    24537-3-capturar2

Context

  • HeidiSQL version: 9.5,
  • Database system + version: MySQL 5.7 and MariaDB 10.1
  • Operating system: Windows 10
@ansgarbecker

This comment has been minimized.

Show comment
Hide comment
@ansgarbecker

ansgarbecker Dec 22, 2017

Collaborator

In the latest build Heidi does now not copy values when duplicating a row.

For that export dialog I'd like to solve that without another new checkbox "include virtual columns". Such an option would only be useful for the SQL formats, but not for the many other formats the dialog supports.

Collaborator

ansgarbecker commented Dec 22, 2017

In the latest build Heidi does now not copy values when duplicating a row.

For that export dialog I'd like to solve that without another new checkbox "include virtual columns". Such an option would only be useful for the SQL formats, but not for the many other formats the dialog supports.

ansgarbecker added a commit that referenced this issue Dec 22, 2017

Refactor exclusion of virtual columns in various places:
* introduce TDBQuery.ColIsVirtal() returning a boolean for a column index, and use that instead of examining a columns virtuality everywhere
* exclude virtual column when exporting SQL code in the grid export dialog - see #53
* sql export dialog must not activate edit mode on a result, as this introduces endless loops
* instead, move some code out of PrepareEditing into PrepareColumnAttributes, which we can now call separately without activating edit mode
@ansgarbecker

This comment has been minimized.

Show comment
Hide comment
@ansgarbecker

ansgarbecker Dec 22, 2017

Collaborator

The grid export dialog should now also exclude virtual columns in the various SQL formats. (Not so for CSV, HTML etc.)
I just straightened the code a bit, so please have an eye on new bugs, and report these. Thanks!

Collaborator

ansgarbecker commented Dec 22, 2017

The grid export dialog should now also exclude virtual columns in the various SQL formats. (Not so for CSV, HTML etc.)
I just straightened the code a bit, so please have an eye on new bugs, and report these. Thanks!

@lukinhaspm

This comment has been minimized.

Show comment
Hide comment
@lukinhaspm

lukinhaspm Dec 22, 2017

Great @ansgarbecker , its works very good!
I'll use more to validate.
Thank you!

lukinhaspm commented Dec 22, 2017

Great @ansgarbecker , its works very good!
I'll use more to validate.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment