sequel_pg 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -1
- data/ext/sequel_pg/sequel_pg.c +14 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08ac123f28a04a27f31f8e0c36f35357c97518db'
|
4
|
+
data.tar.gz: f55ca7eec3931cbc8b4d3a4c6eb1295299d511a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdee057696e6a5cf1c283a2e1305df07dd7a9773e5eb284a6bdd7ecf5df4e21288a7f961afaad334ff23d71ec1b6ef980be95753ec80f0912d86920b897b7073
|
7
|
+
data.tar.gz: 97715ed30e04d22e9f479720e8bd08c830050e86408a67dae20f60ce1aca397a40155b8c31c6d837b651b4b2b426e79757a1a802281cba8fdf21a8142d2fb0ea
|
data/CHANGELOG
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
===
|
1
|
+
=== 1.7.1 (2017-08-25)
|
2
|
+
|
3
|
+
* Handle case where PGconn#get_result returns nil in single row mode (jeremyevans)
|
4
|
+
|
5
|
+
* Fix RB_GC_GUARD usage to handle additional segfault (Eric Wong)
|
6
|
+
|
7
|
+
=== 1.7.0 (2017-06-30)
|
8
|
+
|
9
|
+
* Add Dataset#with_optimize_model_load to change optimized model loading for specific datasets (jeremyevans)
|
10
|
+
|
11
|
+
* Deprecate optimize_model_load Database and Dataset accessors (jeremyevans)
|
12
|
+
|
13
|
+
* Turn optimized model loading on by default, disable automatically when Model.call overridden (jeremyevans)
|
2
14
|
|
3
15
|
* Override Dataset#as_hash instead of #to_hash if #as_hash is defined (jeremyevans)
|
4
16
|
|
data/ext/sequel_pg/sequel_pg.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#define SEQUEL_PG_VERSION_INTEGER
|
1
|
+
#define SEQUEL_PG_VERSION_INTEGER 10701
|
2
2
|
|
3
3
|
#include <string.h>
|
4
4
|
#include <stdio.h>
|
@@ -127,13 +127,14 @@ static int enc_get_index(VALUE val)
|
|
127
127
|
}
|
128
128
|
#endif
|
129
129
|
|
130
|
-
static VALUE read_array(int *index, char *c_pg_array_string, int array_string_length,
|
130
|
+
static VALUE read_array(int *index, char *c_pg_array_string, int array_string_length, VALUE buf, VALUE converter
|
131
131
|
#ifdef SPG_ENCODING
|
132
132
|
, int enc_index
|
133
133
|
#endif
|
134
134
|
)
|
135
135
|
{
|
136
136
|
int word_index = 0;
|
137
|
+
char *word = RSTRING_PTR(buf);
|
137
138
|
|
138
139
|
/* The current character in the input string. */
|
139
140
|
char c;
|
@@ -203,7 +204,7 @@ static VALUE read_array(int *index, char *c_pg_array_string, int array_string_le
|
|
203
204
|
else if(c == '{')
|
204
205
|
{
|
205
206
|
(*index)++;
|
206
|
-
rb_ary_push(array, read_array(index, c_pg_array_string, array_string_length,
|
207
|
+
rb_ary_push(array, read_array(index, c_pg_array_string, array_string_length, buf, converter
|
207
208
|
#ifdef SPG_ENCODING
|
208
209
|
, enc_index
|
209
210
|
#endif
|
@@ -236,6 +237,8 @@ static VALUE read_array(int *index, char *c_pg_array_string, int array_string_le
|
|
236
237
|
}
|
237
238
|
}
|
238
239
|
|
240
|
+
RB_GC_GUARD(buf);
|
241
|
+
|
239
242
|
return array;
|
240
243
|
}
|
241
244
|
|
@@ -246,8 +249,6 @@ static VALUE parse_pg_array(VALUE self, VALUE pg_array_string, VALUE converter)
|
|
246
249
|
char *c_pg_array_string = StringValueCStr(pg_array_string);
|
247
250
|
int array_string_length = RSTRING_LEN(pg_array_string);
|
248
251
|
VALUE buf = rb_str_buf_new(array_string_length);
|
249
|
-
RB_GC_GUARD(buf);
|
250
|
-
char *word = RSTRING_PTR(buf);
|
251
252
|
int index = 1;
|
252
253
|
|
253
254
|
if (array_string_length == 0) {
|
@@ -271,7 +272,7 @@ static VALUE parse_pg_array(VALUE self, VALUE pg_array_string, VALUE converter)
|
|
271
272
|
rb_raise(rb_eArgError, "unexpected PostgreSQL array format, doesn't start with { or [");
|
272
273
|
}
|
273
274
|
|
274
|
-
return read_array(&index, c_pg_array_string, array_string_length,
|
275
|
+
return read_array(&index, c_pg_array_string, array_string_length, buf, converter
|
275
276
|
#ifdef SPG_ENCODING
|
276
277
|
, enc_get_index(pg_array_string)
|
277
278
|
#endif
|
@@ -924,6 +925,9 @@ static VALUE spg__yield_each_row(VALUE self) {
|
|
924
925
|
GetPGconn(rconn, conn);
|
925
926
|
|
926
927
|
rres = rb_funcall(rconn, spg_id_get_result, 0);
|
928
|
+
if (rres == Qnil) {
|
929
|
+
goto end_yield_each_row;
|
930
|
+
}
|
927
931
|
rb_funcall(rres, spg_id_check, 0);
|
928
932
|
GetPGresult(rres, res);
|
929
933
|
|
@@ -970,11 +974,15 @@ static VALUE spg__yield_each_row(VALUE self) {
|
|
970
974
|
}
|
971
975
|
|
972
976
|
rres = rb_funcall(rconn, spg_id_get_result, 0);
|
977
|
+
if (rres == Qnil) {
|
978
|
+
goto end_yield_each_row;
|
979
|
+
}
|
973
980
|
rb_funcall(rres, spg_id_check, 0);
|
974
981
|
GetPGresult(rres, res);
|
975
982
|
}
|
976
983
|
rb_funcall(rres, spg_id_clear, 0);
|
977
984
|
|
985
|
+
end_yield_each_row:
|
978
986
|
return self;
|
979
987
|
}
|
980
988
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_pg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|