Why is the mysql lookup field updated for no reason?

ask a question
mysql"s order table somehow, the pay_time field data will change. A random line is updated into the sum of order adding time + a fixed period of time. I am not sure which project links the updated data in the database, or there are scheduled tasks, how to check?

problem description

the environmental background of the problems and what methods you have tried

try to find the commonness of these orders, but there is nothing in common in the fields. Some of my personal orders have been updated and some have not.

related codes

part of order data


CREATE TABLE `aws_orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT "id ",
  `oid` varchar(32) DEFAULT "0" COMMENT "ID",
  `plat_oid` varchar(64) DEFAULT "0" COMMENT "",
  `uid` int(10) unsigned DEFAULT "0" COMMENT "ID",
  `add_time` int(10) unsigned DEFAULT "0" COMMENT "",
  `amount` int(10) unsigned DEFAULT "0" COMMENT "",
  `pay_amount` decimal(7,2) unsigned DEFAULT "0.00" COMMENT "",
  `pay_time` varchar(20) DEFAULT "0" COMMENT "",
  `is_delete` tinyint(3) unsigned DEFAULT "0" COMMENT " 0 1",
  `pay_type` tinyint(3) unsigned DEFAULT "0" COMMENT " 1 2 3",
  `from` tinyint(3) unsigned DEFAULT "0" COMMENT " 1 2  3IOS 4Android",
  `coupon_id` int(10) unsigned DEFAULT "0" COMMENT "ID",
  `from_plat` tinyint(3) unsigned DEFAULT "0" COMMENT " 0 1ios 2android 3IPAD 4Mobile",
  `pay_plat` tinyint(3) unsigned DEFAULT "0" COMMENT " 0 1ios 2android 3IPAD 4Mobile",
  `type` tinyint(3) unsigned DEFAULT "0" COMMENT " 0 1 2",
  `full_cut` varchar(20) DEFAULT "0" COMMENT " ",
  PRIMARY KEY (`id`),
  KEY `i_oid` (`oid`) USING BTREE,
  KEY `i_uid` (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=48035 DEFAULT CHARSET=utf8

the problem is the pay_time field, which originally has a value. I don"t know why it has been updated after a period of time. I have asked the relevant colleagues of the company and leader, that no one is operating at the back end. All operations related to the order table, such as payment callbacks and placing orders, are logged, and there is no such stifling operation.

some error data


+------------+-----------------+----------------------+--------+-------+
| add_time   | pay_time        | oid                  | uid    | ispay |
+------------+-----------------+----------------------+--------+-------+
| 1524973498 | 1533008773.6939 | 1524973498601898106  |  60189 |     2 |
| 1524975582 | 1533010805.9663 | 15249755824529331409 | 452933 |     0 |
| 1525001588 | 1533036851.0322 | 15250015884533789469 | 453378 |     2 |
| 1525001992 | 1533037260.197  | 15250019924533763961 | 453376 |     2 |
| 1525002153 | 1533037381.1686 | 15250021534533765879 | 453376 |     2 |
+------------+-----------------+----------------------+--------+-------+

there is also a point here. The integers originally stored in pay_time are transformed into floating-point digital timestamps after data confusion.

what result do you expect? What is the error message actually seen?

now I want to know why it has been updated for no reason

Apr.05,2021

you can try.
find the company's DBA, to check the log of executed SQL statements, find the corresponding sql, and then find which side of the program to update.


in terms of update, this field should have accessed microtim (true)

Search for this expression in the

project

or

search for all code checks that may update the table


check the binlog, to see the update statement, but do not know what source, the data posted below, reference.

error data of mysql database:

+-----------------+----------------------+--------+-------+--------------------+-----------------------------------------------------+
| pay_time        | oid                  | uid    | ispay | cha_time           | beizhu                                              |
+-----------------+----------------------+--------+-------+--------------------+-----------------------------------------------------+

| 1533037381.1686 | 15250021534533765879 | 453376 |     2 |  8035228.168600082 | NULL                                                |
+-----------------+----------------------+--------+-------+--------------------+-----------------------------------------------------+


binlog:

15733 -sharp180731 19:43:01 server id 1  end_log_pos 1069695028 CRC32 0xc258c5e8   Update_rows: table id 172 flags: STMT_END_F
15734 -sharp-sharp-sharp UPDATE `julyedu`.`aws_orders`
15735 -sharp-sharp-sharp WHERE
15736 -sharp-sharp-sharp   @1=48183
15737 -sharp-sharp-sharp   @2='15250021534533765879'
15738 -sharp-sharp-sharp   @3='2018042921001004880586962338'
15739 -sharp-sharp-sharp   @4=453376
15740 -sharp-sharp-sharp   @5=1525002153
15741 -sharp-sharp-sharp   @6=1200
15742 -sharp-sharp-sharp   @7=389.00
15743 -sharp-sharp-sharp   @8='1525002163.0765'
15744 -sharp-sharp-sharp   @9=0
15745 -sharp-sharp-sharp   @10=2
15746 -sharp-sharp-sharp   @11=0
15747 -sharp-sharp-sharp   @12=0
15748 -sharp-sharp-sharp   @13=1
15749 -sharp-sharp-sharp   @14=1
15750 -sharp-sharp-sharp   @15=0
15751 -sharp-sharp-sharp   @16='0'
15752 -sharp-sharp-sharp SET
15753 -sharp-sharp-sharp   @1=48183
15754 -sharp-sharp-sharp   @2='15250021534533765879'
15755 -sharp-sharp-sharp   @3='2018042921001004880586962338'
15756 -sharp-sharp-sharp   @4=453376
15757 -sharp-sharp-sharp   @5=1525002153
15758 -sharp-sharp-sharp   @6=1200
15759 -sharp-sharp-sharp   @7=389.00
15760 -sharp-sharp-sharp   @8='1533037381.1686'
15761 -sharp-sharp-sharp   @9=0
15762 -sharp-sharp-sharp   @10=2
15763 -sharp-sharp-sharp   @11=0
15764 -sharp-sharp-sharp   @12=0
15765 -sharp-sharp-sharp   @13=1
15766 -sharp-sharp-sharp   @14=1
15767 -sharp-sharp-sharp   @15=0
15768 -sharp-sharp-sharp   @16='0'
15769 -sharp at 1069695028
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36095-2bfc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36095-2bfc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?