|
2 | 2 | * Routines for handling of 'SET var TO', 'SHOW var' and 'RESET var'
|
3 | 3 | * statements.
|
4 | 4 | *
|
5 |
| - * $Id: variable.c,v 1.6 1997/04/24 15:41:37 vadim Exp $ |
| 5 | + * $Id: variable.c,v 1.7 1997/04/29 04:38:58 vadim Exp $ |
6 | 6 | *
|
7 | 7 | */
|
8 | 8 |
|
|
16 | 16 |
|
17 | 17 | extern Cost _cpu_page_wight_;
|
18 | 18 | extern Cost _cpu_index_page_wight_;
|
| 19 | +extern bool _use_geqo_; |
19 | 20 |
|
20 | 21 | /*-----------------------------------------------------------------------*/
|
21 | 22 | #if USE_EURODATES
|
@@ -69,6 +70,40 @@ static bool reset_null(const char *value)
|
69 | 70 | return TRUE;
|
70 | 71 | }
|
71 | 72 |
|
| 73 | +static bool parse_geqo (const char *value) |
| 74 | +{ |
| 75 | + |
| 76 | + if ( strcasecmp (value, "on") == 0 ) |
| 77 | + _use_geqo_ = true; |
| 78 | + else if ( strcasecmp (value, "off") == 0 ) |
| 79 | + _use_geqo_ = false; |
| 80 | + else |
| 81 | + elog(WARN, "Bad value for GEQO (%s)", value); |
| 82 | + |
| 83 | + return TRUE; |
| 84 | +} |
| 85 | + |
| 86 | +static bool show_geqo () |
| 87 | +{ |
| 88 | + |
| 89 | + if ( _use_geqo_ ) |
| 90 | + elog (NOTICE, "GEQO is ON"); |
| 91 | + else |
| 92 | + elog (NOTICE, "GEQO is OFF"); |
| 93 | + return TRUE; |
| 94 | +} |
| 95 | + |
| 96 | +static bool reset_geqo () |
| 97 | +{ |
| 98 | + |
| 99 | +#ifdef GEQO |
| 100 | + _use_geqo_ = true; |
| 101 | +#else |
| 102 | + _use_geqo_ = false; |
| 103 | +#endif |
| 104 | + return TRUE; |
| 105 | +} |
| 106 | + |
72 | 107 | static bool parse_cost_heap (const char *value)
|
73 | 108 | {
|
74 | 109 | float32 res = float4in ((char*)value);
|
@@ -202,6 +237,7 @@ struct VariableParsers
|
202 | 237 | show_cost_heap, reset_cost_heap },
|
203 | 238 | { "cost_index", parse_cost_index,
|
204 | 239 | show_cost_index, reset_cost_index },
|
| 240 | + { "geqo", parse_geqo, show_geqo, reset_geqo }, |
205 | 241 | { NULL, NULL, NULL }
|
206 | 242 | };
|
207 | 243 |
|
|
0 commit comments