Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
a new query inside a result loop and exception

a new query inside a result loop and exception

2006-08-31       - By Shigeya Suzuki

 Back
Reply:     1     2     3  

Hi,

I have two questions...

I'm writing a code something like this:

  create query
  run query using use()

  while (mysqlpp::Row row = res.fetch_row()) {
        try {
          {{create and exec a stored procedure here}}
        }
  catch (...) {
        }
  }

I created two different connection object and use them for the loop and
for the inner execution.

Now, when the inner query (actually, executing a stored procedure to add
a record to two tables) fail and raise an exception, while trying to
unwind stack frame, program stuck at following read().. following is the
stack trace of the moment.

#0  0x900108c7 in read ()
#1  0x00431092 in vio_read_buff ()
#2  0x004323f8 in my_real_read ()
#3  0x004325db in my_net_read ()
#4  0x0042c0b9 in net_safe_read ()
#5  0x0042c1cf in cli_flush_use_result ()
#6  0x0042c248 in mysql_free_result ()
#7  0x00479c42 in mysqlpp::ResUse::purge ()
#8  0x0040e4c6 in mysqlpp::ResUse::~ResUse ()
#9  0x0000590c in CDBSupport_MySQL::DoEtherFrameScanByCondition
(this=0x1100a60, ef=0xbffff858, where=@(protected), orderby=@(protected))
at db_support_mysql.cpp:276
#10 0x00024a69 in CDBSupport::EtherFrameScanByCondition (ef=0xbffff858,
where=@(protected), orderby=@(protected)) at db_support.h:118
#11 0x0000c723 in CSource_DB_EtherFrame::ScanByCondition
(this=0xbffff858, where=@(protected), order=@(protected)) at
source_db_etherframe.cpp:33
#12 0x0000c85c in CSource_DB_EtherFrame::ScanBySourceID
(this=0xbffff858, source=1) at source_db_etherframe.cpp:26
#13 0x000029e9 in MyEtherSessionScanner::Scan (this=0xbffff854,
file=@(protected)) at ipv4index.cpp:80
#14 0x00002b15 in main (ac=1, av=0xbffff8ec) at ipv4index.cpp:112


It looks like trying to free ResUse object but no luck.


Now, questions:

1) Why this is happening?

2) Is there any way to exec a stored procedure, while reading result
using fetch_row() other than using two connections like this?


I'm currently using MySQL 5.0.24 on MacOS X, but by some reason, I built
binary by myself. (via ported NetBSD Package) Both client program and
server run on same box. I will try on NetBSD too, but I doubt OS is the
source of problem..

shigeya

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=mysql@(protected)