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
9c26980f
Commit
9c26980f
authored
Dec 07, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace unportable and overflow-prone use of 'long long' with safer
'double' arithmetic, per recent discussion.
parent
80af69ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
contrib/pg_autovacuum/pg_autovacuum.c
contrib/pg_autovacuum/pg_autovacuum.c
+4
-4
contrib/pgbench/pgbench.c
contrib/pgbench/pgbench.c
+5
-5
No files found.
contrib/pg_autovacuum/pg_autovacuum.c
View file @
9c26980f
...
@@ -978,7 +978,7 @@ main(int argc, char *argv[])
...
@@ -978,7 +978,7 @@ main(int argc, char *argv[])
db_info
*
dbs
;
db_info
*
dbs
;
tbl_info
*
tbl
;
tbl_info
*
tbl
;
PGresult
*
res
=
NULL
;
PGresult
*
res
=
NULL
;
long
long
diff
=
0
;
double
diff
;
struct
timeval
now
,
struct
timeval
now
,
then
;
then
;
...
@@ -1151,14 +1151,14 @@ main(int argc, char *argv[])
...
@@ -1151,14 +1151,14 @@ main(int argc, char *argv[])
/* Figure out how long to sleep etc ... */
/* Figure out how long to sleep etc ... */
gettimeofday
(
&
now
,
0
);
gettimeofday
(
&
now
,
0
);
diff
=
(
now
.
tv_sec
-
then
.
tv_sec
)
*
1000000
+
(
now
.
tv_usec
-
then
.
tv_usec
);
diff
=
(
int
)
(
now
.
tv_sec
-
then
.
tv_sec
)
*
1000000
.
0
+
(
int
)
(
now
.
tv_usec
-
then
.
tv_usec
);
sleep_secs
=
args
->
sleep_base_value
+
args
->
sleep_scaling_factor
*
diff
/
1000000
;
sleep_secs
=
args
->
sleep_base_value
+
args
->
sleep_scaling_factor
*
diff
/
1000000
.
0
;
loops
++
;
loops
++
;
if
(
args
->
debug
>=
2
)
if
(
args
->
debug
>=
2
)
{
{
sprintf
(
logbuffer
,
sprintf
(
logbuffer
,
"%i All DBs checked in: %
lld
usec, will sleep for %i secs."
,
"%i All DBs checked in: %
.0f
usec, will sleep for %i secs."
,
loops
,
diff
,
sleep_secs
);
loops
,
diff
,
sleep_secs
);
log_entry
(
logbuffer
);
log_entry
(
logbuffer
);
}
}
...
...
contrib/pgbench/pgbench.c
View file @
9c26980f
/*
/*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.
29 2003/11/29 19:51:35 pgsq
l Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.
30 2003/12/07 19:55:58 tg
l Exp $
*
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
* written by Tatsuo Ishii
...
@@ -261,14 +261,14 @@ doOne(CState * state, int n, int debug, int ttype)
...
@@ -261,14 +261,14 @@ doOne(CState * state, int n, int debug, int ttype)
*/
*/
if
(
use_log
)
if
(
use_log
)
{
{
long
long
diff
;
double
diff
;
struct
timeval
now
;
struct
timeval
now
;
gettimeofday
(
&
now
,
0
);
gettimeofday
(
&
now
,
0
);
diff
=
(
now
.
tv_sec
-
st
->
txn_begin
.
tv_sec
)
*
100000
0
+
diff
=
(
int
)
(
now
.
tv_sec
-
st
->
txn_begin
.
tv_sec
)
*
1000000
.
0
+
(
now
.
tv_usec
-
st
->
txn_begin
.
tv_usec
);
(
int
)
(
now
.
tv_usec
-
st
->
txn_begin
.
tv_usec
);
fprintf
(
LOGFILE
,
"%d %d %
lld
\n
"
,
st
->
id
,
st
->
cnt
,
diff
);
fprintf
(
LOGFILE
,
"%d %d %
.0f
\n
"
,
st
->
id
,
st
->
cnt
,
diff
);
}
}
res
=
PQgetResult
(
st
->
con
);
res
=
PQgetResult
(
st
->
con
);
...
...
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