← Back to team overview

maria-developers team mailing list archive

Re: b0d21b7: MDEV-14567 Include full name of object in message about incorrect value for column.

 

Hi, Alexey!

On Nov 07, Alexey Botchkov wrote:
> >  But that's fine to show, right? No NULL, no garbage.
> 
> Looks like this:
>            Incorrect datetime value: '0000-00-00 00:00:00' for column
> 'test.#sql-691c_15d.c1' at row 1
> No NULL, but that #sql-something name doesn't tell anything and is
> always different so we have to add lots of --replace-result in tests.

Right, but we already have a lot of replace-result in tests.
#sql-691c_15d showing in error messages in a different issue (but see
below).

> My patch shows it as.this:
>  Incorrect datetime value: '0000-00-00 00:00:00' for column ' {temporary}.c1' at row 1

This isn't much better in my opinion. It only helps tests to avoid replace-result,
and I always believed in solving test problems in tests, not in the
server. Meaning, exactly, replace-result. For the end user #sql-691c_15d
and {temporary} has about the save amount of information.

> > By the way, can this error ever happen for internal temporary tables?
> Yes.
> In our tests it happens pretty often.
> Code like this:
> CREATE TABLE t3(c1 DATETIME NOT NULL);
> INSERT INTO t3 VALUES (0);
> 
> --echo
> SET sql_mode = TRADITIONAL;
> 
> --echo
> --error ER_TRUNCATED_WRONG_VALUE
> ALTER TABLE t3 ADD INDEX(c1);

Oh, ALTER TABLE.
This is different. In one of the system versioning related fixes,
midenok added a TABLE_SHARE::error_table_name() method to be used
in error messages in ALTER. See 912769b7dc.

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


References