>>>>> "TOMITA" == TOMITA Masahiro <tommy@stripped> writes:
>> Description:
TOMITA> In manual, mysql_real_connect()'s first parameter can be NULL.
TOMITA> Is it true? The following sample program is core dumped.
TOMITA> In client/libmysql.c, mysql_real_connect() use mysql pointer
TOMITA> without initialize.
>> How-To-Repeat:
TOMITA> % cat aa.c
TOMITA> #include <mysql.h>
TOMITA> #define NULL 0
TOMITA> main()
TOMITA> {
TOMITA> mysql_real_connect(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0);
TOMITA> }
TOMITA> % gcc aa.c -I/usr/local/include/mysql -L/usr/local/lib/mysql -lmysqlclient
TOMITA> % ./a.out
TOMITA> Segmentation fault (core dumped)
>> Fix:
TOMITA> Document bug?
Hi!
This documentation bug is already fixed in the online manual; You
can only use NULL with mysql_init() and mysql_connect(); Not with
mysql_real_connect().
Regards,
Monty