pg 1.3.0.rc3-x64-mingw32 → 1.3.0.rc4-x64-mingw32

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: 1c8dd86a0ff7573d4ee5160db7ba24bfcb8a60b0b8a1f8ba024c4f4df4f474ce
4
- data.tar.gz: 267098a841b2930912910d7ff679d74224f5f7e45dc3636b7151ad7f513ca40d
3
+ metadata.gz: 22e6961399788ab8caf991c0703eeb822b3bdbd6a9e72d2ffd05027ae648f77a
4
+ data.tar.gz: f979112a81a00b45e988d4c330e14251047d1fdd6ae8c6bad5fabd40c9062f41
5
5
  SHA512:
6
- metadata.gz: 2141632efe8c5ef6442d960d6d0e4351ba019cf7bdfe894d8feec6b55b3daa218a1e652c66005f4deb073508c8357d8f7f85b13fff73eb713ecc3f65e9825c82
7
- data.tar.gz: 1d937df566d35602d7e75c6b82552fdfc774519fd9725f7679ead731160f20592944f9dd1bc147a7b4a2fb1fbaee12f236c8225e2d42f8a4fc3cd26d10ec4bb9
6
+ metadata.gz: 9e8f8ab9e4b073a4bed83ccc4c67bacc6eb73c9141ea64a4fe3b595f296311e76a8a2ab32039e64b06910d7cb2d8a3ad75605f637d09bcd2360434a3dc9cab89
7
+ data.tar.gz: 29505dbed6343d783f6c31d2b1f735abbfa2986f7347c9889ba3d6df4d85fd73ae2a65638b48b979c4d7603af24e0b8c28eee8a88166140fa530045921965e0b
checksums.yaml.gz.sig CHANGED
Binary file
@@ -79,6 +79,7 @@ jobs:
79
79
  echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
80
80
  echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
81
81
 
82
+ - run: gem update --system
82
83
  - run: bundle install
83
84
  - run: gem install --local pg-*${{ matrix.platform }}.gem --verbose
84
85
  - name: Run specs
@@ -110,6 +110,7 @@ jobs:
110
110
  unzip postgresql-$PGVERSION-binaries.zip && \
111
111
  echo `pwd`/pgsql/bin >> $GITHUB_PATH
112
112
 
113
+ - run: gem update --system
113
114
  - run: bundle install
114
115
 
115
116
  - run: gem install --local *.gem --verbose
data/ext/extconf.rb CHANGED
@@ -155,6 +155,7 @@ have_func 'rb_io_wait' # since ruby-3.0
155
155
  # unistd.h confilicts with ruby/win32.h when cross compiling for win32 and ruby 1.9.1
156
156
  have_header 'unistd.h'
157
157
  have_header 'inttypes.h'
158
+ have_header('ruby/fiber/scheduler.h') if RUBY_PLATFORM=~/mingw|mswin/
158
159
 
159
160
  checking_for "C99 variable length arrays" do
160
161
  $defs.push( "-DHAVE_VARIABLE_LENGTH_ARRAYS" ) if try_compile('void test_vla(int l){ int vla[l]; }')
data/ext/pg_connection.c CHANGED
@@ -2207,8 +2207,110 @@ pgconn_notifies(VALUE self)
2207
2207
  return hash;
2208
2208
  }
2209
2209
 
