[Groonga-commit] groonga/groonga at c649cfd [master] mrb: add error check for nonexistent sort/group key

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 6 20:30:22 JST 2015


Kouhei Sutou	2015-07-06 20:30:22 +0900 (Mon, 06 Jul 2015)

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

  Message:
    mrb: add error check for nonexistent sort/group key

  Modified files:
    lib/mrb/scripts/table.rb

  Modified: lib/mrb/scripts/table.rb (+9 -1)
===================================================================
--- lib/mrb/scripts/table.rb    2015-07-06 15:29:39 +0900 (36696f4)
+++ lib/mrb/scripts/table.rb    2015-07-06 20:30:22 +0900 (ba87604)
@@ -90,7 +90,15 @@ module Groonga
         key_name[0] = ""
       end
 
-      sort_key.key = find_column(key_name)
+      key = find_column(key_name)
+      if key.nil?
+        table_name = table.name || "(temporary)"
+        message = "unknown key: #{key_name.inspect}: "
+        message << "#{table_name}(#{table.size})"
+        raise ArgumentError, message
+      end
+
+      sort_key.key = key
       if order == :ascending
         sort_key.flags = Groonga::TableSortFlags::ASCENDING
       else
-------------- next part --------------
HTML����������������������������...
Download 



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