From 36d0feb242622d1ef197a7ac06c98809e04e44a0 Mon Sep 17 00:00:00 2001 From: Morris Guan <44405167+mkwan01@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:10:29 -0400 Subject: [PATCH] Add temp trace code for authority issue Signed-off-by: Morris Guan <44405167+mkwan01@users.noreply.github.com> --- UnitTests/ProcedureTest.cs | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/UnitTests/ProcedureTest.cs b/UnitTests/ProcedureTest.cs index e35f11b..9058468 100644 --- a/UnitTests/ProcedureTest.cs +++ b/UnitTests/ProcedureTest.cs @@ -55,13 +55,33 @@ public void NumberParameters() DaemonServer daemonServer = MapepireTest.GetTestDaemonServer(); string successString = "connection created using (" + MapepireTest.host + "," + MapepireTest.port + "," + MapepireTest.user + ",*******)"; - Console.WriteLine("Host: " + daemonServer.Host); - Console.WriteLine("Port: " + daemonServer.Port); - Console.WriteLine("User: " + daemonServer.User); - SqlJob job = new(); ConnectionResult? cr = job.Connect(daemonServer); + Query query1 = job.Query("SELECT LOCAL_HOST_NAME FROM QSYS2.TCPIP_INFO"); + QueryResult result1 = query1.Execute(); + List>? data = result1.Data; + + if (data?.Count > 0) { + List? columns = result1.Metadata?.Columns; + Dictionary hashmap = data.ElementAt(0); + string? key = columns?.ElementAt(0)?.Name; + Console.WriteLine("Host name: " + hashmap.GetValueOrDefault(key ?? throw new Exception("Null column"))); + } + query1.Close(); + + Query query2 = job.Query("VALUES CURRENT USER"); + QueryResult result2 = query2.Execute(); + data = result2.Data; + + if (data?.Count > 0) { + List? columns = result2.Metadata?.Columns; + Dictionary hashmap = data.ElementAt(0); + string? key = columns?.ElementAt(0)?.Name; + Console.WriteLine("Current user: " + hashmap.GetValueOrDefault(key ?? throw new Exception("Null column"))); + } + query2.Close(); + String testProc = "CREATE OR REPLACE PROCEDURE " + TestSchema + ".PROCEDURE_TEST(" + " IN P1 INTEGER," + " INOUT P2 INTEGER,"