@@ -832,7 +832,7 @@ static void doLog(TState *thread, CState *st,
832
832
StatsData * agg , bool skipped , double latency , double lag );
833
833
static void processXactStats (TState * thread , CState * st , pg_time_usec_t * now ,
834
834
bool skipped , StatsData * agg );
835
- static void addScript (ParsedScript script );
835
+ static void addScript (const ParsedScript * script );
836
836
static THREAD_FUNC_RETURN_TYPE THREAD_FUNC_CC threadRun (void * arg );
837
837
static void finishCon (CState * st );
838
838
static void setalarm (int seconds );
@@ -5743,15 +5743,15 @@ ConditionError(const char *desc, int cmdn, const char *msg)
5743
5743
* Partial evaluation of conditionals before recording and running the script.
5744
5744
*/
5745
5745
static void
5746
- CheckConditional (ParsedScript ps )
5746
+ CheckConditional (const ParsedScript * ps )
5747
5747
{
5748
5748
/* statically check conditional structure */
5749
5749
ConditionalStack cs = conditional_stack_create ();
5750
5750
int i ;
5751
5751
5752
- for (i = 0 ; ps . commands [i ] != NULL ; i ++ )
5752
+ for (i = 0 ; ps -> commands [i ] != NULL ; i ++ )
5753
5753
{
5754
- Command * cmd = ps . commands [i ];
5754
+ Command * cmd = ps -> commands [i ];
5755
5755
5756
5756
if (cmd -> type == META_COMMAND )
5757
5757
{
@@ -5762,20 +5762,20 @@ CheckConditional(ParsedScript ps)
5762
5762
break ;
5763
5763
case META_ELIF :
5764
5764
if (conditional_stack_empty (cs ))
5765
- ConditionError (ps . desc , i + 1 , "\\elif without matching \\if" );
5765
+ ConditionError (ps -> desc , i + 1 , "\\elif without matching \\if" );
5766
5766
if (conditional_stack_peek (cs ) == IFSTATE_ELSE_FALSE )
5767
- ConditionError (ps . desc , i + 1 , "\\elif after \\else" );
5767
+ ConditionError (ps -> desc , i + 1 , "\\elif after \\else" );
5768
5768
break ;
5769
5769
case META_ELSE :
5770
5770
if (conditional_stack_empty (cs ))
5771
- ConditionError (ps . desc , i + 1 , "\\else without matching \\if" );
5771
+ ConditionError (ps -> desc , i + 1 , "\\else without matching \\if" );
5772
5772
if (conditional_stack_peek (cs ) == IFSTATE_ELSE_FALSE )
5773
- ConditionError (ps . desc , i + 1 , "\\else after \\else" );
5773
+ ConditionError (ps -> desc , i + 1 , "\\else after \\else" );
5774
5774
conditional_stack_poke (cs , IFSTATE_ELSE_FALSE );
5775
5775
break ;
5776
5776
case META_ENDIF :
5777
5777
if (!conditional_stack_pop (cs ))
5778
- ConditionError (ps . desc , i + 1 , "\\endif without matching \\if" );
5778
+ ConditionError (ps -> desc , i + 1 , "\\endif without matching \\if" );
5779
5779
break ;
5780
5780
default :
5781
5781
/* ignore anything else... */
@@ -5784,7 +5784,7 @@ CheckConditional(ParsedScript ps)
5784
5784
}
5785
5785
}
5786
5786
if (!conditional_stack_empty (cs ))
5787
- ConditionError (ps . desc , i + 1 , "\\if without matching \\endif" );
5787
+ ConditionError (ps -> desc , i + 1 , "\\if without matching \\endif" );
5788
5788
conditional_stack_destroy (cs );
5789
5789
}
5790
5790
@@ -5916,7 +5916,7 @@ ParseScript(const char *script, const char *desc, int weight)
5916
5916
5917
5917
ps .commands [index ] = NULL ;
5918
5918
5919
- addScript (ps );
5919
+ addScript (& ps );
5920
5920
5921
5921
termPQExpBuffer (& line_buf );
5922
5922
psql_scan_finish (sstate );
@@ -6093,11 +6093,11 @@ parseScriptWeight(const char *option, char **script)
6093
6093
6094
6094
/* append a script to the list of scripts to process */
6095
6095
static void
6096
- addScript (ParsedScript script )
6096
+ addScript (const ParsedScript * script )
6097
6097
{
6098
- if (script . commands == NULL || script . commands [0 ] == NULL )
6098
+ if (script -> commands == NULL || script -> commands [0 ] == NULL )
6099
6099
{
6100
- pg_log_fatal ("empty command list for script \"%s\"" , script . desc );
6100
+ pg_log_fatal ("empty command list for script \"%s\"" , script -> desc );
6101
6101
exit (1 );
6102
6102
}
6103
6103
@@ -6109,7 +6109,7 @@ addScript(ParsedScript script)
6109
6109
6110
6110
CheckConditional (script );
6111
6111
6112
- sql_script [num_scripts ] = script ;
6112
+ sql_script [num_scripts ] = * script ;
6113
6113
num_scripts ++ ;
6114
6114
}
6115
6115
0 commit comments