Bug #72894 get rid of dynamic_array in Server_ids::dynamic_ids
Submitted: 6 Jun 2014 7:10 Modified: 17 Jun 2014 12:01
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[6 Jun 2014 7:10] Tor Didriksen
Description:
Our array abstractions should be removed, and substituted with modern data
structures.
See e.g. Bug#18556403, Bug#18486249 and other similar bugs.

Templatized vectors are:
 - type safe
 - easier to read/maintain
 - faster

Additionally for this patch: remove some dead code.
The class Database_ids is unused, which means we can remove it, and the base class Dynamic_ids.
The member function Server_ids::do_search_id is also unused, and can be removed.

There was a bug in change_receive_options():
If we are inserting multiple ids into mi->ignore_server_ids
then we need to re-sort before doing a binary_search.
The old code worked "by accident", bsearch() found an element, 
even though the array was no longer sorted after an insert_dynamic()

How to repeat:
Read the code

Suggested fix:
Use prealloced_array
[17 Jun 2014 12:01] Paul DuBois
Fixed in 5.7.5.

Code cleanup. No changelog entry needed.