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

Commit62b6aaa

Browse files
committed
Only DISCARD ALL should be in the command_no_begin list.
We allowes DISCARD PLANS and TEMP in a transaction.
1 parentd08c698 commit62b6aaa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/bin/psql/common.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,8 +1388,20 @@ command_no_begin(const char *query)
13881388
return true;
13891389
}
13901390

1391+
/* DISCARD ALL isn't allowed in xacts, but other variants are allowed. */
13911392
if (wordlen==7&&pg_strncasecmp(query,"discard",7)==0)
1392-
return true;
1393+
{
1394+
query+=wordlen;
1395+
1396+
query=skip_white_space(query);
1397+
1398+
wordlen=0;
1399+
while (isalpha((unsignedchar)query[wordlen]))
1400+
wordlen+=PQmblen(&query[wordlen],pset.encoding);
1401+
1402+
if (wordlen==3&&pg_strncasecmp(query,"all",3)==0)
1403+
return true;
1404+
}
13931405

13941406
return false;
13951407
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp