table model (not good but i have to deal with..)
CREATE TABLE `vr_connection_param` (
`connectionSize` enum('SMALL','MEDIUM','LARGE') COLLATE latin1_general_ci NOT NULL,
`type` enum('OVP_BASIC','OVP_EXTENDED','TPASS') COLLATE latin1_general_ci NOT NULL,
`numberConnection` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`connectionSize`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
data recorded
select * from vr_connection_param;
+----------------+--------------+------------------+
| connectionSize | type | numberConnection |
+----------------+--------------+------------------+
| SMALL | OVP_BASIC | 5 |
| SMALL | OVP_EXTENDED | 5 |
| MEDIUM | OVP_BASIC | 10 |
| MEDIUM | OVP_EXTENDED | 10 |
| LARGE | OVP_BASIC | 30 |
| LARGE | OVP_EXTENDED | 30 |
+----------------+--------------+------------------+
try to update
update vr_connection_param
INNER JOIN
(select distinct concat(`connectionSize`,`type`) from vr_connection_param where concat(`connectionSize`,`type`) like '%OVP_BASIC%')
AS TMP
SET type='OVPFE_EXPRESS';
error returned
ERROR 1265 (01000): Data truncated for column 'type' at row 1
You're trying to set the value 'OVPFE_EXPRESS' in the type column which is an enum that doesn't contain that value. So the value is "truncated" (to '', apparently, according to my MySQL install).
It's also worth noting that the entire INNER JOIN part of your statement is a no-op, since you don't do anything with TMP. So you're just doing an UPDATE with (effectively) no WHERE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With