pg 0.19.0.pre20160904200247 → 0.19.0.pre20170115074000

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
  SHA1:
3
- metadata.gz: 43b6f99364777b057b8e0e3400ec54e3f7d3c5f8
4
- data.tar.gz: a0222f2ee3226ceaab1c77fe2ca3be5e274f2e27
3
+ metadata.gz: 45d6447d5c7f6c7dd3c840b66d5d08acc5e760ed
4
+ data.tar.gz: 16bd7e6580a8d28e1a09f93dc0a7bbafa724b3a8
5
5
  SHA512:
6
- metadata.gz: c7f97041e38289d5224d878187255bcb2dda49dcb7b8eb1475088d77a3ab84da169d3a35655d19ec1d41e273c34b7b19781298f18201a2fea3cc8c54c09a4a74
7
- data.tar.gz: e6359d00f99c01b2a8de6325293accf4e093b40b492a404aa413de476c5a83bb5dcb1eec40c92c2b7af85a799d2fba299d69bef71f7984e2863288d0afef3ded
6
+ metadata.gz: affc767d5db4fed552319cfe49313b516fa5d22d43e37f3dce69904d367264dec4efca68907c53116dd90fe8562dc325edacd6745efd00772a0c1c6d55c41941
7
+ data.tar.gz: ebb43e94435552f839db9349bf17fe76b17a8b2e5eb8f96400b6ad02ccb157fe2ae6dc70f3f13b8a81d5a4140d7200a79fd17b99216a0f47ce085d4c4d70b150
Binary file
data.tar.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,3 +1,113 @@
1
+ 2017-01-14 Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ * History.rdoc:
4
+ Update History file. [ci-skip]
5
+ [0d1921b825d7] [tip]
6
+
7
+ * Rakefile.cross:
8
+ Update Windows binary rubies to support 2.0 to 2.4
9
+ [3736e33ce71e]
10
+
11
+ * ext/pg_connection.c, ext/pg_result.c:
12
+ Change all Fixnum to Integer in documentation.
13
+
14
+ Fixnum are deprecated in Ruby-2.4.
15
+ [2e17f315848e]
16
+
17
+ * ext/pg_type_map.c:
18
+ Avoid compiler warnings about noreturn-functions:
19
+
20
+ ../../../../ext/pg_type_map.c: In function
21
+ ‘pg_typemap_fit_to_result’: ../../../../ext/pg_type_map.c:15:1:
22
+ warning: function might be candidate for attribute ‘noreturn’
23
+ [-Wsuggest-attribute=noreturn] pg_typemap_fit_to_result( VALUE self,
24
+ VALUE result )
25
+ [2af122820861]
26
+
27
+ * spec/pg/type_map_by_class_spec.rb:
28
+ Bignum,Fixnum and Integer are the same in Ruby-2.4.
29
+
30
+ Fixes #255 : https://bitbucket.org/ged/ruby-pg/issues/255
31
+ [a446dfaf9d8f]
32
+
33
+ * Rakefile, pg.gemspec:
34
+ Update rake-compiler and rake-compiler-dock
35
+
36
+ This adds support for Ruby-2.4 on Windows and Ruby version
37
+ constraints for binary gems.
38
+ [6ebcebaad39c]
39
+
40
+ * ext/pg_coder.c:
41
+ Fix method arguments for Coder#encode in documentation.
42
+ [ee79cce8b141]
43
+
44
+ 2016-12-04 Lars Kanis <lars@greiz-reinsdorf.de>
45
+
46
+ * History.rdoc, lib/pg/result.rb, spec/pg/result_spec.rb:
47
+ Fix Result#inspect on a cleared result.
48
+ [0c60865f718e]
49
+
50
+ 2016-11-09 Lars Kanis <lars@greiz-reinsdorf.de>
51
+
52
+ * Merge branch 'master' of github.com:larskanis/ruby-pg
53
+ [db7c584532e5]
54
+
55
+ 2016-11-09 Lars Kanis <kanis@comcard.de>
56
+
57
+ * Rakefile.cross:
58
+ Don't download gems in the rake-compiler-dock, but use the local
59
+ installed gems.
60
+
61
+ This saves traffic and avoids download issues.
62
+ [14e6fa84d31c]
63
+
64
+ * Rakefile.cross:
65
+ Update cross postgres and openssl versions.
66
+ [a6ec62e2b783]
67
+
68
+ * Rakefile:
69
+ Fetch the errorcodes from a specific release version.
70
+
71
+ This avoids introduction of errorcodes, which are not yet released
72
+ and possibly subject to change.
73
+ [b399dae9e988]
74
+
75
+ * ext/errorcodes.def, ext/errorcodes.txt:
76
+ Update errorcodes to PostgreSQL version 9.6.1
77
+ [c1b690f2b47d]
78
+
79
+ 2016-11-09 Michael Granger <ged@FaerieMUD.org>
80
+
81
+ * History.rdoc:
82
+ Merged with d62b04efb055
83
+ [cefe252948ed]
84
+
85
+ 2016-09-21 Michael Granger <ged@FaerieMUD.org>
86
+
87
+ * .hgtags:
88
+ Added tag v0.19.0 for changeset bd2aaa2c5797
89
+ [5ed7106cc770]
90
+
91
+ * .hgsigs:
92
+ Added signature for changeset 8beaa5d72670
93
+ [bd2aaa2c5797] [v0.19.0]
94
+
95
+ * History.rdoc, lib/pg.rb:
96
+ Bump the minor version, update history.
97
+ [8beaa5d72670]
98
+
99
+ 2016-10-21 Lars Kanis <lars@greiz-reinsdorf.de>
100
+
101
+ * lib/pg/text_encoder.rb:
102
+ Fix typo in JSON#encode
103
+ [d62b04efb055]
104
+
105
+ * History.rdoc, lib/pg/text_decoder.rb, lib/pg/text_encoder.rb:
106
+ Use secure JSON methods for JSON (de)serialisation.
107
+
108
+ This fixes issue #248 : https://bitbucket.org/ged/ruby-pg/issues/248
109
+ [fe3e883bead2]
110
+
1
111
  2016-09-04 Lars Kanis <lars@greiz-reinsdorf.de>
