Subject: | DBD::mysql compilation error when compiled against < 50003 |
The MYSQL_BIND struct did not support member "error" until MySQL 5.0.3. This prevent compilation of DBD::mysql against MySQL 5.0.2 or earlier:
...
cc -c -I/opt/preview/lib/perl5/site_perl/5.8.9/i686-linux/auto/DBI -I/usr/local/mysql-standard-4.1.22-pc-linux-gnu-i686/include -mcpu=pentiumpro -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -pipe -Wall -DVERSION=\"4.032\" -DXS_VERSION=\"4.032\" -fPIC "-I/usr/lib/perl5/5.8.9/i686-linux/CORE" dbdimp.c
dbdimp.c: In function `mysql_describe':
dbdimp.c:3774: structure has no member named `error'
...
Per http://dev.mysql.com/doc/relnotes/mysql/5.0/en/news-5-0-3.html:
"Added an error member to the MYSQL_BIND data structure that is used in the C API for prepared statements. This member is used for reporting data truncation errors. Truncation reporting is enabled using the new MYSQL_REPORT_DATA_TRUNCATION option for the mysql_options() C API function."
Attached patch addresses this bug.
Subject: | DBD-mysql-v41-datatype-compat.patch |
diff -ru DBD-mysql-4.032/dbdimp.c DBD-mysql-4.032.new/dbdimp.c
--- DBD-mysql-4.032/dbdimp.c Mon Jun 15 10:43:03 2015
+++ DBD-mysql-4.032.new/dbdimp.c Tue Aug 18 18:28:32 2015
@@ -3771,7 +3771,9 @@
col_type);
buffer->length= &(fbh->length);
buffer->is_null= (my_bool*) &(fbh->is_null);
+#if MYSQL_VERSION_ID >= NEW_DATATYPE_VERSION
buffer->error= (my_bool*) &(fbh->error);
+#endif
switch (buffer->buffer_type) {
case MYSQL_TYPE_DOUBLE:
Only in DBD-mysql-4.032/t: mysql.mtest