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

BUG: Autocomplete wiping whole line #1720

Closed
Tracked by #1721
mattnSwimd opened this issue Sep 29, 2023 · 16 comments · Fixed by #1722
Closed
Tracked by #1721

BUG: Autocomplete wiping whole line #1720

mattnSwimd opened this issue Sep 29, 2023 · 16 comments · Fixed by #1722

Comments

@mattnSwimd
Copy link

Describe the bug
When using the autocomplete for table columns on a left join, it wipes the line for the left join

To Reproduce
Steps to reproduce the behavior:

  1. Start Typing out a left join
  2. give table an alias
  3. when typing the on clause, use the alias to autocomplete the column
  4. select the autocompleted selection

Expected behavior
It should finish typing the selected column name

Screenshots / Gifs
I am attaching a video of it happening

Version Information (please complete the following information):

  • OS: [e.g. Windows/Mac/Ubuntu]
    Windows
  • App Version [e.g. help -> About Beekeeper Studio]
    4.0.0
  • Database type and version [eg Posgresql 9.3]
    Mariadb and mysql

Additional context
Nope

Untitled.mp4
@rathboma
Copy link
Collaborator

Hey @mattnSwimd That is very strange. I haven't seen this at all, but I'm going to try and replicate it. Thank you SO MUCH for reporting it.

Can you past a SQL query I can use to replicate this behavior?

@rathboma
Copy link
Collaborator

Based on where the dropdown appears for the autocomplete in your video it seems like the autocomplete system thinks that LEFT JOIN officeproductprices is the end of the table name.

@mattnSwimd
Copy link
Author

mattnSwimd commented Sep 29, 2023

I cannot post it publicly but a can provide it to you, also I noticed on that same query the Undo and Redo are totally messed up too.

Edit: It is an unexpected token causing everything to fail. I attached the error from the dev console.

error.txt

@rathboma
Copy link
Collaborator

Ok that's great. Thanks.

If you can find a way to reproduce the problem with a query you can share that would be SUPER helpful.

Some other questions to help me debug:

  1. What version of MariaDB or MySQL are you using?
  2. If you press escape to cancel the autocomplete, then press ctrl+space again to trigger it, does it do anything?

@mattnSwimd
Copy link
Author

mattnSwimd commented Sep 29, 2023

My MariaDB version I am currently seeing this in is 10.5.16-MariaDB, for whatever reason I deleted the query by accident and had to retype the part from the video. I restarted to application and now as I am retyping it, the autocomplete is not showing up at all.

Sorry this is getting so confusing, I have no idea what is going on with it at this point.

Edit: Now I can get the autocomplete open with ctrl+space again. It is still doing the original issue of overwriting the line.

@rathboma
Copy link
Collaborator

rathboma commented Sep 29, 2023

The error trace you sent me does have a helpful error trace in it. Looks like you're running a pretty complex query and my formatter isn't able to recognize it (It thinks you have a query error).

Probably there is something in your SQL code that is confusing the Beekeeper query parsing engine, if it possible to make a generic version of this query to share it would help me identify it. Likely it's a part of the query not shown in the video.

Again, any more errors you see in the dev-console will be very helpful in tracking down your errors.

Does downgrading to the previous version work ok?

@mattnSwimd
Copy link
Author

I haven't tried to downgrade as I am really enjoying this update and even with the issue, I prefer it over the prior version I had. I attached a generic version of the query. I will keep watching for more in the console, and post it here.
crazyQuery.txt

@mattnSwimd
Copy link
Author

another.txt

Here is another error I am getting.

@azmy60
Copy link
Contributor

azmy60 commented Oct 2, 2023

@mattnSwimd In your generic version of the query, can you pinpoint which line that causes the issue?

@mattnSwimd
Copy link
Author

LEFT JOIN product_prices AS ppTwo ON ppTwo.product_id = mt.product_id
  AND  ppTwo.reason = 5
  AND NOT EXISTS (

It is the second condition on line 47 that caused the issue

@mattnSwimd
Copy link
Author

mattnSwimd commented Oct 3, 2023

It has just happened again with a totally different query

SELECT
  l.id,
  l.name,
  l.type,
  GROUP_CONCAT(ih.colThree)
FROM
  tableone AS l
  LEFT JOIN tabletwo AS i ON i.t_id = l.id
  LEFT JOIN tablethree AS ih ON ih.i_id = i.id
WHERE
  l.condition = 0
  AND i.id IS NOT NULL

In this query it happened on the group concat

10:31:02.563 (mysql)               › Connection fatal error %j Error: Connection lost: The server closed the connection.
    at Socket.<anonymous> (C:\Users\Matt\AppData\Local\Programs\beekeeper-studio\resources\app.asar\node_modules\mysql2\lib\connection.js:101:31)
    at Socket.emit (node:events:390:28)
    at TCP.<anonymous> (node:net:687:12)

This is the error it recieved

@azmy60
Copy link
Contributor

azmy60 commented Oct 3, 2023

@mattnSwimd I've spotted something that potentially is the root cause of this issue and added the patch to this PR #1722. Would you be able to test this using the built files attached on it? Just to confirm from your end.

Note: Specifically this line. It needs the await keyword.

@mattnSwimd
Copy link
Author

If you can give me a quick crash course of what you need me to do, I've only worked with the chromium web containers and electron briefly.

@azmy60
Copy link
Contributor

azmy60 commented Oct 3, 2023

There is a windows executable that you can download at the bottom of the page. This is the link of for the artifact.

@mattnSwimd
Copy link
Author

I just ran the second query with that artifact, and it did not mess up on the group concat. I think that change fixes it.

@azmy60
Copy link
Contributor

azmy60 commented Oct 3, 2023

Thanks @mattnSwimd ! That's great to hear : )

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

Successfully merging a pull request may close this issue.

3 participants