pg 0.14.0 → 0.14.1.pre.363
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/ChangeLog +38 -1
- data/History.rdoc +19 -0
- data/ext/extconf.rb +1 -0
- data/ext/pg_connection.c +5 -1
- data/ext/pg_result.c +17 -13
- data/lib/pg.rb +2 -2
- data/spec/pg/connection_spec.rb +1 -0
- metadata +2 -2
- metadata.gz.sig +1 -2
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,10 +1,47 @@
|
|
1
|
+
2012-08-10 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* ext/pg_result.c:
|
4
|
+
Use heap instead of stack for result array in #values, etc al. (refs
|
5
|
+
#135, #136, #138)
|
6
|
+
[4d5e457062e8] [tip]
|
7
|
+
|
8
|
+
2012-08-04 Lars Kanis <kanis@comcard.de>
|
9
|
+
|
10
|
+
* spec/pg/connection_spec.rb:
|
11
|
+
Add missing require for using the TCPServer in connection_spec. This
|
12
|
+
fixes #137 .
|
13
|
+
[72b45840d975]
|
14
|
+
|
15
|
+
2012-07-03 Lars Kanis <kanis@comcard.de>
|
16
|
+
|
17
|
+
* ext/pg_connection.c:
|
18
|
+
Add note about the usage scope of the result object received by the
|
19
|
+
#set_notice_receiver block.
|
20
|
+
[de900bfaff1a]
|
21
|
+
|
22
|
+
2012-07-02 Lars Kanis <kanis@comcard.de>
|
23
|
+
|
24
|
+
* ext/pg_result.c:
|
25
|
+
Add PGRES_COPY_BOTH to documentation of PG::Result#result_status
|
26
|
+
[5e0e06440b1a]
|
27
|
+
|
28
|
+
2012-06-23 Michael Granger <ged@FaerieMUD.org>
|
29
|
+
|
30
|
+
* .hgtags:
|
31
|
+
Added tag v0.14.0 for changeset 634e0a42a101
|
32
|
+
[35eecb26bd34]
|
33
|
+
|
34
|
+
* .hgsigs:
|
35
|
+
Added signature for changeset a45710f8db30
|
36
|
+
[634e0a42a101] [v0.14.0]
|
37
|
+
|
1
38
|
2012-06-17 Lars Kanis <kanis@comcard.de>
|
2
39
|
|
3
40
|
* Rakefile.cross, ext/extconf.rb,
|
4
41
|
misc/postgresql-9.1.4.mingw-w64-support.patch:
|
5
42
|
Update windows cross compilation tasks to the latest
|
6
43
|
Openssl+Postgresql versions and the latest mingw-w64 compiler
|
7
|
-
[a45710f8db30]
|
44
|
+
[a45710f8db30]
|
8
45
|
|
9
46
|
* Rakefile:
|
10
47
|
Use RbConfig instead of obsolete and deprecated Config.
|
data/History.rdoc
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
== v0.14.1 [2012-08-12] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Important bugfix:
|
4
|
+
|
5
|
+
- Fix stack overflow bug in PG::Result#values and #column_values (#135). Thanks
|
6
|
+
to everyone who reported the bug, and Lars Kanis especially for figuring out
|
7
|
+
the problem.
|
8
|
+
|
9
|
+
PostgreSQL 9.2 beta fixes:
|
10
|
+
|
11
|
+
- Recognize PGRES_SINGLE_TUPLE as OK when checking PGresult (Jeremy Evans)
|
12
|
+
|
13
|
+
Documentation fixes:
|
14
|
+
|
15
|
+
- Add note about the usage scope of the result object received by the
|
16
|
+
#set_notice_receiver block. (Lars Kanis)
|
17
|
+
- Add PGRES_COPY_BOTH to documentation of PG::Result#result_status. (Lars Kanis)
|
18
|
+
|
19
|
+
|
1
20
|
== v0.14.0 [2012-06-17] Michael Granger <ged@FaerieMUD.org>
|
2
21
|
|
3
22
|
Bugfixes:
|
data/ext/extconf.rb
CHANGED
@@ -70,6 +70,7 @@ have_func 'rb_encdb_alias'
|
|
70
70
|
have_func 'rb_enc_alias'
|
71
71
|
|
72
72
|
have_const 'PGRES_COPY_BOTH', 'libpq-fe.h'
|
73
|
+
have_const 'PGRES_SINGLE_TUPLE', 'libpq-fe.h'
|
73
74
|
|
74
75
|
$defs.push( "-DHAVE_ST_NOTIFY_EXTRA" ) if
|
75
76
|
have_struct_member 'struct pgNotify', 'extra', 'libpq-fe.h'
|
data/ext/pg_connection.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* pg_connection.c - PG::Connection class extension
|
3
|
-
* $Id: pg_connection.c,v
|
3
|
+
* $Id: pg_connection.c,v de900bfaff1a 2012/07/03 14:38:38 kanis $
|
4
4
|
*
|
5
5
|
*/
|
6
6
|
|
@@ -2325,6 +2325,10 @@ notice_receiver_proxy(void *arg, const PGresult *result)
|
|
2325
2325
|
* the Proc object previously set, or +nil+ if it was previously the default.
|
2326
2326
|
*
|
2327
2327
|
* If you pass no arguments, it will reset the handler to the default.
|
2328
|
+
*
|
2329
|
+
* *Note:* The +result+ passed to the block should not be used outside
|
2330
|
+
* of the block, since the corresponding C object could be freed after the
|
2331
|
+
* block finishes.
|
2328
2332
|
*/
|
2329
2333
|
static VALUE
|
2330
2334
|
pgconn_set_notice_receiver(VALUE self)
|
data/ext/pg_result.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* pg_result.c - PG::Result class extension
|
3
|
-
* $Id: pg_result.c,v
|
3
|
+
* $Id: pg_result.c,v f92b6456c566 2012/08/08 23:22:21 code $
|
4
4
|
*
|
5
5
|
*/
|
6
6
|
|
@@ -67,6 +67,9 @@ pg_result_check( VALUE self )
|
|
67
67
|
case PGRES_COPY_IN:
|
68
68
|
#ifdef HAVE_CONST_PGRES_COPY_BOTH
|
69
69
|
case PGRES_COPY_BOTH:
|
70
|
+
#endif
|
71
|
+
#ifdef HAVE_CONST_PGRES_SINGLE_TUPLE
|
72
|
+
case PGRES_SINGLE_TUPLE:
|
70
73
|
#endif
|
71
74
|
case PGRES_EMPTY_QUERY:
|
72
75
|
case PGRES_COMMAND_OK:
|
@@ -179,6 +182,7 @@ pgresult_get(VALUE self)
|
|
179
182
|
* * +PGRES_BAD_RESPONSE+
|
180
183
|
* * +PGRES_NONFATAL_ERROR+
|
181
184
|
* * +PGRES_FATAL_ERROR+
|
185
|
+
* * +PGRES_COPY_BOTH+
|
182
186
|
*/
|
183
187
|
static VALUE
|
184
188
|
pgresult_result_status(VALUE self)
|
@@ -725,15 +729,15 @@ pgresult_values(VALUE self)
|
|
725
729
|
int field;
|
726
730
|
int num_rows = PQntuples(result);
|
727
731
|
int num_fields = PQnfields(result);
|
728
|
-
VALUE
|
732
|
+
VALUE ary = rb_ary_new2(num_rows);
|
729
733
|
|
730
734
|
for ( row = 0; row < num_rows; row++ ) {
|
731
|
-
VALUE new_row
|
735
|
+
VALUE new_row = rb_ary_new2(num_fields);
|
732
736
|
|
733
737
|
/* populate the row */
|
734
738
|
for ( field = 0; field < num_fields; field++ ) {
|
735
739
|
if ( PQgetisnull(result, row, field) ) {
|
736
|
-
new_row
|
740
|
+
rb_ary_store( new_row, field, Qnil );
|
737
741
|
}
|
738
742
|
else {
|
739
743
|
VALUE val = rb_tainted_str_new( PQgetvalue(result, row, field),
|
@@ -747,14 +751,14 @@ pgresult_values(VALUE self)
|
|
747
751
|
rb_enc_associate( val, rb_ascii8bit_encoding() );
|
748
752
|
}
|
749
753
|
#endif
|
750
|
-
new_row
|
754
|
+
rb_ary_store( new_row, field, val );
|
751
755
|
}
|
752
756
|
}
|
753
757
|
|
754
|
-
|
758
|
+
rb_ary_store( ary, row, new_row );
|
755
759
|
}
|
756
760
|
|
757
|
-
return
|
761
|
+
return ary;
|
758
762
|
}
|
759
763
|
|
760
764
|
|
@@ -769,7 +773,7 @@ make_column_result_array( VALUE self, int col )
|
|
769
773
|
int rows = PQntuples( result );
|
770
774
|
int i;
|
771
775
|
VALUE val = Qnil;
|
772
|
-
VALUE results
|
776
|
+
VALUE results = rb_ary_new2( rows );
|
773
777
|
|
774
778
|
if ( col >= PQnfields(result) )
|
775
779
|
rb_raise( rb_eIndexError, "no column %d in result", col );
|
@@ -787,10 +791,10 @@ make_column_result_array( VALUE self, int col )
|
|
787
791
|
}
|
788
792
|
#endif
|
789
793
|
|
790
|
-
results
|
794
|
+
rb_ary_store( results, i, val );
|
791
795
|
}
|
792
796
|
|
793
|
-
return
|
797
|
+
return results;
|
794
798
|
}
|
795
799
|
|
796
800
|
|
@@ -860,16 +864,16 @@ pgresult_fields(VALUE self)
|
|
860
864
|
{
|
861
865
|
PGresult *result = pgresult_get( self );
|
862
866
|
int n = PQnfields( result );
|
863
|
-
VALUE fields
|
867
|
+
VALUE fields = rb_ary_new2( n );
|
864
868
|
int i;
|
865
869
|
|
866
870
|
for ( i = 0; i < n; i++ ) {
|
867
871
|
VALUE val = rb_tainted_str_new2(PQfname(result, i));
|
868
872
|
ASSOCIATE_INDEX(val, self);
|
869
|
-
fields
|
873
|
+
rb_ary_store( fields, i, val );
|
870
874
|
}
|
871
875
|
|
872
|
-
return
|
876
|
+
return fields;
|
873
877
|
}
|
874
878
|
|
875
879
|
|
data/lib/pg.rb
CHANGED
@@ -19,10 +19,10 @@ end
|
|
19
19
|
module PG
|
20
20
|
|
21
21
|
# Library version
|
22
|
-
VERSION = '0.14.
|
22
|
+
VERSION = '0.14.1'
|
23
23
|
|
24
24
|
# VCS revision
|
25
|
-
REVISION = %q$Revision:
|
25
|
+
REVISION = %q$Revision: ef533f731814 $
|
26
26
|
|
27
27
|
|
28
28
|
### Get the PG library version. If +include_buildnum+ is +true+, include the build ID.
|
data/spec/pg/connection_spec.rb
CHANGED
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.14.
|
4
|
+
version: 0.14.1.pre.363
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
|
37
37
|
Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
|
38
38
|
cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
39
|
-
date: 2012-
|
39
|
+
date: 2012-08-13 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hoe-mercurial
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
����)�ם~��b\���vFCN�6]�K���ߡ�����c�l���a�Vke��iD���@B%��b5yc -e:V/�f��#Qc:��IO�<{&��O���8��7�Sʘ����@�}�߉VX18m����i��ǢR?�rk�$���oF8�K%4��3��!�L�M�/�-�8�dv����M!q�~���^��&�z��'6�j�5��rJ
|
1
|
+
i��7�鰐��ܱ�Q\��� �=Y��|�0��o�[N�p�;%k�[�#���Y�C�W?}C�}��'O����<v:�V�m��;�ii�����W/����=�`@5d���� j3��4��U:VL��k�M��n�x
|