Skip to content
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

Copy/Paste results are out of order #8210

Closed
jjwillis opened this issue Nov 4, 2019 · 11 comments
Closed

Copy/Paste results are out of order #8210

jjwillis opened this issue Nov 4, 2019 · 11 comments

Comments

@jjwillis
Copy link

jjwillis commented Nov 4, 2019

Issue Type: Bug

When copying results to the query window, the pasted data is not in the same order as listed in the results. Steps to reproduce:

declare @table table (num int)
declare @i int = 0
while @i<5
begin
insert into @table values (1), (2), (3)
set @i=@i+1
end
select num from @table order by num

Next, Copy the results from the grid and paste them into the query window or any text editor. The pasted values are out of order. When I do this, this is the pasted results:

1
1
3
3
3
3
3
1
1
1
2
2
2
2
2

I expect to see the pasted results to mimic the query results as shown below:

1
1
1
1
1
2
2
2
2
2
3
3
3
3
3

Similar copy/paste items: #7189, #2955, #1388, #26
Azure Data Studio version: azuredatastudio 1.13.0 (cacd481, 2019-11-02T00:40:05.147Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.93GB (21.03GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (2)
Extension Author (truncated) Version
powershell ms- 2019.9.0
profiler Mic 0.9.0
@Charles-Gagnon
Copy link
Contributor

@jjwillis It seems to be working fine for me. Could you go through the exact steps you're taking to copy/paste this? Are you selecting the entire column or selecting the cells manually?

@aaomidi Could you look into this?

@GUARD-TONYT
Copy link

This worked fine for me this morning after I read this. Then I noticed a pending update, so I installed and now it is doing exactly as described above. And I need my results to be in an order I expect.

Last week there were tabs at the end of each line. This week, bad ordering.

@Charles-Gagnon
Copy link
Contributor

@GUARD-TONYT - Could you also include the exact steps you're taking for the copy/paste? Especially with regards to how you're selecting the cells?

@GUARD-TONYT
Copy link

  1. Open Azure Data Studio. Now running:Version: 1.13.0 (user setup)
    Commit: cacd481
    Date: 2019-11-02T00:40:05.147Z
    VS Code: 1.38.0
    Electron: 4.2.10
    Chrome: 69.0.3497.128
    Node.js: 10.11.0
    V8: 6.9.427.31-electron.0
    OS: Windows_NT x64 10.0.17134

  2. Opened new Qry Window on a database.

  3. Copy/Pasted T-SQL from above into qry window. Clicked Run.

  4. Grid appears as expected.

  5. Clicked on Grid. Then right-clicked, chose Select All, right-clicked again, Copy with Headers.

  6. Opened Notepad.

  7. Pasted Results.

The results appeared in incorrect order. The results grid shows 5 of each number. The pasted data is not in the correct order.

I then altered my query to show Alphabetical Data rather than numbers. It too pasted in an order different than how the grid is displayed. I can't seem find anything in common with how the order is displayed, but it consistently shows the pasted results out of order.

@jjwillis
Copy link
Author

jjwillis commented Nov 4, 2019

Try it with these results:

declare @table table (num int)
declare @i int = 1
while @i<=25
begin
insert into @table values (@i)
set @i=@i+1
end
select num from @table order by num

I installed the latest update to ADS. Run the above statement and the results will display numbers from 1-25, one number on each row. Here are several ways I can reproduce the results:

  1. Click on the column header in the results to highlight the entire column, press Ctrl+C, click somewhere, like Excel or Notepad, and press Ctrl+V to paste.
  2. Click on and cell in the results, press Ctrl+A to highlight everything, press Ctrl +C, click somehwere, like Excel or Notepad, and press Ctrl+V
  3. Click on the space above the row numbers and to the let of the column heading to highlight all results. Press Ctrl+C to copy, click somewhere, like Excel or Notepad, and press Ctrl+V to paste.
    Repeated steps 1-3 using various combinations right click + copy and right click+paste.

I will note that there seems to be a pattern where row 1 and 2 are in order and row 3 is out of order.

@jjwillis
Copy link
Author

jjwillis commented Nov 4, 2019

I tried this again by selecting rows 1-10, it pasted correctly, then I tried this with rows 1-11 and it pasted wrong. Then I selected rows 11-25 and it worked correctly. Then I selected rows 10-25 and the 10th row appeared at the end and the rest were in correct order.

Then I increased my results to 100, selected row 11 and highlighted all until row 100 using shift + arrow, copied, and everything pasted correctly. The issue seems to be around row 10.

@GUARD-TONYT
Copy link

I just tried it with this SQL to get numbers out of the equation:

declare @table table (phrase varchar(50))
insert into @table values ('A is for Apple'), ('B is for Bumble Bee'), ('C is for Charlie'), ('D is for Delta'), ('E is for Elephant'), ('F is for Fox Trot')
insert into @table values ('A is for Apple'), ('B is for Bumble Bee'), ('C is for Charlie'), ('D is for Delta'), ('E is for Elephant'), ('F is for Fox Trot')
select phrase from @table order by phrase

The results are in the order you would expect. Once copied and pasted, they appear in an incorrect order. It always appears the a 1st 2 are in the correct place, then afterward something is wrong.
ads_grid

ads_notepad

@aaomidi
Copy link
Contributor

aaomidi commented Nov 4, 2019

I'm taking a look at this now.

@aaomidi
Copy link
Contributor

aaomidi commented Nov 4, 2019

This issue has been fixed in #8072 and is currently in insiders. If you can, can you verify that ADS Insiders behaves properly?

This fix will be included in the next release.

@GUARD-TONYT
Copy link

@aaomidi I downloaded the ADS Insiders and the problem is corrected. I tried all of the above samples and they now work as expected. Thank you.

@jjwillis
Copy link
Author

jjwillis commented Nov 4, 2019

@Charles-Gagnon @aaomidi Verified that this bug has been corrected with the insiders build version.

Version: 1.14.0-insider (user setup)
Commit: a8eed61
Date: 2019-11-04T08:59:32.766Z
VS Code: 1.38.0
Electron: 6.0.12
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.17763

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants