pg 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: 651abffa980cbaef37ccb16afb4a6f107bf35d0314c2838b27d09ae88848dda7
4
- data.tar.gz: 6910361844ff87e9885d21cd62e5f43522296c08396d8eb6bb8487ba452f2946
3
+ metadata.gz: 066fc0a1f6e951b395f258798f382417c51be61dba5c3999ef6712bb793dc138
4
+ data.tar.gz: a8944c0abae70b7996067dec9a613f750d8cffbbd69e75ab8c35759a36cada53
5
5
  SHA512:
6
- metadata.gz: 413b2ac42d264829d2985a9818ba79be9e67cbd3a5a8b4cbe42007dbca27e53917d6360ae4d03285470c21295d9f651e9d478bbe06491c43d6b015338c6b0d0d
7
- data.tar.gz: 45ce1ad11dcb614018a6da4fa0b3d1f45b0be267922f7d803fc46bed9150aee6443ccacfdd6d70de1718fa8a6db1919de5498e9b544d8f194e8301d386e0ee07
6
+ metadata.gz: c689ccbb0410d6b704144e18d8fb5cf747599f8ad0d84be1d265374f568a9a44b77be6542a36f6c7acdb8dbf862c352e0b0de3d576be82e6d1599801fb7546f0
7
+ data.tar.gz: e0be5c3b24a89b294f1c7762d027f424670b191437db0f35ee74994389e15a5059899740c137918c25eb50906ee1a8979a9c5fcd67a72ff3b69519d1b096229f
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,17 @@
1
+ == v1.3.1 [YYYY-MM-DD] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Bugfixes:
4
+
5
+ - Fix wrong handling of socket writability on Windows introduced in #417.
6
+ This caused starvation in conn.put_copy_data.
7
+ - Fix error in PG.version_string(true). #419
8
+ - Fix a regression in pg 1.3.0 where Ruby 2.x busy-looping any fractional seconds for every wait. #420
9
+
10
+ Enhancements:
11
+
12
+ - Raise an error when conn.copy_data is used in nonblocking mode.
13
+
14
+
1
15
  == v1.3.0 [2022-01-20] Michael Granger <ged@FaerieMUD.org>
2
16
 
3
17
  Install Enhancements:
@@ -65,6 +79,7 @@ Deprecated:
65
79
  Removed:
66
80
  - Remove support of ruby-2.2, 2.3 and 2.4. Minimum is ruby-2.5 now.
67
81
  - Remove support for PostgreSQL-9.2. Minimum is PostgreSQL-9.3 now.
82
+ - Remove constant PG::REVISION, which was broken since pg-1.1.4.
68
83
 
69
84
  Repository:
70
85
  - Replace Hoe by Bundler for gem packaging
