-
Marc Alff authored
Before this fix, starting the server with host_cache_size = N in the my.cnf file had no effect. The internal host cache size was always 128. The root cause is in hostname_cache_init(), which is using 'HOST_CACHE_SIZE' (a #define to 128) instead of 'host_cache_size' (the C global variable that corresponds to the SQL system value named host_cache_size). Overall, the initialization of the host cache is not satisfactory, and needs to be cleaned up. In particular, the fact that there are distinct: - data path (mysqld.cc setting the host_cache_size global variable, to be used by hostname.cc) - control path (mysqld.cc calling hostname_cache_init with no parameters) can only be a source of confusion. This fix: - moves the global variable host_cache_size to mysqld, where it belongs, because this is a server global variable - changes the variable type from ulong to uint, given that the size really is an unsigned int, per hash_filo::m_size - changes hostname_cache_init() to take explicitely a size, for consistency with hostname_cache_resize(), and for a cleaner interface.
Marc Alff authoredBefore this fix, starting the server with host_cache_size = N in the my.cnf file had no effect. The internal host cache size was always 128. The root cause is in hostname_cache_init(), which is using 'HOST_CACHE_SIZE' (a #define to 128) instead of 'host_cache_size' (the C global variable that corresponds to the SQL system value named host_cache_size). Overall, the initialization of the host cache is not satisfactory, and needs to be cleaned up. In particular, the fact that there are distinct: - data path (mysqld.cc setting the host_cache_size global variable, to be used by hostname.cc) - control path (mysqld.cc calling hostname_cache_init with no parameters) can only be a source of confusion. This fix: - moves the global variable host_cache_size to mysqld, where it belongs, because this is a server global variable - changes the variable type from ulong to uint, given that the size really is an unsigned int, per hash_filo::m_size - changes hostname_cache_init() to take explicitely a size, for consistency with hostname_cache_resize(), and for a cleaner interface.
Loading