2
112
 
3
113
  * ext/pg_connection.c:
@@ -5,7 +115,7 @@
5
115
 
6
116
  We don't really need an Array at all, but storing the values on the
7
117
  stack is enough.
8
- [4d9c4ee44d11] [tip]
118
+ [4d9c4ee44d11]
9
119
 
10
120
  * ext/pg_connection.c:
11
121
  Use the asynchronous interface for setting the default_encoding.
@@ -1,4 +1,20 @@
1
- == v0.19.0 [YYYY-MM-DD] Michael Granger <ged@FaerieMUD.org>
1
+ == v0.19.1 [YYYY-MM-DD] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Enhancements:
4
+ - Update error codes to PostgreSQL-9.6
5
+ - Update Windows binary gems to Ruby-2.4, PostgreSQL 9.6.1 and
6
+ OpenSSL 1.0.2j.
7
+
8
+ Bugfixes:
9
+ - Use secure JSON methods for JSON (de)serialisation. #248
10
+ - Fix Result#inspect on a cleared result.
11
+ - Fix test case that failed on Ruby-2.4. #255
12
+
13
+ Documentation fixes:
14
+ - Talk about Integer instead of Fixnum.
15
+ - Fix method signature of Coder#encode.
16
+
17
+ == v0.19.0 [2016-09-21] Michael Granger <ged@FaerieMUD.org>
2
18
 
3
19
  - Deprecate Ruby 1.9
4
20
 
data/Rakefile CHANGED
@@ -60,8 +60,8 @@ $hoespec = Hoe.spec 'pg' do
60
60
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
61
61
  self.developer 'Lars Kanis', 'lars@greiz-reinsdorf.de'
62
62
 
63
- self.dependency 'rake-compiler', '~> 0.9', :developer
64
- self.dependency 'rake-compiler-dock', '~> 0.5', :developer
63
+ self.dependency 'rake-compiler', '~> 1.0.3', :developer
64
+ self.dependency 'rake-compiler-dock', '~> 0.6.0', :developer
65
65
  self.dependency 'hoe', '~> 3.12', :developer
66
66
  self.dependency 'hoe-deveiate', '~> 0.6', :developer
67
67
  self.dependency 'hoe-bundler', '~> 1.0', :developer
@@ -185,7 +185,7 @@ end
185
185
 
