Description:
When I cast from signed to unsigned, I need to work with 32-bit numbers. For example,
mysql> select cast(-2164260863 as unsigned);
+-------------------------------+
| cast(-2164260863 as unsigned) |
+-------------------------------+
| 18446744071545290753 |
+-------------------------------+
1 row in set (0.01 sec)
but I need result like
mysql> select (-2164260863+0x100000000) % 0x100000000;
+-----------------------------------------+
| (-2164260863+0x100000000) % 0x100000000 |
+-----------------------------------------+
| 2130706433 |
+-----------------------------------------+
1 row in set (0.00 sec)
How to repeat:
mysql> select cast(-2164260863 as unsigned);
+-------------------------------+
| cast(-2164260863 as unsigned) |
+-------------------------------+
| 18446744071545290753 |
+-------------------------------+
1 row in set (0.01 sec)
but I need result like
mysql> select (-2164260863+0x100000000) % 0x100000000;
+-----------------------------------------+
| (-2164260863+0x100000000) % 0x100000000 |
+-----------------------------------------+
| 2130706433 |
+-----------------------------------------+
1 row in set (0.00 sec)
Suggested fix:
Please add to cast() option like cast(num as unsigned int(4)) or describe it in your documentation if it is realized now.
Thx for support ;)