Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu


PG_PACKAGE_VERSION=14.5
PG_PACKAGE_VERSION=14.6



Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dnl The PACKAGE_VERSION from upstream PostgreSQL is maintained in the
dnl PG_PACKAGE_VERSION variable, when merging make sure to update this
dnl variable with the merge conflict from the AC_INIT() statement.
AC_INIT([Apache Cloudberry], [2.1.0-incubating], [dev@cloudberry.apache.org], [], [https://cloudberry.apache.org/])
[PG_PACKAGE_VERSION=14.5]
[PG_PACKAGE_VERSION=14.6]
AC_SUBST(PG_PACKAGE_VERSION)

dnl m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Expand Down
16 changes: 14 additions & 2 deletions contrib/pg_stat_statements/pg_stat_statements.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
{
Node *parsetree = pstmt->utilityStmt;
uint64 saved_queryId = pstmt->queryId;
int saved_stmt_location = pstmt->stmt_location;
int saved_stmt_len = pstmt->stmt_len;

/*
* Force utility statements to get queryId zero. We do this even in cases
Expand Down Expand Up @@ -1145,6 +1147,16 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
}
PG_END_TRY();

/*
* CAUTION: do not access the *pstmt data structure again below here.
* If it was a ROLLBACK or similar, that data structure may have been
* freed. We must copy everything we still need into local variables,
* which we did above.
*
* For the same reason, we can't risk restoring pstmt->queryId to its
* former value, which'd otherwise be a good idea.
*/

INSTR_TIME_SET_CURRENT(duration);
INSTR_TIME_SUBTRACT(duration, start);

Expand All @@ -1170,8 +1182,8 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,

pgss_store(queryString,
saved_queryId,
pstmt->stmt_location,
pstmt->stmt_len,
saved_stmt_location,
saved_stmt_len,
PGSS_EXEC,
INSTR_TIME_GET_MILLISEC(duration),
rows,
Expand Down
Loading
Loading