SHOW connection_id() In mysql, I can inspect the current Connection ID by using:
SELECT connection_id();

And it returns the id:
# connection_id()
'6558851'

Or:
SELECT * from information_schema.processlist 
WHERE id = connection_id();

# ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO
'6558851', 'abc', '99-51-01-something:55353', 'XA', 'Query', '0', 'executing', 'select * from information_schema.processlist plist where id=connection_id()'

Where is that function (if it's a function?) defined though? I've checked in sys and information_schema and was unable to find a function defined with that name. Where is this located then?

Update, on reviewing this a bit more, it seems like these are just built-in functions to the mysql database -- i.e., no different than using a GROUP_CONCAT() or any other function, for example:
SELECT connection_id(), now(), id, email FROM auth_user limit 10;

In this way it would be defined in the C++ code rather than as a user/system-defined function. Is that a correct understanding?
It is a thread _id which you see in SHOW Prpcesslist

ID


The connection identifier. This is the same value displayed in the Id column of the SHOW PROCESSLIST statement, displayed in the PROCESSLIST_ID column of the Performance Schema threads table, and returned by the CONNECTION_ID() function within the thread.

https://dev.mysql.com/doc/refman/8.0/en/performance-schema-processlist-table.html