Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
-
10.2.13
-
None
-
Linux, Ubuntu 14.04, n.a.
Description
Window Functions seems to return string instead of numbers:
Just following your examples here:
https://mariadb.com/kb/en/library/window-functions-overview/
SELECT salary, SUM(salary) OVER () FROM employee_salaries; |
+--------+---------------------+ |
| salary | SUM(salary) OVER () | |
+--------+---------------------+ |
| 3500 | 17750 |
|
| 3000 | 17750 |
|
| 2800 | 17750 |
|
| 2500 | 17750 |
|
| 2200 | 17750 |
|
| 1800 | 17750 |
|
| 500 | 17750 |
|
| 400 | 17750 |
|
| 300 | 17750 |
|
| 300 | 17750 |
|
| 250 | 17750 |
|
| 200 | 17750 |
|
+--------+---------------------+ |
SELECT salary, CAST(SUM(salary) OVER () AS INT) FROM employee_salaries; |
+--------+----------------------------------+ |
| salary | CAST(SUM(salary) OVER () AS INT) | |
+--------+----------------------------------+ |
| 3500 | 17750 |
|
| 3000 | 17750 |
|
| 2800 | 17750 |
|
| 2500 | 17750 |
|
| 2200 | 17750 |
|
| 1800 | 17750 |
|
| 500 | 17750 |
|
| 400 | 17750 |
|
| 300 | 17750 |
|
| 300 | 17750 |
|
| 250 | 17750 |
|
| 200 | 17750 |
|
+--------+----------------------------------+ |
If you did not fake the docu I would say you have introduced a bug...
I do not know if this is dramatic. But I could imagine, that some applications relay on the data type and behave differently/wrong?
Attachments
Issue Links
- is duplicated by
-
MDEV-15263 Different justification behaviour for integer mysql client output
- Closed