Dear All,
I have a scenario where I notice in my log file for few different instances there
is one query running and another one is called and kills the former running query.My application is based on C# and using .net connector.I have attached two sample cases but I have many samples to be shown.

Sample 1
If you see this statement 320 Query KILL QUERY 319
thereafter the next statement is only missing not in the database butthe rest are in the
database.
319 Query Insert into tblReceiptDetails Set receiptID=2162,receiptDetailsID = 3687,
outletID = 11,stockID = 3120, productID= 3007,productType = 'Imei', productQuantity = 1 ,
productSIQ ='359478030011584', costPrice = 257, sellingPrice = 290, profitAmount =33,
profit = 'y'
Sample 2
100612 14:15:49 780 Query KILL QUERY 766
Then the query 766 is never run successfully and the delete neverhappen. I am very sure
I never code a KILL QUERY statement in my program. So what bug is this can anyone help me
on this? Thank you.

Recommended Answers

All 2 Replies

Hello,

The only thing I can think of is probably off but it may be it. You mentioned that you are running the queries from C code. Are you termination the actual sql code entries with a semi-colon (;). If not then mysql would be waiting for you to finish entering the query before it executes. Does that make sense?

Try running the query from the mysql command line interface and you will see what I am referring to. Even when you type QUIT it does not execute till you enter the semi-colon.

Insert into tblReceiptDetails Set receiptID=2162,receiptDetailsID = 3687,
outletID = 11,stockID = 3120, productID= 3007,productType = 'Imei', productQuantity = 1 ,
productSIQ ='359478030011584', costPrice = 257, sellingPrice = 290, profitAmount =33,
profit = 'y' ;

The other thing that I notice is the format of your insert statement. I normally use a format where the fields are in the same order as the fields in the table and it looks something like this:

CREATE TABLE `Inventory` (
  `Item_ID` int(10) NOT NULL AUTO_INCREMENT,
  `Category_ID` int(10) DEFAULT NULL,
  `Category_Item_ID` int(10) DEFAULT NULL,
  `Item_Short_Description` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
  `On_Hand` int(10) DEFAULT '0',
  `Allocated` int(10) DEFAULT '0',
  `Re_Order_Level` int(10) DEFAULT '0',
  `Date_Last_Used` date DEFAULT NULL,
  `Date_Last_Added` date DEFAULT NULL,
  `Active` smallint(6) DEFAULT '0',
  `Date_Allocated` date DEFAULT NULL,
  `Min_Spare` int(10) DEFAULT '2',
  PRIMARY KEY (`Item_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=125 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of Inventory
-- ----------------------------
INSERT INTO `Inventory` VALUES ('1', '1', '1', 'PIII 1.1Ghz', '0', '0', '0', '2008-12-14', '2008-11-03', '1', null, '2');
INSERT INTO `Inventory` VALUES ('2', '1', '2', 'Celeron 1.4GHz', '1', '0', '0', '2008-12-03', '2008-11-09', '0', null, '2');
INSERT INTO `Inventory` VALUES ('3', '1', '3', 'Celeron 2.0GHz', '2', '0', '0', null, '2008-11-03', '0', null, '2');
INSERT INTO `Inventory` VALUES ('4', '1', '4', 'Celeron 2.4GHz', '1', '0', '0', null, '2008-11-03', '0', null, '2');
INSERT INTO `Inventory` VALUES ('5', '1', '5', 'Celeron 2.8GHz', '2', '0', '0', null, '2008-12-04', '0', null, '2');

Dear Rch,
No actually the sample I shown you at the top I took from the mysql log file. In actual factual in my C# coding the semi colon do exist. This problem does not exist for all my queries only certain queries only. Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.