[Groonga-commit] groonga/groonga [master] remove [...] from truncate result.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 3月 27日 (日) 22:58:24 JST


Kouhei Sutou	2011-03-27 13:58:24 +0000 (Sun, 27 Mar 2011)

  New Revision: 2c9a13597718658c3502f929cacc8adda2f018e9

  Log:
    remove [...] from truncate result.
    
    Other commands, table_create, column_create and so on, returns
    bare true/false. The truncate command uses the same format.
    
    refs #888

  Modified files:
    lib/proc.c
    test/unit/core/test-command-truncate.c

  Modified: lib/proc.c (+0 -2)
===================================================================
--- lib/proc.c    2011-03-27 13:45:49 +0000 (209c72f)
+++ lib/proc.c    2011-03-27 13:58:24 +0000 (c42ab18)
@@ -2122,7 +2122,6 @@ static grn_obj *
 proc_truncate(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
 {
   int table_name_len = GRN_TEXT_LEN(VAR(0));
-  GRN_OUTPUT_ARRAY_OPEN("RESULT", 1);
   if (table_name_len == 0) {
       ERR(GRN_INVALID_ARGUMENT, "table name is missing");
   } else {
@@ -2153,7 +2152,6 @@ proc_truncate(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
     }
   }
   GRN_OUTPUT_BOOL(!ctx->rc);
-  GRN_OUTPUT_ARRAY_CLOSE();
   return NULL;
 }
 

  Modified: test/unit/core/test-command-truncate.c (+2 -2)
===================================================================
--- test/unit/core/test-command-truncate.c    2011-03-27 13:45:49 +0000 (663c990)
+++ test/unit/core/test-command-truncate.c    2011-03-27 13:58:24 +0000 (550dc20)
@@ -95,7 +95,7 @@ test_no_columns(void)
        "[2,\"gunyara-kun\"],"
        "[3,\"yu\"]]]",
     send_command("select Users"));
-  cut_assert_equal_string("[true]",
+  cut_assert_equal_string("true",
                           send_command("truncate Users"));
   cut_assert_equal_string(
       "[[[0],"
@@ -124,7 +124,7 @@ test_have_columns(void)
        "[2,\"gunyara-kun\",\"Tasuku SUENAGA\"],"
        "[3,\"yu\",\"Yutaro Shimamura\"]]]",
     send_command("select Users --sortby _id"));
-  cut_assert_equal_string("[true]",
+  cut_assert_equal_string("true",
                           send_command("truncate Users"));
   cut_assert_equal_string(
       "[[[0],"




Groonga-commit メーリングリストの案内
Back to archive index