[Groonga-mysql-commit] mroonga/mroonga at 0e74691 [master] fix compile error with MariaDB 10.0.2. refs #1729

Back to archive index

Kentoku null+****@clear*****
Wed May 1 03:18:39 JST 2013


Kentoku	2013-05-01 03:18:39 +0900 (Wed, 01 May 2013)

  New Revision: 0e74691561c6e490385ebd281ef13fd9ae137dd1
  https://github.com/mroonga/mroonga/commit/0e74691561c6e490385ebd281ef13fd9ae137dd1

  Message:
    fix compile error with MariaDB 10.0.2. refs #1729

  Modified files:
    ha_mroonga.cpp
    mrn_table.cpp

  Modified: ha_mroonga.cpp (+6 -0)
===================================================================
--- ha_mroonga.cpp    2013-04-30 17:47:14 +0900 (c1549da)
+++ ha_mroonga.cpp    2013-05-01 03:18:39 +0900 (a7a18a4)
@@ -10167,9 +10167,15 @@ int ha_mroonga::storage_encode_key_datetime(Field *field, const uchar *key,
 #endif
   {
     long long int encoded_datetime = sint8korr(key);
+#if MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P)
+    uint32 part1 = (uint32)(encoded_datetime / 1000000LL);
+    uint32 part2 = (uint32)(encoded_datetime -
+                            (unsigned long long int)part1 * 1000000LL);
+#else
     uint32 part1 = (uint32)(encoded_datetime / LL(1000000));
     uint32 part2 = (uint32)(encoded_datetime -
                             (unsigned long long int)part1 * LL(1000000));
+#endif
     struct tm date;
     memset(&date, 0, sizeof(struct tm));
     date.tm_year = part1 / 10000 - TM_YEAR_BASE;

  Modified: mrn_table.cpp (+17 -0)
===================================================================
--- mrn_table.cpp    2013-04-30 17:47:14 +0900 (129300c)
+++ mrn_table.cpp    2013-05-01 03:18:39 +0900 (7875537)
@@ -895,12 +895,21 @@ TABLE_SHARE *mrn_get_table_share(TABLE_LIST *table_list, int *error)
   key_length = get_table_def_key(table_list, &key);
 #else
   char key[MAX_DBKEY_LENGTH];
+#if MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P)
+  key_length = create_table_def_key(key, table_list->db, table_list->table_name);
+#else
   key_length = create_table_def_key(thd, key, table_list, FALSE);
 #endif
+#endif
 #if MYSQL_VERSION_ID >= 50500
   hash_value = my_calc_hash(&table_def_cache, (uchar*) key, key_length);
+#if MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P)
+  share = get_table_share(thd, table_list->db, table_list->table_name, key,
+                          key_length, 0, hash_value);
+#else
   share = get_table_share(thd, table_list, key, key_length, 0, error,
                           hash_value);
+#endif
 #else
   share = get_table_share(thd, table_list, key, key_length, 0, error);
 #endif
@@ -922,10 +931,18 @@ TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path
   MRN_DBUG_ENTER_FUNCTION();
 #if MYSQL_VERSION_ID >= 50603 && !defined(MRN_MARIADB_P)
   key_length = get_table_def_key(table_list, &key);
+#elif MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P)
+  key_length = create_table_def_key(key, table_list->db,
+                                    table_list->table_name);
 #else
   key_length = create_table_def_key(thd, key, table_list, FALSE);
 #endif
+#if MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P)
+  if (!(share = alloc_table_share(table_list->db, table_list->table_name, key,
+                                  key_length)))
+#else
   if (!(share = alloc_table_share(table_list, key, key_length)))
+#endif
   {
     *error = ER_CANT_OPEN_FILE;
     DBUG_RETURN(NULL);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index