pg 1.5.2-x64-mingw32 → 1.5.3-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: 965a62aeee6293e1d8b76d2b018024b31d2e540b83d8930bb480d521cc7598b1
4
- data.tar.gz: a977824a52ab4844710e172b05290f47a6c8a49011eb8bb271a1af6703cdd87f
3
+ metadata.gz: 446a14cb9e82644f39143b72b3a8fe6c9df919835709b69139e972013f322ec5
4
+ data.tar.gz: 664d953714bb1be9c2903b97fbcda29a53994dc1b4aca43b87e1092f8d172352
5
5
  SHA512:
6
- metadata.gz: 3785d9a94845341b98b9ec0f2e72576057007b8e19512124f012b06ca717ef36064e8fae2c4e089e10e32f71be3cbe3bdc5b73fae8ad74b6481162db09923879
7
- data.tar.gz: e68123f60f991a7fe108ce26992d5b1e32abf6eca0b125fb7a7230264b4ce981f12707dfd15cd3fba8ab4bd7747c8f443401df0f1e4c435e7ac87b4c29471080
6
+ metadata.gz: 289df9bd183104621ea395b11e9bf6a763ce31f23b79a7c7487eb1d4892a35bf8c5874ec3f75a42264ab220941852fe58c98fc5c6a3d3e65efd21c8be1412b0d
7
+ data.tar.gz: 503810c481b089a40ad7db1636ebb8f5b0bda6e67ef4c31ed360b649b8412e53076d20ddc1cdce9470726e362b255c9aa280524ac58c94996905db334cd4c3f6
checksums.yaml.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## v1.5.3 [2023-04-28] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Fix possible segfault when creating a new PG::Result with type map. [#530](https://github.com/ged/ruby-pg/pull/530)
4
+ - Add category to deprecation warnings of Coder.new, so that they are suppressed for most users. [#528](https://github.com/ged/ruby-pg/pull/528)
5
+
6
+
7
+ ## v1.5.2 [2023-04-26] Lars Kanis <lars@greiz-reinsdorf.de>
8
+
9
+ - Fix regression in copy_data regarding binary format when using no coder. [#527](https://github.com/ged/ruby-pg/pull/527)
10
+
11
+
1
12
  ## v1.5.1 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
2
13
 
3
14
  - Don't overwrite flags of timestamp coders. [#524](https://github.com/ged/ruby-pg/pull/524)
data/ext/pg_result.c CHANGED
@@ -208,12 +208,16 @@ pg_new_result2(PGresult *result, VALUE rb_pgconn)
208
208
 
209
209
  this = (t_pg_result *)xmalloc(sizeof(*this) + sizeof(*this->fnames) * nfields);
210
210
  this->pgresult = result;
211
+ /* Initialize connection and typemap prior to any object allocations,
212
+ * to make sure valid objects are marked. */
213
+ this->connection = rb_pgconn;
214
+ this->typemap = pg_typemap_all_strings;
215
+ this->p_typemap = RTYPEDDATA_DATA( this->typemap );
211
216
  this->nfields = -1;
212
217
  this->tuple_hash = Qnil;
213
218
  this->field_map = Qnil;
214
219
  this->flags = 0;
215
220
  self = TypedData_Wrap_Struct(rb_cPGresult, &pgresult_type, this);
216
- RB_OBJ_WRITE(self, &this->connection, rb_pgconn);
217
221
 
218
222
  if( result ){
219
223
  t_pg_connection *p_conn = pg_get_connection(rb_pgconn);
@@ -227,8 +231,6 @@ pg_new_result2(PGresult *result, VALUE rb_pgconn)
227
231
  this->p_typemap = RTYPEDDATA_DATA( this->typemap );
228
232
  this->flags = p_conn->flags;
229
233
  } else {
230
- RB_OBJ_WRITE(self, &this->typemap, pg_typemap_all_strings);
231
- this->p_typemap = RTYPEDDATA_DATA( this->typemap );
232
234
  this->enc_idx = rb_locale_encindex();
233
235
  }
234
236
 
@@ -391,7 +393,7 @@ pg_result_clear(VALUE self)
391
393
  *
392
394
  */
393
395
  VALUE
394
- pg_result_freeze(VALUE self)
396
+ static pg_result_freeze(VALUE self)
395
397
  {
396
398
  t_pg_result *this = pgresult_get_this(self);
397
399
 
@@ -405,7 +407,7 @@ pg_result_freeze(VALUE self)
405
407
  *
406
408
  * Returns +true+ if the backend result memory has been freed.
407
409
  */
408
- VALUE
410
+ static VALUE
409
411
  pgresult_cleared_p( VALUE self )
410
412
  {
411
413
  t_pg_result *this = pgresult_get_this(self);
@@ -422,7 +424,7 @@ pgresult_cleared_p( VALUE self )
422
424
  * All other Result objects are automatically cleared by the GC when the object is no longer in use or manually by PG::Result#clear .
423
425
  *
424
426
  */
425
- VALUE
427
+ static VALUE
426
428
  pgresult_autoclear_p( VALUE self )
427
429
  {
428
430
  t_pg_result *this = pgresult_get_this(self);
@@ -1422,8 +1424,9 @@ pgresult_type_map_set(VALUE self, VALUE typemap)
1422
1424
  /* Check type of method param */
1423
1425
  TypedData_Get_Struct(typemap, t_typemap, &pg_typemap_type, p_typemap);
1424
1426
 
1425
- RB_OBJ_WRITE(self, &this->typemap, p_typemap->funcs.fit_to_result( typemap, self ));
1426
- this->p_typemap = RTYPEDDATA_DATA( this->typemap );
1427
+ typemap = p_typemap->funcs.fit_to_result( typemap, self );
1428
+ RB_OBJ_WRITE(self, &this->typemap, typemap);
1429
+ this->p_typemap = RTYPEDDATA_DATA( typemap );
1427
1430
 
1428
1431
  return typemap;
1429
1432
  }
@@ -287,9 +287,7 @@ pg_tmbc_init(VALUE self, VALUE conv_ary)
287
287
  t_pg_coder *p_coder;
288
288
  /* Check argument type and store the coder pointer */
289
289
  TypedData_Get_Struct(obj, t_pg_coder, &pg_coder_type, p_coder);
290
- if( p_coder ){
291
- RB_OBJ_WRITTEN(self, Qnil, p_coder->coder_obj);
292
- }
290
+ RB_OBJ_WRITTEN(self, Qnil, p_coder->coder_obj);
293
291
  this->convs[i].cconv = p_coder;
294
292
  }
295
293
  }
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
@@ -6,19 +6,19 @@ module PG
6
6
  # Convenience classes for timezone options
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
9
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
10
10
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
15
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
16
16
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
21
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
22
22
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
@@ -6,13 +6,13 @@ module PG
6
6
  # Convenience classes for timezone options
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
9
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
10
10
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
15
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
16
16
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL)
17
17
  end
18
18
  end
data/lib/pg/coder.rb CHANGED
@@ -7,7 +7,7 @@ module PG
7
7
 
8
8
  module BinaryFormatting
9
9
  def initialize(hash={}, **kwargs)
10
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
11
11
  super(format: 1, **hash, **kwargs)
12
12
  end
13
13
  end
@@ -15,7 +15,7 @@ module PG
15
15
 
16
16
  # Create a new coder object based on the attribute Hash.
17
17
  def initialize(hash=nil, **kwargs)
18
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" if hash
18
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) if hash
19
19
 
