Hi!
On Oct 30, antony@stripped wrote:
> ChangeSet@stripped, 2007-10-30 13:38:48-07:00, antony@stripped +3 -0
> Bug#30671
> "ALTER SERVER causes the server to crash"
> An attempt to pass NULL into strcmp() caused crash.
>
> sql/sql_servers.cc@stripped, 2007-10-30 13:38:45-07:00, antony@stripped +12
> -12
> bug30671
> existing->value may be NULL which will cause crash when user attempts
> to alter value.
existing values cannot really be null.
See how they set in prepare_server_struct_for_insert().
And see how they're read from the table in
get_server_from_table_to_cache() - all fields are set to an empty
string, if they're unset. With the one exception - socket is set to
NULL.
This is where it crashes in this bug - on socket.
Note that the behaviour is inconsistent - the socket is set to an empty
string in prepare_server_struct_for_insert / CREATE SERVER. But it's set
to NULL in get_server_from_table_to_cache() - on ALTER or server
restart.
The inconsistency is certainly a bug, and I don't see a reason for
socket to be NULL at all. Make it an empty string in
get_server_from_table_to_cache(), just like all other fields are.
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140