Phpmyadmin: History table saving only last query in multi query statement

Created on 13 Oct 2019  Â·  3Comments  Â·  Source: phpmyadmin/phpmyadmin

Describe the bug

Executing multi query will result in only last one saved in history table.

To Reproduce

Execute:

START TRANSACTION;
DELETE from `xyz`;
rollback;

Check history table. Only rollback command gets saved.

Expected behavior

All queries should be saved. Either in one entry or multiple.

bug

All 3 comments

The last sentence of @fliespl is interesting…

@williamdes @mauriciofauth @ibennetch , what do you think please? Should a "multi-queries" request be logged as one entry or should it be as many entries than the number of queries?

My opinion would be to have one entry with all queries because in some cases this is the whole pack which is relevant (for instance when you have some queries creating temporary table, starting a transaction, setting autocommit to 0, …).

Thank you for your feedback.

@Tithugues one entry seems like a good idea

Found another issue related to this.

If we execute multiple queries (in example we have table with 1 column with primary key):

insert into migration_versions values (1);
insert into migration_versions values (2);
insert into migration_versions values (1);

setHistory is never called even though first two queries executed correctly and only third one failed. Currently not sure what it should save. Maybe add two columns in history table? One for successful queries and second one for failed ones?

Another thing that might be worth thinking about is to provide ability, so that we can configure PMA to always execute multiple queries in transaction (either by default or configurable) with rollback if any error happens.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChrisHSandN picture ChrisHSandN  Â·  3Comments

barkermn01 picture barkermn01  Â·  3Comments

bm322741 picture bm322741  Â·  3Comments

ChrisHSandN picture ChrisHSandN  Â·  3Comments

KDCinfo picture KDCinfo  Â·  3Comments