186
186
  desc "Update list of server error codes"
187
187
  task :update_error_codes do
188
- URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=HEAD"
188
+ URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL9_6_1"
189
189
 
190
190
  ERRORCODES_TXT = "ext/errorcodes.txt"
191
191
  sh "wget #{URL_ERRORCODES_TXT.inspect} -O #{ERRORCODES_TXT.inspect} || curl #{URL_ERRORCODES_TXT.inspect} -o #{ERRORCODES_TXT.inspect}"
@@ -29,8 +29,8 @@ class CrossLibrary < OpenStruct
29
29
  self.host_platform = toolchain
30
30
 
31
31
  # Cross-compilation constants
32
- self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.2h'
33
- self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.5.4'
32
+ self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.2j'
33
+ self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.6.1'
34
34
 
35
35
  # Check if symlinks work in the current working directory.
36
36
  # This fails, if rake-compiler-dock is running on a Windows box.
@@ -291,11 +291,12 @@ task 'gem:windows' => ['ChangeLog'] do
291
291
  # Copy gem signing key and certs to be accessable from the docker container
292
292
  mkdir_p 'build/gem'
293
293
  sh "cp ~/.gem/gem-*.pem build/gem/ || true"
294
+ sh "bundle package"
294
295
 
295
296
  RakeCompilerDock.sh <<-EOT
296
297
  mkdir ~/.gem &&
297
298
  (cp build/gem/gem-*.pem ~/.gem/ || true) &&
298
- bundle install &&
299
- rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0:1.9.3
299
+ bundle install --local &&
300
+ rake cross native gem RUBY_CC_VERSION=2.4.0:2.3.0:2.2.2:2.1.6:2.0.0
300
301
  EOT
301
302
  end
@@ -373,6 +373,10 @@
373
373
  VALUE klass = define_error_class( "InFailedSqlTransaction", "25" );
374
374
  register_error_class( "25P02", klass );
375
375
  }
376
+ {
377
+ VALUE klass = define_error_class( "IdleInTransactionSessionTimeout", "25" );
378
+ register_error_class( "25P03", klass );
379
+ }
376
380
  {
377
381
  VALUE klass = define_error_class( "InvalidSqlStatementName", NULL );
378
382
  register_error_class( "26000", klass );
@@ -793,6 +797,11 @@
793
797
  VALUE klass = define_error_class( "DuplicateFile", "58" );
794
798
  register_error_class( "58P02", klass );
795
799
  }
800
+ {
801
+ VALUE klass = define_error_class( "SnapshotTooOld", NULL );
802
+ register_error_class( "72000", klass );
803
+ register_error_class( "72", klass );
804
+ }
796
805
  {
797
806
  VALUE klass = define_error_class( "ConfigFileError", NULL );
798
807
  register_error_class( "F0000", klass );
@@ -15,6 +15,9 @@
15
15
  # src/pl/plpgsql/src/plerrcodes.h
16
16
  # a list of PL/pgSQL condition names and their SQLSTATE codes
17
17
  #
18
+ # src/pl/tcl/pltclerrcodes.h
19
+ # the same, for PL/Tcl
20
+ #
18
21
  # doc/src/sgml/errcodes-list.sgml
19
22
  # a SGML table of error codes for inclusion in the documentation
20
23
  #
@@ -229,6 +232,7 @@ Section: Class 25 - Invalid Transaction State
229
232
  25007 E ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED schema_and_data_statement_mixing_not_supported
230
233
  25P01 E ERRCODE_NO_ACTIVE_SQL_TRANSACTION no_active_sql_transaction
231
234
  25P02 E ERRCODE_IN_FAILED_SQL_TRANSACTION in_failed_sql_transaction
235
+ 25P03 E ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT idle_in_transaction_session_timeout
232
236
 
233
237
  Section: Class 26 - Invalid SQL Statement Name
234
238
 
@@ -413,6 +417,10 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself)
413
417
  58P01 E ERRCODE_UNDEFINED_FILE undefined_file
414
418
  58P02 E ERRCODE_DUPLICATE_FILE duplicate_file
415
419
 
420
+ Section: Class 72 - Snapshot Failure
421
+ # (class borrowed from Oracle)
422
+ 72000 E ERRCODE_SNAPSHOT_TOO_OLD snapshot_too_old
423
+
416
424
  Section: Class F0 - Configuration File Error
