Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
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);
|