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

CTRL + ENTER executing sql command 2 times #14460

Closed
spankandex opened this issue Jul 5, 2018 · 13 comments
Closed

CTRL + ENTER executing sql command 2 times #14460

spankandex opened this issue Jul 5, 2018 · 13 comments
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete ui Issues relating to the user interface
Milestone

Comments

@spankandex
Copy link

Steps to reproduce

  1. Select Database;
  2. Select SQL query.
  3. Use CTRL+Enter keys shortcut to execute query.

Expected behaviour

Executes the command once.

Actual behaviour

Executes the command twice. Try to insert only a row in a simple table. (It is inserted twice)

Server configuration

AWS AMI
Linux

Web server:
Nginx

Database:
MySQL 5.7

PHP version:
7.0.2

phpMyAdmin version:
Latest 4.8.2

Client configuration

Chrome latest version Win

@aroralakshya
Copy link
Contributor

@williamdes, can you repro. this. I could not
server : apache2.4.18
php :7.2
mariadb : 10.3

@williamdes
Copy link
Member

williamdes commented Jul 7, 2018

@nulll-pointer Yes

  • Create an empty table
  • Go to sql tab create an insert statement, fill with random data and CTRL+ enter
  • Row is inserted twice !

Using Google Chrome

@aroralakshya
Copy link
Contributor

Still can't reproduce this.

@spankandex
Copy link
Author

Humm.. I've run the phpmyadmin "install" in a database. Then this issue started happening. Not sure if it was the update or the phpmyadmin tables

@spankandex
Copy link
Author

spankandex commented Jul 7, 2018

I'll try to reproduce it in other server I have.
And maybe this could be a bug due to some extension like ad block or something. I'll try to reproduce in more environments. Thanks for the replies

@spankandex
Copy link
Author

Okay. I ve found it. It only happens if you install phpmyadmin, aka running that script that create pma tables in a database. Can someone confirm this?

@spankandex
Copy link
Author

Damn.. I've found it. I've created the phpmyadmin tables in my aplication database, not in phpmyadmin database as it is recommend to do. It was clearly my mistake. Not sure what to do with this ticket.

Resume of the situation:
-If you create the phpmyadmin tables in a database that is being used for something of your own, statements are executed twice if you use CTRL ENTER shortcut.

@spankandex spankandex reopened this Jul 9, 2018
@spankandex
Copy link
Author

Okay. Found it. It's another reason. Try to save a SQL query "Bookmark this SQL query" function. Once you do this, the issue I specified in bug details starts happening.

Sorry for so many redundant information.

@aroralakshya
Copy link
Contributor

I could reproduce this on the demo server(master branch) by following the steps in your last comment.

@akankshya107
Copy link

Reproduced this exact error. Using the console, you can see that this error is reproduced for every single SQL command.
Server: apache2.4.18
PHP: 7.0
image

@vmcruz
Copy link

vmcruz commented Jul 16, 2018

In summary, in order to reproduce this, the steps are:

  • Go to SQL Tab and create an insert statement
  • Before running the sql statement, "Bookmark this SQL query" by giving it a name
  • Hit CTRL + Enter, SQL Query will be executed and saved in bookmarks, and 1 row will be inserted
  • Go to SQL Tab again and create another insert statement
  • Now when pressing CTRL + Enter, row is inserted twice, or PMA throws an error in case of primary keys duplicate

@Piyush3079
Copy link
Contributor

Another way to reproduce this is:

  1. Go to SQL Tab and execute a query by hitting CTRL + Enter.

  2. The PHP server command line will show that request is sent on import.php twice.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Nov 28, 2018
roelvanduijnhoven pushed a commit to roelvanduijnhoven/phpmyadmin that referenced this issue Feb 22, 2019
This fixes phpmyadmin#14460.

When there are multiple submit buttons, using the CTRL+ENTER shortcut will submit the same form multiple times.

The PMA module adds a lot of duplicate submit buttons. So in that situation it will occur al ot.
roelvanduijnhoven pushed a commit to roelvanduijnhoven/phpmyadmin that referenced this issue Feb 22, 2019
This fixes phpmyadmin#14460.

When there are multiple submit buttons, using the CTRL+ENTER shortcut will submit the same form multiple times.

The PMA module adds a lot of duplicate submit buttons. So in that situation it will occur al ot.

Signed-off-by: Roel van Duijnhoven <roel.duijnhoven@gmail.com>
roelvanduijnhoven pushed a commit to roelvanduijnhoven/phpmyadmin that referenced this issue Feb 22, 2019
This fixes phpmyadmin#14460.

When there are multiple submit buttons, using the CTRL+ENTER shortcut will submit the same form multiple times.

The PMA module adds a lot of duplicate submit buttons. So in that situation it will occur al ot.

Signed-off-by: Roel van Duijnhoven <roel.duijnhoven@gmail.com>
@williamdes williamdes added ui Issues relating to the user interface has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete labels Feb 23, 2019
@williamdes williamdes self-assigned this Apr 25, 2019
@williamdes williamdes added this to the 4.8.6 milestone Apr 25, 2019
williamdes added a commit that referenced this issue Apr 25, 2019
Fixes: #14460
Pull-request: #14968
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Apr 25, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete ui Issues relating to the user interface
Projects
None yet
Development

No branches or pull requests

6 participants