do_postgres 0.10.14-java → 0.10.15-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e713c4f8e64d9e78ad27b85869182bbfd0cac21
4
- data.tar.gz: 58716b50b16155c2dc9ec2e9dc4cc28768c3a195
3
+ metadata.gz: 8496579eeb06643a72f13b3adf3e4a5ba624a83f
4
+ data.tar.gz: c1a0f1ee6198272852c06c17a2e3e90f20784062
5
5
  SHA512:
6
- metadata.gz: 6737cb3c8eb9d178f37b5dcc52acd3b3ba973d74085800cb72489cae87146c8aaa2490d4a0ac53349f554f18129b85665f412e79fc6d9352787cb9ef1153de96
7
- data.tar.gz: 05220beac6495307a7972ace61450f8ca43489825d1d1256a0b34a317a726a39abfe32bd8881af62d9042261fc47d128700b9dc829c8cae90987ebfa1abf9093
6
+ metadata.gz: 705b7e05729957029245c89a885d41d523ea84192cb79144e62f8a393ea125062302cf060e4756e7c94fb681360cb21e056608f54e602e046f2996dffcd2615f
7
+ data.tar.gz: 8a9953177c89cf99236ec043b458c8bb9fc3fae4bc8f25c5f8f85e5148f42e27abf338783d43f07f79b63f96e94b31ee14ebcf088623aaff18d0a7af4652d17a
data/ChangeLog.markdown CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.10.15 2015-02-15
2
+
3
+ * Ruby 2.2 support
4
+ * Double after free fix in do\_postgres
5
+ * Windows support on 2.1.x and 2.2.x
6
+
1
7
  ## 0.10.14 2014-02-13
2
8
 
3
9
  * Don't do DNS lookup in transaction loading
@@ -63,7 +63,7 @@ void data_objects_debug(VALUE connection, VALUE string, struct timeval *start) {
63
63
  rb_funcall(connection, DO_ID_LOG, 1, message);
64
64
  }
65
65
 
66
- void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, const char *message, VALUE query, VALUE state) {
66
+ void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, VALUE message, VALUE query, VALUE state) {
67
67
  const char *exception_type = "SQLError";
68
68
  const struct errcodes *e;
69
69
  VALUE uri, exception;
@@ -82,7 +82,7 @@ void data_objects_raise_error(VALUE self, const struct errcodes *errors, int err
82
82
  data_objects_const_get(mDO, exception_type),
83
83
  DO_ID_NEW,
84
84
  5,
85
- rb_str_new2(message),
85
+ message,
86
86
  INT2NUM(errnum),
87
87
  state,
88
88
  query,
@@ -123,7 +123,7 @@ static inline void data_objects_define_errors(VALUE scope, const struct errcodes
123
123
  }
124
124
  }
125
125
 
126
- extern void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, const char *message, VALUE query, VALUE state);
126
+ extern void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, VALUE message, VALUE query, VALUE state);
127
127
 
128
128
  extern VALUE data_objects_typecast(const char *value, long length, const VALUE type, int encoding);
129
129
 
@@ -32,6 +32,18 @@
32
32
  #endif
33
33
 
34
34
 
35
+ #ifndef HAVE_RB_THREAD_FD_SELECT
36
+ #define rb_fdset_t fd_set
37
+ #define rb_fd_isset(n, f) FD_ISSET(n, f)
38
+ #define rb_fd_init(f) FD_ZERO(f)
39
+ #define rb_fd_zero(f) FD_ZERO(f)
40
+ #define rb_fd_set(n, f) FD_SET(n, f)
41
+ #define rb_fd_clr(n, f) FD_CLR(n, f)
42
+ #define rb_fd_term(f)
43
+ #define rb_thread_fd_select rb_thread_select
44
+ #endif
45
+
46
+
35
47
  #include <ruby.h>
36
48
  #include <string.h>
37
49
  #include <math.h>
@@ -99,13 +111,14 @@ VALUE do_postgres_typecast(const char *value, long length, const VALUE type, int
99
111
  }
100
112
 
101
113
  void do_postgres_raise_error(VALUE self, PGresult *result, VALUE query) {
102
- const char *message = PQresultErrorMessage(result);
114
+ VALUE message = rb_str_new2(PQresultErrorMessage(result));
103
115
  char *sql_state = PQresultErrorField(result, PG_DIAG_SQLSTATE);
104
116
  int postgres_errno = MAKE_SQLSTATE(sql_state[0], sql_state[1], sql_state[2], sql_state[3], sql_state[4]);
117
+ VALUE str = rb_str_new2(sql_state);
105
118
 
106
119
  PQclear(result);
107
120
 
108
- data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, query, rb_str_new2(sql_state));
121
+ data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, query, str);
109
122
  }
110
123
 
111
124
  /* ====== Public API ======= */
@@ -269,12 +282,12 @@ PGresult * do_postgres_cCommand_execute_async(VALUE self, VALUE connection, PGco
269
282
  }
270
283
 
271
284
  int socket_fd = PQsocket(db);
272
- fd_set rset;
285
+ rb_fdset_t rset;
273
286
 
274
287
  while (1) {
275
- FD_ZERO(&rset);
276
- FD_SET(socket_fd, &rset);
277
- retval = rb_thread_select(socket_fd + 1, &rset, NULL, NULL, NULL);
288
+ rb_fd_init(&rset);
289
+ rb_fd_set(socket_fd, &rset);
290
+ retval = rb_thread_fd_select(socket_fd + 1, &rset, NULL, NULL, NULL);
278
291
 
279
292
  if (retval < 0) {
280
293
  rb_sys_fail(0);
@@ -31,7 +31,7 @@ dir_config('pgsql-server', config_value('includedir-server'), config_value('libd
31
31
  dir_config('pgsql-client', config_value('includedir'), config_value('libdir'))
32
32
  dir_config('pgsql-win32') if RUBY_PLATFORM =~ /mswin|mingw/
33
33
 
34
- desired_functions = %w(localtime_r gmtime_r PQsetClientEncoding pg_encoding_to_char PQfreemem)
34
+ desired_functions = %w(localtime_r gmtime_r PQsetClientEncoding pg_encoding_to_char PQfreemem rb_thread_fd_select)
35
35
  compat_functions = %w(PQescapeString PQexecParams)
36
36
 
37
37
  if have_build_env
Binary file
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Postgres
3
- VERSION = '0.10.14'
3
+ VERSION = '0.10.15'
4
4
  end
5
5
  end
data/tasks/compile.rake CHANGED
@@ -70,7 +70,7 @@ begin
70
70
  ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar'
71
71
  ext.java_compiling do |gem|
72
72
  gem.add_dependency 'jdbc-postgres', '>=8.2'
73
- gem.add_dependency 'do_jdbc', '0.10.14'
73
+ gem.add_dependency 'do_jdbc', '0.10.15'
74
74
  end
75
75
  end
76
76
  rescue LoadError
data/tasks/release.rake CHANGED
@@ -3,7 +3,7 @@ task :build_all do
3
3
  `rake clean`
4
4
  `rake build`
5
5
  `rake java gem`
6
- `rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0`
6
+ `rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0:2.1.5:2.2.0`
7
7
  end
8
8
 
9
9
  desc 'Release all gems (native, binaries for JRuby and Windows)'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do_postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.14
4
+ version: 0.10.15
5
5
  platform: java
6
6
  authors:
7
7
  - Dirkjan Bussink
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: data_objects
@@ -16,54 +16,54 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.10.14
19
+ version: 0.10.15
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.10.14
26
+ version: 0.10.15
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.5'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake-compiler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jdbc-postgres
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '8.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '8.2'
69
69
  - !ruby/object:Gem::Dependency
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.10.14
75
+ version: 0.10.15
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.10.14
82
+ version: 0.10.15
83
83
  description: Implements the DataObjects API for PostgreSQL
84
84
  email: d.bussink@gmail.com
85
85
  executables: []
@@ -101,7 +101,6 @@ files:
101
101
  - ext/do_postgres/extconf.rb
102
102
  - ext/do_postgres/pg_config.h
103
103
  - lib/do_postgres.rb
104
- - lib/do_postgres/do_postgres.jar
105
104
  - lib/do_postgres/encoding.rb
106
105
  - lib/do_postgres/transaction.rb
107
106
  - lib/do_postgres/version.rb
@@ -130,6 +129,7 @@ files:
130
129
  - tasks/release.rake
131
130
  - tasks/retrieve.rake
132
131
  - tasks/spec.rake
132
+ - lib/do_postgres/do_postgres.jar
133
133
  homepage:
134
134
  licenses: []
135
135
  metadata: {}
@@ -139,17 +139,17 @@ require_paths:
139
139
  - lib
140
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - '>='
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ">="
147
+ - - '>='
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project: dorb
152
- rubygems_version: 2.2.0.preview.1
152
+ rubygems_version: 2.0.14
153
153
  signing_key:
154
154
  specification_version: 3
155
155
  summary: DataObjects PostgreSQL Driver