Skip to content

Commit 7d15cc1

Browse files
authored
Merge pull request IvorySQL#1210 from Data-Bene/upstream/fix-scanquotetype
Keep scanner quote types self-consistent
2 parents ee770ff + 945bc94 commit 7d15cc1

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/bin/psql/ora_psqlscanslash.l

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ other .
250250
yytext + 1,
251251
yyleng - 1);
252252
value = cur_state->oracallbacks->get_variable(varname,
253-
PQUOTE_PLAIN,
254-
cur_state->cb_passthrough);
253+
ORAPQUOTE_PLAIN,
254+
cur_state->cb_passthrough);
255255
free(varname);
256256

257257
/*
@@ -276,15 +276,15 @@ other .
276276

277277
:'{variable_char}+' {
278278
ora_psqlscan_escape_variable(cur_state, yytext, yyleng,
279-
PQUOTE_SQL_LITERAL);
279+
ORAPQUOTE_SQL_LITERAL);
280280
*option_quote = ':';
281281
unquoted_option_chars = 0;
282282
}
283283

284284

285285
:\"{variable_char}+\" {
286286
ora_psqlscan_escape_variable(cur_state, yytext, yyleng,
287-
PQUOTE_SQL_IDENT);
287+
ORAPQUOTE_SQL_IDENT);
288288
*option_quote = ':';
289289
unquoted_option_chars = 0;
290290
}
@@ -389,8 +389,8 @@ other .
389389
yytext + 1,
390390
yyleng - 1);
391391
value = cur_state->oracallbacks->get_variable(varname,
392-
PQUOTE_PLAIN,
393-
cur_state->cb_passthrough);
392+
ORAPQUOTE_PLAIN,
393+
cur_state->cb_passthrough);
394394
free(varname);
395395

396396
if (value)
@@ -405,7 +405,7 @@ other .
405405

406406
:'{variable_char}+' {
407407
ora_psqlscan_escape_variable(cur_state, yytext, yyleng,
408-
PQUOTE_SHELL_ARG);
408+
ORAPQUOTE_SHELL_ARG);
409409
}
410410

411411
:'{variable_char}* {

src/include/fe_utils/psqlscan_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ extern YY_BUFFER_STATE ora_psqlscan_prepare_buffer(PsqlScanState state, const ch
319319
extern void ora_psqlscan_emit(PsqlScanState state, const char *txt, int len);
320320
extern char * ora_psqlscan_extract_substring(PsqlScanState state, const char *txt, int len);
321321
extern void ora_psqlscan_escape_variable(PsqlScanState state, const char *txt, int len,
322-
PsqlScanQuoteType quote);
322+
Ora_psqlScanQuoteType quote);
323323
extern void ora_psqlscan_test_variable(PsqlScanState state, const char *txt, int len);
324324

325325
#endif /* PSQLSCAN_INT_H */

src/oracle_fe_utils/ora_psqlscan.l

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,10 @@ other .
848848
varname = ora_psqlscan_extract_substring(cur_state,
849849
yytext + 1,
850850
yyleng - 1);
851-
if (cur_state->oracallbacks->get_variable)
852-
value = cur_state->oracallbacks->get_variable(varname,
853-
PQUOTE_PLAIN,
854-
cur_state->cb_passthrough);
851+
if (cur_state->oracallbacks->get_variable)
852+
value = cur_state->oracallbacks->get_variable(varname,
853+
ORAPQUOTE_PLAIN,
854+
cur_state->cb_passthrough);
855855
else
856856
value = NULL;
857857

@@ -888,12 +888,12 @@ other .
888888

889889
:'{variable_char}+' {
890890
ora_psqlscan_escape_variable(cur_state, yytext, yyleng,
891-
PQUOTE_SQL_LITERAL);
891+
ORAPQUOTE_SQL_LITERAL);
892892
}
893893

894894
:\"{variable_char}+\" {
895895
ora_psqlscan_escape_variable(cur_state, yytext, yyleng,
896-
PQUOTE_SQL_IDENT);
896+
ORAPQUOTE_SQL_IDENT);
897897
}
898898

899899
:\{\?{variable_char}+\} {
@@ -1801,7 +1801,7 @@ ora_psqlscan_extract_substring(PsqlScanState state, const char *txt, int len)
18011801
*/
18021802
void
18031803
ora_psqlscan_escape_variable(PsqlScanState state, const char *txt, int len,
1804-
PsqlScanQuoteType quote)
1804+
Ora_psqlScanQuoteType quote)
18051805
{
18061806
char *varname;
18071807
char *value;
@@ -1836,8 +1836,8 @@ ora_psqlscan_test_variable(PsqlScanState state, const char *txt, int len)
18361836

18371837
varname = ora_psqlscan_extract_substring(state, txt + 3, len - 4);
18381838
if (state->oracallbacks->get_variable)
1839-
value = state->oracallbacks->get_variable(varname, PQUOTE_PLAIN,
1840-
state->cb_passthrough);
1839+
value = state->oracallbacks->get_variable(varname, ORAPQUOTE_PLAIN,
1840+
state->cb_passthrough);
18411841
else
18421842
value = NULL;
18431843
free(varname);

0 commit comments

Comments
 (0)