Skip to content

Commit

Permalink
compilation failures
Browse files Browse the repository at this point in the history
windows: use GetProcAddress() to access internal server data structures
rhel5: CONNECT-JDBC requires at least Java 1.6
  • Loading branch information
vuvova committed Jun 22, 2016
1 parent 26bf066 commit e167806
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions plugin/metadata_lock_info/metadata_lock_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "sql_class.h"
#include "sql_show.h"

I_List<THD> *thds;

static const LEX_STRING metadata_lock_info_lock_name[] = {
{ C_STRING_WITH_LEN("Global read lock") },
{ C_STRING_WITH_LEN("Schema metadata lock") },
Expand Down Expand Up @@ -134,7 +136,7 @@ static THD *find_thread(my_thread_id id)
THD *tmp;

mysql_mutex_lock(&LOCK_thread_count);
I_List_iterator<THD> it(threads);
I_List_iterator<THD> it(*thds);
while ((tmp= it++))
{
if (id == tmp->thread_id)
Expand All @@ -160,7 +162,7 @@ static int i_s_metadata_lock_info_fill_table(THD *thd, TABLE_LIST *tables,
/* Gather thread identifiers */
my_init_dynamic_array(&ids, sizeof(my_thread_id), 512, 1, MYF(0));
mysql_mutex_lock(&LOCK_thread_count);
I_List_iterator<THD> it(threads);
I_List_iterator<THD> it(*thds);
while ((tmp= it++))
if (tmp != thd && (info.error= insert_dynamic(&ids, &tmp->thread_id)))
break;
Expand All @@ -186,10 +188,16 @@ static int i_s_metadata_lock_info_init(
) {
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p;
DBUG_ENTER("i_s_metadata_lock_info_init");
#ifdef _WIN32
thds = (I_List<THD>*)
GetProcAddress(GetModuleHandle(NULL), "?threads@@3V?$I_List@VTHD@@@@A");
#else
thds = &threads;
#endif
schema->fields_info = i_s_metadata_lock_info_fields_info;
schema->fill_table = i_s_metadata_lock_info_fill_table;
schema->idx_field1 = 0;
DBUG_RETURN(0);
DBUG_RETURN(thds == 0);
}

static int i_s_metadata_lock_info_deinit(
Expand Down
4 changes: 2 additions & 2 deletions storage/connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ IF(CONNECT_WITH_JDBC)
# TODO: Find how to compile and install the java wrapper class
# Find required libraries and include directories

FIND_PACKAGE(Java)
FIND_PACKAGE(JNI)
FIND_PACKAGE(Java 1.6)
FIND_PACKAGE(JNI)
IF (JAVA_FOUND AND JNI_FOUND)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2})
Expand Down

0 comments on commit e167806

Please sign in to comment.