← Back to team overview

maria-developers team mailing list archive

Re: A mess with sql_alloc() ?

 

Hi!

>>>>> "Kristian" == Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx> writes:

Kristian> Alexi1952 <Alexi1952@xxxxxxxxx> writes:
>> mysql_priv.h:

>> (1)    void *sql_alloc(size_t);

>> So I redefined sql_alloc() in a client context:
>> 
>> void *sql_alloc(size_t size) { ... }
>> ...
>> #include "sql_string.h"
>> #include "sql_list.h"

Kristian> (Any reason you put the definition before the #include's ? Usually one writes
Kristian> things the other way around)

>> sql/sql_string.cc:
>> 
>> (2)     extern uchar* sql_alloc(unsigned size);

>> (3)     extern void sql_alloc(size_t size);

>> - I found no direct usage of sql_alloc() in sql_string.* files;
>> - After commenting (2) & (3) out the rebuild was successfull.
>> If (2) & (3) shouldn't be deleted, then they should be brought

Kristian> Seems like you should just delete them.

Yes, you should just delete it;  This is something that has been left
in the code from old times or some.

Same goes for sql_element_free().

I have deleted them from my version of MariaDB and will be in the code
next time I push.
(This is normal cleanup we have to do, even at the risk to get a few
merge conflicts with MySQL)

Kristian> In any case extern declarations like this should be avoided, much better to
Kristian> only have the declaration in one place in some *.h file.

Agree.

Regards,
Monty



References