[Groonga-commit] groonga/groonga [master] Fix a bug that time -> time cast breaks value

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Sep 22 23:03:18 JST 2012


Kouhei Sutou	2012-09-22 23:03:18 +0900 (Sat, 22 Sep 2012)

  New Revision: aee53cf1b32db7fd0faee95032b73078536c7b24
  https://github.com/groonga/groonga/commit/aee53cf1b32db7fd0faee95032b73078536c7b24

  Log:
    Fix a bug that time -> time cast breaks value

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -1)
===================================================================
--- lib/db.c    2012-09-21 21:01:40 +0900 (065c567)
+++ lib/db.c    2012-09-22 23:03:18 +0900 (274747e)
@@ -4569,6 +4569,8 @@ grn_obj_is_persistent(grn_ctx *ctx, grn_obj *obj)
 
 #define NUM2TIME(ctx, dest, value)\
   GRN_TIME_SET(ctx, dest, (long long int)(value) * GRN_TIME_USEC_PER_SEC);
+#define TIME2TIME(ctx, dest, value)\
+  GRN_TIME_SET(ctx, dest, value);
 #define FLOAT2TIME(ctx, dest, value)\
   GRN_TIME_SET(ctx, dest, (long long int)(value * GRN_TIME_USEC_PER_SEC));
 
@@ -4599,7 +4601,7 @@ grn_obj_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, int addp)
     NUM2DEST(GRN_INT64_VALUE, grn_text_lltoa, NUM2BOOL, NUM2TIME);
     break;
   case GRN_DB_TIME :
-    NUM2DEST(GRN_TIME_VALUE, grn_text_lltoa, NUM2BOOL, NUM2TIME);
+    NUM2DEST(GRN_TIME_VALUE, grn_text_lltoa, NUM2BOOL, TIME2TIME);
     break;
   case GRN_DB_UINT64 :
     NUM2DEST(GRN_UINT64_VALUE, grn_text_lltoa, NUM2BOOL, NUM2TIME);
-------------- next part --------------
HTML����������������������������...
下載 



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