| 366 | /* This is only called if using_udf_functions != 0 */ |
| 367 | |
| 368 | udf_func *find_udf(const char *name,size_t length,bool mark_used) |
| 369 | { |
| 370 | udf_func *udf=0; |
| 371 | DBUG_ENTER("find_udf"); |
| 372 | DBUG_ASSERT(strlen(name) == length); |
| 373 | |
| 374 | if (!initialized) |
| 375 | DBUG_RETURN(NULL); |
| 376 | |
| 377 | DEBUG_SYNC(current_thd, "find_udf_before_lock"); |
| 378 | /* TODO: This should be changed to reader locks someday! */ |
| 379 | if (mark_used) |
| 380 | mysql_rwlock_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ |
| 381 | else |
| 382 | mysql_rwlock_rdlock(&THR_LOCK_udf); /* Called during parsing */ |
| 383 | |
| 384 | if ((udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) name, length))) |
| 385 | { |
| 386 | if (!udf->dlhandle) |
| 387 | udf=0; // Could not be opened |
| 388 | else if (mark_used) |
| 389 | udf->usage_count++; |
| 390 | } |
| 391 | mysql_rwlock_unlock(&THR_LOCK_udf); |
| 392 | DBUG_RETURN(udf); |
| 393 | } |
| 394 | |
| 395 | |
| 396 | static void *find_udf_dl(const char *dl) |
no test coverage detected