Home > database >  The influence of mysql rows for bosses to solve
The influence of mysql rows for bosses to solve

Time:09-16

INSERT INTO userbase (Uid, Mobile, site_code)
VALUES
(
'aaa'
'15555555555',
'jyjt'
) ON DUPLICATE KEY UPDATE Uid='aaa',
Mobile='15555555555',
Site_code='jyjt',


INSERT INTO userbase (Uid, Mobile, site_code)
VALUES
(
'aaa'
'15555555555',
NULL
) ON DUPLICATE KEY UPDATE Uid='aaa',
Mobile='15555555555',
Site_code=NULL

As above two SQL, they influence the number of rows in the first execution of 2 why (2), in many times, the influence of the 1 line number is 0, 2 rows have been to 1, the influence of why
Strives for the bosses to solve
Attached the table structure as follows
The CREATE TABLE ` userbase ` (
` Nid ` int (11), NOT NULL AUTO_INCREMENT COMMENT 'primary key digital ID to do something such as QQ number after digital identity role since 10000' remember,
` Uid ` varchar (60) DEFAULT NULL COMMENT 'logic only user login ID',
` Pwd ` varchar (100) the DEFAULT 'COMMENT' user password MD5 encryption,
` Cid ` varchar (60) DEFAULT '0' COMMENT 'offline VIP card number logic only,
` Mobile ` varchar (16) DEFAULT NULL COMMENT 'user's phone number,
` Email ` varchar (64) the DEFAULT NULL COMMENT 'user Email,
` IsActive ` int (2) the DEFAULT '1' COMMENT 'active 0 inactive 1 has been activated 2 3 for unpopular users to remove state',
` LoginCount ` int (9) the DEFAULT '0' COMMENT 'login times',
` LastIp ` varchar (50) DEFAULT 'COMMENT' last login ID ',
` LastTime ` datetime DEFAULT NULL COMMENT 'last login time,
` RegIp ` varchar (50) DEFAULT 'COMMENT' registered IP,
` RegTime ` datetime DEFAULT NULL COMMENT 'registration time,
` CardNo ` varchar (20) DEFAULT 'COMMENT' electronic card members',
` checkEmail ` int (1) the DEFAULT '0' COMMENT 'whether the validation email,
` checkMobile ` int (1) the DEFAULT '0' COMMENT 'whether mobile phone',
` levelId ` int (4) NOT NULL DEFAULT '0' COMMENT 'user level,
` userType ` int (4) the DEFAULT '0' COMMENT 'member type (0 individual users, 1 internal enterprises, 2 external enterprise)',
` levelExpire ` datetime DEFAULT NULL COMMENT 'level expiration time,
` GroupId ` int (11) the DEFAULT '0' COMMENT '0 for individual users, 1 for the enterprise users',
` site_code ` varchar (32) DEFAULT 'hbis' COMMENT' site coding,
` point ` int (10) unsigned DEFAULT '0' COMMENT 'points',
PRIMARY KEY (` Nid `),
The UNIQUE KEY ` idx_uid ` (Uid ` `),
The KEY ` uid ` (uid ` `),
The KEY ` Email ` (` Email `),
The KEY ` CardNo ` (` CardNo `),
KEY Mobile ` ` (` Mobile `),
The KEY ` in_last_time ` (` LastTime `),
The KEY ` in_reg_time ` (` RegTime `),
The KEY ` test_cid ` (` Cid `) USING BTREE,
The KEY ` index_site_code ` (` site_code `)
) ENGINE=InnoDB AUTO_INCREMENT=1161 DEFAULT CHARSET=utf8;

CodePudding user response:

The fact is not like what you said the first two are 2, behind more different:

CodePudding user response:

Feeling # 1 and the host's version is not the same,

CodePudding user response:

Yesterday was 8, tried 5.5 today, as well as the
  • Related