List:MySQL++« Previous MessageNext Message »
From:Tomas Fischer Date:June 2 2006 8:14pm
Subject:Segmention fault with several connections
View as plain text  
Hi,

isn't it possible to create several
mysqlpp::Connections? Both of them use same db, host,
user. Code below doesn't work.

class A {
  A() { 
    mysqlpp::Connection con;
    con= mysqlpp::Connection::Connection(...);
  }
};

class B {
  B() {  
    mysqlpp::Connection con;
    con= mysqlpp::Connection::Connection(...);
  }
};

int main() {
  A a;
  B b;
  return 0;
}

Using g++ 4.0.4
mysql++: Version: 2.0.7-2+b1 (Debian).

It doesn't matter if con are objects or pointers.

Best regards,
Tomas.


gdb trace-back:
#0  0x080498e9 in
mysqlpp::Connection::OptionInfo::operator= ()
#1  0x08049974 in std::__copy<false,
std::random_access_iterator_tag>::copy<std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo const&,
mysqlpp::Connection::OptionInfo const*>,
std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo&,
mysqlpp::Connection::OptionInfo*> >
    ()
#2  0x08049a4c in
std::__copy_aux<std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo const&,
mysqlpp::Connection::OptionInfo const*>,
std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo&,
mysqlpp::Connection::OptionInfo*> > ()
#3  0x08049af0 in std::__copy_normal<false,
false>::copy_n<std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo const&,
mysqlpp::Connection::OptionInfo const*>,
std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo&,
mysqlpp::Connection::OptionInfo*> > ()
#4  0x08049b9c in
std::copy<std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo const&,
mysqlpp::Connection::OptionInfo const*>,
std::_Deque_iterator<mysqlpp::Connection::OptionInfo,
mysqlpp::Connection::OptionInfo&,
mysqlpp::Connection::OptionInfo*> > ()
#5  0x0804c8ed in
std::deque<mysqlpp::Connection::OptionInfo,
std::allocator<mysqlpp::Connection::OptionInfo>
>::operator= ()
#6  0x0804ca5f in mysqlpp::Connection::operator= ()
#7  0x0804caf2 in A::A ()
#8  0x08048afb in main ()


__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen
Massenmails. 
http://mail.yahoo.com 
Thread
Segmention fault with several connectionsTomas Fischer2 Jun
  • Re: Segmention fault with several connectionsDrew M.3 Jun
    • Re: Segmention fault with several connectionsTomas Fischer3 Jun
    • Re: Segmention fault with several connectionsWarren Young26 Jun