Bug #58011 incorrect row number in the error message
Submitted: 5 Nov 2010 11:04 Modified: 30 Apr 2015 7:56
Reporter: Sergei Golubchik Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.1.52, 5.5 OS:Any
Assigned to: CPU Architecture:Any

[5 Nov 2010 11:04] Sergei Golubchik
Description:
Error message says 

Incorrect datetime value: '' for column 'NOW()' at row 2

while there is only one row involved.

In 5.1 the error message is correct for innodb, wrong for myisam.
In 5.5 it's wrong for innodb too.

How to repeat:
CREATE TABLE t1(a INT) ENGINE=myisam;
INSERT INTO t1 VALUES (0);
SET SQL_MODE='STRICT_ALL_TABLES';
CREATE TABLE t2 
  SELECT LEAST((SELECT '' FROM t1),NOW()) FROM t1;
DROP TABLE t1;
[5 Nov 2010 11:31] Valeriy Kravchuk
Verified with 5.1.52:

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot -proot -P3310 test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.1.52-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE TABLE t1(a INT) ENGINE=myisam;
Query OK, 0 rows affected (0.05 sec)

mysql> INSERT INTO t1 VALUES (0);
Query OK, 1 row affected (0.00 sec)

mysql> SET SQL_MODE='STRICT_ALL_TABLES';
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t2
    ->   SELECT LEAST((SELECT '' FROM t1),NOW()) FROM t1;
ERROR 1292 (22007): Incorrect datetime value: '' for column 'NOW()' at row 2
[30 Apr 2015 7:56] Ståle Deraas
Not repeatable in 5.5