pg 1.1.0 → 1.1.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: 412c807a50f306e6328752a9b678423bc69530d23039c7d5089cb021037f174d
4
- data.tar.gz: 4f670f1536a8e69b835b43d2b1863552bca4542711323aad9cfdba58118ef051
3
+ metadata.gz: eb252541d5a9478881517c64cee61f829e5ac09eb9e307afa728e9a8f7b592ca
4
+ data.tar.gz: 5a3e1f03ac12d2f7bf547eccbe86c8152f6731cd184612052767968677632297
5
5
  SHA512:
6
- metadata.gz: d28cbd788013f390e2b458ac41ea8e6f88890691679d66477da39a986f2218e7c5454058b6f0c002e8964bcc2defb10fd73efe8fb324e354db0555c5bf04fa6b
7
- data.tar.gz: 10ceb6ab1fed9ad3acb2f114f84c40dccbc77fc4a0c22cb186fa10d53fbb25977043cb34f9fcdedb742957b156658f9580ec5eb35442c88a453ad27b8994a566
6
+ metadata.gz: 9982eb5ca1a25c07df3bde63394ee73eca318b8a4db403895401d768a518783ffc761e71c225d1b28579c70f30b03ca1ffdd94321c64f81b1f163a6abb39bb92
7
+ data.tar.gz: 55e73416ae1f64ff43b03cdba862ac0f829c3427c30800756441fd5f10ea2a2baff224e41eb8d984b14656710bc44ddbc671ac19f493578dd173ae4c2b55c5ca
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,8 @@
1
+ == v1.1.1 [YYYY-MM-DD] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Reduce deprecation warnings to only one message per deprecation.
4
+
5
+
1
6
  == v1.1.0 [2018-08-24] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  Deprecated (disable warnings per PG_SKIP_DEPRECATION_WARNING=1):
@@ -18,7 +23,7 @@ PG::Connection enhancements:
18
23
 
19
24
  Result retrieval enhancements:
20
25
  - Add PG::Result#tuple_values to retrieve all field values of a row as array.
21
- - Add PG::Tuple, PG::Result#tuple_values and PG::Result#stream_each_tuple .
26
+ - Add PG::Tuple, PG::Result#tuple and PG::Result#stream_each_tuple .
22
27
  PG::Tuple offers a way to lazy cast result values.
23
28
  - Estimate PG::Result size allocated by libpq and notify the garbage collector about it when running on Ruby-2.4 or newer.
24
29
  - Make the estimated PG::Result size available to ObjectSpace.memsize_of(result) .
data/ext/pg.c CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * pg.c - Toplevel extension
3
- * $Id: pg.c,v 0d4acc8a0bc5 2018/08/05 09:07:58 lars $
3
+ * $Id: pg.c,v be48d118eeed 2018/08/25 11:35:03 lars $
4
4
  *
5
5
  * Author/s:
6
6
  *
@@ -382,7 +382,12 @@ pg_s_init_ssl(VALUE self, VALUE do_ssl)
382
382
  void
383
383
  Init_pg_ext()
384
384
  {
385
- pg_skip_deprecation_warning = RTEST(rb_eval_string("ENV['PG_SKIP_DEPRECATION_WARNING']"));
385
+ if( RTEST(rb_eval_string("ENV['PG_SKIP_DEPRECATION_WARNING']")) ){
386
+ /* Set all bits to disable all deprecation warnings. */
387
+ pg_skip_deprecation_warning = 0xFFFF;
388
+ } else {
389
+ pg_skip_deprecation_warning = 0;
390
+ }
386
391
 
387
392
  rb_mPG = rb_define_module( "PG" );
388
393
  rb_mPGconstants = rb_define_module_under( rb_mPG, "Constants" );
data/ext/pg.h CHANGED
@@ -351,10 +351,16 @@ rb_encoding *pg_conn_enc_get _(( PGconn * ));
351
351
  void notice_receiver_proxy(void *arg, const PGresult *result);
352
352
  void notice_processor_proxy(void *arg, const char *message);
353
353
 
354
- /* reports if `-W' specified and PG_SKIP_DEPRECATION_WARNING environment variable isn't set */
355
- #define pg_deprecated(x) \
354
+ /* reports if `-W' specified and PG_SKIP_DEPRECATION_WARNING environment variable isn't set
355
+ *
356
+ * message_id identifies the warning, so that it's reported only once.
357
+ */
358
+ #define pg_deprecated(message_id, format_args) \
356
359
  do { \
357
- if( !pg_skip_deprecation_warning ) rb_warning x; \
360
+ if( !(pg_skip_deprecation_warning & (1 << message_id)) ){ \
361
+ pg_skip_deprecation_warning |= 1 << message_id; \
362
+ rb_warning format_args; \
363
+ } \
358
364
  } while(0);
359
365
 
360
366
  #endif /* end __pg_h */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * pg_connection.c - PG::Connection class extension
3
- * $Id: pg_connection.c,v e57f6b452eb3 2018/08/18 10:58:52 lars $
3
+ * $Id: pg_connection.c,v be48d118eeed 2018/08/25 11:35:03 lars $
4
4
  *
5
5
  */
6
6
 
@@ -1006,7 +1006,7 @@ pgconn_exec(int argc, VALUE *argv, VALUE self)
1006
1006
  }
