MySQL Forums
Forum List  »  Performance

Values not inserting into MySQL Database table
Posted by: Shan Abdussalam
Date: November 11, 2015 06:13AM

This is a problem that has been haunting me for some time. I have a PHP Web application built on Zend. For a particular feature, I have around 10-20 MySQL queries that get executed within a transaction. Out of these queries, some queries are used to delete values and others to insert values. 99% of the time everything works perfectly. But every now and again, some values are not inserted into the tables. I tried the following to debug this but to no avail:

1. Logged all MySQL queries by setting log = /var/log/mysql/mysql.log in my.cnf file. The necessary queries are being logged and when I execute them manually, the insert takes place correctly.
2. Checked the return value after the insert and it returns the primary key of the table.
3. Checked using newrelic if there was any unusual traffic on the server at these instances, but found out that it was ok
It does not seem to be an issue with the code and I am somehow inclined to believe that it has to be some issues with the MySQL DB.

Another strange thing that I want to mention with regards to this is: In one table the primary key is auto-incremented. After the insert the return value gives me the auto incremented value in the log (eg: 32363). But when I check the table, I can find 32362 and 32364, but not 32363.

Options: ReplyQuote


Subject
Views
Written By
Posted
Values not inserting into MySQL Database table
8982
November 11, 2015 06:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.