417
425
 
418
426
  # (PostgreSQL-specific error class)
@@ -105,7 +105,7 @@ pg_composite_decoder_allocate( VALUE klass )
105
105
 
106
106
  /*
107
107
  * call-seq:
108
- * coder.encode( value )
108
+ * coder.encode( value [, encoding] )
109
109
  *
110
110
  * Encodes the given Ruby object into string representation, without
111
111
  * sending data to/from the database server.
@@ -352,9 +352,9 @@ pgconn_s_connect_start( int argc, VALUE *argv, VALUE klass )
352
352
  #ifdef HAVE_PQPING
353
353
  /*
354
354
  * call-seq:
355
- * PG::Connection.ping(connection_hash) -> Fixnum
356
- * PG::Connection.ping(connection_string) -> Fixnum
357
- * PG::Connection.ping(host, port, options, tty, dbname, login, password) -> Fixnum
355
+ * PG::Connection.ping(connection_hash) -> Integer
356
+ * PG::Connection.ping(connection_string) -> Integer
357
+ * PG::Connection.ping(host, port, options, tty, dbname, login, password) -> Integer
358
358
  *
359
359
  * Check server status.
360
360
  *
@@ -457,7 +457,7 @@ pgconn_s_encrypt_password(VALUE self, VALUE password, VALUE username)
457
457
 
458
458
  /*
459
459
  * call-seq:
460
- * conn.connect_poll() -> Fixnum
460
+ * conn.connect_poll() -> Integer
461
461
  *
462
462
  * Returns one of:
463
463
  * [+PGRES_POLLING_READING+]
@@ -566,7 +566,7 @@ pgconn_reset_start(VALUE self)
566
566
 
567
567
  /*
568
568
  * call-seq:
569
- * conn.reset_poll -> Fixnum
569
+ * conn.reset_poll -> Integer
570
570
  *
571
571
  * Checks the status of a connection reset operation.
572
572
  * See #connect_start and #connect_poll for
@@ -805,7 +805,7 @@ pgconn_error_message(VALUE self)
805
805
 
806
806
  /*
807
807
  * call-seq:
808
- * conn.socket() -> Fixnum
808
+ * conn.socket() -> Integer
809
809
  *
810
810
  * Returns the socket's file descriptor for this connection.
811
811
  * <tt>IO.for_fd()</tt> can be used to build a proper IO object to the socket.
@@ -880,7 +880,7 @@ pgconn_socket_io(VALUE self)
880
880
 
881
881
  /*
882
882
  * call-seq:
883
- * conn.backend_pid() -> Fixnum
883
+ * conn.backend_pid() -> Integer
884
884
  *
885
885
  * Returns the process ID of the backend server
886
886
  * process for this connection.
@@ -1234,8 +1234,8 @@ pgconn_query_assign_typemap( VALUE self, struct query_params_data *paramsData )
1234
1234
  * Each element of the +params+ array may be either:
1235
1235
  * a hash of the form:
1236
1236
  * {:value => String (value of bind parameter)
1237
- * :type => Fixnum (oid of type of bind parameter)
1238
- * :format => Fixnum (0 for text, 1 for binary)
1237
+ * :type => Integer (oid of type of bind parameter)
1238
+ * :format => Integer (0 for text, 1 for binary)
1239
1239
  * }
1240
1240
  * or, it may be a String. If it is a string, that is equivalent to the hash:
1241
1241
  * { :value => <string value>, :type => 0, :format => 0 }
@@ -1377,7 +1377,7 @@ pgconn_prepare(int argc, VALUE *argv, VALUE self)
1377
1377
  * SQL query. Each element of the +params+ array may be either:
1378
1378
  * a hash of the form:
1379
1379
  * {:value => String (value of bind parameter)
1380
- * :format => Fixnum (0 for text, 1 for binary)
1380
+ * :format => Integer (0 for text, 1 for binary)
1381
1381
  * }
1382
1382
  * or, it may be a String. If it is a string, that is equivalent to the hash:
1383
1383
  * { :value => <string value>, :format => 0 }
@@ -1793,8 +1793,8 @@ pgconn_set_single_row_mode(VALUE self)
1793
1793
  * Each element of the +params+ array may be either:
1794
1794
  * a hash of the form:
1795
1795
  * {:value => String (value of bind parameter)
1796
- * :type => Fixnum (oid of type of bind parameter)
1797
- * :format => Fixnum (0 for text, 1 for binary)
1796
+ * :type => Integer (oid of type of bind parameter)
1797
+ * :format => Integer (0 for text, 1 for binary)
1798
1798
  * }
1799
1799
  * or, it may be a String. If it is a string, that is equivalent to the hash:
1800
1800
  * { :value => <string value>, :type => 0, :format => 0 }
@@ -1940,7 +1940,7 @@ pgconn_send_prepare(int argc, VALUE *argv, VALUE self)
1940
1940
  * SQL query. Each element of the +params+ array may be either:
1941
1941
  * a hash of the form:
1942
1942
  * {:value => String (value of bind parameter)
1943
- * :format => Fixnum (0 for text, 1 for binary)
1943
+ * :format => Integer (0 for text, 1 for binary)
1944
1944
  * }
1945
1945
  * or, it may be a String. If it is a string, that is equivalent to the hash:
1946
1946
  * { :value => <string value>, :format => 0 }
@@ -2724,7 +2724,7 @@ pgconn_get_copy_data(int argc, VALUE *argv, VALUE self )
2724
2724
 
2725
2725
  /*
2726
2726
  * call-seq:
2727
- * conn.set_error_verbosity( verbosity ) -> Fixnum
2727
+ * conn.set_error_verbosity( verbosity ) -> Integer
2728
2728
  *
2729
2729
  * Sets connection's verbosity to _verbosity_ and returns
2730
2730
  * the previous setting. Available settings are:
@@ -3280,7 +3280,7 @@ pgconn_ssl_attribute_names(VALUE self)
3280
3280
 
3281
3281
  /*
3282
3282
  * call-seq:
3283
- * conn.lo_creat( [mode] ) -> Fixnum
3283
+ * conn.lo_creat( [mode] ) -> Integer
3284
3284
  *
3285
3285
  * Creates a large object with mode _mode_. Returns a large object Oid.
3286
3286
  * On failure, it raises PG::Error.
@@ -3307,7 +3307,7 @@ pgconn_locreat(int argc, VALUE *argv, VALUE self)
3307
3307
 
3308
3308
  /*
3309
3309
  * call-seq:
3310
- * conn.lo_create( oid ) -> Fixnum
3310
+ * conn.lo_create( oid ) -> Integer
3311
3311
  *
3312
3312
  * Creates a large object with oid _oid_. Returns the large object Oid.
3313
3313
  * On failure, it raises PG::Error.
@@ -3328,7 +3328,7 @@ pgconn_locreate(VALUE self, VALUE in_lo_oid)
3328
3328
 
3329
3329
  /*
3330
3330
  * call-seq:
3331
- * conn.lo_import(file) -> Fixnum
3331
+ * conn.lo_import(file) -> Integer
3332
3332
  *
3333
3333
  * Import a file to a large object. Returns a large object Oid.
3334
3334
  *
@@ -3373,7 +3373,7 @@ pgconn_loexport(VALUE self, VALUE lo_oid, VALUE filename)
3373
3373
 
3374
3374
  /*
3375
3375
  * call-seq:
3376
- * conn.lo_open( oid, [mode] ) -> Fixnum
3376
+ * conn.lo_open( oid, [mode] ) -> Integer
3377
3377
  *
3378
3378
  * Open a large object of _oid_. Returns a large object descriptor
3379
3379
  * instance on success. The _mode_ argument specifies the mode for
@@ -3404,7 +3404,7 @@ pgconn_loopen(int argc, VALUE *argv, VALUE self)
3404
3404
 
3405
3405
  /*
3406
3406
  * call-seq:
3407
- * conn.lo_write( lo_desc, buffer ) -> Fixnum
3407
+ * conn.lo_write( lo_desc, buffer ) -> Integer
3408
3408
  *
3409
3409
  * Writes the string _buffer_ to the large object _lo_desc_.
3410
3410
  * Returns the number of bytes written.
@@ -3471,7 +3471,7 @@ pgconn_loread(VALUE self, VALUE in_lo_desc, VALUE in_len)
3471
3471
 
3472
3472
  /*
3473
3473
  * call-seq:
3474
- * conn.lo_lseek( lo_desc, offset, whence ) -> Fixnum
3474
+ * conn.lo_lseek( lo_desc, offset, whence ) -> Integer
3475
3475
  *
3476
3476
  * Move the large object pointer _lo_desc_ to offset _offset_.
3477
3477
  * Valid values for _whence_ are +SEEK_SET+, +SEEK_CUR+, and +SEEK_END+.
@@ -3493,7 +3493,7 @@ pgconn_lolseek(VALUE self, VALUE in_lo_desc, VALUE offset, VALUE whence)
3493
3493
 
3494
3494
  /*
3495
3495
  * call-seq:
3496
- * conn.lo_tell( lo_desc ) -> Fixnum
3496
+ * conn.lo_tell( lo_desc ) -> Integer
3497
3497
  *
3498
3498
  * Returns the current position of the large object _lo_desc_.
3499
3499
  */
