DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

DBD::mysql compilation error due to mismatched braces when compiled against < 40103 [rt.cpan.org #83347]

Open mbeijen opened this issue 8 years ago • 1 comments
trafficstars

Migrated from rt.cpan.org#83347 (status was 'open')

Requestors:

From [email protected] on 2013-02-15 16:34:50:

Originally reported by Richard Smith at
http://bugs.mysql.com/bug.php?id=65629

Description:
If the #ifdef on dbdimp.c:3448 doesn't evaluate to true, then the else
statement and open brace on line 3461 is compiled out, but the close
brace on line 3479 remains compiled in.

How to repeat:
See above

Suggested fix:
[root@sphinx DBD-mysql-4.021]# tar xfz ../DBD-mysql-4.021.tar.gz -O
DBD-mysql-4.021/dbdimp.c | diff -u - dbdimp.c
--- -	2012-06-15 17:58:32.100389000 +0100
+++ dbdimp.c	2012-06-15 17:56:22.000000000 +0100
@@ -3458,8 +3458,9 @@
                                                   &imp_sth->has_been_bound
                                                  );
   }
-  else {
+  else 
 #endif
+  {
     imp_sth->row_num= mysql_st_internal_execute(
                                                 sth,
                                                 *statement,

The offending lines are these two:

richard@hourn:~$ sed '3461{n;p};d' dbdimp.c 
  else {
#endif

The open brace needs to be *after* the #endif so that it can be closed
on line 3479:

richard@hourn:~$ sed '3479p;d' dbdimp.c 
  }

The patch I gave previously fixes this.

From [email protected] on 2017-01-21 20:25:02:

Fix is there: https://github.com/perl5-dbi/DBD-mysql/pull/81

From [email protected] on 2017-01-21 21:24:05:

Thanks to pali this is fixed now in the master branch of DBD::mysql.

From [email protected] on 2017-07-01 09:20:27:

Reopening, fix was reverted in 4.043.

mbeijen avatar Nov 15 '17 07:11 mbeijen

Related to #81

dveeden avatar Sep 15 '18 21:09 dveeden

4.x and earlier is no longer supported in master

dveeden avatar Aug 23 '23 16:08 dveeden