Clang 3.3 correctly complains that a variable of type enum
MultiXactStatus cannot hold a value of -1, which makes sense. Change
the declared type of the variable to int instead, and apply casting as
necessary to avoid the warning.
Per notice from Andres Freund
* update them). This table (and the macros below) helps us determine the
* heavyweight lock mode and MultiXactStatus values to use for any particular
* tuple lock strength.
* update them). This table (and the macros below) helps us determine the
* heavyweight lock mode and MultiXactStatus values to use for any particular
* tuple lock strength.
+ *
+ * Don't look at lockstatus/updstatus directly! Use get_mxact_status_for_lock
+ * instead.
*/
static const struct
{
LOCKMODE hwlock;
*/
static const struct
{
LOCKMODE hwlock;
- MultiXactStatus lockstatus;
- MultiXactStatus updstatus;
+ int lockstatus;
+ int updstatus;
}
tupleLockExtraInfo[MaxLockTupleMode + 1] =
}
tupleLockExtraInfo[MaxLockTupleMode + 1] =
static MultiXactStatus
get_mxact_status_for_lock(LockTupleMode mode, bool is_update)
{
static MultiXactStatus
get_mxact_status_for_lock(LockTupleMode mode, bool is_update)
{
- MultiXactStatus retval;
if (is_update)
retval = tupleLockExtraInfo[mode].updstatus;
if (is_update)
retval = tupleLockExtraInfo[mode].updstatus;
elog(ERROR, "invalid lock tuple mode %d/%s", mode,
is_update ? "true" : "false");
elog(ERROR, "invalid lock tuple mode %d/%s", mode,
is_update ? "true" : "false");
+ return (MultiXactStatus) retval;