swift-db-postgres 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.4 (2012-08-18)
2
+
3
+ * gc protect bind args.
4
+
1
5
  == 0.2.3 (2012-07-31)
2
6
 
3
7
  * remove rb_protect from Result#each.
@@ -396,6 +396,7 @@ VALUE db_postgres_adapter_query(int argc, VALUE *argv, VALUE self) {
396
396
  bind_args_fmt = (int *) malloc(sizeof(int) * RARRAY_LEN(bind));
397
397
  bind_args_data = (char **) malloc(sizeof(char *) * RARRAY_LEN(bind));
398
398
 
399
+ rb_gc_register_address(&bind);
399
400
  for (n = 0; n < RARRAY_LEN(bind); n++) {
400
401
  data = rb_ary_entry(bind, n);
401
402
  if (NIL_P(data)) {
@@ -418,6 +419,7 @@ VALUE db_postgres_adapter_query(int argc, VALUE *argv, VALUE self) {
418
419
  ok = PQsendQueryParams(a->connection, RSTRING_PTR(sql), RARRAY_LEN(bind), 0,
419
420
  (const char* const *)bind_args_data, bind_args_size, bind_args_fmt, 0);
420
421
 
422
+ rb_gc_unregister_address(&bind);
421
423
  free(bind_args_size);
422
424
  free(bind_args_data);
423
425
  free(bind_args_fmt);
@@ -22,12 +22,13 @@ lib_paths = %w(
22
22
  /sw/lib
23
23
  )
24
24
 
25
- (inc_paths << ENV['SPG_INCLUDE_DIRS']).compact!
26
- (lib_paths << ENV['SPG_LIBRARY_DIRS']).compact!
25
+ uuid_inc, uuid_lib = dir_config('uuid', '/usr/include/uuid', '/usr/lib')
26
+ libpq_inc, libpq_lib = dir_config('postgresql')
27
27
 
28
- find_header('libpq-fe.h', *inc_paths) or raise 'unable to locate postgresql headers set SPG_INCLUDE_DIRS'
29
- find_header('uuid/uuid.h', *inc_paths) or raise 'unable to locate uuid headers set SPG_INCLUDE_DIRS'
28
+ find_header 'uuid/uuid.h', *inc_paths.dup.unshift(uuid_inc).compact
29
+ find_header 'libpq-fe.h', *inc_paths.dup.unshift(libpq_inc).compact
30
+
31
+ find_library 'uuid', 'main', *lib_paths.dup.unshift(uuid_lib).compact
32
+ find_library 'pq', 'main', *lib_paths.dup.unshift(libpq_lib).compact
30
33
 
31
- find_library('pq', 'main', *lib_paths) or raise 'unable to locate postgresql lib set SPG_LIBRARY_DIRS'
32
- find_library('uuid','main', *lib_paths) or raise 'unable to locate uuid lib set SPG_LIBRARY_DIRS'
33
34
  create_makefile('swift_db_postgres_ext')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift-db-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
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-07-31 00:00:00.000000000 Z
12
+ date: 2012-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -35,13 +35,13 @@ extensions:
35
35
  - ext/swift/db/postgres/extconf.rb
36
36
  extra_rdoc_files: []
37
37
  files:
38
- - ext/swift/db/postgres/result.c
39
38
  - ext/swift/db/postgres/datetime.c
39
+ - ext/swift/db/postgres/result.c
40
40
  - ext/swift/db/postgres/adapter.c
41
+ - ext/swift/db/postgres/statement.c
41
42
  - ext/swift/db/postgres/typecast.c
42
43
  - ext/swift/db/postgres/common.c
43
44
  - ext/swift/db/postgres/main.c
44
- - ext/swift/db/postgres/statement.c
45
45
  - ext/swift/db/postgres/typecast.h
46
46
  - ext/swift/db/postgres/common.h
47
47
  - ext/swift/db/postgres/datetime.h