logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Problem with lookup_by_name: msg#00004

db.mysql.c++

Subject: Problem with lookup_by_name


Hi,

I'm using mysql++-1.7.21 binary rpm built for FC2. I hadn't had any problems
until I decided to upgrade to version 1.7.28. As there is no binary rpm to
download for FC2, I got the src rpm and did a rpmbuild. This worked fine and
installed properly.

But, upon running my application, which worked previously with 1.7.21, I
discovered that it segfaulted while doing lookup_by_name. After testing with
1.7.21 and 1.7.22 built and installed from the src rpms, I found that it
segfaulted regardless of these versions.

I then tested this using 'simple1' from the 1.7.28 source gz file. Below is
the backtrace:

#0 mysqlpp::Row::operator[] (this=0xfef12a10, i=5) at basic_string.h:249
#1 0x007c5a74 in mysqlpp::Row::lookup_by_name (this=0xfef12a10, i=0x8050a29
"weight") at result.h:355
#2 0x0804e115 in print_stock_table (query=@0x95d42a4) at const_string.h:58
#3 0x0804b7b2 in main (argc=4, argv=0xfef13064) at simple1.cpp:24

Replacing:

cout << setw(20) << row[0].c_str() <<
setw(9) << row[1].c_str() <<
setw(9) << row.lookup_by_name("weight").c_str()
<<
setw(9) << row[3].c_str() <<
row[4] << endl;

with:

cout << setw(20) << row[0].c_str() <<
setw(9) << row[1].c_str() <<
setw(9) << row[2].c_str() <<
setw(9) << row[3].c_str() <<
row[4] << endl;

allows it to run fine.

Has anyone had this problem from using the libs built from the sources? Any
ideas?

Also, I'm using FC2 and MySQL 5.0.1. Ironically, the 1.7.21 binaries built for
FC2 and MySQL 4.0 work on my machine while those I build on my machine do not.

Thanks in advance.

Regards,
Patrick Lin


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.5 - Release Date: 2/3/2005




Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo