pg 1.4.2-x64-mingw-ucrt → 1.4.3-x64-mingw-ucrt

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: e314b891dc2ddfcb46fd85b01aa5867af39fba5fea4d349921e487b1b5190319
4
- data.tar.gz: 96820e836cdccdb3d961a1a9ab16fd254ce977e95bcdc78d73649ad94f26e5c2
3
+ metadata.gz: 24cb477c8691dae6695f0b8a6b7a547d2b8bfadf16c181f63e75b6daf859397e
4
+ data.tar.gz: 1606b0631b85a5fcb9ff7a5f0d2990c5cc92932a18204b7a5d827eef8db45159
5
5
  SHA512:
6
- metadata.gz: bd853ba3e8b1012fa1a37746d87763e795f53eed74b85341b5050308d4c69ff0129bfe13fd5e05f9548e0fdbe932c904b0a30c0646a8b036ea29e87222b0fcb5
7
- data.tar.gz: 87b218527cfb921065de9561fe42dea9f082c1c924658ced529d222cc51aba439ce186c2fb6901aab13241647ecfcbe1ec2c3f30ed0b8160f2dea7e8fc3e8a17
6
+ metadata.gz: 21a22e9dd8cab1006b3a744c80f315b6215c1d0f3a109a1ec5bd951c39476f4dc3122ddeef855c7e03cb606659abd8daaba9057b49a5756e3ad0f1b65f53ae2a
7
+ data.tar.gz: cd6e45df28b45506fb88d734fe436513ecb74101eac6f02eacde29c731fbe5cccf3616d88a03343df941f8f308f8ec030b3c5ca3f896b201bd9037325c22005e
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == v1.4.3 [2022-08-09] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Avoid memory bloat possible in put_copy_data in pg-1.4.0 to 1.4.2. #473
4
+ - Use Encoding::BINARY for JOHAB, removing some useless code. #472
5
+
6
+
1
7
  == v1.4.2 [2022-07-27] Lars Kanis <lars@greiz-reinsdorf.de>
2
8
 
3
9
  Bugfixes:
data/ext/pg.c CHANGED
@@ -127,26 +127,6 @@ const char * const (pg_enc_pg2ruby_mapping[][2]) = {
127
127
  static struct st_table *enc_pg2ruby;
128
128
 
129
129
 
130
- /*
131
- * Look up the JOHAB encoding, creating it as a dummy encoding if it's not
132
- * already defined.
133
- */
134
- static rb_encoding *
135
- pg_find_or_create_johab(void)
136
- {
137
- static const char * const aliases[] = { "JOHAB", "Windows-1361", "CP1361" };
138
- int enc_index;
139
- size_t i;
140
-
141
- for (i = 0; i < sizeof(aliases)/sizeof(aliases[0]); ++i) {
142
- enc_index = rb_enc_find_index(aliases[i]);
143
- if (enc_index > 0) return rb_enc_from_index(enc_index);
144
- }
145
-
146
- enc_index = rb_define_dummy_encoding(aliases[0]);
147
- return rb_enc_from_index(enc_index);
148
- }
149
-
150
130
  /*
151
131
  * Return the given PostgreSQL encoding ID as an rb_encoding.
152
132
  *
@@ -187,10 +167,6 @@ pg_get_pg_encname_as_rb_encoding( const char *pg_encname )
187
167
  return rb_enc_find( pg_enc_pg2ruby_mapping[i][1] );
188
168
  }
189
169
 
190
- /* JOHAB isn't a builtin encoding, so make up a dummy encoding if it's seen */
191
- if ( strncmp(pg_encname, "JOHAB", 5) == 0 )
192
- return pg_find_or_create_johab();
193
-
194
170
  /* Fallthrough to ASCII-8BIT */
195
171
  return rb_ascii8bit_encoding();
196
172
  }
data/ext/pg_connection.c CHANGED
@@ -266,6 +266,7 @@ pgconn_s_allocate( VALUE klass )
266
266
  this->encoder_for_put_copy_data = Qnil;
267
267
  this->decoder_for_get_copy_data = Qnil;
268
268
  this->trace_stream = Qnil;
269
+ rb_ivar_set(self, rb_intern("@calls_to_put_copy_data"), INT2FIX(0));
269
270
 
270
271
  return self;
271
272
  }
data/lib/3.1/pg_ext.so CHANGED
Binary file
data/lib/pg/connection.rb CHANGED
@@ -408,7 +408,17 @@ class PG::Connection
408
408
  # See also #copy_data.
409
409
  #
410
410
  def put_copy_data(buffer, encoder=nil)
411
+ # sync_put_copy_data does a non-blocking attept to flush data.
411
412
  until res=sync_put_copy_data(buffer, encoder)
413
+ # It didn't flush immediately and allocation of more buffering memory failed.
414
+ # Wait for all data sent by doing a blocking flush.
415
+ res = flush
416
+ end
417
+
418
+ # And do a blocking flush every 100 calls.
419
+ # This is to avoid memory bloat, when sending the data is slower than calls to put_copy_data happen.
420
+ if (@calls_to_put_copy_data += 1) > 100
421
+ @calls_to_put_copy_data = 0
412
422
  res = flush
413
423
  end
414
424
  res
@@ -431,6 +441,7 @@ class PG::Connection
431
441
  until sync_put_copy_end(*args)
432
442
  flush
433
443
  end
444
+ @calls_to_put_copy_data = 0
434
445
  flush
435
446
  end
436
447
  alias async_put_copy_end put_copy_end
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.4.2'
3
+ VERSION = '1.4.3'
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.4.2
4
+ version: 1.4.3
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  oL1mUdzB8KrZL4/WbG5YNX6UTtJbIOu9qEFbBAy4/jtIkJX+dlNoFwd4GXQW1YNO
37
37
  nA==
38
38
  -----END CERTIFICATE-----
39
- date: 2022-07-27 00:00:00.000000000 Z
39
+ date: 2022-08-09 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.
metadata.gz.sig CHANGED
Binary file