List:MySQL++« Previous MessageNext Message »
From:Graham Reitz Date:August 11 2007 5:45am
Subject:Re: Query insert() Seg Faulting using SSQLS, not sure why...
View as plain text  
If the client_photo blob is initialized it won't seg. fault.

It looks like there is no check when a sql_blob type is not  
initialized. (when used in this manner)

It should be able to handle this without seg. faulting.

Changing the populate_client_info() to the following works without  
seg. faulting:

void populate_client_info(clients& client_info)
{
     client_info.billing_id = 1;
     client_info.client_first_name = "Graham";
     client_info.client_middle_initial = "T";
     client_info.client_last_name = "Reitz";

     char data = 'A';	// new
     ColData cd(&data, 1);	// new
     client_info.client_photo = cd;	// new
}

Thanks,
Graham

On Aug 10, 2007, at 7:41 PM, Graham Reitz wrote:

> Thanks for the reply Warren,
>
> If the sql_blob is there it seg faults, if not it's ok.
>
> The following code will get it to crash:  (Can you see anything?)
>
> #include <string>
> #include <mysql++.h>
> #include <custom.h>
>
> using namespace std;
> using namespace mysqlpp;
>
> sql_create_6(clients, 1, 6,
>              unsigned int,     client_id,
>              unsigned int,     billing_id,
>              string,           client_first_name,
>              string,           client_middle_initial,
>              string,           client_last_name,
>              sql_blob,         client_photo)
>
> void populate_client_info(clients& client_info)
> {
>     client_info.billing_id = 1;
>     client_info.client_first_name = "Joe";
>     client_info.client_middle_initial = "T";
>     client_info.client_last_name = "Shmo";
> }
>
> int main (int argc, char* const argv[])
> {
>     Connection connection("db_name","ip_addres","user",
>                           "pw",3306, false);
>
>     Query client_query = connection.query();
>
>     clients a_client;
>     populate_client_info(a_client);
>
>     client_query.insert(a_client);
>
>     return 0;
> }
>
>
>
>
> On Aug 9, 2007, at 7:04 AM, Warren Young wrote:
>
>> Graham Reitz wrote:
>>> I was able to narrow it down to this:
>>> In the sql_create_N macro I have a blob entry:
>>> mysqlpp::sql_blob, my_blob
>>> If the sql_blob type is in the  sql_create call it  seg. faults,  
>>> otherwise it succeeds.
>>
>> Can you modify examples/load_jpeg.cpp to exhibit the same problem?  
>> Providing an example of the problem in a way anyone can run will  
>> increase the chances that someone can help you.
>>
>> -- 
>> MySQL++ Mailing List
>> For list archives: http://lists.mysql.com/plusplus
>> To unsubscribe:    http://lists.mysql.com/plusplus? 
>> unsub=grahamreitz@stripped
>>
>


Thread
Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz9 Aug
  • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz9 Aug
    • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz9 Aug
      • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz9 Aug
        • Re: Query insert() Seg Faulting using SSQLS, not sure why...Warren Young9 Aug
          • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz11 Aug
          • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz11 Aug
            • Re: Query insert() Seg Faulting using SSQLS, not sure why...Graham Reitz11 Aug
              • Inserting with a column that uses auto_incrementGraham Reitz11 Aug
                • RE: Inserting with a column that uses auto_incrementJim Wallace12 Aug
                  • Re: Inserting with a column that uses auto_incrementGraham Reitz12 Aug
                  • Re: Inserting with a column that uses auto_incrementGraham Reitz12 Aug
                    • RE: Inserting with a column that uses auto_incrementJim Wallace12 Aug
                      • Re: Inserting with a column that uses auto_incrementGraham Reitz12 Aug
                      • Re: Inserting with a column that uses auto_incrementWarren Young14 Aug
              • Re: Query insert() Seg Faulting using SSQLS, not sure why...Warren Young28 Dec
Re: Inserting with a column that uses auto_incrementGraham Reitz14 Aug
  • RE: Inserting with a column that uses auto_incrementJoel Fielder14 Aug
    • Re: Inserting with a column that uses auto_incrementGraham Reitz14 Aug
  • Re: Inserting with a column that uses auto_incrementWarren Young15 Aug
    • Re: Inserting with a column that uses auto_incrementGraham Reitz15 Aug
      • Re: Inserting with a column that uses auto_incrementWarren Young16 Aug
        • Re: Inserting with a column that uses auto_incrementGraham Reitz17 Aug
    • Re: Inserting with a column that uses auto_incrementGraham Reitz15 Aug