rafsun42 commented on code in PR #1015:
URL: https://github.com/apache/age/pull/1015#discussion_r1254632046
##########
src/backend/utils/adt/agtype.c:
##########
@@ -4661,56 +4670,57 @@ Datum column_get_datum(TupleDesc tupdesc, HeapTuple
tuple, int column,
* function returns a pointer to a duplicated string that needs to be freed
* when you are finished using it.
*/
-static char *get_label_name(const char *graph_name, int64 graphid)
+static char *get_label_name(const char *graph_name, int64 label_id)
{
ScanKeyData scan_keys[2];
Relation ag_label;
SysScanDesc scan_desc;
HeapTuple tuple;
TupleDesc tupdesc;
char *result = NULL;
+ bool column_is_null;
- Oid graphoid = get_graph_oid(graph_name);
+ Oid graph_id = get_graph_oid(graph_name);
/* scankey for first match in ag_label, column 2, graphoid, BTEQ, OidEQ */
ScanKeyInit(&scan_keys[0], Anum_ag_label_graph, BTEqualStrategyNumber,
- F_OIDEQ, ObjectIdGetDatum(graphoid));
+ F_OIDEQ, ObjectIdGetDatum(graph_id));
/* scankey for second match in ag_label, column 3, label id, BTEQ, Int4EQ
*/
ScanKeyInit(&scan_keys[1], Anum_ag_label_id, BTEqualStrategyNumber,
- F_INT4EQ, Int32GetDatum(get_graphid_label_id(graphid)));
+ F_INT42EQ, Int32GetDatum(get_graphid_label_id(label_id)));
- ag_label = heap_open(ag_relation_id("ag_label", "table"), ShareLock);
- scan_desc = systable_beginscan(ag_label,
- ag_relation_id("ag_label_graph_id_index",
- "index"), true, NULL, 2,
- scan_keys);
+ ag_label = table_open(ag_label_relation_id(), ShareLock);
+ scan_desc = systable_beginscan(ag_label, ag_label_graph_oid_index_id(),
true,
+ NULL, 2, scan_keys);
tuple = systable_getnext(scan_desc);
if (!HeapTupleIsValid(tuple))
{
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
- errmsg("graphid %lu does not exist", graphid)));
+ errmsg("graphid abc %lu does not exist", label_id)));
Review Comment:
Is 'abc' a typo?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]