Navigation Menu

Skip to content

Commit

Permalink
mysql57: follow data type inf Foreign_key change
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 16, 2015
1 parent 103493d commit 830ce09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ha_mroonga.cpp
Expand Up @@ -3316,15 +3316,23 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table,
Key_part_spec *key_part_ref_col = key_part_ref_col_iterator++;
LEX_STRING ref_field_name = key_part_ref_col->field_name;
DBUG_PRINT("info", ("mroonga: ref_field_name=%s", ref_field_name.str));
#ifdef MRN_FOREIGN_KEY_USE_CONST_STRING
LEX_CSTRING ref_db_name = fk->ref_db;
#else
LEX_STRING ref_db_name = fk->ref_db;
#endif
DBUG_PRINT("info", ("mroonga: ref_db_name=%s", ref_db_name.str));
if (ref_db_name.str && lower_case_table_names) {
strmake(ref_db_buff, ref_db_name.str, sizeof(ref_db_buff) - 1);
my_casedn_str(system_charset_info, ref_db_buff);
ref_db_name.str = ref_db_buff;
DBUG_PRINT("info", ("mroonga: casedn ref_db_name=%s", ref_db_name.str));
}
#ifdef MRN_FOREIGN_KEY_USE_CONST_STRING
LEX_CSTRING ref_table_name = fk->ref_table;
#else
LEX_STRING ref_table_name = fk->ref_table;
#endif
DBUG_PRINT("info", ("mroonga: ref_table_name=%s", ref_table_name.str));
if (ref_table_name.str && lower_case_table_names) {
strmake(ref_table_buff, ref_table_name.str, sizeof(ref_table_buff) - 1);
Expand Down
4 changes: 4 additions & 0 deletions ha_mroonga.hpp
Expand Up @@ -213,6 +213,10 @@ extern "C" {
# define MRN_HAVE_HTON_ALTER_TABLE_FLAGS
#endif

#if MYSQL_VERSION_ID >= 50706 && !defined(MRN_MARIADB_P)
# define MRN_FOREIGN_KEY_USE_CONST_STRING
#endif

class ha_mroonga;

/* structs */
Expand Down

0 comments on commit 830ce09

Please sign in to comment.