@@ -1399,20 +1399,8 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
1399
1399
if (numParams > 0 )
1400
1400
parse_fixed_parameters (pstate , paramTypes , numParams );
1401
1401
1402
- pstate -> p_queryEnv = queryEnv ;
1403
- query = parse_analyze (parseTree , sourceText , paramTypes , numParams ,
1404
- queryEnv );
1405
-
1406
- return query ;
1407
- //query = transformTopLevelStmt(pstate, parseTree);
1408
- if (list_length (parseTree -> stmt ) == 1 ) {
1409
- Node * n = linitial (parseTree -> stmt );
1410
-
1411
-
1412
-
1413
- if (is_ag_node (n , cypher_create_graph )) {
1414
- cypher_create_graph * ccg = n ;
1415
- //ereport(ERROR, errmsg("Here"));
1402
+ if (is_ag_node (parseTree -> stmt , cypher_create_graph )) {
1403
+ cypher_create_graph * ccg = parseTree -> stmt ;
1416
1404
1417
1405
query = cypher_create_graph_utility (pstate , ccg -> graph_name );
1418
1406
@@ -1424,11 +1412,10 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
1424
1412
free_parsestate (pstate );
1425
1413
1426
1414
pgstat_report_query_id (query -> queryId , false);
1427
- //PushActiveSnapshot(GetTransactionSnapshot());
1428
1415
return query ;
1429
1416
1430
- } else if (is_ag_node (n , cypher_use_graph )) {
1431
- cypher_use_graph * ccg = n ;
1417
+ } else if (is_ag_node (parseTree -> stmt , cypher_use_graph )) {
1418
+ cypher_use_graph * ccg = parseTree -> stmt ;
1432
1419
1433
1420
query = cypher_use_graph_utility (pstate , ccg -> graph_name );
1434
1421
@@ -1440,10 +1427,9 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
1440
1427
free_parsestate (pstate );
1441
1428
1442
1429
pgstat_report_query_id (query -> queryId , false);
1443
- //PushActiveSnapshot(GetTransactionSnapshot());
1444
1430
return query ;
1445
- } else if (is_ag_node (n , cypher_drop_graph )) {
1446
- cypher_drop_graph * ccg = n ;
1431
+ } else if (is_ag_node (parseTree -> stmt , cypher_drop_graph )) {
1432
+ cypher_drop_graph * ccg = parseTree -> stmt ;
1447
1433
1448
1434
query = cypher_drop_graph_utility (pstate , ccg -> graph_name );
1449
1435
@@ -1455,22 +1441,21 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
1455
1441
free_parsestate (pstate );
1456
1442
1457
1443
pgstat_report_query_id (query -> queryId , false);
1458
- //PushActiveSnapshot(GetTransactionSnapshot());
1459
- return query ;
1460
-
1461
- }
1462
- else if (!IsA (n , List )){
1463
- query = parse_analyze ((makeRawStmt (n , 0 )), sourceText , paramTypes , numParams ,
1444
+ return query ;
1445
+ }
1446
+
1447
+ pstate -> p_queryEnv = queryEnv ;
1448
+ query = parse_analyze (parseTree , sourceText , paramTypes , numParams ,
1464
1449
queryEnv );
1465
1450
1466
- return query ;
1467
- }
1468
- }
1451
+ return query ;
1452
+ //query = transformTopLevelStmt(pstate, parseTree);
1453
+ /*
1469
1454
Oid graph_oid = get_session_graph_oid();
1470
1455
graph_cache_data *gcd = search_graph_namespace_cache(graph_oid);
1471
1456
1472
- cpstate -> graph_name = gcd -> name .data ;
1473
- cpstate -> graph_oid = graph_oid ;
1457
+ cpstate->graph_name = gcd->name.data;
1458
+ cpstate->graph_oid = graph_oid;
1474
1459
1475
1460
query = analyze_cypher(parseTree->stmt, pstate, sourceText, 0, gcd->name.data, graph_oid, NULL);
1476
1461
//PushActiveSnapshot(GetTransactionSnapshot());
@@ -1485,6 +1470,7 @@ cpstate->graph_oid = graph_oid;
1485
1470
pgstat_report_query_id(query->queryId, false);
1486
1471
1487
1472
return query;
1473
+ */
1488
1474
}
1489
1475
1490
1476
0 commit comments