File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 253
253
MySQL_Prepared_ResultSet::closeIntern ()
254
254
{
255
255
CPP_ENTER (" MySQL_Prepared_ResultSet::closeIntern" );
256
+ // if this is the only one, free result
257
+ if (result_bind.use_count () == 2 )
258
+ proxy->stmt_free_result ();
256
259
is_valid = false ;
257
260
}
258
261
/* }}} */
Original file line number Diff line number Diff line change @@ -56,8 +56,7 @@ MySQL_NativeStatementWrapper::MySQL_NativeStatementWrapper(::st_mysql_stmt * _st
56
56
/* {{{ MySQL_NativeStatementWrapper::~MySQL_NativeStatementWrapper() */
57
57
MySQL_NativeStatementWrapper::~MySQL_NativeStatementWrapper ()
58
58
{
59
- stmt_free_result ();
60
- api->stmt_close (stmt);
59
+ api->stmt_close (stmt);
61
60
}
62
61
/* }}} */
63
62
Original file line number Diff line number Diff line change @@ -754,6 +754,8 @@ void bugs::bug21066575()
754
754
755
755
pstmt.reset (con->prepareStatement (" select * from bug21066575" ));
756
756
757
+ res.reset ();
758
+
757
759
for (int i = 0 ; i < 10 ; ++i)
758
760
{
759
761
res.reset (pstmt->executeQuery ());
@@ -774,7 +776,7 @@ void bugs::bug21066575()
774
776
" (repeat('f',1024000)),"
775
777
" (repeat('f',1024000))" );
776
778
777
- // Detect with Valgrind if there are memory leaks
779
+
778
780
for (int i= 0 ; i < 100 ; i++)
779
781
{
780
782
pstmt.reset (con->prepareStatement (" select id, f1 from bug21066575_2" ));
@@ -788,14 +790,10 @@ void bugs::bug21066575()
788
790
ss << " f1 = " << res->getString (2 );
789
791
logMsg (ss.str ().c_str ());
790
792
}
793
+ // Detect if process frees ResultSet resources.
794
+ res.reset ();
791
795
}
792
796
793
- res.reset ();
794
- pstmt.reset ();
795
-
796
- sleep (1 );
797
-
798
- stmt->execute (" DROP TABLE IF EXISTS test" );
799
797
}
800
798
catch (sql::SQLException &e)
801
799
{
You can’t perform that action at this time.
0 commit comments