[MDEV-15728] main.thread_id_overflow fails in ps-protocol Created: 2018-03-29  Updated: 2018-04-12  Resolved: 2018-04-12

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.3
Fix Version/s: 10.3.6

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

On Linux ./mtr --ps-protocol thread_id_overflow gives:

main.thread_id_overflow                  [ fail ]
        Test ended at 2018-03-29 19:47:18
 
CURRENT_TEST: main.thread_id_overflow
--- /home/svoj/devel/maria/mariadb/mysql-test/r/thread_id_overflow.result	2018-03-29 19:44:00.133283709 +0400
+++ /home/svoj/devel/maria/mariadb/mysql-test/r/thread_id_overflow.reject	2018-03-29 19:47:18.017905411 +0400
@@ -9,7 +9,7 @@
 connection con3;
 SELECT CONNECTION_ID();
 CONNECTION_ID()
-4294967294
+-2
 connection default;
 SET GLOBAL DEBUG_DBUG=@orig_debug;
 connect con4, localhost,root;

There seem to be no problems until the value gets to CONNECTION_ID(). This patch helps, but I fail to understand why original code works in normal mode:

diff --git a/sql/item_func.h b/sql/item_func.h
index f33b936..6be2a32 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -849,7 +849,7 @@ class Item_func_connection_id :public Item_long_func
   longlong value;
 
 public:
-  Item_func_connection_id(THD *thd): Item_long_func(thd) {}
+  Item_func_connection_id(THD *thd): Item_long_func(thd) { unsigned_flag= 1; }
   const char *func_name() const { return "connection_id"; }
   void fix_length_and_dec();
   bool fix_fields(THD *thd, Item **ref);


Generated at Thu Feb 08 08:23:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.