20
20
  (hash || kwargs).each do |key, val|
21
21
  send("#{key}=", val)
@@ -6,19 +6,19 @@ module PG
6
6
  # Convenience classes for timezone options
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
9
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
10
10
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
15
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
16
16
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
- warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
21
+ warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) unless hash.empty?
22
22
  super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.5.2'
3
+ VERSION = '1.5.3'
4
4
  end
data/lib/pg.rb CHANGED
@@ -115,4 +115,15 @@ module PG
115
115
  require 'pg/tuple'
116
116
  autoload :VERSION, 'pg/version'
117
117
 
118
+
119
+ # Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1
120
+ if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations)
121
+ module TruffleFixWarn
122
+ def warn(str, category=nil)
123
+ super(str)
124
+ end
125
+ end
126
+ Warning.extend(TruffleFixWarn)
127
+ end
128
+
118
129
  end # module PG
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.5.2
4
+ version: 1.5.3
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  Dzx/gFSOrRoCt2mXNgrmcAfr386AfaMvCh7cXqdxZwmVo7ILZCYXck0pajvubsDd
35
35
  NUIIFkVXvd1odFyK9LF1RFAtxn/iAmpx
36
36
  -----END CERTIFICATE-----
37
- date: 2023-04-26 00:00:00.000000000 Z
37
+ date: 2023-04-28 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