public void QueryPlanOnly_Test() { using (CUBRIDConnection conn = new CUBRIDConnection()) { LogTestStep("Test GetQueryPlanOnly"); conn.ConnectionString = DBHelper.connString; conn.Open(); string queryPlan = conn.GetQueryPlanOnly("select * from athlete order by 1 desc"); //the string I get from Linux does not cotain tab and enter Console.WriteLine(queryPlan); Assert.IsTrue(queryPlan.Contains("Join graph segments (f indicates final):")); Assert.IsTrue(queryPlan.Contains("class: athlete node[0]")); Assert.IsTrue(queryPlan.Contains("select athlete.code, athlete.[name], athlete.gender, athlete.nation_code, athlete.event from athlete athlete order by 1 desc")); LogStepPass(); LogTestResult(); } }
/// <summary> /// Test CUBRIDConnection GetQueryPlanOnly() method /// </summary> private static void Test_QueryPlanOnly() { using (CUBRIDConnection conn = new CUBRIDConnection()) { conn.ConnectionString = TestCases.connString; conn.Open(); string queryPlan = conn.GetQueryPlanOnly("select * from athlete order by 1 desc"); Debug.Assert(queryPlan == "Join graph segments (f indicates final):\nseg[0]: [0]\nseg[1]: code[0] (f)\nseg[2]: name[0] (f)\nseg[3]: gender[0] (f)\nseg[4]: nation_code[0] (f)\nseg[5]: event[0] (f)\nJoin graph nodes:\nnode[0]: athlete athlete(6677/27) (sargs 0)\nJoin graph terms:\nterm[0]: athlete.code range (-2147483648 ge_inf max) (sel 1) (rank 2) (sarg term) (not-join eligible) (indexable code[0]) (loc 0)\n\nQuery plan:\n\niscan\n class: athlete node[0]\n index: pk_athlete_code term[0] (desc_index)\n sort: 1 asc\n cost: 92 card 6677\n\nQuery stmt:\n\nselect athlete.code, athlete.[name], athlete.gender, athlete.nation_code, athlete.event from athlete athlete where (athlete.code>=-2147483648) order by 1 desc \n\n/* ---> skip ORDER BY */\n"); } }