2210
+ #if defined(_WIN32)
2211
+
2212
+ /* We use a specialized implementation of rb_io_wait() on Windows.
2213
+ * This is because rb_io_wait() and rb_wait_for_single_fd() are very slow on Windows.
2214
+ */
2215
+
2216
+ #if defined(HAVE_RUBY_FIBER_SCHEDULER_H)
2217
+ #include <ruby/fiber/scheduler.h>
2218
+ #endif
2219
+
2220
+ typedef enum {
2221
+ PG_RUBY_IO_READABLE = RB_WAITFD_IN,
2222
+ PG_RUBY_IO_WRITABLE = RB_WAITFD_OUT,
2223
+ PG_RUBY_IO_PRIORITY = RB_WAITFD_PRI,
2224
+ } pg_rb_io_event_t;
2225
+
2226
+ int rb_w32_wait_events( HANDLE *events, int num, DWORD timeout );
2227
+
2228
+ static VALUE
2229
+ pg_rb_thread_io_wait(VALUE io, VALUE events, VALUE timeout) {
2230
+ rb_io_t *fptr;
2231
+ struct timeval ptimeout;
2232
+
2233
+ struct timeval aborttime={0,0}, currtime, waittime;
2234
+ DWORD timeout_milisec = INFINITE;
2235
+ HANDLE hEvent = WSACreateEvent();
2236
+
2237
+ long rb_events = NUM2UINT(events);
2238
+ long w32_events = 0;
2239
+ DWORD wait_ret;
2240
+
2241
+ GetOpenFile((io), fptr);
2242
+ if( !NIL_P(timeout) ){
2243
+ ptimeout.tv_sec = (time_t)(NUM2DBL(timeout));
2244
+ ptimeout.tv_usec = (time_t)(NUM2DBL(timeout) - (double)ptimeout.tv_sec);
2245
+
2246
+ gettimeofday(&currtime, NULL);
2247
+ timeradd(&currtime, &ptimeout, &aborttime);
2248
+ }
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
+ }
2257
+
2258
+ for(;;) {
2259
+ if ( WSAEventSelect(_get_osfhandle(fptr->fd), hEvent, w32_events) == SOCKET_ERROR ) {
2260
+ WSACloseEvent( hEvent );
2261
+ rb_raise( rb_eConnectionBad, "WSAEventSelect socket error: %d", WSAGetLastError() );
2262
+ }
2263
+
2264
+ if ( !NIL_P(timeout) ) {
2265
+ gettimeofday(&currtime, NULL);
2266
+ timersub(&aborttime, &currtime, &waittime);
2267
+ timeout_milisec = (DWORD)( waittime.tv_sec * 1e3 + waittime.tv_usec / 1e3 );
2268
+ }
2269
+
2270
+ if( NIL_P(timeout) || (waittime.tv_sec >= 0 && waittime.tv_usec >= 0) ){
2271
+ /* Wait for the socket to become readable before checking again */
2272
+ wait_ret = rb_w32_wait_events( &hEvent, 1, timeout_milisec );
2273
+ } else {
2274
+ wait_ret = WAIT_TIMEOUT;
2275
+ }
2276
+
2277
+ if ( wait_ret == WAIT_TIMEOUT ) {
2278
+ WSACloseEvent( hEvent );
2279
+ return UINT2NUM(0);
2280
+ } else if ( wait_ret == WAIT_OBJECT_0 ) {
2281
+ WSACloseEvent( hEvent );
2282
+ /* The event we were waiting for. */
2283
+ return UINT2NUM(rb_events);
2284
+ } else if ( wait_ret == WAIT_OBJECT_0 + 1) {
2285
+ /* This indicates interruption from timer thread, GC, exception
2286
+ * from other threads etc... */
2287
+ rb_thread_check_ints();
2288
+ } else if ( wait_ret == WAIT_FAILED ) {
2289
+ WSACloseEvent( hEvent );
2290
+ rb_raise( rb_eConnectionBad, "Wait on socket error (WaitForMultipleObjects): %lu", GetLastError() );
2291
+ } else {
2292
+ WSACloseEvent( hEvent );
2293
+ rb_raise( rb_eConnectionBad, "Wait on socket abandoned (WaitForMultipleObjects)" );
2294
+ }
2295
+ }
2296
+ }
2297
+
2298
+ static VALUE
2299
+ pg_rb_io_wait(VALUE io, VALUE events, VALUE timeout) {
2300
+ #if defined(HAVE_RUBY_FIBER_SCHEDULER_H)
2301
+ /* We don't support Fiber.scheduler on Windows ruby-3.0 because there is no fast way to check whether a scheduler is active.
2302
+ * Fortunatelly ruby-3.1 offers a C-API for it.
2303
+ */
2304
+ VALUE scheduler = rb_fiber_scheduler_current();
2305
+
2306
+ if (!NIL_P(scheduler)) {
2307
+ return rb_io_wait(io, events, timeout);
2308
+ }
2309
+ #endif
2310
+ return pg_rb_thread_io_wait(io, events, timeout);
2311
+ }
2210
2312
 
2211
- #if defined(HAVE_RB_IO_WAIT)
2313
+ #elif defined(HAVE_RB_IO_WAIT)
2212
2314
 
2213
2315
  /* Use our own function and constants names, to avoid conflicts with truffleruby-head on its road to ruby-3.0 compatibility. */
2214
2316
  #define pg_rb_io_wait rb_io_wait
@@ -134,7 +134,7 @@ pg_recordcoder_type_map_get(VALUE self)
134
134
  * tm = PG::TypeMapByColumn.new([PG::TextEncoder::Float.new]*2)
135
135
  * # Use this type map to encode the record:
136
136
  * PG::TextEncoder::Record.new(type_map: tm).encode([1,2])
137
- * # => "(\"1.0000000000000000E+00\",\"2.0000000000000000E+00\")"
137
+ * # => "(\"1.0\",\"2.0\")"
138
138
  *
139
139
  * Records can also be encoded and decoded directly to and from the database.
140
140
  * This avoids intermediate string allocations and is very fast.
data/lib/2.5/pg_ext.so CHANGED
Binary file
data/lib/2.6/pg_ext.so CHANGED
Binary file
data/lib/2.7/pg_ext.so CHANGED
Binary file
data/lib/3.0/pg_ext.so CHANGED
Binary file
data/lib/pg/connection.rb CHANGED
@@ -7,7 +7,7 @@ require 'io/wait'
7
7
  require 'socket'
8
8
 
9
9
  # The PostgreSQL connection class. The interface for this class is based on
10
- # {libpq}[http://www.postgresql.org/docs/9.2/interactive/libpq.html], the C
10
+ # {libpq}[http://www.postgresql.org/docs/current/libpq.html], the C
11
11
  # application programmer's interface to PostgreSQL. Some familiarity with libpq
12
12
  # is recommended, but not necessary.
13
13
  #
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.3.0.rc3'
3
+ VERSION = '1.3.0.rc4'
4
4
  end
Binary file
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.rc3
4
+ version: 1.3.0.rc4
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  d5T9wAD7jW/0seVujw+76/YOJWO3Dft+FQmMBbdd8s3J47HbN9R2mDt6fl6he+X/
37
37
  gw==
38
38
  -----END CERTIFICATE-----
39
- date: 2022-01-13 00:00:00.000000000 Z
39
+ date: 2022-01-22 00:00:00.000000000 Z
40
40
  dependencies: []
41
41
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
42
42
  9.3 and later.
@@ -177,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
177
  version: '2.5'
178
178
  - - "<"
179
179
  - !ruby/object:Gem::Version
180
- version: 3.2.dev
180
+ version: 3.1.dev
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - ">"
metadata.gz.sig CHANGED
Binary file