List:MySQL++« Previous MessageNext Message »
From:Russell Robinson Date:October 28 2008 4:53am
Subject:Re: Patch for ssqls null blob deficiency
View as plain text  
Hi Warren,

All fixed and working!

I guess you (and/or others) need to tell me whether the changes to type_info 
are correct, but given my reasoning is correct together with the stepwise 
resolution of this problem I think they must be.

To summarize the work:
1. My original patch allowed the insert code for a Null<sql_blob> column to 
compile, but causes the "Failed to find MySQL C API type ID for" error when 
you try to actually insert a non-null blob value.  So, load_jpeg with a jpeg 
argument fails.
2. My second patch (to type_info) resolves this problem, but the binary data 
is always only 4 bytes long.  So, load_jpeg works, but puts the wrong data in 
the blob.
3. This patch resolves this final problem.

The original patch was flawed in stadapter.cpp.  It needed to convert 
the "String" object to a "string" object when constructing the Null<String> 
version of SQLTypeAdapter.

I've found the right way to do this is to convert it using "stream2string".

The attached patch must be applied to the current SVN - ie. it must be applied 
after my first patch.

Please test and let me know how it goes!

This was many hours of debugging and research, so I hope this is the end.  
But, let me know if it isn't.

-- 
Russell Robinson (russellr@stripped)

Attachment: [text/x-diff] typeinfoblob-works.patch
Thread
Patch for ssqls null blob deficiencyRussell Robinson27 Oct
  • Re: Patch for ssqls null blob deficiencyRussell Robinson27 Oct
  • Re: Patch for ssqls null blob deficiencyWarren Young27 Oct
    • Re: Patch for ssqls null blob deficiencyRussell Robinson27 Oct
      • Re: Patch for ssqls null blob deficiencyWarren Young28 Oct
        • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
        • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
          • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
            • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
              • Re: Patch for ssqls null blob deficiencyWarren Young28 Oct
                • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
                  • Re: Patch for ssqls null blob deficiencyRussell Robinson28 Oct
                    • Re: Patch for ssqls null blob deficiencyWarren Young29 Oct
                      • Re: Patch for ssqls null blob deficiencyRussell Robinson29 Oct
                        • Re: Patch for ssqls null blob deficiencyWarren Young29 Oct
                          • Re: Patch for ssqls null blob deficiencyRussell Robinson29 Oct