Bug #20140 | UPDATE query is affecting rows it shouldn't affect | ||
---|---|---|---|
Submitted: | 30 May 2006 9:24 | Modified: | 30 May 2006 10:07 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.13 | OS: | Linux (linux) |
Assigned to: | CPU Architecture: | Any |
[30 May 2006 9:24]
[ name withheld ]
[30 May 2006 10:07]
Tonci Grgin
Hi Anders, thanks for your problem report. I was unable to verify with latest bk on Suse 10.0, MyISAM and InnoDB with script you provided: mysql> select version(); +--------------+ | version() | +--------------+ | 5.0.23-debug | +--------------+ 1 row in set (0.00 sec) mysql> select * from tblTransactions\G *************************** 1. row *************************** iTransactionId: 1000 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: NULL vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: NULL vSecondaryReferenceNr: NULL iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: PENDING vTransactionResultCode: NULL dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 *************************** 2. row *************************** iTransactionId: 1001 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: NULL vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: NULL vSecondaryReferenceNr: NULL iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: PENDING vTransactionResultCode: NULL dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 2 rows in set (0.00 sec) mysql> UPDATE tblTransactions SET cCountryCode='se' WHERE iTransactionId=1001; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from tblTransactions\G *************************** 1. row *************************** iTransactionId: 1000 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: NULL vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: NULL vSecondaryReferenceNr: NULL iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: PENDING vTransactionResultCode: NULL dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 *************************** 2. row *************************** iTransactionId: 1001 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: se vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: NULL vSecondaryReferenceNr: NULL iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: PENDING vTransactionResultCode: NULL dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 2 rows in set (0.00 sec) mysql> UPDATE tblTransactions SET vReferenceNr='', eTransactionState='REDIRECT ',vTransactionResultCode='', vSecondaryReferenceNr='' WHERE iTransactionId=1001; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from tblTransactions\G *************************** 1. row *************************** iTransactionId: 1000 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: NULL vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: NULL vSecondaryReferenceNr: NULL iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: PENDING vTransactionResultCode: NULL dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 *************************** 2. row *************************** iTransactionId: 1001 iUserId: 201 iAmount: 50 vFirstName: NULL vLastName: NULL cCountryCode: se vAddress: NULL vCity: NULL vZipCode: NULL vEmail: NULL vReferenceNr: vSecondaryReferenceNr: iIPAddressUser: 3232235681 dTime: 2006-05-30 11:44:21 iNumberOfAttempts: 1 eTransactionState: REDIRECTED vTransactionResultCode: dRecurringNextDate: NULL eRecurringInterval: NONE iCreditCardType: NULL iRecieptMailSent: 0 2 rows in set (0.01 sec) mysql>