1007
1007
  return rb_pgresult;
1008
1008
  }
1009
- pg_deprecated(("forwarding exec to exec_params is deprecated"));
1009
+ pg_deprecated(0, ("forwarding exec to exec_params is deprecated"));
1010
1010
 
1011
1011
  /* Otherwise, just call #exec_params instead for backward-compatibility */
1012
1012
  return pgconn_exec_params( argc, argv, self );
@@ -1321,7 +1321,7 @@ pgconn_exec_params( int argc, VALUE *argv, VALUE self )
1321
1321
  * is passed to #exec
1322
1322
  */
1323
1323
  if ( NIL_P(paramsData.params) ) {
1324
- pg_deprecated(("forwarding exec_params to exec is deprecated"));
1324
+ pg_deprecated(1, ("forwarding exec_params to exec is deprecated"));
1325
1325
  return pgconn_exec( 1, argv, self );
1326
1326
  }
1327
1327
  pgconn_query_assign_typemap( self, &paramsData );
@@ -1851,7 +1851,7 @@ pgconn_send_query(int argc, VALUE *argv, VALUE self)
1851
1851
  return Qnil;
1852
1852
  }
1853
1853
 
1854
- pg_deprecated(("forwarding async_exec to async_exec_params and send_query to send_query_params is deprecated"));
1854
+ pg_deprecated(2, ("forwarding async_exec to async_exec_params and send_query to send_query_params is deprecated"));
1855
1855
 
1856
1856
  /* If called with parameters, and optionally result_format,
1857
1857
  * use PQsendQueryParams
@@ -3223,7 +3223,7 @@ pgconn_async_exec_params(int argc, VALUE *argv, VALUE self)
3223
3223
  pgconn_discard_results( self );
3224
3224
  /* If called with no or nil parameters, use PQsendQuery for compatibility */
3225
3225
  if ( argc == 1 || (argc >= 2 && argc <= 4 && NIL_P(argv[1]) )) {
3226
- pg_deprecated(("forwarding async_exec_params to async_exec is deprecated"));
3226
+ pg_deprecated(3, ("forwarding async_exec_params to async_exec is deprecated"));
3227
3227
  pgconn_send_query( argc, argv, self );
3228
3228
  } else {
3229
3229
  pgconn_send_query_params( argc, argv, self );
data/lib/pg.rb CHANGED
@@ -35,10 +35,10 @@ end
35
35
  module PG
36
36
 
37
37
  # Library version
38
- VERSION = '1.1.0'
38
+ VERSION = '1.1.1'
39
39
 
40
40
  # VCS revision
41
- REVISION = %q$Revision: ca83074366ac $
41
+ REVISION = %q$Revision: 71d5c24f937e $
42
42
 
43
43
  class NotAllCopyDataRetrieved < PG::Error
44
44
  end
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  X0qdrKi+2aZZ0NGuFj9AItBsVmAvkBGIpX4TEKQp5haEbPpmaqO5nIIhV26PXmyT
37
37
  OMKv6pWsoS81vw5KAGBmfX8nht/Py90DQrbRvakATGI=
38
38
  -----END CERTIFICATE-----
39
- date: 2018-08-24 00:00:00.000000000 Z
39
+ date: 2018-08-27 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hoe-mercurial
metadata.gz.sig CHANGED
Binary file