[Groonga-commit] pgroonga/pgroonga at f5f44dc [master] Add a convenience function to find column

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Wed Sep 23 17:24:48 JST 2015


Kouhei Sutou	2015-09-23 17:24:48 +0900 (Wed, 23 Sep 2015)

  New Revision: f5f44dc5a466b385a7f407b29cd18bfd02198d66
  https://github.com/pgroonga/pgroonga/commit/f5f44dc5a466b385a7f407b29cd18bfd02198d66

  Message:
    Add a convenience function to find column

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+22 -0)
===================================================================
--- pgroonga.c    2015-09-23 12:14:10 +0900 (39c4e0c)
+++ pgroonga.c    2015-09-23 17:24:48 +0900 (3556629)
@@ -812,6 +812,28 @@ PGrnLookup(const char *name, int errorLevel)
 }
 
 static grn_obj *
+PGrnLookupColumn(grn_obj *table, const char *name, int errorLevel)
+{
+	grn_obj *column;
+
+	column = grn_obj_column(ctx, table, name, strlen(name));
+	if (!column)
+	{
+		char tableName[GRN_TABLE_MAX_KEY_SIZE];
+		int tableNameSize;
+
+		tableNameSize = grn_obj_name(ctx, table, tableName, sizeof(tableName));
+		ereport(errorLevel,
+				(errcode(ERRCODE_INVALID_NAME),
+				 errmsg("pgroonga: column isn't found: <%.*s>:<%s>",
+						tableNameSize, tableName,
+						name)));
+	}
+
+	return column;
+}
+
+static grn_obj *
 PGrnLookupSourcesTable(Relation index, int errorLevel)
 {
 	char name[GRN_TABLE_MAX_KEY_SIZE];
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る