Bug #83901 | insert into...select... with cast function, working error | ||
---|---|---|---|
Submitted: | 21 Nov 2016 8:09 | Modified: | 24 Nov 2016 2:26 |
Reporter: | Lyu Joey | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.6.26 | OS: | Windows (WINDOWS 10) |
Assigned to: | CPU Architecture: | Any |
[21 Nov 2016 8:09]
Lyu Joey
[22 Nov 2016 11:46]
MySQL Verification Team
Hello Lyu Joey, Thank you for the report. Please could you share exact create table statements(SHOW CREATE TABLE <table_name>\G) to reproduce this issue at our end? Also, what is the value set for sql_mode? A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range. A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition etc. Thanks, Umesh
[23 Nov 2016 3:53]
Lyu Joey
CREATE TABLE `t_date` ( `my_date` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE `t_str` ( `my_str` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 sql_mode: STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
[23 Nov 2016 3:59]
Lyu Joey
here is a similar post: http://stackoverflow.com/questions/28796190/using-cast-with-an-insert-into-select
[23 Nov 2016 6:47]
MySQL Verification Team
Thank you for the requested details. Imho, this is by design and expected behavior. When strict mode is in effect, any invalid values are rejected, please see related bug See, https://bugs.mysql.com/bug.php?id=8294
[24 Nov 2016 2:26]
Lyu Joey
thank you~