Navigation Menu

Skip to content

Commit

Permalink
[mysql5.6.4] support MYSQL_TYPE_{TIMESTAMP,DATETIME,TIME}2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Dec 21, 2011
1 parent 630c6ba commit 9c405c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ha_mroonga.cc
Expand Up @@ -563,6 +563,21 @@ static grn_builtin_type mrn_grn_type_from_field(grn_ctx *ctx, Field *field,
case MYSQL_TYPE_BIT: // BIT; <= 8bytes
type = GRN_DB_INT64; // 8bytes
break;
#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2
case MYSQL_TYPE_TIMESTAMP2: // TIMESTAMP; 4bytes
type = GRN_DB_TIME; // 8bytes
break;
#endif
#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2
case MYSQL_TYPE_DATETIME2: // DATETIME; 8bytes
type = GRN_DB_TIME; // 8bytes
break;
#endif
#ifdef MRN_HAVE_MYSQL_TYPE_TIME2
case MYSQL_TYPE_TIME2: // TIME; 3bytes
type = GRN_DB_TIME; // 8bytes
break;
#endif
case MYSQL_TYPE_NEWDECIMAL: // DECIMAL; <= 9bytes
type = GRN_DB_SHORT_TEXT; // 4Kbytes
break;
Expand Down
6 changes: 6 additions & 0 deletions ha_mroonga.h
Expand Up @@ -85,6 +85,12 @@ extern "C" {
# define MRN_HA_ROWS_FORMAT "lu"
#endif

#if MYSQL_VERSION_ID >= 50604
# define MRN_HAVE_MYSQL_TYPE_TIMESTAMP2
# define MRN_HAVE_MYSQL_TYPE_DATETIME2
# define MRN_HAVE_MYSQL_TYPE_TIME2
#endif

class ha_mroonga;

/* structs */
Expand Down

0 comments on commit 9c405c1

Please sign in to comment.