data/ext/pg_connection.c CHANGED
@@ -2241,19 +2241,15 @@ pg_rb_thread_io_wait(VALUE io, VALUE events, VALUE timeout) {
2241
2241
  GetOpenFile((io), fptr);
2242
2242
  if( !NIL_P(timeout) ){
2243
2243
  ptimeout.tv_sec = (time_t)(NUM2DBL(timeout));
2244
- ptimeout.tv_usec = (time_t)(NUM2DBL(timeout) - (double)ptimeout.tv_sec);
2244
+ ptimeout.tv_usec = (time_t)((NUM2DBL(timeout) - (double)ptimeout.tv_sec) * 1e6);
2245
2245
 
2246
2246
  gettimeofday(&currtime, NULL);
2247
2247
  timeradd(&currtime, &ptimeout, &aborttime);
2248
2248
  }
2249
2249
 
2250
- if(rb_events & PG_RUBY_IO_READABLE) {
2251
- w32_events |= FD_READ | FD_ACCEPT | FD_CLOSE;
2252
- } else if(rb_events & PG_RUBY_IO_WRITABLE) {
2253
- w32_events |= FD_WRITE | FD_CONNECT;
2254
- } else if(rb_events & PG_RUBY_IO_PRIORITY) {
2255
- w32_events |= FD_OOB;
2256
- }
2250
+ if(rb_events & PG_RUBY_IO_READABLE) w32_events |= FD_READ | FD_ACCEPT | FD_CLOSE;
2251
+ if(rb_events & PG_RUBY_IO_WRITABLE) w32_events |= FD_WRITE | FD_CONNECT;
2252
+ if(rb_events & PG_RUBY_IO_PRIORITY) w32_events |= FD_OOB;
2257
2253
 
2258
2254
  for(;;) {
2259
2255
  if ( WSAEventSelect(_get_osfhandle(fptr->fd), hEvent, w32_events) == SOCKET_ERROR ) {
@@ -2336,7 +2332,7 @@ pg_rb_io_wait(VALUE io, VALUE events, VALUE timeout) {
2336
2332
  GetOpenFile((io), fptr);
2337
2333
  if( !NIL_P(timeout) ){
2338
2334
  waittime.tv_sec = (time_t)(NUM2DBL(timeout));
2339
- waittime.tv_usec = (time_t)(NUM2DBL(timeout) - (double)waittime.tv_sec);
2335
+ waittime.tv_usec = (time_t)((NUM2DBL(timeout) - (double)waittime.tv_sec) * 1e6);
2340
2336
  }
2341
2337
  res = rb_wait_for_single_fd(fptr->fd, NUM2UINT(events), NIL_P(timeout) ? NULL : &waittime);
2342
2338
 
data/lib/pg/connection.rb CHANGED
@@ -241,6 +241,7 @@ class PG::Connection
241
241
  # ["more", "data", "to", "copy"]
242
242
 
243
243
  def copy_data( sql, coder=nil )
244
+ raise PG::NotInBlockingMode, "copy_data can not be used in nonblocking mode" if nonblocking?
244
245
  res = exec( sql )
245
246
 
246
247
  case res.result_status
@@ -385,7 +386,7 @@ class PG::Connection
385
386
  # If the optional code block is given, it will be passed <i>result</i> as an argument,
386
387
  # and the PG::Result object will automatically be cleared when the block terminates.
387
388
  # In this instance, <code>conn.exec</code> returns the value of the block.
388
- def get_result(*args)
389
+ def get_result
389
390
  block
390
391
  sync_get_result
391
392
  end
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.1'
4
4
  end
data/lib/pg.rb CHANGED
@@ -53,12 +53,14 @@ module PG
53
53
 
54
54
  class NotAllCopyDataRetrieved < PG::Error
55
55
  end
56
+ class NotInBlockingMode < PG::Error
57
+ end
56
58
 
57
- ### Get the PG library version. If +include_buildnum+ is +true+, include the build ID.
58
- def self::version_string( include_buildnum=false )
59
- vstring = "%s %s" % [ self.name, VERSION ]
60
- vstring << " (build %s)" % [ REVISION[/: ([[:xdigit:]]+)/, 1] || '0' ] if include_buildnum
61
- return vstring
59
+ # Get the PG library version.
60
+ #
61
+ # +include_buildnum+ is no longer used and any value passed will be ignored.
62
+ def self::version_string( include_buildnum=nil )
63
+ return "%s %s" % [ self.name, VERSION ]
62
64
  end
63
65
 
64
66
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  P5YP5BAbNW+gvd3QHRiWTTuhgHrdDnGdXg93N2M5KHn1ug8BtPLQwlcFwEpKnlLn
35
35
  btEP+7EplFuoiMfd
36
36
  -----END CERTIFICATE-----
37
- date: 2022-01-23 00:00:00.000000000 Z
37
+ date: 2022-02-01 00:00:00.000000000 Z
38
38
  dependencies: []
39
39
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
40
40
  9.3 and later.
metadata.gz.sig CHANGED
Binary file