Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7d1a8d

Browse files
committed
Fix some corner-case bugs in _sendSQLLine's parsing of SQL commands
> found in a pg_dump archive. It had problems with dollar-quote tagsbroken across bufferload boundaries (this may explain bug report fromRod Taylor), also with dollar-quote literals of the form $a$a$...,and was also confused about the rules for backslash in double quotedidentifiers (ie, they're not special). Also put in placeholder supportfor E'...' literals --- this will need more work later.
1 parente1a7d1b commitc7d1a8d

File tree

2 files changed

+186
-212
lines changed

2 files changed

+186
-212
lines changed

‎src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*
1919
* IDENTIFICATION
20-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.66 2005/07/27 12:44:10 neilc Exp $
20+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.67 2005/09/11 04:10:25 tgl Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -136,22 +136,24 @@ typedef struct _outputContext
136136

137137
typedefenum
138138
{
139-
SQL_SCAN=0,
140-
SQL_IN_SQL_COMMENT,
141-
SQL_IN_EXT_COMMENT,
142-
SQL_IN_QUOTE,
143-
SQL_IN_DOLLARTAG,
144-
SQL_IN_DOLLARQUOTE
139+
SQL_SCAN=0,/* normal */
140+
SQL_IN_SQL_COMMENT,/* -- comment */
141+
SQL_IN_EXT_COMMENT,/* slash-star comment */
142+
SQL_IN_SINGLE_QUOTE,/* '...' literal */
143+
SQL_IN_E_QUOTE,/* E'...' literal */
144+
SQL_IN_DOUBLE_QUOTE,/* "..." identifier */
145+
SQL_IN_DOLLAR_TAG,/* possible dollar-quote starting tag */
146+
SQL_IN_DOLLAR_QUOTE/* body of dollar quote */
145147
}sqlparseState;
146148

147149
typedefstruct
148150
{
149-
intbackSlash;
150-
sqlparseStatestate;
151-
charlastChar;
152-
charquoteChar;
153-
intbraceDepth;
154-
PQExpBuffertagBuf;
151+
sqlparseStatestate;/* see above */
152+
charlastChar;/* preceding char, or '\0' initially */
153+
boolbackSlash;/* next char is backslash quoted? */
154+
intbraceDepth;/* parenthesis nesting depth */
155+
PQExpBuffertagBuf;/* dollar quote tag (NULL if not created) */
156+
intminTagEndPos;/* first possible end position of $-quote */
155157
}sqlparseInfo;
156158

157159
typedefenum

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp