[DRE-commits] [ruby-dataobjects-postgres] 01/06: Imported Upstream version 0.10.16
Antonio Terceiro
terceiro at moszumanska.debian.org
Fri Jul 24 12:17:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-dataobjects-postgres.
commit 50327128e7d3a332747952286d8b911b31fd8eb8
Author: Antonio Terceiro <terceiro at debian.org>
Date: Fri Jul 24 08:41:11 2015 -0300
Imported Upstream version 0.10.16
---
ChangeLog.markdown | 10 ++++++++++
checksums.yaml.gz | Bin 269 -> 0 bytes
ext/do_postgres/do_common.c | 4 ++--
ext/do_postgres/do_common.h | 2 +-
ext/do_postgres/do_postgres.c | 25 +++++++++++++++++++------
ext/do_postgres/extconf.rb | 16 +++++++++++++---
lib/do_postgres/version.rb | 2 +-
metadata.yml | 22 +++++++++++-----------
tasks/compile.rake | 2 +-
tasks/release.rake | 2 +-
10 files changed, 59 insertions(+), 26 deletions(-)
diff --git a/ChangeLog.markdown b/ChangeLog.markdown
index 7e14ece..7c6f45c 100644
--- a/ChangeLog.markdown
+++ b/ChangeLog.markdown
@@ -1,3 +1,13 @@
+## 0.10.16 2015-05-17
+
+* Fix compile issue with do\_postgres on stock OS X Ruby
+
+## 0.10.15 2015-02-15
+
+* Ruby 2.2 support
+* Double after free fix in do\_postgres
+* Windows support on 2.1.x and 2.2.x
+
## 0.10.14 2014-02-13
* Don't do DNS lookup in transaction loading
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
deleted file mode 100644
index 7428368..0000000
Binary files a/checksums.yaml.gz and /dev/null differ
diff --git a/ext/do_postgres/do_common.c b/ext/do_postgres/do_common.c
index f997ca4..04481e2 100644
--- a/ext/do_postgres/do_common.c
+++ b/ext/do_postgres/do_common.c
@@ -63,7 +63,7 @@ void data_objects_debug(VALUE connection, VALUE string, struct timeval *start) {
rb_funcall(connection, DO_ID_LOG, 1, message);
}
-void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, const char *message, VALUE query, VALUE state) {
+void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, VALUE message, VALUE query, VALUE state) {
const char *exception_type = "SQLError";
const struct errcodes *e;
VALUE uri, exception;
@@ -82,7 +82,7 @@ void data_objects_raise_error(VALUE self, const struct errcodes *errors, int err
data_objects_const_get(mDO, exception_type),
DO_ID_NEW,
5,
- rb_str_new2(message),
+ message,
INT2NUM(errnum),
state,
query,
diff --git a/ext/do_postgres/do_common.h b/ext/do_postgres/do_common.h
index 3ec5cf1..9a8af89 100644
--- a/ext/do_postgres/do_common.h
+++ b/ext/do_postgres/do_common.h
@@ -123,7 +123,7 @@ static inline void data_objects_define_errors(VALUE scope, const struct errcodes
}
}
-extern void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, const char *message, VALUE query, VALUE state);
+extern void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, VALUE message, VALUE query, VALUE state);
extern VALUE data_objects_typecast(const char *value, long length, const VALUE type, int encoding);
diff --git a/ext/do_postgres/do_postgres.c b/ext/do_postgres/do_postgres.c
index 282fa20..3e8b770 100644
--- a/ext/do_postgres/do_postgres.c
+++ b/ext/do_postgres/do_postgres.c
@@ -32,6 +32,18 @@
#endif
+#ifndef HAVE_RB_THREAD_FD_SELECT
+#define rb_fdset_t fd_set
+#define rb_fd_isset(n, f) FD_ISSET(n, f)
+#define rb_fd_init(f) FD_ZERO(f)
+#define rb_fd_zero(f) FD_ZERO(f)
+#define rb_fd_set(n, f) FD_SET(n, f)
+#define rb_fd_clr(n, f) FD_CLR(n, f)
+#define rb_fd_term(f)
+#define rb_thread_fd_select rb_thread_select
+#endif
+
+
#include <ruby.h>
#include <string.h>
#include <math.h>
@@ -99,13 +111,14 @@ VALUE do_postgres_typecast(const char *value, long length, const VALUE type, int
}
void do_postgres_raise_error(VALUE self, PGresult *result, VALUE query) {
- const char *message = PQresultErrorMessage(result);
+ VALUE message = rb_str_new2(PQresultErrorMessage(result));
char *sql_state = PQresultErrorField(result, PG_DIAG_SQLSTATE);
int postgres_errno = MAKE_SQLSTATE(sql_state[0], sql_state[1], sql_state[2], sql_state[3], sql_state[4]);
+ VALUE str = rb_str_new2(sql_state);
PQclear(result);
- data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, query, rb_str_new2(sql_state));
+ data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, query, str);
}
/* ====== Public API ======= */
@@ -269,12 +282,12 @@ PGresult * do_postgres_cCommand_execute_async(VALUE self, VALUE connection, PGco
}
int socket_fd = PQsocket(db);
- fd_set rset;
+ rb_fdset_t rset;
while (1) {
- FD_ZERO(&rset);
- FD_SET(socket_fd, &rset);
- retval = rb_thread_select(socket_fd + 1, &rset, NULL, NULL, NULL);
+ rb_fd_init(&rset);
+ rb_fd_set(socket_fd, &rset);
+ retval = rb_thread_fd_select(socket_fd + 1, &rset, NULL, NULL, NULL);
if (retval < 0) {
rb_sys_fail(0);
diff --git a/ext/do_postgres/extconf.rb b/ext/do_postgres/extconf.rb
index 4608341..cc9c979 100644
--- a/ext/do_postgres/extconf.rb
+++ b/ext/do_postgres/extconf.rb
@@ -14,11 +14,21 @@ def pg_config(type)
IO.popen("pg_config --#{type}").readline.chomp rescue nil
end
+# The preheader argument wasn't introduced till Ruby 1.9.3.
+def have_header_with_preheader(header, preheader)
+ if method(:have_header).arity == -2
+ have_header(header, preheader)
+ else
+ have_header(header)
+ end
+end
+
def have_build_env
(have_library('pq') || have_library('libpq')) &&
have_header('libpq-fe.h') && have_header('libpq/libpq-fs.h') &&
- have_header('postgres.h') && have_header('mb/pg_wchar.h') &&
- have_header('catalog/pg_type.h')
+ have_header('postgres.h') &&
+ have_header_with_preheader('mb/pg_wchar.h', 'postgres.h') &&
+ have_header_with_preheader('catalog/pg_type.h', 'postgres.h')
end
$CFLAGS << ' -UENABLE_NLS -DHAVE_GETTIMEOFDAY -DHAVE_CRYPT' if RUBY_PLATFORM =~ /mswin|mingw/
@@ -31,7 +41,7 @@ dir_config('pgsql-server', config_value('includedir-server'), config_value('libd
dir_config('pgsql-client', config_value('includedir'), config_value('libdir'))
dir_config('pgsql-win32') if RUBY_PLATFORM =~ /mswin|mingw/
-desired_functions = %w(localtime_r gmtime_r PQsetClientEncoding pg_encoding_to_char PQfreemem)
+desired_functions = %w(localtime_r gmtime_r PQsetClientEncoding pg_encoding_to_char PQfreemem rb_thread_fd_select)
compat_functions = %w(PQescapeString PQexecParams)
if have_build_env
diff --git a/lib/do_postgres/version.rb b/lib/do_postgres/version.rb
index 004e012..11d5dcd 100644
--- a/lib/do_postgres/version.rb
+++ b/lib/do_postgres/version.rb
@@ -1,5 +1,5 @@
module DataObjects
module Postgres
- VERSION = '0.10.14'
+ VERSION = '0.10.16'
end
end
diff --git a/metadata.yml b/metadata.yml
index 02fe593..dde340e 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: do_postgres
version: !ruby/object:Gem::Version
- version: 0.10.14
+ version: 0.10.16
platform: ruby
authors:
- Dirkjan Bussink
autorequire:
bindir: bin
cert_chain: []
-date: 2014-02-13 00:00:00.000000000 Z
+date: 2015-05-17 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: data_objects
@@ -16,40 +16,40 @@ dependencies:
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 0.10.14
+ version: 0.10.16
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 0.10.14
+ version: 0.10.16
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ~>
- !ruby/object:Gem::Version
version: '2.5'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ~>
- !ruby/object:Gem::Version
version: '2.5'
- !ruby/object:Gem::Dependency
name: rake-compiler
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ~>
- !ruby/object:Gem::Version
version: '0.7'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ~>
- !ruby/object:Gem::Version
version: '0.7'
description: Implements the DataObjects API for PostgreSQL
@@ -111,17 +111,17 @@ require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - - ">="
+ - - '>='
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - - ">="
+ - - '>='
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project: dorb
-rubygems_version: 2.2.0.preview.1
+rubygems_version: 2.0.14
signing_key:
specification_version: 3
summary: DataObjects PostgreSQL Driver
diff --git a/tasks/compile.rake b/tasks/compile.rake
index 06f2fc5..4c98217 100644
--- a/tasks/compile.rake
+++ b/tasks/compile.rake
@@ -70,7 +70,7 @@ begin
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar'
ext.java_compiling do |gem|
gem.add_dependency 'jdbc-postgres', '>=8.2'
- gem.add_dependency 'do_jdbc', '0.10.14'
+ gem.add_dependency 'do_jdbc', '0.10.16'
end
end
rescue LoadError
diff --git a/tasks/release.rake b/tasks/release.rake
index b2b7ab7..b590fc8 100644
--- a/tasks/release.rake
+++ b/tasks/release.rake
@@ -3,7 +3,7 @@ task :build_all do
`rake clean`
`rake build`
`rake java gem`
- `rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0`
+ `rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0:2.1.5:2.2.0`
end
desc 'Release all gems (native, binaries for JRuby and Windows)'
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-dataobjects-postgres.git
More information about the Pkg-ruby-extras-commits
mailing list