Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Transactions Not Working IN HediSQL but are working in PHPMYADMIN

jocose's profile image jocose posted 1 month ago in General Permalink

I have the following code:

`START TRANSACTION; UPDATE clients SET invoice_count = @ic := invoice_count + 1 WHERE clients.id = 7;

INSERT INTO invoices (client_invoice_count, grand_totalz) VALUES(( SELECT @ic) ,1208);

SELECT LAST_INSERT_ID(); COMMIT; `

I added a "z" to grand_total so that the second query fails. Since i'm using "START TRANSACTION" auto_commit should be 0 and the update before the insert should not commit to the database.

The problem is that it does commit every single time.

However if I run this exact same command in PHPMYADMIN it works as expected. The insert fails and the update isn't committed.

What is going on?

jocose's profile image jocose posted 1 month ago Permalink

NOTE: I am using MYSQL 5.7 and, yes, InnoDB is set for all the tables being used.

ansgar's profile image ansgar posted 1 month ago Permalink

Confirmed, on MariaDB 10.3 with Heidi 10.2.

Any clue what could cause that?

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.