[Groonga-commit] groonga/groonga at fb50eeb [master] Unlink only accessors in expanded columns

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Fri May 6 00:42:44 JST 2016


Kouhei Sutou	2016-05-06 00:42:44 +0900 (Fri, 06 May 2016)

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

  Message:
    Unlink only accessors in expanded columns

  Modified files:
    lib/grn_ecmascript.c
    lib/grn_ecmascript.lemon

  Modified: lib/grn_ecmascript.c (+11 -8)
===================================================================
--- lib/grn_ecmascript.c    2016-05-06 00:22:54 +0900 (3030fe1)
+++ lib/grn_ecmascript.c    2016-05-06 00:42:44 +0900 (cace9d3)
@@ -2087,12 +2087,15 @@ static void yy_reduce(
     }
 
     for (i = 0; i < n_columns; i++) {
+      grn_obj *column = columns[i];
       if (n_output_columns > 1 && i > 0) {
         grn_expr_append_op(ctx, expr, GRN_OP_COMMA, 2);
       }
-      grn_expr_append_const(ctx, expr, columns[i], GRN_OP_GET_VALUE, 1);
+      grn_expr_append_const(ctx, expr, column, GRN_OP_GET_VALUE, 1);
       n_output_columns++;
-      GRN_PTR_PUT(ctx, &e->objs, columns[i]);
+      if (column->header.type == GRN_ACCESSOR) {
+        grn_expr_take_obj(ctx, expr, column);
+      }
     }
 
     GRN_OBJ_FIN(ctx, &columns_buffer);
@@ -2103,21 +2106,21 @@ static void yy_reduce(
     yymsp[0].minor.yy0 = 0;
   }
 }
-#line 2107 "grn_ecmascript.c"
+#line 2110 "grn_ecmascript.c"
         break;
       case 79: /* output_column ::= NONEXISTENT_COLUMN */
-#line 536 "grn_ecmascript.lemon"
+#line 539 "grn_ecmascript.lemon"
 {
   yymsp[0].minor.yy0 = 0;
 }
-#line 2114 "grn_ecmascript.c"
+#line 2117 "grn_ecmascript.c"
         break;
       case 80: /* output_column ::= assignment_expression */
-#line 539 "grn_ecmascript.lemon"
+#line 542 "grn_ecmascript.lemon"
 {
   yymsp[0].minor.yy0 = 1;
 }
-#line 2121 "grn_ecmascript.c"
+#line 2124 "grn_ecmascript.c"
         break;
       default:
       /* (84) input ::= query */ yytestcase(yyruleno==84);
@@ -2246,7 +2249,7 @@ static void yy_syntax_error(
       GRN_OBJ_FIN(ctx, &message);
     }
   }
-#line 2250 "grn_ecmascript.c"
+#line 2253 "grn_ecmascript.c"
 /************ End %syntax_error code ******************************************/
   grn_expr_parserARG_STORE; /* Suppress warning about unused %extra_argument variable */
 }

  Modified: lib/grn_ecmascript.lemon (+5 -2)
===================================================================
--- lib/grn_ecmascript.lemon    2016-05-06 00:22:54 +0900 (36b516a)
+++ lib/grn_ecmascript.lemon    2016-05-06 00:42:44 +0900 (161e0ca)
@@ -517,12 +517,15 @@ output_column(N_STACKED_COLUMNS) ::= STAR. {
     }
 
     for (i = 0; i < n_columns; i++) {
+      grn_obj *column = columns[i];
       if (n_output_columns > 1 && i > 0) {
         grn_expr_append_op(ctx, expr, GRN_OP_COMMA, 2);
       }
-      grn_expr_append_const(ctx, expr, columns[i], GRN_OP_GET_VALUE, 1);
+      grn_expr_append_const(ctx, expr, column, GRN_OP_GET_VALUE, 1);
       n_output_columns++;
-      GRN_PTR_PUT(ctx, &e->objs, columns[i]);
+      if (column->header.type == GRN_ACCESSOR) {
+        grn_expr_take_obj(ctx, expr, column);
+      }
     }
 
     GRN_OBJ_FIN(ctx, &columns_buffer);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index