| 4488 | static uint thd_key_no = 42; |
| 4489 | |
| 4490 | int thd_key_create(MYSQL_THD_KEY_T *key) |
| 4491 | { |
| 4492 | int flags= PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_STR | |
| 4493 | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT; |
| 4494 | char namebuf[256]; |
| 4495 | snprintf(namebuf, sizeof(namebuf), "%u", thd_key_no++); |
| 4496 | mysql_prlock_wrlock(&LOCK_system_variables_hash); |
| 4497 | // non-letters in the name as an extra safety |
| 4498 | st_bookmark *bookmark= register_var("\a\v\a\t\a\r", namebuf, flags); |
| 4499 | mysql_prlock_unlock(&LOCK_system_variables_hash); |
| 4500 | if (bookmark) |
| 4501 | { |
| 4502 | *key= bookmark->offset; |
| 4503 | return 0; |
| 4504 | } |
| 4505 | return ENOMEM; |
| 4506 | } |
| 4507 | |
| 4508 | void thd_key_delete(MYSQL_THD_KEY_T *key) |
| 4509 | { |
nothing calls this directly
no test coverage detected