[MDEV-5447] CONNECT: no error on conversion 0 -> NULL with strict mode Created: 2013-12-14 Updated: 2013-12-23 Resolved: 2013-12-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.6 |
| Fix Version/s: | 10.0.5, 10.0.6, 10.0.7, 10.0.8 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Olivier Bertrand |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I don't know if this is really a bug, but this behavior is different from the one we rely on, with this SQL_MODE:
Both the DEFAULT 0 clause and the explicit 0 INSERT specify a value that is not supported for this data format. The strict mode is meant to prevent silent data changes. But even without strict mode, maybe a warnings is expected? |
| Comments |
| Comment by Olivier Bertrand [ 2013-12-23 ] |
|
Indeed CONNECT handles NULL's in a specific way. |
| Comment by Federico Razzoli [ 2013-12-23 ] |
|
I understand that some text files can't contain NULLs. And this may be a personal opinion. When @@sql_mode='STRICT_ALL_TABLES' and I try to insert a 0 in a NULL-able column, I expect an error, and if @@sql_mode='' I expect a warning (it happens with other engines). This seems to me useful, because if I try to explicitly insert a 0, or I specify a DEFAULT 0, it is probably a mistake. |
| Comment by Olivier Bertrand [ 2013-12-23 ] |
|
It is not a mistake but just the fact that CONNECT does not handle nulls like other engines (at least for file based tables) |