This was caused by a bug in the CMake script. The script was using mysql_config for the include and library directories but if there was a different libmysqlclient_r in a system library directory (such as /usr/lib) that was overriding the data supplied by mysql_config.
This means that the structs specified in the include file are different to those in the library causing this segfault.
This was caused by a bug in the CMake script. The script was using mysql_config for the include and library directories but if there was a different libmysqlclient_r in a system library directory (such as /usr/lib) that was overriding the data supplied by mysql_config.
This means that the structs specified in the include file are different to those in the library causing this segfault.