@@ -302,7 +302,7 @@ static void pgresult_init_fnames(VALUE self)
302
302
 
303
303
  /*
304
304
  * call-seq:
305
- * res.result_status() -> Fixnum
305
+ * res.result_status() -> Integer
306
306
  *
307
307
  * Returns the status of the query. The status value is one of:
308
308
  * * +PGRES_EMPTY_QUERY+
@@ -414,7 +414,7 @@ pgresult_error_field(VALUE self, VALUE field)
414
414
 
415
415
  /*
416
416
  * call-seq:
417
- * res.ntuples() -> Fixnum
417
+ * res.ntuples() -> Integer
418
418
  *
419
419
  * Returns the number of tuples in the query result.
420
420
  */
@@ -466,7 +466,7 @@ pgresult_fname(VALUE self, VALUE index)
466
466
 
467
467
  /*
468
468
  * call-seq:
469
- * res.fnumber( name ) -> Fixnum
469
+ * res.fnumber( name ) -> Integer
470
470
  *
471
471
  * Returns the index of the field specified by the string +name+.
472
472
  * The given +name+ is treated like an identifier in an SQL command, that is,
@@ -527,7 +527,7 @@ pgresult_ftable(VALUE self, VALUE column_number)
527
527
 
528
528
  /*
529
529
  * call-seq:
530
- * res.ftablecol( column_number ) -> Fixnum
530
+ * res.ftablecol( column_number ) -> Integer
531
531
  *
532
532
  * Returns the column number (within its table) of the table from
533
533
  * which the column _column_number_ is made up.
@@ -552,7 +552,7 @@ pgresult_ftablecol(VALUE self, VALUE column_number)
552
552
 
553
553
  /*
554
554
  * call-seq:
555
- * res.fformat( column_number ) -> Fixnum
555
+ * res.fformat( column_number ) -> Integer
556
556
  *
557
557
  * Returns the format (0 for text, 1 for binary) of column
558
558
  * _column_number_.
@@ -696,7 +696,7 @@ pgresult_getisnull(VALUE self, VALUE tup_num, VALUE field_num)
696
696
 
697
697
  /*
698
698
  * call-seq:
699
- * res.getlength( tup_num, field_num ) -> Fixnum
699
+ * res.getlength( tup_num, field_num ) -> Integer
700
700
  *
701
701
  * Returns the (String) length of the field in bytes.
702
702
  *
@@ -721,7 +721,7 @@ pgresult_getlength(VALUE self, VALUE tup_num, VALUE field_num)
721
721
 
722
722
  /*
723
723
  * call-seq:
724
- * res.nparams() -> Fixnum
724
+ * res.nparams() -> Integer
725
725
  *
726
726
  * Returns the number of parameters of a prepared statement.
727
727
  * Only useful for the result returned by conn.describePrepared
@@ -11,46 +11,53 @@ VALUE rb_mDefaultTypeMappable;
11
11
  static ID s_id_fit_to_query;
12
12
  static ID s_id_fit_to_result;
13
13
 
14
+ NORETURN( VALUE
15
+ pg_typemap_fit_to_result( VALUE self, VALUE result ));
16
+ NORETURN( VALUE
17
+ pg_typemap_fit_to_query( VALUE self, VALUE params ));
18
+ NORETURN( int
19
+ pg_typemap_fit_to_copy_get( VALUE self ));
20
+ NORETURN( VALUE
21
+ pg_typemap_result_value( t_typemap *p_typemap, VALUE result, int tuple, int field ));
22
+ NORETURN( t_pg_coder *
23
+ pg_typemap_typecast_query_param( t_typemap *p_typemap, VALUE param_value, int field ));
24
+ NORETURN( VALUE
25
+ pg_typemap_typecast_copy_get( t_typemap *p_typemap, VALUE field_str, int fieldno, int format, int enc_idx ));
26
+
14
27
  VALUE
15
28
  pg_typemap_fit_to_result( VALUE self, VALUE result )
16
29
  {
17
30
  rb_raise( rb_eNotImpError, "type map %s is not suitable to map result values", rb_obj_classname(self) );
18
- return Qnil;
19
31
  }
20
32
 
21
33
  VALUE
22
34
  pg_typemap_fit_to_query( VALUE self, VALUE params )
23
35
  {
24
36
  rb_raise( rb_eNotImpError, "type map %s is not suitable to map query params", rb_obj_classname(self) );
25
- return Qnil;
26
37
  }
27
38
 
28
39
  int
29
40
  pg_typemap_fit_to_copy_get( VALUE self )
30
41
  {
31
42
  rb_raise( rb_eNotImpError, "type map %s is not suitable to map get_copy_data results", rb_obj_classname(self) );
32
- return Qnil;
33
43
  }
34
44
 
35
45
  VALUE
36
46
  pg_typemap_result_value( t_typemap *p_typemap, VALUE result, int tuple, int field )
37
47
  {
38
48
  rb_raise( rb_eNotImpError, "type map is not suitable to map result values" );
39
- return Qnil;
40
49
  }
41
50
 
42
51
  t_pg_coder *
43
52
  pg_typemap_typecast_query_param( t_typemap *p_typemap, VALUE param_value, int field )
44
53
  {
45
54
  rb_raise( rb_eNotImpError, "type map is not suitable to map query params" );
46
- return NULL;
47
55
  }
48
56
 
49
57
  VALUE
50
58
  pg_typemap_typecast_copy_get( t_typemap *p_typemap, VALUE field_str, int fieldno, int format, int enc_idx )
51
59
  {
52
60
  rb_raise( rb_eNotImpError, "type map is not suitable to map get_copy_data results" );
53
- return Qnil;
54
61
  }
55
62
 
56
63
  const struct pg_typemap_funcs pg_typemap_funcs = {
data/lib/pg.rb CHANGED
@@ -24,7 +24,7 @@ end
24
24
  module PG
25
25
 
26
26
  # Library version
27
- VERSION = '0.19.0.pre20160904200247'
27
+ VERSION = '0.19.0.pre20170115074000'
28
28
 
29
29
  # VCS revision
30
30
  REVISION = %q$Revision$
@@ -19,7 +19,11 @@ class PG::Result
19
19
  ### Return a String representation of the object suitable for debugging.
20
20
  def inspect
21
21
  str = self.to_s
22
- str[-1,0] = " status=#{res_status(result_status)} ntuples=#{ntuples} nfields=#{nfields} cmd_tuples=#{cmd_tuples}"
22
+ str[-1,0] = if cleared?
23
+ " cleared"
24
+ else
25
+ " status=#{res_status(result_status)} ntuples=#{ntuples} nfields=#{nfields} cmd_tuples=#{cmd_tuples}"
26
+ end
23
27
  return str
24
28
  end
25
29
 
@@ -43,7 +43,7 @@ module PG
43
43
 
44
44
  class JSON < SimpleDecoder
45
45
  def decode(string, tuple=nil, field=nil)
46
- ::JSON.load(string)
46
+ ::JSON.parse(string, quirks_mode: true)
47
47
  end
48
48
  end
49
49
  end
@@ -27,7 +27,7 @@ module PG
27
27
 
28
28
  class JSON < SimpleEncoder
29
29
  def encode(value)
30
- ::JSON.dump(value)
30
+ ::JSON.generate(value, quirks_mode: true)
31
31
  end
32
32
  end
33
33
  end
@@ -403,6 +403,13 @@ describe PG::Result do
403
403
  expect( r.cleared? ).to eq(true)
404
404
  end
405
405
 
406
+ it "can be inspected before and after clear" do
407
+ r = @conn.exec "select 1"
408
+ expect( r.inspect ).to match(/status=PGRES_TUPLES_OK/)
409
+ r.clear
410
+ expect( r.inspect ).to match(/cleared/)
411
+ end
412
+
406
413
  context 'result value conversions with TypeMapByColumn' do
407
414
  let!(:textdec_int){ PG::TextDecoder::Integer.new name: 'INT4', oid: 23 }
408
415
  let!(:textdec_float){ PG::TextDecoder::Float.new name: 'FLOAT4', oid: 700 }
@@ -59,7 +59,7 @@ describe PG::TypeMapByClass do
59
59
  it "should retrieve particular conversions" do
60
60
  expect( tm[Integer] ).to eq(binaryenc_int)
61
61
  expect( tm[Float] ).to eq(textenc_float)
62
- expect( tm[Bignum] ).to be_nil
62
+ expect( tm[Range] ).to be_nil
63
63
  expect( derived_tm[raise_class] ).to be_kind_of(Proc)
64
64
  expect( derived_tm[Array] ).to eq(:array_type_map_for)
65
65
  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: 0.19.0.pre20160904200247
4
+ version: 0.19.0.pre20170115074000
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -30,7 +30,7 @@ cert_chain:
30
30
  PizTJCem24R2bzZN5VGvA5tpqgwytgcFq1PZofgFxK2uKPCS+tmsA8wIjjGzFsnR
31
31
  WfgqWGyHn5K4wejsMic/uA==
32
32
  -----END CERTIFICATE-----
33
- date: 2016-09-04 00:00:00.000000000 Z
33
+ date: 2017-01-15 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: hoe-mercurial
@@ -74,48 +74,34 @@ dependencies:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0.2'
77
- - !ruby/object:Gem::Dependency
78
- name: rdoc
79
- requirement: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '4.0'
84
- type: :development
85
- prerelease: false
86
- version_requirements: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '4.0'
91
77
  - !ruby/object:Gem::Dependency
92
78
  name: rake-compiler
93
79
  requirement: !ruby/object:Gem::Requirement
94
80
  requirements:
95
81
  - - "~>"
96
82
  - !ruby/object:Gem::Version
97
- version: '0.9'
83
+ version: 1.0.3
98
84
  type: :development
99
85
  prerelease: false
100
86
  version_requirements: !ruby/object:Gem::Requirement
101
87
  requirements:
102
88
  - - "~>"
103
89
  - !ruby/object:Gem::Version
104
- version: '0.9'
90
+ version: 1.0.3
105
91
  - !ruby/object:Gem::Dependency
106
92
  name: rake-compiler-dock
107
93
  requirement: !ruby/object:Gem::Requirement
108
94
  requirements:
109
95
  - - "~>"
110
96
  - !ruby/object:Gem::Version
111
- version: '0.5'
97
+ version: 0.6.0
112
98
  type: :development
113
99
  prerelease: false
114
100
  version_requirements: !ruby/object:Gem::Requirement
115
101
  requirements:
116
102
  - - "~>"
117
103
  - !ruby/object:Gem::Version
118
- version: '0.5'
104
+ version: 0.6.0
119
105
  - !ruby/object:Gem::Dependency
120
106
  name: hoe
121
107
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +144,20 @@ dependencies:
158
144
  - - "~>"
159
145
  - !ruby/object:Gem::Version
160
146
  version: '3.0'
147
+ - !ruby/object:Gem::Dependency
148
+ name: rdoc
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '4.0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '4.0'
161
161
  description: |-
162
162
  Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
163
163
 
@@ -322,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
322
  version: 1.3.1
323
323
  requirements: []
324
324
  rubyforge_project:
325
- rubygems_version: 2.5.1
325
+ rubygems_version: 2.6.8
326
326
  signing_key:
327
327
  specification_version: 4
328
328
  summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- }qEF7
2
- e�7y�M�)4��ڐ��뭏Р�D�G��U.�Q�L�x���X�{�qW���DC�\#0a���=��â�*��dŬV{��\*�������$�ώ)�u\���Q�][Q/Ľ��$ߜ�*H��iLޱ
1
+ )KX��R9���� .0��ϟ]��b��