Skip to content

Commit

Permalink
version 0.7-6
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomoaki Nishiyama authored and cran-robot committed Jan 12, 2024
1 parent 51b07cf commit 13a8c37
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 38 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2024-01-11 Tomoaki NISHIYAMA <tomoakin@staff.kanazawa-u.ac.jp>
* Supply (void) for a testprogram in configure.ac for warning by clang

2024-01-10 Tomoaki NISHIYAMA <tomoakin@staff.kanazawa-u.ac.jp>
* Fix partial match warning #132
* Suppress warnings on win-devel

2023-12-15 Tomoaki NISHIYAMA <tomoakin@staff.kanazawa-u.ac.jp>
* %s format string for an integer in an error message was corrected
* exclude dropped column from column listing (reported by warnes #130)

2023-01-12 Tomoaki NISHIYAMA <tomoakin@staff.kanazawa-u.ac.jp>
* replace sprintf with snprintf
* replace strcpy with strncpy
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RPostgreSQL
Version: 0.7-5
Date: 2023-02-09
Version: 0.7-6
Date: 2024-01-11
Title: R Interface to the 'PostgreSQL' Database System
Author: Joe Conway, Dirk Eddelbuettel, Tomoaki Nishiyama, Sameer Kumar Prayaga (during 2008), Neil Tiffin
Maintainer: Tomoaki Nishiyama <tomoakin@staff.kanazawa-u.ac.jp>
Expand All @@ -22,6 +22,6 @@ URL: https://github.com/tomoakin/RPostgreSQL,
https://cran.r-project.org/package=DBI,
https://www.postgresql.org
NeedsCompilation: yes
Packaged: 2023-02-10 08:49:09 UTC; tomoaki
Packaged: 2024-01-11 01:29:20 UTC; tomoaki
Repository: CRAN
Date/Publication: 2023-02-10 10:00:02 UTC
Date/Publication: 2024-01-11 06:23:03 UTC
22 changes: 11 additions & 11 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
e30d991fa11d6cecc31e86874dd7474d *ChangeLog
fe9169f551466eb1d3a240f654eece2f *DESCRIPTION
7877af8c18a6463d92adc397fbb1649b *ChangeLog
d4004ab5b17f95eb5157b333bb368edf *DESCRIPTION
532949fe6f8ba0bcd380ecdc746d28d4 *LICENSE
ef67e1a6b6119ab1e5c8ef1a91d67304 *NAMESPACE
eeb697c8142a3ae9d80089a524196a4e *R/PostgreSQL.R
ef38255aea563c169f1c43cf2e5fcd9b *R/PostgreSQLSupport.R
5f08c746b4a2b56cb39aa36f2d0c988b *NAMESPACE
172d9e1dd0fbefebe533c8ed70f92b59 *R/PostgreSQL.R
d7af76488a75d43ed01042b42e691a09 *R/PostgreSQLSupport.R
7d7c6c93167e88df8801f1faef732672 *R/S4R.R
0972c665e3149619a32f3b4d30528e0f *R/dbObjectId.R
e186b6a39b159fc324e46e782b409e81 *R/zzz.R
4b5e59c53d38086590d8d8553853ab04 *cleanup
ffbc73249332c5a0944043849943d742 *configure
b13ed4ee6d3f8c17b8be9264075db61a *configure.ac
56edd9ca60173e78683e439b8fd5b7e2 *configure
3bee6bc0317baa4f68556fd7e947f92a *configure.ac
d41d8cd98f00b204e9800998ecf8427e *configure.win
b5dc804b1235adfa8c8a310b052420fe *inst/ANNOUNCEMENT
9d4faa4f14b8d1ea95ec1747a01f4b52 *inst/NEWS
cbcd1f0924d9d1b9857a3c735b22add0 *inst/NEWS
86063092fe732dcbc47a4830ca72703c *inst/README
b73cbf6aae0e4d6ece79307f8a86713f *inst/THANKS
8679cac91afacc39bc33286a030ed8d3 *inst/TODO
Expand Down Expand Up @@ -56,7 +56,7 @@ d6e06acf69eb5a72bba126285917aeab *src/Makevars.in
b8d8232a7427a51cb16c50d081d21232 *src/RS-PQescape.c
b724299c627acebd2fc392a7842b32e2 *src/RS-PostgreSQL.c
6c0be5883afe2ace76eed7703082a8ca *src/RS-PostgreSQL.h
474db1c723ed4445734081b5314c017f *src/RS-pgsql-copy.c
c80af9f7f3ac08650148ab00805dd1b6 *src/RS-pgsql-copy.c
2f9ef8b94157b095a6125f25cfcdd553 *src/RS-pgsql-getResult.c
8cefd6e8550acdf81d3e197a10a2f530 *src/RS-pgsql-pqexec.c
67cadc07988646841ad88e968d64c8cf *src/RS-pgsql-pqexecparams.c
Expand All @@ -68,7 +68,7 @@ ef344a9f1740fa86ca1465e306fc30bf *src/libpq/COPYRIGHT
eb7275b692da0783d3fa79f9e7ae7e1a *src/libpq/Makefile.darwin
7c4433575a34e6077f2332c6401c4ceb *src/libpq/Makefile.global.darwin
cf791fc03435238d03ca7664b7538e8c *src/libpq/Makefile.global.win32
a881f40366f80b26dc5e22853e77947e *src/libpq/Makefile.global.win64
2dae33a4a621ccbcd76eeed5afc667e7 *src/libpq/Makefile.global.win64
cd612b52f4c8225182a8dbd899de2b18 *src/libpq/Makefile.port.darwin
fc91b22c9650df71dac423b8c615456f *src/libpq/Makefile.shlib.darwin
d2198b6fb37817b8ecf64b1b356a00c1 *src/libpq/Makefile.win
Expand All @@ -92,7 +92,7 @@ fd2f53f017b7060bd01defd635e445e6 *src/libpq/fe-exec.c
4fac7dc199985d1c43610fa8bb485a9f *src/libpq/fe-lobj.c
dc58ce19c66f5b0dddfc71e211038afc *src/libpq/fe-misc.c
24e5f7d45349b58cb6b0c2adf6e5b5c3 *src/libpq/fe-print.c
ca5e35424155a627354e41542e81c5ce *src/libpq/fe-protocol2.c
8dfb002366c5d7c16a89e8cee59de01e *src/libpq/fe-protocol2.c
1a2d1af13dd82a2260814acb1a997b9b *src/libpq/fe-protocol3.c
649663faf2cb67ad4cb51cae14c01a2a *src/libpq/fe-secure-openssl.c
558b49e25123220c65dd69c06c3c6197 *src/libpq/fe-secure.c
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export(
PostgreSQL,
postgresqlBuildTableDefinition,
isPostgresqlIdCurrent,
.PostgreSQLKeywords,
# .PostgreSQLKeywords,
postgresqlInitDriver,
postgresqlCloseDriver,
postgresqlDescribeDriver,
Expand Down
21 changes: 12 additions & 9 deletions R/PostgreSQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,22 @@ setMethod("dbListFields",
if(qlength == 1){
currentschema <- dbGetQuery(conn, "SELECT current_schema()")
flds <- dbGetQuery(conn,
paste("select a.attname from pg_attribute a, pg_class c, pg_tables t, pg_namespace nsp",
" where a.attrelid = c.oid and c.relname = tablename and c.relnamespace = nsp.oid and a.attnum > 0 and ",
"nspname = current_schema() and schemaname = nspname and ",
"tablename = '", postgresqlEscapeStrings(conn, name), "'", sep=""))[,1]
paste0("select a.attname from pg_attribute a, pg_class c, pg_tables t, pg_namespace nsp ",
"where a.attrelid = c.oid and c.relname = tablename and c.relnamespace = nsp.oid and ",
"a.attnum > 0 and not a.attisdropped and ",
"nspname = current_schema() and ",
"schemaname = nspname and ",
"tablename = '", postgresqlEscapeStrings(conn, name), "'"))[,1]
}
else{
if(qlength == 2){
flds <- dbGetQuery(conn,
paste("select a.attname from pg_attribute a, pg_class c, pg_tables t, pg_namespace nsp",
" where a.attrelid = c.oid and c.relname = t.tablename and c.relnamespace = nsp.oid and a.attnum > 0 and ",
"nspname = schemaname ",
"and schemaname = '", postgresqlEscapeStrings(conn, name[1]), "' ",
"and tablename = '", postgresqlEscapeStrings(conn, name[2]), "'", sep=""))[,1]
paste0("select a.attname from pg_attribute a, pg_class c, pg_tables t, pg_namespace nsp ",
"where a.attrelid = c.oid and c.relname = t.tablename and c.relnamespace = nsp.oid and ",
"a.attnum > 0 and not a.attisdropped and ",
"nspname = schemaname and ",
"schemaname = '", postgresqlEscapeStrings(conn, name[1]), "' and ",
"tablename = '", postgresqlEscapeStrings(conn, name[2]), "'"))[,1]
}
}

Expand Down
4 changes: 2 additions & 2 deletions R/PostgreSQLSupport.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ postgresqlFetch <- function(res, n=0, ...) {
## create running row index as of previous fetch (if any)
cnt <- dbGetRowCount(res)
nrec <- length(rel[[1]])
indx <- seq(from = cnt - nrec + 1, length = nrec)
attr(rel, "row.names") <- as.integer(indx)
indx <- seq.int(from = cnt - nrec + 1, length.out = nrec)
attr(rel, "row.names") <- indx
if(usingR())
class(rel) <- "data.frame"
else
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu

echo '#include <libpq-fe.h>' > conftest.c
echo 'int main(int,char**);int main(int argc, char**argv){printf("%i...",PQlibVersion());return 0;}' >> conftest.c
echo 'int main(void);int main(void){printf("%i...",PQlibVersion());return 0;}' >> conftest.c
echo $CC $CFLAGS -I${PG_INCDIR} -L${PG_LIBDIR} conftest.c -lpq -o pqconftest
$CC $CFLAGS -I${PG_INCDIR} -L${PG_LIBDIR} conftest.c -lpq -o pqconftest
echo ./pqconftest
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ clean:

AC_LANG(C)
echo '#include <libpq-fe.h>' > conftest.c
echo 'int main(int,char**);int main(int argc, char**argv){printf("%i...",PQlibVersion());return 0;}' >> conftest.c
echo 'int main(void);int main(void){printf("%i...",PQlibVersion());return 0;}' >> conftest.c
echo $CC $CFLAGS -I${PG_INCDIR} -L${PG_LIBDIR} conftest.c -lpq -o pqconftest
$CC $CFLAGS -I${PG_INCDIR} -L${PG_LIBDIR} conftest.c -lpq -o pqconftest
echo ./pqconftest
Expand Down
5 changes: 5 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 0.7-6
o Fix bugs found by warnings and suppress other nonsesical warnings
o Fix partial match warning #132
o exclude dropped column from column listing #130

Version 0.7-5

o Adhere to coding standards.
Expand Down
2 changes: 1 addition & 1 deletion src/RS-pgsql-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ RS_PostgreSQL_CopyInDataframe(Con_Handle * conHandle, SEXP x, SEXP nrow, SEXP nc
tmp = EncodeElementSconn(my_connection, levels[j], REAL(xj)[i] - 1,
&rstrbuf, cdec);
}else
error("column %s claims to be a factor but does not have numeric codes", j+1);
error("column %i claims to be a factor but does not have numeric codes", j+1);
} else {
tmp = EncodeElementSconn(my_connection, xj, i,
&rstrbuf, cdec);
Expand Down
2 changes: 1 addition & 1 deletion src/libpq/Makefile.global.win64
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ override CPPFLAGS := -I. $(CPPFLAGS)
CC = gcc
GCC = yes
SUN_STUDIO_CC = no
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -Wno-stringop-truncation
CFLAGS = -Wall -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2
CFLAGS_VECTOR = -funroll-loops -ftree-vectorize
CFLAGS_SSE42 = -msse4.2

Expand Down
32 changes: 25 additions & 7 deletions src/libpq/fe-protocol2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,30 @@ pqBuildStartupPacket2(PGconn *conn, int *packetlen,
startpacket->protoVersion = htonl(conn->pversion);

/* strncpy is safe here: postmaster will handle full fields correctly */
strncpy(startpacket->user, conn->pguser, SM_USER);
strncpy(startpacket->database, conn->dbName, SM_DATABASE);
strncpy(startpacket->tty, conn->pgtty, SM_TTY);

if (conn->pgoptions)
strncpy(startpacket->options, conn->pgoptions, SM_OPTIONS);

{ size_t l;
l = strnlen(conn->pguser, SM_USER);
if(l == SM_USER)
memcpy(startpacket->user, conn->pguser, l);
else
memcpy(startpacket->user, conn->pguser, l+1);
l = strnlen(conn->dbName, SM_DATABASE);
if(l == SM_DATABASE)
memcpy(startpacket->database, conn->dbName, SM_DATABASE);
else
memcpy(startpacket->database, conn->dbName, l+1);
l = strnlen(conn->dbName, SM_TTY);
if(l == SM_TTY)
memcpy(startpacket->tty, conn->pgtty, SM_TTY);
else
memcpy(startpacket->tty, conn->pgtty, l+1);

if (conn->pgoptions) {
l = strnlen(conn->pgoptions, SM_OPTIONS);
if( l == SM_OPTIONS)
memcpy(startpacket->options, conn->pgoptions, SM_OPTIONS);
else
memcpy(startpacket->options, conn->pgoptions, l+1);
}
}
return (char *) startpacket;
}

0 comments on commit 13a8c37

Please sign in to comment.