do_postgres 0.10.14 → 0.10.15

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: 3223502cee39ce56587e2561bce2e397e963e647
4
- data.tar.gz: 42037d3a42f04d7f60c638c17c749dade9ef4797
3
+ metadata.gz: 20ad15733afd76ec824781ec298ed1ed3229a6b8
4
+ data.tar.gz: 1f07bc24496fb038a4edba8a9e4b4f9d3d174b3b
5
5
  SHA512:
6
- metadata.gz: 68600c3179179ab61825bd3189ea80b7c7bcf81b7d26f8fd62dee8d3068569dc81c0fd7e558929f2fd35b4c89af419b70402a216188a8a72e0e2f05dd200ae70
7
- data.tar.gz: 0d371a9150f66defb841c755e527dd5153f358e34e3bffd3824293a4ee5c4390c5f0ce3ba402339dd04f7642b2bf6f96c447d755386ca28a53d2367d471e6848
6
+ metadata.gz: 3661885c33e702120a3188bdf5eee0058aef81c257072e8b9c6b34a05ed30b782daaa3bc5e9bf1b5094a7078f57f1fc218e4726494eaafec24e281446a7db9c5
7
+ data.tar.gz: cc12bc4b6c259f07d86be2be3c4387f9933ff455bf134c16200584e437a2f26d98980685d9e3f9e92acec6d2220bc0924ecffd92c6b3f0ac2691a2064e08af06
@@ -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
@@ -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
@@ -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
@@ -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: ruby
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,40 +16,40 @@ 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
  description: Implements the DataObjects API for PostgreSQL
@@ -111,17 +111,17 @@ require_paths:
111
111
  - lib
112
112
  required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ">="
114
+ - - '>='
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - ">="
119
+ - - '>='
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project: dorb
124
- rubygems_version: 2.2.0.preview.1
124
+ rubygems_version: 2.0.14
125
125
  signing_key:
126
126
  specification_version: 3
127
127
  summary: DataObjects PostgreSQL Driver