Skip to content

Commit

Permalink
[CUBRIDQA-1236] revised spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
junsklee committed Nov 5, 2024
1 parent a25e8bf commit 96687aa
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions CTP/sql_by_cci/execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,16 +1011,16 @@ readFile (char *fileName)
{
hasqp = 1;
}
else if (startswith(line, "--@joingraph"))
else if (startswith (line, "--@joingraph"))
{
hasjg = 1;
hasqp = 1;
}
else if (startswith (line, "--@fullplan"))
{
hasfullp = 1;
hasqp = 1;
}
else if (startswith (line, "--@fullplan"))
{
hasfullp = 1;
hasqp = 1;
}
else if (startswithCI (line, "--+ server-message") ||
startswithCI (line, "--+server-message") ||
startswithCI (line, "--+ holdcas") || startswithCI (line, "--+holdcas"))
Expand All @@ -1029,7 +1029,7 @@ readFile (char *fileName)
strcpy (sqlstate[total_sql].sql, line);
sqlstate[total_sql].hasqp = 0;
sqlstate[total_sql].onlyjg = 0;
sqlstate[total_sql].hasfullp = 0;
sqlstate[total_sql].hasfullp = 0;
//if script like "? = call"
sqlstate[total_sql].iscallwithoutvalue = 0;

Expand Down Expand Up @@ -1062,7 +1062,7 @@ readFile (char *fileName)
strcpy (sqlstate[total_sql].sql, sql_buf);
sqlstate[total_sql].hasqp = hasqp;
sqlstate[total_sql].onlyjg = hasjg;
sqlstate[total_sql].hasfullp = hasfullp;
sqlstate[total_sql].hasfullp = hasfullp;
//if script like "? = call"
sqlstate[total_sql].iscallwithoutvalue = startswith (line, "?");

Expand All @@ -1072,7 +1072,7 @@ readFile (char *fileName)
sql_len = 0;
hasqp = 0;
hasjg = 0;
hasfullp = 0;
hasfullp = 0;
}

if (is_statement_end ())
Expand Down Expand Up @@ -1284,25 +1284,27 @@ formatfullplan (FILE * fp, char *queryPlan)

queryPlanLen = strlen (queryPlan);
str = (char *) malloc (sizeof (char) * (queryPlanLen + 1));
memset (str, 0, sizeof (char) * (queryPlanLen + 1));
p = (char *) malloc (sizeof (char) * (queryPlanLen + 1));
memset (p, 0, sizeof (char) * (queryPlanLen + 1));

if (str == NULL || p == NULL)
{
if (str != NULL)
{
free(str);
}
if (str != NULL)
{
free(str);
}

if (p != NULL)
{
free(p);
if (p != NULL)
{
free(p);
}

fprintf(stdout, "formatfullplan: malloc failure\n");
return;
}

fprintf(stdout, "formatfullplan: malloc failure\n");
return;
}


memset (str, 0, sizeof (char) * (queryPlanLen + 1));
memset (p, 0, sizeof (char) * (queryPlanLen + 1));

newline = 0;
for (i = 0; i < queryPlanLen; i++)
{
Expand Down Expand Up @@ -2007,14 +2009,14 @@ execute (FILE * fp, char conn, const SqlStateStruce *pSqlState)
if (res >= 0)
{
if (onlyjoingraph)
{
{
formatjoingraph (fp, plan);
}
else if (hasfullplan)
{
formatfullplan (fp, plan);
}
else
{
formatfullplan (fp, plan);
}
else
{
formatplan (fp, plan);
}
Expand Down

0 comments on commit 96687aa

Please sign in to comment.