Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jean-Paul Smets
slapos
Commits
a12d8a16
Commit
a12d8a16
authored
Apr 09, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version up : MariaDB 10.0.10.
parent
6843f00d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
308 additions
and
76 deletions
+308
-76
component/mariadb/buildout.cfg
component/mariadb/buildout.cfg
+5
-2
component/mariadb/mroonga-4.00-mariadb-10.0.9.patch
component/mariadb/mroonga-4.00-mariadb-10.0.9.patch
+0
-74
component/mariadb/mroonga-4.01-mariadb-10.0.10.patch
component/mariadb/mroonga-4.01-mariadb-10.0.10.patch
+303
-0
No files found.
component/mariadb/buildout.cfg
View file @
a12d8a16
...
...
@@ -19,10 +19,10 @@ parts =
[mariadb]
recipe = slapos.recipe.cmmi
version = 10.0.
9
version = 10.0.
10
revision = 1
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http://ftp.osuosl.org/pub/mariadb
md5sum =
36363eaaeace9e81a64ac94d9d53bffe
md5sum =
14ce22b8197d4eae88d237776d47220f
# compile directory is required to build mysql plugins.
keep-compile-dir = true
patch-options = -p0
...
...
@@ -58,6 +58,9 @@ environment =
recipe = slapos.recipe.cmmi
url = http://packages.groonga.org/source/mroonga/mroonga-4.01.tar.gz
md5sum = 7081aed69e715fb4b0b8f65b0d8d99f1
patch-options = -p1
patches =
${:_profile_base_location_}/mroonga-4.01-mariadb-10.0.10.patch#f229aca89b6223c43add5f2bd5f5d359
configure-options =
--with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
--with-mysql-config=${mariadb:location}/bin/mysql_config
...
...
component/mariadb/mroonga-4.00-mariadb-10.0.9.patch
deleted
100644 → 0
View file @
6843f00d
commit e2d340aa5eff721eaff24003a3d04eb01f0aaa3c
Author: Kouhei Sutou <kou@clear-code.com>
Date: Sat Mar 15 17:47:08 2014 +0900
mariadb: support MariaDB 10.0.9
Redmine: fixes #2387
We drop MariaDB 10.0.0 - 10.0.8 support. You should use the latest
MariaDB for 10.0 series.
Reported by Kazuhiko Shiozaki. Thanks!!!
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 496deed..3310a16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,6 +182,13 @@
else()
set_mysql_config_value("--version" MYSQL_VERSION)
endif()
+if((${MYSQL_VERSION} VERSION_GREATER "10.0.0") AND
+ (${MYSQL_VERSION} VERSION_LESS "10.0.9"))
+ message(FATAL_ERROR
+ "Mroonga doesn't supports MariaDB 10.0.0-10.0.8: <${MYSQL_VERSION}>")
+ return()
+endif()
+
if(MRN_GROONGA_BUNDLED)
set(GROONGA_INCLUDE_DIRS "${MRN_BUNDLED_GROONGA_DIR}/include")
set(GROONGA_LIBRARY_DIRS "${MRN_BUNDLED_GROONGA_DIR}/lib")
diff --git a/mrn_mysql_compat.h b/mrn_mysql_compat.h
index 4dd878b..7312dd7 100644
--- a/mrn_mysql_compat.h
+++ b/mrn_mysql_compat.h
@@ -105,12 +105,11 @@
# define MRN_ITEM_HAVE_ITEM_NAME
#endif
-#if MYSQL_VERSION_ID >= 50500 && \
- !(defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100004)
+#if MYSQL_VERSION_ID >= 50500 && MYSQL_VERSION_ID < 50700
# define MRN_HAVE_TABLE_DEF_CACHE
#endif
-#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100004
+#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100009
# define MRN_HAVE_TDC_ACQUIRE_SHARE
#endif
diff --git a/mrn_table.cpp b/mrn_table.cpp
index 7a7d4c2..79e1c83 100644
--- a/mrn_table.cpp
+++ b/mrn_table.cpp
@@ -1,7 +1,7 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2011-2013 Kentoku SHIBA
- Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
+ Copyright(C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -970,7 +970,9 @@
TABLE_SHARE *mrn_get_table_share(TABLE_LIST *table_list, int *error)
hash_value);
#elif defined(MRN_HAVE_TDC_ACQUIRE_SHARE)
share = tdc_acquire_share(thd, table_list->db, table_list->table_name, key,
- key_length, GTS_TABLE, NULL);
+ key_length,
+ table_list->mdl_request.key.tc_hash_value(),
+ GTS_TABLE, NULL);
#else
share = get_table_share(thd, table_list, key, key_length, 0, error);
#endif
component/mariadb/mroonga-4.01-mariadb-10.0.10.patch
0 → 100644
View file @
a12d8a16
diff --git a/ha_mroonga.cpp b/ha_mroonga.cpp
index 20d251a..2504599 100644
--- a/ha_mroonga.cpp
+++ b/ha_mroonga.cpp
@@ -101,22 +101,38 @@
#define MRN_TEXT_SIZE (1 << 16) // 64Kbytes
#define MRN_LONG_TEXT_SIZE (1 << 31) // 2Gbytes
-#if MYSQL_VERSION_ID >= 50500
-# ifdef DBUG_OFF
-# ifndef _WIN32
+#ifdef MRN_HAVE_TDC_LOCK_TABLE_SHARE
+# define mrn_open_mutex(share) &((share)->tdc.LOCK_table_share)
+# define mrn_open_mutex_lock(share) do { \
+ TABLE_SHARE *share_ = share; \
+ if (share_) { \
+ mysql_mutex_lock(mrn_open_mutex(share_)); \
+ } \
+} while (0)
+# define mrn_open_mutex_unlock(share) do { \
+ TABLE_SHARE *share_ = share; \
+ if (share_) { \
+ mysql_mutex_unlock(mrn_open_mutex(share_)); \
+ } \
+} while (0)
+#else
+# if MYSQL_VERSION_ID >= 50500
+# ifdef DBUG_OFF
+# ifndef _WIN32
extern mysql_mutex_t LOCK_open;
+# endif
# endif
-# endif
mysql_mutex_t *mrn_LOCK_open;
-# define mrn_open_mutex_lock() mysql_mutex_lock(mrn_LOCK_open)
-# define mrn_open_mutex_unlock() mysql_mutex_unlock(mrn_LOCK_open)
-#else
-# ifndef _WIN32
+# define mrn_open_mutex_lock(share) mysql_mutex_lock(mrn_LOCK_open)
+# define mrn_open_mutex_unlock(share) mysql_mutex_unlock(mrn_LOCK_open)
+# else
+# ifndef _WIN32
extern pthread_mutex_t LOCK_open;
-# endif
+# endif
pthread_mutex_t *mrn_LOCK_open;
-# define mrn_open_mutex_lock()
-# define mrn_open_mutex_unlock()
+# define mrn_open_mutex_lock(share)
+# define mrn_open_mutex_unlock(share)
+# endif
#endif
#if MYSQL_VERSION_ID >= 50600
@@ -1275,13 +1291,15 @@
static int mrn_init(void *p)
mrn_table_def_cache = (HASH *)GetProcAddress(current_module,
"?table_def_cache@@3Ust_hash@@A");
# endif
+# ifndef MRN_HAVE_TDC_LOCK_TABLE_SHARE
mrn_LOCK_open =
-# if MYSQL_VERSION_ID >= 50500
+# if MYSQL_VERSION_ID >= 50500
(mysql_mutex_t *)GetProcAddress(current_module,
"?LOCK_open@@3Ust_mysql_mutex@@A");
-# else
+# else
(pthread_mutex_t *)GetProcAddress(current_module,
"?LOCK_open@@3U_RTL_CRITICAL_SECTION@@A");
+# endif
# endif
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
mrn_table_share_lock_share =
@@ -1297,7 +1315,9 @@
static int mrn_init(void *p)
# ifdef MRN_HAVE_TABLE_DEF_CACHE
mrn_table_def_cache = &table_def_cache;
# endif
+# ifndef MRN_HAVE_TDC_LOCK_TABLE_SHARE
mrn_LOCK_open = &LOCK_open;
+# endif
#endif
// init groonga
@@ -3033,10 +3053,10 @@
bool ha_mroonga::storage_create_foreign_key(TABLE *table,
mapper.mysql_table_name(),
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table->s);
tmp_ref_table_share =
mrn_create_tmp_table_share(&table_list, ref_path, &error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table->s);
if (!tmp_ref_table_share) {
grn_obj_unlink(ctx, grn_table_ref);
error = ER_CANT_CREATE_TABLE;
@@ -3048,9 +3068,9 @@
bool ha_mroonga::storage_create_foreign_key(TABLE *table,
}
uint ref_pkey_nr = tmp_ref_table_share->primary_key;
if (ref_pkey_nr == MAX_KEY) {
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table->s);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table->s);
grn_obj_unlink(ctx, grn_table_ref);
error = ER_CANT_CREATE_TABLE;
char err_msg[MRN_BUFFER_SIZE];
@@ -3062,9 +3082,9 @@
bool ha_mroonga::storage_create_foreign_key(TABLE *table,
KEY *ref_key_info = &tmp_ref_table_share->key_info[ref_pkey_nr];
uint ref_key_parts = KEY_N_KEY_PARTS(ref_key_info);
if (ref_key_parts > 1) {
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table->s);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table->s);
grn_obj_unlink(ctx, grn_table_ref);
error = ER_CANT_CREATE_TABLE;
char err_msg[MRN_BUFFER_SIZE];
@@ -3076,9 +3096,9 @@
bool ha_mroonga::storage_create_foreign_key(TABLE *table,
}
Field *ref_field = &ref_key_info->key_part->field[0];
if (strcmp(ref_field->field_name, ref_field_name.str)) {
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table->s);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table->s);
grn_obj_unlink(ctx, grn_table_ref);
error = ER_CANT_CREATE_TABLE;
char err_msg[MRN_BUFFER_SIZE];
@@ -3088,9 +3108,9 @@
bool ha_mroonga::storage_create_foreign_key(TABLE *table,
my_message(error, err_msg, MYF(0));
DBUG_RETURN(false);
}
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table->s);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table->s);
grn_obj_flags col_flags = GRN_OBJ_PERSISTENT;
column = grn_column_create(ctx, table_obj, field->field_name,
strlen(field->field_name),
@@ -4210,18 +4230,18 @@
int ha_mroonga::close()
table_list.init_one_table(mapper.db_name(), mapper.mysql_table_name(),
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
tmp_table_share =
mrn_create_tmp_table_share(&table_list, share->table_name, &tmp_error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
if (!tmp_table_share) {
error = tmp_error;
} else if ((tmp_error = alter_share_add(share->table_name,
tmp_table_share))) {
error = tmp_error;
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
mrn_free_tmp_table_share(tmp_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
}
}
bitmap_free(&multiple_column_key_bitmap);
@@ -4394,9 +4414,9 @@
int ha_mroonga::delete_table(const char *name)
table_list.init_one_table(mapper.db_name(), mapper.mysql_table_name(),
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
tmp_table_share = mrn_create_tmp_table_share(&table_list, name, &error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
if (!tmp_table_share) {
DBUG_RETURN(error);
}
@@ -4407,9 +4427,9 @@
int ha_mroonga::delete_table(const char *name)
#endif
if (!(tmp_share = mrn_get_share(name, &tmp_table, &error)))
{
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
mrn_free_tmp_table_share(tmp_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
DBUG_RETURN(error);
}
@@ -4425,9 +4445,9 @@
int ha_mroonga::delete_table(const char *name)
tmp_share->long_term_share = NULL;
}
mrn_free_share(tmp_share);
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
mrn_free_tmp_table_share(tmp_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
if (is_temporary_table_name(name)) {
mrn_drop_db(name);
}
@@ -11885,9 +11905,9 @@
int ha_mroonga::rename_table(const char *from, const char *to)
from_mapper.mysql_table_name(),
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
tmp_table_share = mrn_create_tmp_table_share(&table_list, from, &error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
if (!tmp_table_share) {
DBUG_RETURN(error);
}
@@ -11897,9 +11917,9 @@
int ha_mroonga::rename_table(const char *from, const char *to)
#endif
if (!(tmp_share = mrn_get_share(from, &tmp_table, &error)))
{
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
mrn_free_tmp_table_share(tmp_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
DBUG_RETURN(error);
}
@@ -11925,9 +11945,9 @@
int ha_mroonga::rename_table(const char *from, const char *to)
} else if (error && from_mapper.table_name()[0] == '#') {
alter_share_add(from, tmp_table_share);
} else {
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(NULL);
mrn_free_tmp_table_share(tmp_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(NULL);
}
DBUG_RETURN(error);
}
@@ -14482,10 +14502,10 @@
char *ha_mroonga::storage_get_foreign_key_create_info()
ref_table_buff,
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table_share);
tmp_ref_table_share =
mrn_create_tmp_table_share(&table_list, ref_path, &error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table_share);
if (!tmp_ref_table_share) {
DBUG_RETURN(NULL);
}
@@ -14494,9 +14514,9 @@
char *ha_mroonga::storage_get_foreign_key_create_info()
Field *ref_field = &ref_key_info->key_part->field[0];
append_identifier(ha_thd(), &create_info_str, ref_field->field_name,
strlen(ref_field->field_name));
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table_share);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table_share);
if (create_info_str.reserve(39)) {
DBUG_RETURN(NULL);
}
@@ -14694,10 +14714,10 @@
int ha_mroonga::storage_get_foreign_key_list(THD *thd,
ref_table_buff,
TL_WRITE);
#endif
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table_share);
tmp_ref_table_share =
mrn_create_tmp_table_share(&table_list, ref_path, &error);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table_share);
if (!tmp_ref_table_share) {
DBUG_RETURN(error);
}
@@ -14709,9 +14729,9 @@
int ha_mroonga::storage_get_foreign_key_list(THD *thd,
strlen(ref_field->field_name),
TRUE);
f_key_info.referenced_fields.push_back(ref_col_name);
- mrn_open_mutex_lock();
+ mrn_open_mutex_lock(table_share);
mrn_free_tmp_table_share(tmp_ref_table_share);
- mrn_open_mutex_unlock();
+ mrn_open_mutex_unlock(table_share);
FOREIGN_KEY_INFO *p_f_key_info =
(FOREIGN_KEY_INFO *) thd_memdup(thd, &f_key_info,
sizeof(FOREIGN_KEY_INFO));
diff --git a/ha_mroonga.hpp b/ha_mroonga.hpp
index 579210e..d200bca 100644
--- a/ha_mroonga.hpp
+++ b/ha_mroonga.hpp
@@ -172,6 +172,10 @@
extern "C" {
# define MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS
#endif
+#if (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100010)
+# define MRN_HAVE_TDC_LOCK_TABLE_SHARE
+#endif
+
class ha_mroonga;
/* structs */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment