Skip to content

'Copy As SQL' copies all cells from header but only selected cells for values #2638

Description

@chrisjlocke

Details for the issue

What did you do?

Highlighted some non-sequential cells in the 'Execute SQL' results grid and selected 'Copy as SQL'

What did you expect to see?

Unsure - hadn't used it before

What did you see instead?

All the cells from the first selected cell to the last selected cell was used as column identifiers, but only the selected cells were used for values. This resulted in invalid SQL being generated.

Useful extra information

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: ___ )
  • macOS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • 3.12.99 (21 Mar 2021)
  • 3.12.0
  • 3.11.x
  • Other: ___

Did you also

Here is a screencast.
https://user-images.githubusercontent.com/7872218/111918224-fcb0fc80-8a7b-11eb-9223-2bccac98a9f2.mp4
Skip to 0:43 as that's where the real action starts - prior to this is just me setting up the new table.

Selecting cells 1 and 4 created this SQL:
INSERT INTO "main"."" ("Field1", "Field2", "Field3", "Field4") VALUES ('1', '4');

The empty table name is expected - the grid could be made up from a number of different tables used in the select statement. However, the insert consists of four fields, but only two values. The values are correct - field1 value (1) and field4 value (4).

Metadata

Metadata

Assignees

Labels

Execute SQLbugConfirmed bugs or reports that are very likely to be bugs.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions