[MDEV-32645] CAST(AS UNSIGNED) fails with --view-protocol Created: 2023-11-01  Updated: 2024-01-09  Resolved: 2024-01-09

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2, 11.4.1

Type: Bug Priority: Critical
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-32461 types changed in view protocol in cas... Closed

 Description   

This MTR test:

SELECT CAST(-1e0 AS UNSIGNED);

fails when executed with --view-protocol with this diff:

@@ -1,5 +1,5 @@
 SELECT CAST(-1e0 AS UNSIGNED);
 CAST(-1e0 AS UNSIGNED)
-0
+18446744073709551615
 Warnings:
-Note	1916	Got overflow when converting '-1' to UNSIGNED BIGINT. Value truncated
+Note	1105	Cast to unsigned converted negative integer to it's positive complement



 Comments   
Comment by Alexander Barkov [ 2023-11-13 ]

Hello serg,

Can you please review a patch for this bug?

https://github.com/MariaDB/server/commit/c50eed1e904b5c3a689a4c1e5036863021f2fbbc

Thanks.

Generated at Thu Feb 08 10:32:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.