Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5.5
-
None
-
None
-
Windows 10, 10.5.5-MariaDB, tested in HeidiSQL and also command line.
Description
Please see steps to reproduce as follows....
CREATE TABLE `a` (
`someField` VARCHAR(50) NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
/* This fails correctly with an INT conversion error (1292)
INSERT INTO A
WITH CTE AS (SELECT CAST(LTRIM(RTRIM('N/A')) AS INT) AS someNumber WHERE CAST(LTRIM(RTRIM('N/A')) AS INT) = 0)
SELECT 'blah' FROM CTE; */
/* but this runs okay with the CAST changing 'N/A' to a 0, only when you attempt any INSERT do you get an error
WITH CTE AS (SELECT CAST(LTRIM(RTRIM('N/A')) AS INT) AS someNumber WHERE CAST(LTRIM(RTRIM('N/A')) AS INT) = 0)
SELECT 'blah' FROM CTE; */
DROP TABLE A;
/* Which one is the preferred behavior? Can we get it consistent please! */