Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions storage/connect/inihandl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,17 +621,16 @@ void PROFILE_End(void)
if (trace(3))
htrc("PROFILE_End: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES);

if (!CurProfile) // Sergey Vojtovich
return;

/* Close all opened files and free the cache structure */
for (i = 0; i < N_CACHED_PROFILES; i++) {
CurProfile = MRUProfile[i];
if (!CurProfile)
continue;
if (trace(3))
htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i);
htrc("MRU=%s i=%d\n", SVP(CurProfile->filename), i);

// CurProfile = MRUProfile[i]; Sergey Vojtovich
// PROFILE_ReleaseFile(); see MDEV-9997
free(MRUProfile[i]);
PROFILE_ReleaseFile();
memfree(CurProfile);
} // endfor i
Comment thread
grooverdan marked this conversation as resolved.

} // end of PROFILE_End
Expand Down
7 changes: 7 additions & 0 deletions storage/connect/mysql-test/connect/r/ini_alone.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# MDEV-39513 connect table_type=INI memory leak
#
CREATE TABLE t (c INT) ENGINE=CONNECT table_type=INI file_name='TMP/foobar';;
UPDATE t SET c=0;
DROP TABLE t;
# End of 11.4 tests
1 change: 1 addition & 0 deletions storage/connect/mysql-test/connect/t/ini_alone.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--secure_file_priv=$MYSQL_TMP_DIR
19 changes: 19 additions & 0 deletions storage/connect/mysql-test/connect/t/ini_alone.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# This test requires that the ini subsystem of connect
# hasn't been touched. Any call to PROFILE_Open will invalid
# the that the MDEV causes.
#
--echo #
--echo # MDEV-39513 connect table_type=INI memory leak
--echo #

--source include/force_restart.inc

--replace_result $MYSQL_TMP_DIR TMP
--eval CREATE TABLE t (c INT) ENGINE=CONNECT table_type=INI file_name='$MYSQL_TMP_DIR/foobar';
Comment thread
grooverdan marked this conversation as resolved.
UPDATE t SET c=0;

--source include/force_restart.inc
DROP TABLE t;

--echo # End of 11.4 tests
Loading