Bug #2843 custom.pl improperly creates set function based on sql_create_# macro
Submitted: 17 Feb 2004 11:26 Modified: 9 Nov 2004 17:21
Reporter: Christopher Boumenot Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL++ Severity:S3 (Non-critical)
Version:1.7.9 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[17 Feb 2004 11:26] Christopher Boumenot
Description:
The files custom.hh and custom-macros.hh are auto generated from the file custom.pl.  The output is incorrect when the set function is generated due to the fact that too many unnecessary assignment operations are created.  The unnecessary assignments should be optimized away but nonetheless they are useless.

For example (current):

#define sql_compare_define_3 .....
  void set  (const T1 &p1, const T2 &p2, const T3 &p3) { \
    C1 = p1;\
    C1 = p1;\
    C2 = p2;\
    C1 = p1;\
    C2 = p2;\
    C3 = p3;\

With the patch applied:

#define sql_construct_define_3 .....
  void set  (const T1 &p1, const T2 &p2, const T3 &p3) { \
    C1 = p1;\
    C2 = p2;\
    C3 = p3;\

How to repeat:
perl custom.pl

Suggested fix:
--- custom.pl.old       Tue Feb 17 13:54:54 2004
+++ custom.pl   Tue Feb 17 13:55:16 2004
@@ -135,10 +135,10 @@
       $parm2 .= ", "  unless $j == $i;
       $define.= "C$j (p$j)";
       $define.= ", "  unless $j == $i;
-      $set   .= "    C$j = p$j;\\\n";
       $compp .= "true";
       $compp .= ", " unless $j == $i;
   }
+  $set   .= "    C$i = p$i;\\\n";
   print OUT << "---";
 
 // ---------------------------------------------------
[19 Feb 2004 12:17] MySQL Verification Team
This is a recognized issue handled now by devloper who is assigned to this record.
[9 Nov 2004 17:21] MySQL Verification Team
MySQL++ is no longer maintained by MySQL AB