List:MySQL++« Previous MessageNext Message »
From:cgifalco Date:November 24 2004 4:06pm
Subject:Re: Segmentation fault
View as plain text  
Warren Young wrote:

> cgifalco wrote:
>
>> If I comment these lines
>> //                    << setw(15) << res.types(i).sql_name() //line
> 40
>> //                    << setw(20) << res.types(i).name()  //line 43
>
>
> That isn't what appears on lines 40 and 43 in 1.7.23.  That makes me 
> wonder, have you modified these samples?
>
>> and if I change
>>       if (res.types(0) == typeid(string)) { //line 49
>> to
>>       if (res.types(0).base_type() == typeid(string)) {
>
>
> I don't see why that would affect anything.
>
> Instead of calling base_type(), what happens if you call c_type() 
> instead?
>
Ok, the program is the same except of some empty lines so I change the 
nubers to the original.
line 40 is 38, line 43 is 41, line 49 is 47 and line 56 is 54.

If I call instead of  base_type() the c_type()  in the original program
the output is (here is also how I compiled fieldinf1.cc)
[root@localhost examples]# g++ fieldinf1.cc util.cc -o fieldinf1 
-I/usr/include/mysql -I/usr/include/mysql++ -L/usr/lib -lmysqlclient 
-lmysqlpp
[root@localhost examples]# ./fieldinf1
Query: select * from stock
Records Found: 5

Query Info:
Segmentation fault

cgifalco

Thread
Segmentation faultcgifalco20 Nov
  • Re: Segmentation faultWarren Young21 Nov
    • Re: Segmentation faultcgifalco21 Nov
      • Re: Segmentation faultWarren Young22 Nov
        • Re: Segmentation faultcgifalco23 Nov
          • Re: Segmentation faultWarren Young23 Nov
            • Re: Segmentation faultcgifalco24 Nov