| 5649 | */ |
| 5650 | |
| 5651 | int item_create_init() |
| 5652 | { |
| 5653 | Native_func_registry *func; |
| 5654 | |
| 5655 | DBUG_ENTER("item_create_init"); |
| 5656 | |
| 5657 | if (my_hash_init(& native_functions_hash, |
| 5658 | system_charset_info, |
| 5659 | array_elements(func_array), |
| 5660 | 0, |
| 5661 | 0, |
| 5662 | (my_hash_get_key) get_native_fct_hash_key, |
| 5663 | NULL, /* Nothing to free */ |
| 5664 | MYF(0))) |
| 5665 | DBUG_RETURN(1); |
| 5666 | |
| 5667 | for (func= func_array; func->builder != NULL; func++) |
| 5668 | { |
| 5669 | if (my_hash_insert(& native_functions_hash, (uchar*) func)) |
| 5670 | DBUG_RETURN(1); |
| 5671 | } |
| 5672 | |
| 5673 | #ifndef DBUG_OFF |
| 5674 | for (uint i=0 ; i < native_functions_hash.records ; i++) |
| 5675 | { |
| 5676 | func= (Native_func_registry*) my_hash_element(& native_functions_hash, i); |
| 5677 | DBUG_PRINT("info", ("native function: %s length: %u", |
| 5678 | func->name.str, (uint) func->name.length)); |
| 5679 | } |
| 5680 | #endif |
| 5681 | |
| 5682 | DBUG_RETURN(0); |
| 5683 | } |
| 5684 | |
| 5685 | /* |
| 5686 | Empty the hash table for native functions. |
no test coverage detected