Search code examples
mysqlwarningsalter

MySql - How to select the row a warning occurred at?


While running an ALTER TABLE statement, I got these warnings back:

enter image description here

How do I SELECT from my table at row 3522 to see what went wrong?

I'm not sure if row refers to the primary key or what?

I tried something like this:

SELECT * FROM table LIMIT 3521,1; // for row 3522


Solution

  • Have you tried to measure length of 'date_due_lastupdated' and 'date_completion_lastupdated' with your SQL? At these specific rows data length in these fields should be the same size as column max lenght.

    Warnings are related to primary key - your query is ok.

    You can create table with varchar(7) - fill it with data (5-7 char lenght) and then alter column varchar(6).