[Groonga-commit] groonga/grnxx at 0b21d58 [master] Disable "_id" and "_score" in Expression::push_column(). (#54)

Back to archive index

susumu.yata null+****@clear*****
Tue Sep 16 15:39:54 JST 2014


susumu.yata	2014-09-16 15:39:54 +0900 (Tue, 16 Sep 2014)

  New Revision: 0b21d58bd318af2c562c8c6530a4fb28d924b030
  https://github.com/groonga/grnxx/commit/0b21d58bd318af2c562c8c6530a4fb28d924b030

  Message:
    Disable "_id" and "_score" in Expression::push_column(). (#54)

  Modified files:
    include/grnxx/expression.hpp
    lib/grnxx/expression.cpp
    test/test_pipeline.cpp
    test/test_sorter.cpp

  Modified: include/grnxx/expression.hpp (+0 -4)
===================================================================
--- include/grnxx/expression.hpp    2014-09-16 15:35:59 +0900 (2918644)
+++ include/grnxx/expression.hpp    2014-09-16 15:39:54 +0900 (66332bc)
@@ -229,10 +229,6 @@ class ExpressionBuilder {
 
   // Push a node associated with a column.
   //
-  // TODO: "_id" and "_score" will be obsolete.
-  // If "name" == "_id", pushes a pseudo column associated with row IDs.
-  // If "name" == "_score", pushes a pseudo column associated with scores.
-  //
   // On success, returns true.
   // On failure, returns false and stores error information into "*error" if
   // "error" != nullptr.

  Modified: lib/grnxx/expression.cpp (+0 -19)
===================================================================
--- lib/grnxx/expression.cpp    2014-09-16 15:35:59 +0900 (62c3256)
+++ lib/grnxx/expression.cpp    2014-09-16 15:39:54 +0900 (21c9bc6)
@@ -2994,25 +2994,6 @@ unique_ptr<Node> Builder::create_datum_node(
 unique_ptr<Node> Builder::create_column_node(
     Error *error,
     String name) {
-  if (name == "_id") {
-    // Create a node associated with row IDs of records.
-    unique_ptr<Node> node(RowIDNode::create(error));
-    if (!node) {
-      return nullptr;
-    }
-    return node;
-  }
-
-  if (name == "_score") {
-    // Create a node associated with scores of records.
-    unique_ptr<Node> node(ScoreNode::create(error));
-    if (!node) {
-      return nullptr;
-    }
-    return node;
-  }
-
-  // Create a node associated with a column.
   Column *column = table_->find_column(error, name);
   if (!column) {
     return nullptr;

  Modified: test/test_pipeline.cpp (+1 -1)
===================================================================
--- test/test_pipeline.cpp    2014-09-16 15:35:59 +0900 (0a35e00)
+++ test/test_pipeline.cpp    2014-09-16 15:39:54 +0900 (769ccb7)
@@ -288,7 +288,7 @@ void test_sorter() {
   assert(expression);
   orders[0].expression = std::move(expression);
   orders[0].type = grnxx::REGULAR_ORDER;
-  assert(expression_builder->push_column(&error, "_id"));
+  assert(expression_builder->push_row_id(&error));
   expression = expression_builder->release(&error);
   assert(expression);
   orders[1].expression = std::move(expression);

  Modified: test/test_sorter.cpp (+4 -4)
===================================================================
--- test/test_sorter.cpp    2014-09-16 15:35:59 +0900 (d66ae20)
+++ test/test_sorter.cpp    2014-09-16 15:39:54 +0900 (bc3ec5b)
@@ -166,7 +166,7 @@ void test_bool() {
   assert(expression);
   orders[0].expression = std::move(expression);
   orders[0].type = grnxx::REGULAR_ORDER;
-  assert(expression_builder->push_column(&error, "_id"));
+  assert(expression_builder->push_row_id(&error));
   expression = expression_builder->release(&error);
   assert(expression);
   orders[1].expression = std::move(expression);
@@ -244,7 +244,7 @@ void test_int() {
   assert(expression);
   orders[0].expression = std::move(expression);
   orders[0].type = grnxx::REGULAR_ORDER;
-  assert(expression_builder->push_column(&error, "_id"));
+  assert(expression_builder->push_row_id(&error));
   expression = expression_builder->release(&error);
   assert(expression);
   orders[1].expression = std::move(expression);
@@ -340,7 +340,7 @@ void test_float() {
   assert(expression);
   orders[0].expression = std::move(expression);
   orders[0].type = grnxx::REGULAR_ORDER;
-  assert(expression_builder->push_column(&error, "_id"));
+  assert(expression_builder->push_row_id(&error));
   expression = expression_builder->release(&error);
   assert(expression);
   orders[1].expression = std::move(expression);
@@ -418,7 +418,7 @@ void test_text() {
   assert(expression);
   orders[0].expression = std::move(expression);
   orders[0].type = grnxx::REGULAR_ORDER;
-  assert(expression_builder->push_column(&error, "_id"));
+  assert(expression_builder->push_row_id(&error));
   expression = expression_builder->release(&error);
   assert(expression);
   orders[1].expression = std::move(expression);
-------------- next part --------------
HTML����������������������������...
Download 



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