Warren Young wrote:
> cgifalco wrote:
>
>> Under version 1.7.23 is dbinfo.cc now OK, but fieldinf1.cc issues
>> still segmentation fault.
>
>
> Send a backtrace and the program's output.
>
I tested this program more carefully and here is what I found.
If I left the program unchanged the output is
[root@localhost examples]# ./fieldinf1 Query: select * from stock
Records Found: 5
Query Info:
Segmentation fault
If I comment these lines
// << setw(15) << res.types(i).sql_name() //line 40
// << setw(20) << res.types(i).name() //line 43
the output is
[root@localhost examples]# ./fieldinf1 Query: select * from stock
Records Found: 5
Query Info:
0 item
1 num
2 weight
3 price
4 sdate
Segmentation fault
and if I change
if (res.types(0) == typeid(string)) { //line 49
to
if (res.types(0).base_type() == typeid(string)) {
and
if (res.types(1) == typeid(longlong)) { //line 56
to
if (res.types(1).base_type() == typeid(double)) {
then there is this output
[root@localhost examples]# ./fieldinf1 Query: select * from stock
Records Found: 5
Query Info:
0 item
1 num
2 weight
3 price
4 sdate
Field 'num' is of an SQL type which most closely resembles
C++ long long int type
If I uncomment after all these changes
<< setw(15) << res.types(i).sql_name() //line 40
now the output is
[root@localhost examples]# ./fieldinf1 Query: select * from stock
Records Found: 5
Query Info:
0 item [root@localhost examples]#
cgifalco