pg 0.18.2 → 0.18.4
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ChangeLog +368 -2
- data/History.rdoc +25 -0
- data/README-Windows.rdoc +15 -26
- data/README.rdoc +4 -1
- data/Rakefile +17 -5
- data/Rakefile.cross +41 -20
- data/ext/extconf.rb +1 -0
- data/ext/pg_binary_decoder.c +3 -1
- data/ext/pg_binary_encoder.c +7 -5
- data/ext/pg_connection.c +5 -5
- data/ext/pg_text_decoder.c +3 -1
- data/ext/pg_text_encoder.c +4 -1
- data/ext/pg_type_map.c +7 -7
- data/ext/pg_type_map_by_column.c +7 -7
- data/ext/util.c +2 -2
- data/lib/pg/basic_type_mapping.rb +35 -35
- data/lib/pg/text_decoder.rb +3 -1
- data/lib/pg.rb +2 -2
- data/spec/helpers.rb +1 -1
- data/spec/pg/basic_type_mapping_spec.rb +4 -4
- data/spec/pg/connection_spec.rb +11 -2
- data/spec/pg/type_spec.rb +9 -0
- data.tar.gz.sig +0 -0
- metadata +20 -10
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e802023c7320274316216de2f75c7bc54459a23
|
|
4
|
+
data.tar.gz: c07502af262fe81db01d5c66d9519938ff6f9038
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: befad3519208bb8149a222cc231542289da851c6c5a3b538f487c833755818bfb956ebc149a3f1042002b71ea79925718857ffdcaa9d4228a6f5250a4d6d0100
|
|
7
|
+
data.tar.gz: 5e963d5cad53bf673913c9f9c399e1337bceda26901b8a2fb54b34a39224a7600d95ad8f69d5f8deb370d38637b6b9c0da634003c68926276246f4408174b12e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/ChangeLog
CHANGED
|
@@ -1,8 +1,374 @@
|
|
|
1
|
+
2015-11-13 Michael Granger <ged@FaerieMUD.org>
|
|
2
|
+
|
|
3
|
+
* .hgignore:
|
|
4
|
+
Ignore some build artifacts
|
|
5
|
+
[f4bd9e53ccab] [tip]
|
|
6
|
+
|
|
7
|
+
* Rakefile:
|
|
8
|
+
Only use fivefish formatter when building from repo
|
|
9
|
+
[6161d8eeb3f1]
|
|
10
|
+
|
|
11
|
+
2015-11-13 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
12
|
+
|
|
13
|
+
* History.rdoc:
|
|
14
|
+
Update History.rdoc regarding PR#22.
|
|
15
|
+
[e4a8a1d41104]
|
|
16
|
+
|
|
17
|
+
* Merge ../ruby-pg.git.bare
|
|
18
|
+
[810c1e4dad4d]
|
|
19
|
+
|
|
20
|
+
2015-10-08 Lars Kanis <larskanis@gmail.com>
|
|
21
|
+
|
|
22
|
+
* README.rdoc:
|
|
23
|
+
Fix link to appveyor CI tests in the README.
|
|
24
|
+
[604f4dd3d5bd]
|
|
25
|
+
|
|
26
|
+
2015-11-04 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
27
|
+
|
|
28
|
+
* ext/pg_binary_encoder.c:
|
|
29
|
+
Merged in t-richards/ruby-pg/jemalloc-native-ext (pull request #22)
|
|
30
|
+
|
|
31
|
+
Fix build against jemalloc 4.0.0
|
|
32
|
+
[72168db5fb7b]
|
|
33
|
+
|
|
34
|
+
2015-09-10 Tom Richards <tom@tomrichards.net>
|
|
35
|
+
|
|
36
|
+
* ext/pg_binary_encoder.c:
|
|
37
|
+
Fix build against jemalloc 4.0.0
|
|
38
|
+
[fe05106909f7] <jemalloc-native-ext>
|
|
39
|
+
|
|
40
|
+
2015-09-24 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
41
|
+
|
|
42
|
+
* History.rdoc:
|
|
43
|
+
Add latest changes to History.rdoc.
|
|
44
|
+
[11b978b08d63]
|
|
45
|
+
|
|
46
|
+
* History.rdoc:
|
|
47
|
+
Add missing entry in History.rdoc.
|
|
48
|
+
|
|
49
|
+
This fixes bitbucket issue #225 : https://bitbucket.org/ged/ruby-
|
|
50
|
+
pg/issues/225
|
|
51
|
+
[132d674d999f]
|
|
52
|
+
|
|
53
|
+
* Merge ../ruby-pg.git.bare
|
|
54
|
+
[479799a98cfa]
|
|
55
|
+
|
|
56
|
+
* ext/pg_text_encoder.c, spec/pg/connection_spec.rb,
|
|
57
|
+
spec/pg/type_spec.rb:
|
|
58
|
+
Avoid segfault, when quote_ident is called with Array containing
|
|
59
|
+
non-strings.
|
|
60
|
+
|
|
61
|
+
This fixes bitbucket issue #226 : https://bitbucket.org/ged/ruby-
|
|
62
|
+
pg/issues/226
|
|
63
|
+
[4f0bd19e9111]
|
|
64
|
+
|
|
65
|
+
2015-09-08 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
66
|
+
|
|
67
|
+
* Merge pull request #10 from PuzzleFlow/master
|
|
68
|
+
|
|
69
|
+
Fixing compilation problems with Microsoft Visual Studio 2008.
|
|
70
|
+
[dfb62954f2d6]
|
|
71
|
+
|
|
72
|
+
2015-09-08 jfali <jfali@puzzleflow.com>
|
|
73
|
+
|
|
74
|
+
* ext/extconf.rb, ext/pg_binary_decoder.c, ext/pg_binary_encoder.c,
|
|
75
|
+
ext/pg_text_decoder.c, ext/pg_text_encoder.c, ext/pg_type_map.c,
|
|
76
|
+
ext/pg_type_map_by_column.c:
|
|
77
|
+
Fixing compilation problems with Microsoft Visual Studio 2008.
|
|
78
|
+
- inttypes.h is not available in MSVC 2008
|
|
79
|
+
- Structs members must be initialized implicitly
|
|
80
|
+
[fcf731d3dff7]
|
|
81
|
+
|
|
82
|
+
2015-09-07 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
83
|
+
|
|
84
|
+
* README.rdoc:
|
|
85
|
+
Merge pull request #8 from gitter-badger/gitter-badge
|
|
86
|
+
|
|
87
|
+
Add a Gitter chat badge to README.rdoc
|
|
88
|
+
[ab4d5656abce]
|
|
89
|
+
|
|
90
|
+
2015-03-09 The Gitter Badger <badger@gitter.im>
|
|
91
|
+
|
|
92
|
+
* README.rdoc:
|
|
93
|
+
Added Gitter badge
|
|
94
|
+
[beb02a90f948]
|
|
95
|
+
|
|
96
|
+
2015-09-03 Michael Granger <ged@FaerieMUD.org>
|
|
97
|
+
|
|
98
|
+
* .hgtags:
|
|
99
|
+
Added tag v0.18.3 for changeset 01c42c68797e
|
|
100
|
+
[4c8df76aff6f]
|
|
101
|
+
|
|
102
|
+
* .hgsigs:
|
|
103
|
+
Added signature for changeset 57291f1e96b9
|
|
104
|
+
[01c42c68797e] [v0.18.3]
|
|
105
|
+
|
|
106
|
+
* .hoerc:
|
|
107
|
+
Exclude some generated files from the Manifest
|
|
108
|
+
[57291f1e96b9]
|
|
109
|
+
|
|
110
|
+
* History.rdoc, lib/pg.rb:
|
|
111
|
+
Bump patch version, update history
|
|
112
|
+
[3b49541c9f12]
|
|
113
|
+
|
|
114
|
+
2015-09-01 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
115
|
+
|
|
116
|
+
* lib/pg/text_decoder.rb:
|
|
117
|
+
Add missing require
|
|
118
|
+
[d0ba6a2cb10f]
|
|
119
|
+
|
|
120
|
+
* Merge pull request #9 from ramfjord/date-decoder-return-dates
|
|
121
|
+
|
|
122
|
+
Date decoder to return real Dates
|
|
123
|
+
[676def89b826]
|
|
124
|
+
|
|
125
|
+
2015-06-21 Thomas Ramfjord <thomas.ramfjord@gmail.com>
|
|
126
|
+
|
|
127
|
+
* lib/pg/text_decoder.rb, spec/pg/basic_type_mapping_spec.rb:
|
|
128
|
+
modified TextDecoder::Date to return an actual ruby Date instead of
|
|
129
|
+
a Time
|
|
130
|
+
[c50593d12ba2]
|
|
131
|
+
|
|
132
|
+
2015-08-20 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
133
|
+
|
|
134
|
+
* Rakefile:
|
|
135
|
+
Add include for Hoe::MercurialHelpers as a temporary solution for
|
|
136
|
+
the error:
|
|
137
|
+
|
|
138
|
+
Packaging tasks require the hoe-mercurial plugin (gem install hoe-
|
|
139
|
+
mercurial)
|
|
140
|
+
[a84f83ff5b31]
|
|
141
|
+
|
|
142
|
+
* History.rdoc:
|
|
143
|
+
Update History.rdoc
|
|
144
|
+
[cadfac537e73]
|
|
145
|
+
|
|
146
|
+
* Merge branch 'master' of github.com:larskanis/ruby-pg
|
|
147
|
+
[d27d6d5a6545]
|
|
148
|
+
|
|
149
|
+
* README.rdoc:
|
|
150
|
+
Add Appveyor status badge to the README.
|
|
151
|
+
[c9637c6efcfb]
|
|
152
|
+
|
|
153
|
+
* appveyor.yml:
|
|
154
|
+
Use 9.3 because 9.0, 9.1 and 9.2 segfault in PG.init_openssl
|
|
155
|
+
[158f6649b7b8]
|
|
156
|
+
|
|
157
|
+
* spec/pg/connection_spec.rb:
|
|
158
|
+
Skip conn#host test on Windows-x64, because it segfaults, currently.
|
|
159
|
+
[04110aad7fc6]
|
|
160
|
+
|
|
161
|
+
* spec/pg/connection_spec.rb:
|
|
162
|
+
libpq on Windows doesn't respect the PGPORT env variable, so we
|
|
163
|
+
accept both.
|
|
164
|
+
[b4b666011f3f]
|
|
165
|
+
|
|
166
|
+
* spec/helpers.rb:
|
|
167
|
+
Older versions of PostgreSQL don't have a pid column, so this could
|
|
168
|
+
raise an exception: TypeError: can't convert nil into Integer
|
|
169
|
+
[48f1145fa631]
|
|
170
|
+
|
|
171
|
+
* Rakefile.cross:
|
|
172
|
+
Update OpenSSL version for Windows cross build.
|
|
173
|
+
[be6b75fef0ff]
|
|
174
|
+
|
|
175
|
+
* appveyor.yml:
|
|
176
|
+
Add CI-tests on appveyor.
|
|
177
|
+
[c2dc9e491853]
|
|
178
|
+
|
|
179
|
+
2015-06-29 Lars Kanis <kanis@comcard.de>
|
|
180
|
+
|
|
181
|
+
* History.rdoc:
|
|
182
|
+
Merge branch 'master' of https://github.com/larskanis/ruby-pg
|
|
183
|
+
|
|
184
|
+
Conflicts: History.rdoc
|
|
185
|
+
[affb47533d82]
|
|
186
|
+
|
|
187
|
+
* History.rdoc, ext/util.c, spec/pg/type_spec.rb:
|
|
188
|
+
Fix data type resulting in wrong base64 encoding.
|
|
189
|
+
[5fb9170f6a7d]
|
|
190
|
+
|
|
191
|
+
2015-06-17 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
192
|
+
|
|
193
|
+
* Gemfile, Rakefile, Rakefile.cross:
|
|
194
|
+
Update versions of rake-compiler-dock, OpenSSL and PostgreSQL.
|
|
195
|
+
[10c6b496314c]
|
|
196
|
+
|
|
197
|
+
2015-06-12 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
198
|
+
|
|
199
|
+
* Rakefile.cross:
|
|
200
|
+
Update OpenSSL and PostgreSQL versions for cross build.
|
|
201
|
+
[02094cca1cf8]
|
|
202
|
+
|
|
203
|
+
2015-06-11 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
204
|
+
|
|
205
|
+
* History.rdoc, README-Windows.rdoc:
|
|
206
|
+
Update README-Windows in regards to rake-compiler-dock.
|
|
207
|
+
[4d9fd821ec1e]
|
|
208
|
+
|
|
209
|
+
2015-06-09 Lars Kanis <kanis@comcard.de>
|
|
210
|
+
|
|
211
|
+
* Rakefile.cross:
|
|
212
|
+
Cross build: Ensure ChangeLog file is built on the host side before
|
|
213
|
+
entering the docker container.
|
|
214
|
+
[d32412acff38]
|
|
215
|
+
|
|
216
|
+
* Rakefile.cross:
|
|
217
|
+
Cross build: Add workaround for missing symlink support on Windows.
|
|
218
|
+
[52bb3eef00f0]
|
|
219
|
+
|
|
220
|
+
* Rakefile.cross:
|
|
221
|
+
Explicitly set the gcc-toolchain, instead of deriving from the rake-
|
|
222
|
+
compiler config.
|
|
223
|
+
|
|
224
|
+
Now, that we use the libpq.dll (instead of static linking), we can
|
|
225
|
+
mix the gcc-toolchains. So we better build the dll with the newer
|
|
226
|
+
mingw-w64 toolchain (instead of the old mingw32) and build only the
|
|
227
|
+
extension for ruby-1.9 with the old mingw32-gcc.
|
|
228
|
+
[b3d169fa189b]
|
|
229
|
+
|
|
230
|
+
* Merge https://github.com/ged/ruby-pg
|
|
231
|
+
[5aeb99dda0ca]
|
|
232
|
+
|
|
233
|
+
2015-05-25 Michael Granger <ged@FaerieMUD.org>
|
|
234
|
+
|
|
235
|
+
* lib/pg/basic_type_mapping.rb:
|
|
236
|
+
Whitespace fixes
|
|
237
|
+
[57cfbc230597]
|
|
238
|
+
|
|
239
|
+
2015-05-14 Michael Granger <ged@FaerieMUD.org>
|
|
240
|
+
|
|
241
|
+
* .hgtags:
|
|
242
|
+
Added tag v0.18.2 for changeset 22a361201fd1
|
|
243
|
+
[00d6997551e6]
|
|
244
|
+
|
|
245
|
+
* .hgsigs:
|
|
246
|
+
Added signature for changeset 7d31b04e7913
|
|
247
|
+
[d77ab8ab870e]
|
|
248
|
+
|
|
249
|
+
* History.rdoc, lib/pg.rb:
|
|
250
|
+
Bump patch version, update History
|
|
251
|
+
[fa56690fe72d]
|
|
252
|
+
|
|
253
|
+
* Merged with git branch.
|
|
254
|
+
[9b2c80df821d]
|
|
255
|
+
|
|
256
|
+
2015-06-09 Lars Kanis <kanis@comcard.de>
|
|
257
|
+
|
|
258
|
+
* Rakefile.cross:
|
|
259
|
+
Cross build: Copy gem signing key and certs to be accessable from
|
|
260
|
+
the docker container
|
|
261
|
+
[c5382a785f4d]
|
|
262
|
+
|
|
263
|
+
2015-06-08 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
264
|
+
|
|
265
|
+
* Merged
|
|
266
|
+
[3d56a65c78c5]
|
|
267
|
+
|
|
268
|
+
* Gemfile, Rakefile, Rakefile.cross:
|
|
269
|
+
Add rake task 'gem:windows' which makes use of the new rake-
|
|
270
|
+
compiler-dock.
|
|
271
|
+
|
|
272
|
+
Also update the Gemfile per 'rake bundler:gemfile' .
|
|
273
|
+
[fafadd62cc6d]
|
|
274
|
+
|
|
275
|
+
* Rakefile.cross:
|
|
276
|
+
Cross build: Work around missing dependency to libcommon in
|
|
277
|
+
PostgreSQL-9.4.0
|
|
278
|
+
[630a22437026]
|
|
279
|
+
|
|
280
|
+
2015-05-25 Michael Granger <ged@FaerieMUD.org>
|
|
281
|
+
|
|
282
|
+
* ext/pg_connection.c:
|
|
283
|
+
Change instance_of checks to kind_of for subclassing [#220]
|
|
284
|
+
[eb4d3c003bd6] [github/kind-of-fix]
|
|
285
|
+
|
|
286
|
+
* lib/pg/basic_type_mapping.rb:
|
|
287
|
+
Whitespace fixes
|
|
288
|
+
[4a4368e30bcf] [github/master]
|
|
289
|
+
|
|
290
|
+
2015-05-14 Michael Granger <ged@FaerieMUD.org>
|
|
291
|
+
|
|
292
|
+
* .hgtags:
|
|
293
|
+
Added tag v0.18.2 for changeset 22a361201fd1
|
|
294
|
+
[94e26b472c78]
|
|
295
|
+
|
|
296
|
+
* .hgsigs:
|
|
297
|
+
Added signature for changeset 7d31b04e7913
|
|
298
|
+
[22a361201fd1] [v0.18.2]
|
|
299
|
+
|
|
300
|
+
* History.rdoc, lib/pg.rb:
|
|
301
|
+
Bump patch version, update History
|
|
302
|
+
[7d31b04e7913]
|
|
303
|
+
|
|
304
|
+
* Merged with git branch.
|
|
305
|
+
[45a1753da19a]
|
|
306
|
+
|
|
307
|
+
* .rvm.gems:
|
|
308
|
+
Bump the rvm gemset gem versions
|
|
309
|
+
[8050020330d8]
|
|
310
|
+
|
|
311
|
+
2015-03-13 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
312
|
+
|
|
313
|
+
* ext/pg_text_encoder.c, ext/util.c, ext/util.h:
|
|
314
|
+
Avoid possible symbol name clash when linking againt static libpq.
|
|
315
|
+
|
|
316
|
+
This should fix issue #209 .
|
|
317
|
+
[2334a1bc38e6]
|
|
318
|
+
|
|
319
|
+
2015-02-11 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
320
|
+
|
|
321
|
+
* ext/pg.c, spec/pg/connection_spec.rb:
|
|
322
|
+
Merge from git branch.
|
|
323
|
+
[a7261eb6796f]
|
|
324
|
+
|
|
325
|
+
* ext/pg.h, ext/pg_text_decoder.c:
|
|
326
|
+
Merge branch 'non-c99-compiler'
|
|
327
|
+
[7e8f1e4da59d]
|
|
328
|
+
|
|
329
|
+
2015-02-06 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
330
|
+
|
|
331
|
+
* ext/extconf.rb, ext/pg.h, ext/pg_result.c, ext/pg_text_decoder.c,
|
|
332
|
+
ext/pg_type_map_by_mri_type.c:
|
|
333
|
+
Use fixed size arrays in case the compiler doesn't support C99
|
|
334
|
+
variable length arrays.
|
|
335
|
+
|
|
336
|
+
This is notably the MSVC compiler.
|
|
337
|
+
|
|
338
|
+
Note: The MSVC build environment is currently not tested on a
|
|
339
|
+
regular base, so is not fully supported.
|
|
340
|
+
[a08290a78221]
|
|
341
|
+
|
|
342
|
+
2015-02-11 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
343
|
+
|
|
344
|
+
* ext/pg_connection.c:
|
|
345
|
+
Replace quote_ident implementation with that of
|
|
346
|
+
PG::TextEncoder::Identifier .
|
|
347
|
+
|
|
348
|
+
This allowes quoation of array of strings in addition to plain
|
|
349
|
+
strings and removes duplicated code.
|
|
350
|
+
|
|
351
|
+
It also removes the 63 byte limitation and therefore obsolets pull
|
|
352
|
+
request #21 https://bitbucket.org/ged/ruby-pg/pull-request/21
|
|
353
|
+
[b8ac29b020ee]
|
|
354
|
+
|
|
355
|
+
* ext/pg.c, ext/pg.h, ext/pg_text_decoder.c, ext/pg_text_encoder.c,
|
|
356
|
+
spec/pg/connection_spec.rb, spec/pg/type_spec.rb:
|
|
357
|
+
Derive PG::TextDecoder::Identifier from PG::SimpleDecoder instead of
|
|
358
|
+
CompositeDecoder
|
|
359
|
+
|
|
360
|
+
.. and equally for Encoder.
|
|
361
|
+
|
|
362
|
+
Identifiers are strings, so there is no good reason to compose it
|
|
363
|
+
from other element types. This change allows a faster quoting
|
|
364
|
+
implementation.
|
|
365
|
+
[55ec58cabad4]
|
|
366
|
+
|
|
1
367
|
2015-05-14 Michael Granger <ged@FaerieMUD.org>
|
|
2
368
|
|
|
3
369
|
* .rvmrc:
|
|
4
370
|
Bump default rvm Ruby to 2.2
|
|
5
|
-
[128b075d5800]
|
|
371
|
+
[128b075d5800]
|
|
6
372
|
|
|
7
373
|
2015-03-13 Lars Kanis <lars@greiz-reinsdorf.de>
|
|
8
374
|
|
|
@@ -64,7 +430,7 @@
|
|
|
64
430
|
|
|
65
431
|
* README.rdoc, ext/pg.c:
|
|
66
432
|
Update copyright notices
|
|
67
|
-
[447962e0dcba]
|
|
433
|
+
[447962e0dcba]
|
|
68
434
|
|
|
69
435
|
* spec/pg/connection_spec.rb:
|
|
70
436
|
Whitespace fixes
|
data/History.rdoc
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
== v0.18.4 [2015-11-13] Michael Granger <ged@FaerieMUD.org>
|
|
2
|
+
|
|
3
|
+
Enhancements:
|
|
4
|
+
- Fixing compilation problems with Microsoft Visual Studio 2008. GH #10
|
|
5
|
+
- Avoid name clash with xcode and jemalloc. PR#22, PR#23
|
|
6
|
+
|
|
7
|
+
Bugfixes:
|
|
8
|
+
- Avoid segfault, when quote_ident or TextEncoder::Identifier
|
|
9
|
+
is called with Array containing non-strings. #226
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
== v0.18.3 [2015-09-03] Michael Granger <ged@FaerieMUD.org>
|
|
13
|
+
|
|
14
|
+
Enhancements:
|
|
15
|
+
- Use rake-compiler-dock to build windows gems easily.
|
|
16
|
+
- Add CI-tests on appveyor and fix test cases accordingly.
|
|
17
|
+
|
|
18
|
+
Bugfixes:
|
|
19
|
+
- Fix data type resulting in wrong base64 encoding.
|
|
20
|
+
- Change instance_of checks to kind_of for subclassing. #220
|
|
21
|
+
- TextDecoder::Date returns an actual Ruby Date instead of a Time
|
|
22
|
+
(thanks to Thomas Ramfjord)
|
|
23
|
+
|
|
24
|
+
|
|
1
25
|
== v0.18.2 [2015-05-14] Michael Granger <ged@FaerieMUD.org>
|
|
2
26
|
|
|
3
27
|
Enhancements:
|
|
4
28
|
|
|
5
29
|
- Allow URI connection string (thanks to Chris Bandy)
|
|
30
|
+
- Allow Array type parameter to conn.quote_ident
|
|
6
31
|
|
|
7
32
|
Bugfixes:
|
|
8
33
|
|
data/README-Windows.rdoc
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
In order to build this extension on MS Windows you will need a couple things.
|
|
4
4
|
|
|
5
|
-
First, a compiler. For the one click installer this means you should
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
First, a compiler. For the one click installer this means you should use
|
|
6
|
+
the DevKit or the compiler that comes with cygwin if you're building on that
|
|
7
|
+
platform.
|
|
8
8
|
|
|
9
9
|
If you've built Ruby yourself, you should use the same compiler to build
|
|
10
10
|
this library that you used to build Ruby.
|
|
@@ -29,34 +29,23 @@ Adjust your path accordingly. BE SURE TO USE THE SHORT PATH NAMES! If you
|
|
|
29
29
|
try to use a path with spaces in it, the nmake.exe program will choke.
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
==
|
|
32
|
+
== Building binary 'pg' gems for MS Windows
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
sources. There are no runtime dependencies to any but the standard Windows
|
|
38
|
-
DLLs.
|
|
34
|
+
Binary gems for windows can be built on Linux, OS-X and even on Windows
|
|
35
|
+
with the help of docker. This is how regular windows gems are built for
|
|
36
|
+
rubygems.org .
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
To do this, install boot2docker [on Windows](https://github.com/boot2docker/windows-installer/releases)
|
|
39
|
+
or [on OS X](https://github.com/boot2docker/osx-installer/releases) and make
|
|
40
|
+
sure it is started. A native Docker installation is best on Linux.
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
Then run:
|
|
45
43
|
|
|
46
|
-
rake
|
|
47
|
-
rake-compiler cross-ruby VERSION=1.9.2-p290
|
|
44
|
+
rake gem:windows
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
or with custom versions:
|
|
54
|
-
|
|
55
|
-
rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.2 \
|
|
56
|
-
OPENSSL_VERSION=1.0.0e POSTGRESQL_VERSION=9.1.1
|
|
57
|
-
|
|
58
|
-
If everything works, there should be pg-VERSION-x86-mingw32.gem in the pkg
|
|
59
|
-
directory.
|
|
46
|
+
This will download a docker image suited for building windows gems, and it
|
|
47
|
+
will download and build OpenSSL and PostgreSQL. Finally the gem is built
|
|
48
|
+
containing binaries for all supported ruby versions.
|
|
60
49
|
|
|
61
50
|
|
|
62
51
|
== Reporting Problems
|
data/README.rdoc
CHANGED
|
@@ -4,6 +4,8 @@ home :: https://bitbucket.org/ged/ruby-pg
|
|
|
4
4
|
mirror :: https://github.com/ged/ruby-pg
|
|
5
5
|
docs :: http://deveiate.org/code/pg
|
|
6
6
|
|
|
7
|
+
{<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/ged/ruby-pg">}[https://gitter.im/ged/ruby-pg?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
== Description
|
|
9
11
|
|
|
@@ -29,7 +31,8 @@ A small example usage:
|
|
|
29
31
|
|
|
30
32
|
== Build Status
|
|
31
33
|
|
|
32
|
-
{<img src="https://travis-ci.org/ged/ruby-pg.png?branch=master" alt="Build Status" />}[https://travis-ci.org/ged/ruby-pg]
|
|
34
|
+
{<img src="https://travis-ci.org/ged/ruby-pg.png?branch=master" alt="Build Status Travis-CI" />}[https://travis-ci.org/ged/ruby-pg]
|
|
35
|
+
{<img src="https://ci.appveyor.com/api/projects/status/at4g4swb2cd4xji7/branch/master?svg=true" alt="Build Status Appveyor" />}[https://ci.appveyor.com/project/ged/ruby-pg]
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
== Requirements
|
data/Rakefile
CHANGED
|
@@ -61,6 +61,7 @@ $hoespec = Hoe.spec 'pg' do
|
|
|
61
61
|
self.developer 'Lars Kanis', 'lars@greiz-reinsdorf.de'
|
|
62
62
|
|
|
63
63
|
self.dependency 'rake-compiler', '~> 0.9', :developer
|
|
64
|
+
self.dependency 'rake-compiler-dock', '~> 0.3', :developer
|
|
64
65
|
self.dependency 'hoe', '~> 3.12', :developer
|
|
65
66
|
self.dependency 'hoe-deveiate', '~> 0.6', :developer
|
|
66
67
|
self.dependency 'hoe-bundler', '~> 1.0', :developer
|
|
@@ -73,11 +74,6 @@ $hoespec = Hoe.spec 'pg' do
|
|
|
73
74
|
|
|
74
75
|
self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
|
|
75
76
|
self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
|
|
76
|
-
self.spec_extras[:rdoc_options] = [
|
|
77
|
-
'-f', 'fivefish',
|
|
78
|
-
'-t', 'pg: The Ruby Interface to PostgreSQL',
|
|
79
|
-
'-m', 'README.rdoc',
|
|
80
|
-
]
|
|
81
77
|
|
|
82
78
|
self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
|
|
83
79
|
end
|
|
@@ -142,6 +138,21 @@ Rake::ExtensionTask.new do |ext|
|
|
|
142
138
|
end
|
|
143
139
|
|
|
144
140
|
|
|
141
|
+
# Use the fivefish formatter for docs generated from development checkout
|
|
142
|
+
if File.directory?( '.hg' )
|
|
143
|
+
require 'rdoc/task'
|
|
144
|
+
|
|
145
|
+
Rake::Task[ 'docs' ].clear
|
|
146
|
+
RDoc::Task.new( 'docs' ) do |rdoc|
|
|
147
|
+
rdoc.main = "README.rdoc"
|
|
148
|
+
rdoc.rdoc_files.include( "*.rdoc", "ChangeLog", "lib/**/*.rb", 'ext/**/*.{c,h}' )
|
|
149
|
+
rdoc.generator = :fivefish
|
|
150
|
+
rdoc.title = "PG: The Ruby PostgreSQL Driver"
|
|
151
|
+
rdoc.rdoc_dir = 'doc'
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
|
|
145
156
|
# Make the ChangeLog update if the repo has changed since it was last built
|
|
146
157
|
file '.hg/branch' do
|
|
147
158
|
warn "WARNING: You need the Mercurial repo to update the ChangeLog"
|
|
@@ -150,6 +161,7 @@ file 'ChangeLog' do |task|
|
|
|
150
161
|
if File.exist?('.hg/branch')
|
|
151
162
|
$stderr.puts "Updating the changelog..."
|
|
152
163
|
begin
|
|
164
|
+
include Hoe::MercurialHelpers
|
|
153
165
|
content = make_changelog()
|
|
154
166
|
rescue NameError
|
|
155
167
|
abort "Packaging tasks require the hoe-mercurial plugin (gem install hoe-mercurial)"
|
data/Rakefile.cross
CHANGED
|
@@ -21,17 +21,28 @@ end
|
|
|
21
21
|
class CrossLibrary < OpenStruct
|
|
22
22
|
include Rake::DSL
|
|
23
23
|
|
|
24
|
-
def initialize(for_platform, openssl_config)
|
|
24
|
+
def initialize(for_platform, openssl_config, toolchain)
|
|
25
25
|
super()
|
|
26
26
|
|
|
27
27
|
self.for_platform = for_platform
|
|
28
28
|
self.openssl_config = openssl_config
|
|
29
|
+
self.host_platform = toolchain
|
|
29
30
|
|
|
30
31
|
# Cross-compilation constants
|
|
31
|
-
self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.
|
|
32
|
-
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.2d'
|
|
33
|
+
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.4.4'
|
|
34
|
+
|
|
35
|
+
# Check if symlinks work in the current working directory.
|
|
36
|
+
# This fails, if rake-compiler-dock is running on a Windows box.
|
|
37
|
+
begin
|
|
38
|
+
FileUtils.rm_f '.test_symlink'
|
|
39
|
+
FileUtils.ln_s '/', '.test_symlink'
|
|
40
|
+
rescue SystemCallError
|
|
41
|
+
# Symlinks don't work -> use home directory instead
|
|
42
|
+
self.compile_home = Pathname( "~/.ruby-pg-build" ).expand_path
|
|
43
|
+
else
|
|
44
|
+
self.compile_home = Pathname( "./build" ).expand_path
|
|
45
|
+
end
|
|
35
46
|
self.static_sourcesdir = compile_home + 'sources'
|
|
36
47
|
self.static_builddir = compile_home + 'builds' + for_platform
|
|
37
48
|
|
|
@@ -67,17 +78,6 @@ class CrossLibrary < OpenStruct
|
|
|
67
78
|
self.postgresql_lib = static_postgresql_libdir + 'libpq.dll'
|
|
68
79
|
self.postgresql_patches = Rake::FileList[ (MISCDIR + "postgresql-#{postgresql_version}.*.patch").to_s ]
|
|
69
80
|
|
|
70
|
-
# Use rake-compilers config.yml to determine the toolchain that was used
|
|
71
|
-
# to build Ruby for this platform.
|
|
72
|
-
self.host_platform = begin
|
|
73
|
-
config_file = YAML.load_file(File.expand_path("~/.rake-compiler/config.yml"))
|
|
74
|
-
_, rbfile = config_file.find{|key, fname| key.start_with?("rbconfig-#{for_platform}-") }
|
|
75
|
-
IO.read(rbfile).match(/CONFIG\["CC"\] = "(.*)"/)[1].sub(/\-gcc/, '')
|
|
76
|
-
rescue
|
|
77
|
-
nil
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
|
|
81
81
|
# clean intermediate files and folders
|
|
82
82
|
CLEAN.include( static_builddir.to_s )
|
|
83
83
|
|
|
@@ -217,6 +217,11 @@ class CrossLibrary < OpenStruct
|
|
|
217
217
|
|
|
218
218
|
# make libpq.dll
|
|
219
219
|
task postgresql_lib => [ postgresql_global_makefile ] do |t|
|
|
220
|
+
# Work around missing dependency to libcommon in PostgreSQL-9.4.0
|
|
221
|
+
chdir( static_postgresql_srcdir + "common" ) do
|
|
222
|
+
sh 'make', "-j#{NUM_CPUS}"
|
|
223
|
+
end
|
|
224
|
+
|
|
220
225
|
chdir( postgresql_lib.dirname ) do
|
|
221
226
|
sh 'make',
|
|
222
227
|
"-j#{NUM_CPUS}",
|
|
@@ -246,10 +251,10 @@ end
|
|
|
246
251
|
|
|
247
252
|
if File.exist?(File.expand_path("~/.rake-compiler/config.yml"))
|
|
248
253
|
CrossLibraries = [
|
|
249
|
-
['i386-mingw32', 'mingw'],
|
|
250
|
-
['x64-mingw32', 'mingw64'],
|
|
251
|
-
].map do |platform, openssl_config|
|
|
252
|
-
CrossLibrary.new platform, openssl_config
|
|
254
|
+
['i386-mingw32', 'mingw', 'i686-w64-mingw32'],
|
|
255
|
+
['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'],
|
|
256
|
+
].map do |platform, openssl_config, toolchain|
|
|
257
|
+
CrossLibrary.new platform, openssl_config, toolchain
|
|
253
258
|
end
|
|
254
259
|
else
|
|
255
260
|
$stderr.puts "Cross-compilation disabled -- rake-compiler not properly installed"
|
|
@@ -278,3 +283,19 @@ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
|
|
|
278
283
|
sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so"
|
|
279
284
|
end
|
|
280
285
|
end
|
|
286
|
+
|
|
287
|
+
desc "Build the windows binary gems"
|
|
288
|
+
task 'gem:windows' => ['ChangeLog'] do
|
|
289
|
+
require 'rake_compiler_dock'
|
|
290
|
+
|
|
291
|
+
# Copy gem signing key and certs to be accessable from the docker container
|
|
292
|
+
mkdir_p 'build/gem'
|
|
293
|
+
sh "cp ~/.gem/gem-*.pem build/gem/"
|
|
294
|
+
|
|
295
|
+
RakeCompilerDock.sh <<-EOT
|
|
296
|
+
mkdir ~/.gem &&
|
|
297
|
+
cp build/gem/gem-*.pem ~/.gem/ &&
|
|
298
|
+
bundle install &&
|
|
299
|
+
rake cross native gem RUBYOPT=--disable-rubygems RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2
|
|
300
|
+
EOT
|
|
301
|
+
end
|
data/ext/extconf.rb
CHANGED
|
@@ -92,6 +92,7 @@ $defs.push( "-DHAVE_ST_NOTIFY_EXTRA" ) if
|
|
|
92
92
|
|
|
93
93
|
# unistd.h confilicts with ruby/win32.h when cross compiling for win32 and ruby 1.9.1
|
|
94
94
|
have_header 'unistd.h'
|
|
95
|
+
have_header 'inttypes.h'
|
|
95
96
|
have_header 'ruby/st.h' or have_header 'st.h' or abort "pg currently requires the ruby/st.h header"
|
|
96
97
|
|
|
97
98
|
checking_for "C99 variable length arrays" do
|
data/ext/pg_binary_decoder.c
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_column_map.c - PG::ColumnMap class extension
|
|
3
|
-
* $Id: pg_binary_decoder.c,v
|
|
3
|
+
* $Id: pg_binary_decoder.c,v fcf731d3dff7 2015/09/08 12:25:06 jfali $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
#include "pg.h"
|
|
8
8
|
#include "util.h"
|
|
9
|
+
#ifdef HAVE_INTTYPES_H
|
|
9
10
|
#include <inttypes.h>
|
|
11
|
+
#endif
|
|
10
12
|
|
|
11
13
|
VALUE rb_mPG_BinaryDecoder;
|
|
12
14
|
|
data/ext/pg_binary_encoder.c
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_column_map.c - PG::ColumnMap class extension
|
|
3
|
-
* $Id: pg_binary_encoder.c,v
|
|
3
|
+
* $Id: pg_binary_encoder.c,v 72168db5fb7b 2015/11/04 16:13:42 lars $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
#include "pg.h"
|
|
8
8
|
#include "util.h"
|
|
9
|
+
#ifdef HAVE_INTTYPES_H
|
|
9
10
|
#include <inttypes.h>
|
|
11
|
+
#endif
|
|
10
12
|
|
|
11
13
|
VALUE rb_mPG_BinaryEncoder;
|
|
12
14
|
|
|
@@ -22,14 +24,14 @@ VALUE rb_mPG_BinaryEncoder;
|
|
|
22
24
|
static int
|
|
23
25
|
pg_bin_enc_boolean(t_pg_coder *conv, VALUE value, char *out, VALUE *intermediate)
|
|
24
26
|
{
|
|
25
|
-
char
|
|
27
|
+
char mybool;
|
|
26
28
|
switch(value){
|
|
27
|
-
case Qtrue :
|
|
28
|
-
case Qfalse :
|
|
29
|
+
case Qtrue : mybool = 1; break;
|
|
30
|
+
case Qfalse : mybool = 0; break;
|
|
29
31
|
default :
|
|
30
32
|
rb_raise( rb_eTypeError, "wrong data for binary boolean converter" );
|
|
31
33
|
}
|
|
32
|
-
if(out) *out =
|
|
34
|
+
if(out) *out = mybool;
|
|
33
35
|
return 1;
|
|
34
36
|
}
|
|
35
37
|
|
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 eb4d3c003bd6 2015/05/25 20:04:04 ged $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1534,7 +1534,7 @@ pgconn_s_escape(VALUE self, VALUE string)
|
|
|
1534
1534
|
Check_Type(string, T_STRING);
|
|
1535
1535
|
|
|
1536
1536
|
escaped = ALLOC_N(char, RSTRING_LEN(string) * 2 + 1);
|
|
1537
|
-
if(
|
|
1537
|
+
if( rb_obj_is_kind_of(self, rb_cPGconn) ) {
|
|
1538
1538
|
size = PQescapeStringConn(pg_get_pgconn(self), escaped,
|
|
1539
1539
|
RSTRING_PTR(string), RSTRING_LEN(string), &error);
|
|
1540
1540
|
if(error) {
|
|
@@ -1547,7 +1547,7 @@ pgconn_s_escape(VALUE self, VALUE string)
|
|
|
1547
1547
|
result = rb_str_new(escaped, size);
|
|
1548
1548
|
xfree(escaped);
|
|
1549
1549
|
OBJ_INFECT(result, string);
|
|
1550
|
-
PG_ENCODING_SET_NOCHECK(result, ENCODING_GET(
|
|
1550
|
+
PG_ENCODING_SET_NOCHECK(result, ENCODING_GET( rb_obj_is_kind_of(self, rb_cPGconn) ? self : string ));
|
|
1551
1551
|
|
|
1552
1552
|
return result;
|
|
1553
1553
|
}
|
|
@@ -1587,7 +1587,7 @@ pgconn_s_escape_bytea(VALUE self, VALUE str)
|
|
|
1587
1587
|
from = (unsigned char*)RSTRING_PTR(str);
|
|
1588
1588
|
from_len = RSTRING_LEN(str);
|
|
1589
1589
|
|
|
1590
|
-
if(
|
|
1590
|
+
if ( rb_obj_is_kind_of(self, rb_cPGconn) ) {
|
|
1591
1591
|
to = PQescapeByteaConn(pg_get_pgconn(self), from, from_len, &to_len);
|
|
1592
1592
|
} else {
|
|
1593
1593
|
to = PQescapeBytea( from, from_len, &to_len);
|
|
@@ -3031,7 +3031,7 @@ pgconn_s_quote_ident(VALUE self, VALUE in_str)
|
|
|
3031
3031
|
pg_text_enc_identifier(NULL, in_str, NULL, &ret);
|
|
3032
3032
|
|
|
3033
3033
|
OBJ_INFECT(ret, in_str);
|
|
3034
|
-
PG_ENCODING_SET_NOCHECK(ret, ENCODING_GET(
|
|
3034
|
+
PG_ENCODING_SET_NOCHECK(ret, ENCODING_GET( rb_obj_is_kind_of(self, rb_cPGconn) ? self : in_str ));
|
|
3035
3035
|
|
|
3036
3036
|
return ret;
|
|
3037
3037
|
}
|
data/ext/pg_text_decoder.c
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_text_decoder.c - PG::TextDecoder module
|
|
3
|
-
* $Id: pg_text_decoder.c,v
|
|
3
|
+
* $Id: pg_text_decoder.c,v fcf731d3dff7 2015/09/08 12:25:06 jfali $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
#include "pg.h"
|
|
32
32
|
#include "util.h"
|
|
33
|
+
#ifdef HAVE_INTTYPES_H
|
|
33
34
|
#include <inttypes.h>
|
|
35
|
+
#endif
|
|
34
36
|
|
|
35
37
|
VALUE rb_mPG_TextDecoder;
|
|
36
38
|
static ID s_id_decode;
|
data/ext/pg_text_encoder.c
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_text_encoder.c - PG::TextEncoder module
|
|
3
|
-
* $Id: pg_text_encoder.c,v
|
|
3
|
+
* $Id: pg_text_encoder.c,v 4f0bd19e9111 2015/09/24 18:55:11 lars $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
|
|
42
42
|
#include "pg.h"
|
|
43
43
|
#include "util.h"
|
|
44
|
+
#ifdef HAVE_INTTYPES_H
|
|
44
45
|
#include <inttypes.h>
|
|
46
|
+
#endif
|
|
45
47
|
#include <math.h>
|
|
46
48
|
|
|
47
49
|
VALUE rb_mPG_TextEncoder;
|
|
@@ -493,6 +495,7 @@ pg_text_enc_array_identifier(VALUE value, VALUE string, char *out)
|
|
|
493
495
|
for( i=0; i<nr_elems; i++){
|
|
494
496
|
VALUE entry = rb_ary_entry(value, i);
|
|
495
497
|
|
|
498
|
+
StringValue(entry);
|
|
496
499
|
out = quote_identifier(entry, string, out);
|
|
497
500
|
if( i < nr_elems-1 ){
|
|
498
501
|
out = pg_rb_str_ensure_capa( string, 1, out, NULL );
|
data/ext/pg_type_map.c
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_column_map.c - PG::ColumnMap class extension
|
|
3
|
-
* $Id: pg_type_map.c,v
|
|
3
|
+
* $Id: pg_type_map.c,v fcf731d3dff7 2015/09/08 12:25:06 jfali $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -54,12 +54,12 @@ pg_typemap_typecast_copy_get( t_typemap *p_typemap, VALUE field_str, int fieldno
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const struct pg_typemap_funcs pg_typemap_funcs = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
pg_typemap_fit_to_result,
|
|
58
|
+
pg_typemap_fit_to_query,
|
|
59
|
+
pg_typemap_fit_to_copy_get,
|
|
60
|
+
pg_typemap_result_value,
|
|
61
|
+
pg_typemap_typecast_query_param,
|
|
62
|
+
pg_typemap_typecast_copy_get
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
static VALUE
|
data/ext/pg_type_map_by_column.c
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* pg_column_map.c - PG::ColumnMap class extension
|
|
3
|
-
* $Id: pg_type_map_by_column.c,v
|
|
3
|
+
* $Id: pg_type_map_by_column.c,v fcf731d3dff7 2015/09/08 12:25:06 jfali $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -162,12 +162,12 @@ pg_tmbc_typecast_copy_get( t_typemap *p_typemap, VALUE field_str, int fieldno, i
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
const struct pg_typemap_funcs pg_tmbc_funcs = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
pg_tmbc_fit_to_result,
|
|
166
|
+
pg_tmbc_fit_to_query,
|
|
167
|
+
pg_tmbc_fit_to_copy_get,
|
|
168
|
+
pg_tmbc_result_value,
|
|
169
|
+
pg_tmbc_typecast_query_param,
|
|
170
|
+
pg_tmbc_typecast_copy_get
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
static void
|
data/ext/util.c
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* util.c - Utils for ruby-pg
|
|
3
|
-
* $Id: util.c,v
|
|
3
|
+
* $Id: util.c,v 5fb9170f6a7d 2015/06/29 11:15:12 kanis $
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ static const char base64_encode_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk
|
|
|
17
17
|
void
|
|
18
18
|
base64_encode( char *out, char *in, int len)
|
|
19
19
|
{
|
|
20
|
-
char *in_ptr = in + len;
|
|
20
|
+
unsigned char *in_ptr = (unsigned char *)in + len;
|
|
21
21
|
char *out_ptr = out + BASE64_ENCODED_SIZE(len);
|
|
22
22
|
int part_len = len % 3;
|
|
23
23
|
|
|
@@ -25,9 +25,9 @@ module PG::BasicTypeRegistry
|
|
|
25
25
|
|
|
26
26
|
# populate the enum types
|
|
27
27
|
_enums, leaves = leaves.partition { |row| row['typinput'] == 'enum_in' }
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
# enums.each do |row|
|
|
29
|
+
# coder_map[row['oid'].to_i] = OID::Enum.new
|
|
30
|
+
# end
|
|
31
31
|
|
|
32
32
|
# populate the base types
|
|
33
33
|
leaves.find_all { |row| coders_by_name.key?(row['typname']) }.each do |row|
|
|
@@ -41,9 +41,9 @@ module PG::BasicTypeRegistry
|
|
|
41
41
|
_records_by_oid = result.group_by { |row| row['oid'] }
|
|
42
42
|
|
|
43
43
|
# populate composite types
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
# nodes.each do |row|
|
|
45
|
+
# add_oid row, records_by_oid, coder_map
|
|
46
|
+
# end
|
|
47
47
|
|
|
48
48
|
if arraycoder
|
|
49
49
|
# populate array types
|
|
@@ -62,11 +62,11 @@ module PG::BasicTypeRegistry
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
# populate range types
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
# ranges.find_all { |row| coder_map.key? row['rngsubtype'].to_i }.each do |row|
|
|
66
|
+
# subcoder = coder_map[row['rngsubtype'].to_i]
|
|
67
|
+
# range = OID::Range.new subcoder
|
|
68
|
+
# coder_map[row['oid'].to_i] = range
|
|
69
|
+
# end
|
|
70
70
|
|
|
71
71
|
@coders = coder_map.values
|
|
72
72
|
@coders_by_name = @coders.inject({}){|h, t| h[t.name] = t; h }
|
|
@@ -154,46 +154,46 @@ module PG::BasicTypeRegistry
|
|
|
154
154
|
alias_type 0, 'int8', 'int2'
|
|
155
155
|
alias_type 0, 'oid', 'int2'
|
|
156
156
|
|
|
157
|
-
#
|
|
157
|
+
# register_type 0, 'numeric', OID::Decimal.new
|
|
158
158
|
register_type 0, 'text', PG::TextEncoder::String, PG::TextDecoder::String
|
|
159
159
|
alias_type 0, 'varchar', 'text'
|
|
160
160
|
alias_type 0, 'char', 'text'
|
|
161
161
|
alias_type 0, 'bpchar', 'text'
|
|
162
162
|
alias_type 0, 'xml', 'text'
|
|
163
163
|
|
|
164
|
-
#
|
|
165
|
-
#
|
|
166
|
-
#
|
|
167
|
-
#
|
|
168
|
-
#
|
|
169
|
-
#
|
|
170
|
-
#
|
|
164
|
+
# FIXME: why are we keeping these types as strings?
|
|
165
|
+
# alias_type 'tsvector', 'text'
|
|
166
|
+
# alias_type 'interval', 'text'
|
|
167
|
+
# alias_type 'macaddr', 'text'
|
|
168
|
+
# alias_type 'uuid', 'text'
|
|
169
|
+
#
|
|
170
|
+
# register_type 'money', OID::Money.new
|
|
171
171
|
# There is no PG::TextEncoder::Bytea, because it's simple and more efficient to send bytea-data
|
|
172
172
|
# in binary format, either with PG::BinaryEncoder::Bytea or in Hash param format.
|
|
173
173
|
register_type 0, 'bytea', nil, PG::TextDecoder::Bytea
|
|
174
174
|
register_type 0, 'bool', PG::TextEncoder::Boolean, PG::TextDecoder::Boolean
|
|
175
|
-
#
|
|
176
|
-
#
|
|
177
|
-
|
|
175
|
+
# register_type 'bit', OID::Bit.new
|
|
176
|
+
# register_type 'varbit', OID::Bit.new
|
|
177
|
+
|
|
178
178
|
register_type 0, 'float4', PG::TextEncoder::Float, PG::TextDecoder::Float
|
|
179
179
|
alias_type 0, 'float8', 'float4'
|
|
180
180
|
|
|
181
181
|
register_type 0, 'timestamp', PG::TextEncoder::TimestampWithoutTimeZone, PG::TextDecoder::TimestampWithoutTimeZone
|
|
182
182
|
register_type 0, 'timestamptz', PG::TextEncoder::TimestampWithTimeZone, PG::TextDecoder::TimestampWithTimeZone
|
|
183
183
|
register_type 0, 'date', PG::TextEncoder::Date, PG::TextDecoder::Date
|
|
184
|
-
#
|
|
185
|
-
#
|
|
186
|
-
#
|
|
187
|
-
#
|
|
188
|
-
#
|
|
189
|
-
#
|
|
190
|
-
#
|
|
191
|
-
#
|
|
192
|
-
#
|
|
193
|
-
#
|
|
194
|
-
#
|
|
195
|
-
#
|
|
196
|
-
#
|
|
184
|
+
# register_type 'time', OID::Time.new
|
|
185
|
+
#
|
|
186
|
+
# register_type 'path', OID::Text.new
|
|
187
|
+
# register_type 'point', OID::Point.new
|
|
188
|
+
# register_type 'polygon', OID::Text.new
|
|
189
|
+
# register_type 'circle', OID::Text.new
|
|
190
|
+
# register_type 'hstore', OID::Hstore.new
|
|
191
|
+
# register_type 'json', OID::Json.new
|
|
192
|
+
# register_type 'citext', OID::Text.new
|
|
193
|
+
# register_type 'ltree', OID::Text.new
|
|
194
|
+
#
|
|
195
|
+
# register_type 'cidr', OID::Cidr.new
|
|
196
|
+
# alias_type 'inet', 'cidr'
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
|
data/lib/pg/text_decoder.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
3
5
|
module PG
|
|
4
6
|
module TextDecoder
|
|
5
7
|
class Date < SimpleDecoder
|
|
@@ -7,7 +9,7 @@ module PG
|
|
|
7
9
|
|
|
8
10
|
def decode(string, tuple=nil, field=nil)
|
|
9
11
|
if string =~ ISO_DATE
|
|
10
|
-
|
|
12
|
+
::Date.new $1.to_i, $2.to_i, $3.to_i
|
|
11
13
|
else
|
|
12
14
|
string
|
|
13
15
|
end
|
data/lib/pg.rb
CHANGED
data/spec/helpers.rb
CHANGED
|
@@ -255,7 +255,7 @@ module PG::TestingHelpers
|
|
|
255
255
|
unless conns.empty?
|
|
256
256
|
puts "Lingering connections remain:"
|
|
257
257
|
conns.each do |row|
|
|
258
|
-
puts " [%
|
|
258
|
+
puts " [%s] {%s} %s -- %s" % row.values_at( 'pid', 'state', 'application_name', 'query' )
|
|
259
259
|
end
|
|
260
260
|
end
|
|
261
261
|
end
|
|
@@ -58,8 +58,8 @@ describe 'Basic type mapping' do
|
|
|
58
58
|
it "should do OID based type conversions", :ruby_19 do
|
|
59
59
|
res = @conn.exec( "SELECT 1, 'a', 2.0::FLOAT, TRUE, '2013-06-30'::DATE, generate_series(4,5)" )
|
|
60
60
|
expect( res.map_types!(basic_type_mapping).values ).to eq( [
|
|
61
|
-
[ 1, 'a', 2.0, true,
|
|
62
|
-
[ 1, 'a', 2.0, true,
|
|
61
|
+
[ 1, 'a', 2.0, true, Date.new(2013,6,30), 4 ],
|
|
62
|
+
[ 1, 'a', 2.0, true, Date.new(2013,6,30), 5 ],
|
|
63
63
|
] )
|
|
64
64
|
end
|
|
65
65
|
|
|
@@ -159,8 +159,8 @@ describe 'Basic type mapping' do
|
|
|
159
159
|
CAST('1913-12-31' AS DATE),
|
|
160
160
|
CAST('infinity' AS DATE),
|
|
161
161
|
CAST('-infinity' AS DATE)", [], format )
|
|
162
|
-
expect( res.getvalue(0,0) ).to eq(
|
|
163
|
-
expect( res.getvalue(0,1) ).to eq(
|
|
162
|
+
expect( res.getvalue(0,0) ).to eq( Date.new(2113, 12, 31) )
|
|
163
|
+
expect( res.getvalue(0,1) ).to eq( Date.new(1913, 12, 31) )
|
|
164
164
|
expect( res.getvalue(0,2) ).to eq( 'infinity' )
|
|
165
165
|
expect( res.getvalue(0,3) ).to eq( '-infinity' )
|
|
166
166
|
end
|
data/spec/pg/connection_spec.rb
CHANGED
|
@@ -228,11 +228,14 @@ describe PG::Connection do
|
|
|
228
228
|
expect( @conn.db ).to eq( "test" )
|
|
229
229
|
expect( @conn.user ).to be_a_kind_of( String )
|
|
230
230
|
expect( @conn.pass ).to eq( "" )
|
|
231
|
-
expect( @conn.host ).to eq( "localhost" )
|
|
232
231
|
expect( @conn.port ).to eq( 54321 )
|
|
233
232
|
expect( @conn.tty ).to eq( "" )
|
|
234
233
|
expect( @conn.options ).to eq( "" )
|
|
235
234
|
end
|
|
235
|
+
it "can retrieve it's connection parameters for the established connection",
|
|
236
|
+
skip: RUBY_PLATFORM=~/x64-mingw/ ? "host segfaults on Windows-x64" : false do
|
|
237
|
+
expect( @conn.host ).to eq( "localhost" )
|
|
238
|
+
end
|
|
236
239
|
|
|
237
240
|
EXPECTED_TRACE_OUTPUT = %{
|
|
238
241
|
To backend> Msg Q
|
|
@@ -705,7 +708,7 @@ describe PG::Connection do
|
|
|
705
708
|
it "can return the default connection options as a Hash" do
|
|
706
709
|
expect( described_class.conndefaults_hash ).to be_a( Hash )
|
|
707
710
|
expect( described_class.conndefaults_hash ).to include( :user, :password, :dbname, :host, :port )
|
|
708
|
-
expect(
|
|
711
|
+
expect( ['5432', '54321'] ).to include( described_class.conndefaults_hash[:port] )
|
|
709
712
|
expect( @conn.conndefaults_hash ).to eq( described_class.conndefaults_hash )
|
|
710
713
|
end
|
|
711
714
|
|
|
@@ -1208,6 +1211,12 @@ describe PG::Connection do
|
|
|
1208
1211
|
expect( escaped ).to eq( expected.join(".") )
|
|
1209
1212
|
end
|
|
1210
1213
|
|
|
1214
|
+
it "will raise a TypeError for invalid arguments to quote_ident" do
|
|
1215
|
+
expect{ described_class.quote_ident( nil ) }.to raise_error(TypeError)
|
|
1216
|
+
expect{ described_class.quote_ident( [nil] ) }.to raise_error(TypeError)
|
|
1217
|
+
expect{ described_class.quote_ident( [['a']] ) }.to raise_error(TypeError)
|
|
1218
|
+
end
|
|
1219
|
+
|
|
1211
1220
|
describe "Ruby 1.9.x default_internal encoding" do
|
|
1212
1221
|
|
|
1213
1222
|
it "honors the Encoding.default_internal if it's set and the synchronous interface is used" do
|
data/spec/pg/type_spec.rb
CHANGED
|
@@ -206,6 +206,13 @@ describe "PG::Type derivations" do
|
|
|
206
206
|
expect( quoted_type.encode(['schema','table','col']) ).to eq( %["schema"."table"."col"] )
|
|
207
207
|
expect( quoted_type.encode(['A.','.B']) ).to eq( %["A.".".B"] )
|
|
208
208
|
expect( quoted_type.encode(%['A"."B']) ).to eq( %["'A"".""B'"] )
|
|
209
|
+
expect( quoted_type.encode( nil ) ).to be_nil
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
it "will raise a TypeError for invalid arguments to quote_ident" do
|
|
213
|
+
quoted_type = PG::TextEncoder::Identifier.new
|
|
214
|
+
expect{ quoted_type.encode( [nil] ) }.to raise_error(TypeError)
|
|
215
|
+
expect{ quoted_type.encode( [['a']] ) }.to raise_error(TypeError)
|
|
209
216
|
end
|
|
210
217
|
end
|
|
211
218
|
|
|
@@ -512,6 +519,7 @@ describe "PG::Type derivations" do
|
|
|
512
519
|
expect( e.encode("xxxx") ).to eq("eHh4eA==")
|
|
513
520
|
expect( e.encode("xxxxx") ).to eq("eHh4eHg=")
|
|
514
521
|
expect( e.encode("\0\n\t") ).to eq("AAoJ")
|
|
522
|
+
expect( e.encode("(\xFBm") ).to eq("KPtt")
|
|
515
523
|
end
|
|
516
524
|
|
|
517
525
|
it "should encode Strings as base64 in BinaryDecoder" do
|
|
@@ -540,6 +548,7 @@ describe "PG::Type derivations" do
|
|
|
540
548
|
expect( e.decode("eHh4eA==") ).to eq("xxxx")
|
|
541
549
|
expect( e.decode("eHh4eHg=") ).to eq("xxxxx")
|
|
542
550
|
expect( e.decode("AAoJ") ).to eq("\0\n\t")
|
|
551
|
+
expect( e.decode("KPtt") ).to eq("(\xFBm")
|
|
543
552
|
end
|
|
544
553
|
|
|
545
554
|
it "should decode base64 in BinaryEncoder" do
|
data.tar.gz.sig
CHANGED
|
Binary file
|
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.18.
|
|
4
|
+
version: 0.18.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Granger
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
G8LHR7EjtPPmqCCunfyecJ6MmCNaiJCBxq2NYzyNmluPyHT8+0fuB5kccUVZm6CD
|
|
32
32
|
xn3DzOkDE6NYbk8gC9rTsA==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2015-
|
|
34
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: hoe-mercurial
|
|
@@ -53,14 +53,14 @@ dependencies:
|
|
|
53
53
|
requirements:
|
|
54
54
|
- - "~>"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '0.
|
|
56
|
+
version: '0.7'
|
|
57
57
|
type: :development
|
|
58
58
|
prerelease: false
|
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
|
61
61
|
- - "~>"
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '0.
|
|
63
|
+
version: '0.7'
|
|
64
64
|
- !ruby/object:Gem::Dependency
|
|
65
65
|
name: hoe-highline
|
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -103,6 +103,20 @@ dependencies:
|
|
|
103
103
|
- - "~>"
|
|
104
104
|
- !ruby/object:Gem::Version
|
|
105
105
|
version: '0.9'
|
|
106
|
+
- !ruby/object:Gem::Dependency
|
|
107
|
+
name: rake-compiler-dock
|
|
108
|
+
requirement: !ruby/object:Gem::Requirement
|
|
109
|
+
requirements:
|
|
110
|
+
- - "~>"
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: '0.3'
|
|
113
|
+
type: :development
|
|
114
|
+
prerelease: false
|
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
116
|
+
requirements:
|
|
117
|
+
- - "~>"
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: '0.3'
|
|
106
120
|
- !ruby/object:Gem::Dependency
|
|
107
121
|
name: hoe
|
|
108
122
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -295,11 +309,7 @@ licenses:
|
|
|
295
309
|
metadata: {}
|
|
296
310
|
post_install_message:
|
|
297
311
|
rdoc_options:
|
|
298
|
-
- "
|
|
299
|
-
- fivefish
|
|
300
|
-
- "-t"
|
|
301
|
-
- 'pg: The Ruby Interface to PostgreSQL'
|
|
302
|
-
- "-m"
|
|
312
|
+
- "--main"
|
|
303
313
|
- README.rdoc
|
|
304
314
|
require_paths:
|
|
305
315
|
- lib
|
|
@@ -315,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
315
325
|
version: '0'
|
|
316
326
|
requirements: []
|
|
317
327
|
rubyforge_project:
|
|
318
|
-
rubygems_version: 2.4.
|
|
328
|
+
rubygems_version: 2.4.5.1
|
|
319
329
|
signing_key:
|
|
320
330
|
specification_version: 4
|
|
321
331
|
summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
|
metadata.gz.sig
CHANGED
|
Binary file
|