← Back to team overview

maria-discuss team mailing list archive

Re: Reqeust for SHOW FULL FIELDS FROM and virtual tables in MariaDB



>>>>> "Peter" == Peter Laursen <peter_laursen@xxxxxxxxxx> writes:

Peter> I have a few more points to consider:
Peter> CREATE TABLE table1 (as before);

Peter> SET SQL_MODE = 'strict_all_tables';

Peter> INSERT INTO `test`.`table1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); --
Peter> success
Peter> SHOW WARNINGS -- empty set
Peter> -- this is actually good, even a little inconsistent with what comes next.
Peter> But GRID-type GUI clients could have difficulties working with virtual
Peter> colums if it behaved differently.

Peter> UPDATE `test`.`table1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND
Peter> `d`='a';
Peter> SHOW WARNINGS; -- 1647 The value specified for computed column 'd' in table
Peter> 'table1' ignored
Peter> -- In strict mode we should have an error and not a warning here, I think.

Peter> INSERT INTO `test`.`table1`(`a`,`b`,`c`,`d`) VALUES ( '2','b','3','d');
Peter> -- again two warnings (not errors) here for 3rd and 4th column's INSERT

Peter> -- In summary
Peter> -- I like that it is not returning warnings or errors for values
Peter> -- but in strict mode I think errors whoud be returned where warnings
Peter> currently are. Virtual columns should be sql_mode-aware'.

Agree. Will be fixed in 5.3.