MCPcopy Create free account
hub / github.com/MariaDB/server / find_udf

Function find_udf

sql/sql_udf.cc:368–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366/* This is only called if using_udf_functions != 0 */
367
368udf_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
396static void *find_udf_dl(const char *dl)

Callers 3

fix_fieldsMethod · 0.85
create_funcMethod · 0.85
mysql_create_routineFunction · 0.85

Calls 1

my_hash_searchFunction · 0.85

Tested by

no test coverage detected