The output of MySQL "show warnings" identifies the problematic lines by number. What is the best way to quickly see all the data for such a row?
For example, after the operator starts, the updateresult indicates "1 warning", and the start show warningsgives the following message: "Data is truncated for the person column on line 65278." How can I select this particular line?
Here is a concrete example of researching a solution limit:
create table test1 (
id mediumint,
value varchar(2)
);
insert into test1 (id, value) values
(11, "a"),
(12, "b"),
(13, "c"),
(14, "d"),
(15, "ee"),
(16, "ff");
update test1 set value = concat(value, "X") where id % 2 = 1;
show warnings;
This leads to the output of this warning:
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1265 | Data truncated for column 'value' at row 5 |
+---------+------+--------------------------------------------+
To get only this line 5, I can do this:
select * from test1 limit 4,1;
which leads to the following:
+------+-------+
| id | value |
+------+-------+
| 15 | ee |
+------+-------+
, limit (4) , , , , , where.