Casting dates and times into integers works differently in 5.1-micro
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Undecided
|
Sergei Golubchik |
Bug Description
Casting and comparing dates and times into or to integers does not work in 5.1-micro as it works in mysql-5.1. For a timestamp "YYYY-MM-DD HH:MM:SS" , mysql-5.1 produces an integer YYYYMMDDHHMMSS whereas 5.1-micro produces just YYYY
test case
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f1 TIME, f2 DATE, f3 DATETIME);
INSERT INTO t1 VALUES ('11:22:
SELECT CAST(f1 AS UNSIGNED), CAST(f2 AS UNSIGNED), CAST(f3 AS UNSIGNED) FROM t1;
5.1-micro returns:
+------
| CAST(f1 AS UNSIGNED) | CAST(f2 AS UNSIGNED) | CAST(f3 AS UNSIGNED) |
+------
| 11 | 2011 | 2011 |
+------
mysql-5.1 returns:
+------
| CAST(f1 AS UNSIGNED) | CAST(f2 AS UNSIGNED) | CAST(f3 AS UNSIGNED) |
+------
| 112233 | 20111213 | 20111213112233 |
+------
Related branches
Changed in maria: | |
milestone: | none → 5.3 |
assignee: | nobody → Sergei (sergii) |
Changed in maria: | |
status: | New → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |