Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e546d1d0
Commit
e546d1d0
authored
3 years ago
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_amcheck: Message style and structuring improvements
parent
a945f552
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
src/bin/pg_amcheck/pg_amcheck.c
src/bin/pg_amcheck/pg_amcheck.c
+16
-15
src/bin/pg_amcheck/t/004_verify_heapam.pl
src/bin/pg_amcheck/t/004_verify_heapam.pl
+4
-4
No files found.
src/bin/pg_amcheck/pg_amcheck.c
View file @
e546d1d0
...
...
@@ -1028,29 +1028,28 @@ verify_heap_slot_handler(PGresult *res, PGconn *conn, void *context)
msg
=
PQgetvalue
(
res
,
i
,
3
);
if
(
!
PQgetisnull
(
res
,
i
,
2
))
printf
(
_
(
"heap table
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
, block %s, offset %s, attribute %s:
\n
%s
\n
"
),
printf
(
_
(
"heap table
\"
%s
.%s.%s
\"
, block %s, offset %s, attribute %s:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
PQgetvalue
(
res
,
i
,
0
),
/* blkno */
PQgetvalue
(
res
,
i
,
1
),
/* offnum */
PQgetvalue
(
res
,
i
,
2
),
/* attnum */
msg
);
PQgetvalue
(
res
,
i
,
2
));
/* attnum */
else
if
(
!
PQgetisnull
(
res
,
i
,
1
))
printf
(
_
(
"heap table
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
, block %s, offset %s:
\n
%s
\n
"
),
printf
(
_
(
"heap table
\"
%s
.%s.%s
\"
, block %s, offset %s:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
PQgetvalue
(
res
,
i
,
0
),
/* blkno */
PQgetvalue
(
res
,
i
,
1
),
/* offnum */
msg
);
PQgetvalue
(
res
,
i
,
1
));
/* offnum */
else
if
(
!
PQgetisnull
(
res
,
i
,
0
))
printf
(
_
(
"heap table
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
, block %s:
\n
%s
\n
"
),
printf
(
_
(
"heap table
\"
%s
.%s.%s
\"
, block %s:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
PQgetvalue
(
res
,
i
,
0
),
/* blkno */
msg
);
PQgetvalue
(
res
,
i
,
0
));
/* blkno */
else
printf
(
_
(
"heap table
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
:
\n
%s
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
msg
);
printf
(
_
(
"heap table
\"
%s.%s.%s
\"
:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
);
printf
(
" %s
\n
"
,
msg
);
}
}
else
if
(
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
)
...
...
@@ -1058,8 +1057,9 @@ verify_heap_slot_handler(PGresult *res, PGconn *conn, void *context)
char
*
msg
=
indent_lines
(
PQerrorMessage
(
conn
));
all_checks_pass
=
false
;
printf
(
_
(
"heap table
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
:
\n
%s"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
msg
);
printf
(
_
(
"heap table
\"
%s.%s.%s
\"
:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
);
printf
(
"%s"
,
msg
);
if
(
opts
.
verbose
)
printf
(
_
(
"query was: %s
\n
"
),
rel
->
sql
);
FREE_AND_SET_NULL
(
msg
);
...
...
@@ -1124,8 +1124,9 @@ verify_btree_slot_handler(PGresult *res, PGconn *conn, void *context)
char
*
msg
=
indent_lines
(
PQerrorMessage
(
conn
));
all_checks_pass
=
false
;
printf
(
_
(
"btree index
\"
%s
\"
.
\"
%s
\"
.
\"
%s
\"
:
\n
%s"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
,
msg
);
printf
(
_
(
"btree index
\"
%s.%s.%s
\"
:
\n
"
),
rel
->
datinfo
->
datname
,
rel
->
nspname
,
rel
->
relname
);
printf
(
"%s"
,
msg
);
if
(
opts
.
verbose
)
printf
(
_
(
"query was: %s
\n
"
),
rel
->
sql
);
FREE_AND_SET_NULL
(
msg
);
...
...
This diff is collapsed.
Click to expand it.
src/bin/pg_amcheck/t/004_verify_heapam.pl
View file @
e546d1d0
...
...
@@ -327,14 +327,14 @@ sub header
{
my
(
$blkno
,
$offnum
,
$attnum
)
=
@_
;
return
qr/heap table "postgres
"\."public"\."
test", block $blkno, offset $offnum, attribute $attnum:\s+/
ms
qr/heap table "postgres
\.public\.
test", block $blkno, offset $offnum, attribute $attnum:\s+/
ms
if
(
defined
$attnum
);
return
qr/heap table "postgres
"\."public"\."
test", block $blkno, offset $offnum:\s+/
ms
qr/heap table "postgres
\.public\.
test", block $blkno, offset $offnum:\s+/
ms
if
(
defined
$offnum
);
return
qr/heap table "postgres
"\."public"\."
test", block $blkno:\s+/
ms
return
qr/heap table "postgres
\.public\.
test", block $blkno:\s+/
ms
if
(
defined
$blkno
);
return
qr/heap table "postgres
"\."public"\."
test":\s+/
ms
;
return
qr/heap table "postgres
\.public\.
test":\s+/
ms
;
}
# Corrupt the tuples, one type of corruption per tuple. Some types of
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment