|
15 | 15 | */
|
16 | 16 | #include "postgres.h"
|
17 | 17 |
|
18 |
| -#include "access/attnum.h" |
19 |
| -#include "access/htup.h" |
20 |
| -#include "access/itup.h" |
21 |
| -#include "access/tupdesc.h" |
22 | 18 | #include "bootstrap/bootstrap.h"
|
23 |
| -#include "catalog/pg_am.h" |
24 |
| -#include "catalog/pg_attribute.h" |
25 |
| -#include "catalog/pg_class.h" |
26 |
| -#include "nodes/nodes.h" |
27 |
| -#include "nodes/parsenodes.h" |
28 |
| -#include "nodes/pg_list.h" |
29 |
| -#include "nodes/primnodes.h" |
30 |
| -#include "parser/scansup.h" |
31 |
| -#include "rewrite/prs2lock.h" |
32 |
| -#include "storage/block.h" |
33 |
| -#include "storage/fd.h" |
34 |
| -#include "storage/itemptr.h" |
35 |
| -#include "storage/off.h" |
36 |
| -#include "utils/rel.h" |
| 19 | +#include "utils/guc.h" |
37 | 20 |
|
38 | 21 | /* Not needed now that this file is compiled as part of bootparse. */
|
39 | 22 | /* #include "bootparse.h" */
|
@@ -66,7 +49,7 @@ static int yyline = 1; /* line number for error reporting */
|
66 | 49 |
|
67 | 50 |
|
68 | 51 | id [-A-Za-z0-9_]+
|
69 |
| -sid \"([^\"])*\" |
| 52 | +sid \'([^']|\'\')*\' |
70 | 53 |
|
71 | 54 | /*
|
72 | 55 | * Keyword tokens return the keyword text (as a constant string) in yylval.kw,
|
@@ -120,14 +103,12 @@ NOT { yylval.kw = "NOT"; return XNOT; }
|
120 | 103 | NULL { yylval.kw = "NULL"; return XNULL; }
|
121 | 104 |
|
122 | 105 | {id} {
|
123 |
| - yylval.str = scanstr(yytext); |
| 106 | + yylval.str = pstrdup(yytext); |
124 | 107 | return ID;
|
125 | 108 | }
|
126 | 109 | {sid} {
|
127 |
| - /* leading and trailing quotes are not passed to scanstr */ |
128 |
| - yytext[strlen(yytext) - 1] = '\0'; |
129 |
| - yylval.str = scanstr(yytext+1); |
130 |
| - yytext[strlen(yytext)] = '"'; /* restore yytext */ |
| 110 | + /* strip quotes and escapes */ |
| 111 | + yylval.str = DeescapeQuotedString(yytext); |
131 | 112 | return ID;
|
132 | 113 | }
|
133 | 114 |
|
|
0 commit comments