|
7 | 7 | * |
8 | 8 | * |
9 | 9 | * IDENTIFICATION |
10 | | - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.22 1996/11/27 13:47:05 momjian Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.23 1996/12/07 04:39:06 momjian Exp $ |
11 | 11 | * |
12 | 12 | * NOTES |
13 | 13 | * this is the "main" module of the postgres backend and |
|
83 | 83 | * global variables |
84 | 84 | * ---------------- |
85 | 85 | */ |
| 86 | +staticboolDebugPrintQuery= false; |
86 | 87 | staticboolDebugPrintPlan= false; |
87 | 88 | staticboolDebugPrintParse= false; |
88 | 89 | staticboolDebugPrintRewrittenParsetree= false; |
@@ -406,8 +407,13 @@ pg_plan(char *query_string, /* string to execute */ |
406 | 407 | continue; |
407 | 408 | } |
408 | 409 |
|
| 410 | +if (DebugPrintQuery== true ) { |
| 411 | +printf("\n---- \tquery is:\n%s\n",query_string); |
| 412 | +printf("\n"); |
| 413 | +fflush(stdout); |
| 414 | + } |
| 415 | + |
409 | 416 | if (DebugPrintParse== true ) { |
410 | | -printf("\ninput string is \"%s\"\n",query_string); |
411 | 417 | printf("\n---- \tparser outputs :\n"); |
412 | 418 | nodeDisplay(querytree); |
413 | 419 | printf("\n"); |
@@ -483,9 +489,7 @@ pg_plan(char *query_string, /* string to execute */ |
483 | 489 | } |
484 | 490 |
|
485 | 491 | if (DebugPrintRewrittenParsetree== true) { |
486 | | -printf("\n=================\n"); |
487 | | -printf(" After Rewriting\n"); |
488 | | -printf("=================\n"); |
| 492 | +printf("\n---- \tafter rewriting:\n"); |
489 | 493 |
|
490 | 494 | for (i=0;i<querytree_list->len;i++) { |
491 | 495 | print(querytree_list->qtrees[i]); |
@@ -534,7 +538,7 @@ pg_plan(char *query_string, /* string to execute */ |
534 | 538 | * ---------------- |
535 | 539 | */ |
536 | 540 | if (DebugPrintPlan== true ) { |
537 | | -printf("\nPlan is :\n"); |
| 541 | +printf("\n---- \tplan is :\n"); |
538 | 542 | nodeDisplay(plan); |
539 | 543 | printf("\n"); |
540 | 544 | } |
@@ -646,7 +650,7 @@ pg_eval_dest(char *query_string, /* string to execute */ |
646 | 650 | * ---------------- |
647 | 651 | */ |
648 | 652 | if (DebugPrintPlan== true ) { |
649 | | -printf("\nPlan is :\n"); |
| 653 | +printf("\n---- plan is :\n"); |
650 | 654 | nodeDisplay(plan); |
651 | 655 | printf("\n"); |
652 | 656 | } |
@@ -884,10 +888,15 @@ PostgresMain(int argc, char *argv[]) |
884 | 888 |
|
885 | 889 | case'd':/* debug level */ |
886 | 890 | flagQ=0; |
887 | | -DebugPrintPlan= true; |
888 | | -DebugPrintParse= true; |
889 | | -DebugPrintRewrittenParsetree= true; |
890 | 891 | DebugLvl= (short)atoi(optarg); |
| 892 | +if (DebugLvl>1) |
| 893 | +DebugPrintQuery= true; |
| 894 | +if (DebugLvl>2) |
| 895 | + { |
| 896 | +DebugPrintParse= true; |
| 897 | +DebugPrintPlan= true; |
| 898 | +DebugPrintRewrittenParsetree= true; |
| 899 | + } |
891 | 900 | break; |
892 | 901 |
|
893 | 902 | case'E': |
@@ -1262,7 +1271,7 @@ PostgresMain(int argc, char *argv[]) |
1262 | 1271 | */ |
1263 | 1272 | if (IsUnderPostmaster== false) { |
1264 | 1273 | puts("\nPOSTGRES backend interactive interface"); |
1265 | | -puts("$Revision: 1.22 $ $Date: 1996/11/27 13:47:05 $"); |
| 1274 | +puts("$Revision: 1.23 $ $Date: 1996/12/07 04:39:06 $"); |
1266 | 1275 | } |
1267 | 1276 |
|
1268 | 1277 | /* ---------------- |
|