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

Commitd0afdc1

Browse files
committed
Disallow AQO to write into the ML-tables if can be detected that
the query must be read-only (by the flag XactReadOnly).
1 parentce7188c commitd0afdc1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎storage.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ update_query(int qhash, int fhash,
125125
ScanKeyDatakey;
126126
SnapshotDatasnap;
127127

128+
/* Couldn't allow to write if xact must be read-only. */
129+
if (XactReadOnly)
130+
return false;
131+
128132
reloid=RelnameGetRelid("aqo_queries_query_hash_idx");
129133
if (!OidIsValid(reloid))
130134
{
@@ -225,6 +229,10 @@ add_query_text(int qhash)
225229
Oidreloid;
226230
char*text_str;
227231

232+
/* Couldn't allow to write if xact must be read-only. */
233+
if (XactReadOnly)
234+
return false;
235+
228236
reloid=RelnameGetRelid("aqo_query_texts_query_hash_idx");
229237
if (!OidIsValid(reloid))
230238
{
@@ -386,6 +394,10 @@ update_fss(int fhash, int fsshash, int nrows, int ncols,
386394
ScanKeyDatakey[2];
387395
boolresult= true;
388396

397+
/* Couldn't allow to write if xact must be read-only. */
398+
if (XactReadOnly)
399+
return false;
400+
389401
reloid=RelnameGetRelid("aqo_fss_access_idx");
390402
if (!OidIsValid(reloid))
391403
{
@@ -575,6 +587,10 @@ update_aqo_stat(int qhash, QueryStat *stat)
575587
IndexScanDescscan;
576588
ScanKeyDatakey;
577589

590+
/* Couldn't allow to write if xact must be read-only. */
591+
if (XactReadOnly)
592+
return;
593+
578594
reloid=RelnameGetRelid("aqo_query_stat_idx");
579595
if (!OidIsValid(reloid))
580596
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp