This software is a MySQL extension designed to facilitate storage of persistent variables. It provides an efficient and reliable way to store data permanently within a MySQL database.
With MySQL Global User Variables UDF, you can store any data, including BLOBs, into these persistent variables. One of the main advantages of this software is that updates are atomic and way faster than MEMORY tables, making it an efficient way to handle counters and sequences.
To store an unlimited number of user variables as long as memory is available, users can use the GLOBAL_STORE(), which stores a new shared global variable. Examples of this include DO GLOBAL_STORE("online_users", 42) and DO GLOBAL_STORE("secret_key", "pajfUyfnd"). The GLOBAL_STORE() function always returns 1, unless an error occurs.
To fetch a value, MySQL Global User Variables UDF uses the GLOBAL_GET() function. The value is returned, or NULL if the variable is undefined. An example of this is SELECT GLOBAL_GET("online_users") which will return 42.
Atomic increments can be done with a single function call using the GLOBAL_ADD() function, and the return value is the new value of the variable. An example of this is DO GLOBAL_ADD("online_users", 1) followed by SELECT GLOBAL_ADD("online_users", -4), which will return 39. Adding a value to an undefined variable will return NULL.
For the installation process, simply compile and install the library by typing "make install" (as root) on most systems. The shared library is installed as /usr/local/lib/udf_global_user_variables.so. You can also edit the MAX_NAME_LENGTH and MAX_VALUE_LENGTH variables to meet your specific application needs.
In conclusion, MySQL Global User Variables UDF is an excellent software for anyone who wants to store persistent variables in memory, making it easier to access saved data across multiple platforms. With this software, you can create an unlimited number of user variables and use the GLOBAL_STORE(), GLOBAL_GET(), and GLOBAL_ADD() functions to manage your data with ease.
Version 1.1: N/A