sequel_pg 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/CHANGELOG +4 -0
  2. data/ext/sequel_pg/sequel_pg.c +19 -0
  3. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.6.3 (2012-11-30)
2
+
3
+ * Make streaming support not swallow errors when rows are not retrieved (jeremyevans)
4
+
1
5
  === 1.6.2 (2012-11-16)
2
6
 
3
7
  * Make sequel_pg runnable on rubinius by fixing bad rb_global_variable call (dbussink)
@@ -932,11 +932,30 @@ static VALUE spg__yield_each_row(VALUE self) {
932
932
  static VALUE spg__flush_results(VALUE rconn) {
933
933
  PGconn *conn;
934
934
  PGresult *res;
935
+ VALUE error = 0;
935
936
  Data_Get_Struct(rconn, PGconn, conn);
936
937
 
937
938
  while ((res = PQgetResult(conn)) != NULL) {
939
+ if (!error) {
940
+ switch (PQresultStatus(res))
941
+ {
942
+ case PGRES_BAD_RESPONSE:
943
+ case PGRES_FATAL_ERROR:
944
+ case PGRES_NONFATAL_ERROR:
945
+ error = rb_str_new2(PQresultErrorMessage(res));
946
+ break;
947
+ default:
948
+ break;
949
+ }
950
+ }
938
951
  PQclear(res);
939
952
  }
953
+
954
+ if (error) {
955
+ VALUE exception = rb_exc_new3(spg_PGError, error);
956
+ rb_iv_set(exception, "@connection", rconn);
957
+ rb_exc_raise(exception);
958
+ }
940
959
 
941
960
  return rconn;
942
961
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-17 00:00:00.000000000 Z
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg