pg 1.5.3-x64-mingw-ucrt → 1.5.5-x64-mingw-ucrt
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/.github/workflows/binary-gems.yml +6 -6
- data/.github/workflows/source-gem.yml +13 -9
- data/History.md +17 -0
- data/README.ja.md +54 -30
- data/Rakefile +4 -1
- data/Rakefile.cross +4 -3
- data/certs/kanis@comcard.de.pem +20 -0
- data/ext/errorcodes.txt +1 -1
- data/ext/extconf.rb +4 -0
- data/ext/pg.c +1 -1
- data/ext/pg.h +0 -1
- data/ext/pg_binary_encoder.c +1 -1
- data/ext/pg_connection.c +15 -8
- data/ext/pg_copy_coder.c +7 -7
- data/ext/pg_result.c +2 -2
- data/lib/3.1/pg_ext.so +0 -0
- data/lib/3.2/pg_ext.so +0 -0
- data/lib/3.3/pg_ext.so +0 -0
- data/lib/pg/version.rb +1 -1
- data/lib/x64-mingw-ucrt/libpq.dll +0 -0
- data/pg.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +23 -29
- metadata.gz.sig +0 -0
- data/translation/.po4a-version +0 -7
- data/translation/po/all.pot +0 -910
- data/translation/po/ja.po +0 -1047
- data/translation/po4a.cfg +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c9831af5fa3ccce58ccc4bf70bc8788fdb512995fbfc3c6085e08dda8005bc
|
4
|
+
data.tar.gz: 5c471455a834f80a9abd8332577c48d0ddb3d4adaf27e77a6f6011df2b93965d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e98c5c9972fd5061a22c94ce8a5a877838a23a1ad06221b9da3caddb7025b3e3fe8720c3fdd0b21d0bb1b9a1c736df7c114ac0299bfd79c659f1426b8a2d8c04
|
7
|
+
data.tar.gz: 723ab81defdccec107c1b69e23db507a3787e3f29e6c8bf518d81e99197fd7cc8170d0da065f2b0fb5882f5a8b33e213e42b564332affdaabc2701f45175acbb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -9,7 +9,7 @@ on:
|
|
9
9
|
|
10
10
|
jobs:
|
11
11
|
job_build_x64:
|
12
|
-
name:
|
12
|
+
name: Build
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
strategy:
|
15
15
|
fail-fast: false
|
@@ -23,7 +23,7 @@ jobs:
|
|
23
23
|
- name: Set up Ruby
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
26
|
-
ruby-version: "3.
|
26
|
+
ruby-version: "3.3"
|
27
27
|
- run: bundle install
|
28
28
|
|
29
29
|
- name: Create a dummy cert to satisfy the build
|
@@ -43,18 +43,18 @@ jobs:
|
|
43
43
|
path: pkg/*.gem
|
44
44
|
|
45
45
|
job_test_binary:
|
46
|
-
name: Test
|
46
|
+
name: Test
|
47
47
|
needs: job_build_x64
|
48
48
|
strategy:
|
49
49
|
fail-fast: false
|
50
50
|
matrix:
|
51
51
|
include:
|
52
52
|
- os: windows-latest
|
53
|
-
ruby: "3.
|
53
|
+
ruby: "3.3"
|
54
54
|
platform: "x64-mingw-ucrt"
|
55
|
-
PGVERSION:
|
55
|
+
PGVERSION: 16.0-1-windows-x64
|
56
56
|
- os: windows-latest
|
57
|
-
ruby: "3.1.
|
57
|
+
ruby: "3.1.4-1"
|
58
58
|
platform: "x86-mingw32"
|
59
59
|
PGVERSION: 10.20-1-windows
|
60
60
|
- os: windows-latest
|
@@ -9,7 +9,7 @@ on:
|
|
9
9
|
|
10
10
|
jobs:
|
11
11
|
job_build_gem:
|
12
|
-
name:
|
12
|
+
name: Build
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
steps:
|
15
15
|
- uses: actions/checkout@v3
|
@@ -28,7 +28,7 @@ jobs:
|
|
28
28
|
path: "*.gem"
|
29
29
|
|
30
30
|
job_test_gem:
|
31
|
-
name: Test
|
31
|
+
name: Test
|
32
32
|
needs: job_build_gem
|
33
33
|
strategy:
|
34
34
|
fail-fast: false
|
@@ -36,15 +36,19 @@ jobs:
|
|
36
36
|
include:
|
37
37
|
- os: windows
|
38
38
|
ruby: "head"
|
39
|
-
PGVERSION:
|
40
|
-
PGVER: "
|
39
|
+
PGVERSION: 16.0-1-windows-x64
|
40
|
+
PGVER: "16"
|
41
41
|
- os: windows
|
42
42
|
ruby: "2.5"
|
43
43
|
PGVERSION: 9.4.26-1-windows-x64
|
44
44
|
PGVER: "9.4"
|
45
|
+
- os: windows
|
46
|
+
ruby: "mswin"
|
47
|
+
PGVERSION: 16.0-1-windows-x64
|
48
|
+
PGVER: "16"
|
45
49
|
- os: ubuntu
|
46
50
|
ruby: "head"
|
47
|
-
PGVER: "
|
51
|
+
PGVER: "16"
|
48
52
|
- os: ubuntu
|
49
53
|
ruby: "3.2"
|
50
54
|
PGVER: "12"
|
@@ -57,11 +61,11 @@ jobs:
|
|
57
61
|
PGVER: "13"
|
58
62
|
- os: ubuntu
|
59
63
|
ruby: "truffleruby-head"
|
60
|
-
PGVER: "
|
64
|
+
PGVER: "16"
|
61
65
|
- os: macos
|
62
66
|
ruby: "head"
|
63
|
-
PGVERSION:
|
64
|
-
PGVER: "
|
67
|
+
PGVERSION: 16.0-1-osx
|
68
|
+
PGVER: "16"
|
65
69
|
|
66
70
|
runs-on: ${{ matrix.os }}-${{ matrix.os_ver || 'latest' }}
|
67
71
|
env:
|
@@ -82,7 +86,7 @@ jobs:
|
|
82
86
|
name: source-gem
|
83
87
|
|
84
88
|
- name: Install required packages Windows
|
85
|
-
if: matrix.os == 'windows'
|
89
|
+
if: matrix.os == 'windows' && matrix.ruby != 'mswin'
|
86
90
|
shell: cmd
|
87
91
|
run: ridk exec sh -c "pacman --sync --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gcc"
|
88
92
|
|
data/History.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## v1.5.5 [2024-02-15] Lars Kanis <lars@greiz-reinsdorf.de>
|
2
|
+
|
3
|
+
- Explicitly retype timespec fields to int64_t to fix compatibility with 32bit arches. [#547](https://github.com/ged/ruby-pg/pull/547)
|
4
|
+
- Fix possible buffer overflows in PG::BinaryDecoder::CopyRow on 32 bit systems. [#548](https://github.com/ged/ruby-pg/pull/548)
|
5
|
+
- Add binary Windows gems for Ruby 3.3.
|
6
|
+
- Update Windows fat binary gem to OpenSSL-3.2.1 and PostgreSQL-16.2.
|
7
|
+
|
8
|
+
|
9
|
+
## v1.5.4 [2023-09-01] Lars Kanis <lars@greiz-reinsdorf.de>
|
10
|
+
|
11
|
+
- Fix compiling the pg extension with MSVC 2022. [#535](https://github.com/ged/ruby-pg/pull/535)
|
12
|
+
- Set PG::Connection's encoding even if setting client_encoding on connection startup fails. [#541](https://github.com/ged/ruby-pg/pull/541)
|
13
|
+
- Don't set the server's client_encoding if it's unnecessary. [#542](https://github.com/ged/ruby-pg/pull/542)
|
14
|
+
This is important for connection proxies, who disallow configuration settings.
|
15
|
+
- Update Windows fat binary gem to OpenSSL-3.1.2 and PostgreSQL-15.4.
|
16
|
+
|
17
|
+
|
1
18
|
## v1.5.3 [2023-04-28] Lars Kanis <lars@greiz-reinsdorf.de>
|
2
19
|
|
3
20
|
- Fix possible segfault when creating a new PG::Result with type map. [#530](https://github.com/ged/ruby-pg/pull/530)
|
data/README.ja.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# pg
|
2
2
|
|
3
|
-
*
|
4
|
-
*
|
5
|
-
|
6
|
-
* clog :: link:/History.md
|
3
|
+
* ホーム :: https://github.com/ged/ruby-pg
|
4
|
+
* ドキュメント :: http://deveiate.org/code/pg (英語)、 https://deveiate.org/code/pg/README_ja_md.html (日本語)
|
5
|
+
* 変更履歴 :: link:/History.md
|
7
6
|
|
8
7
|
[](https://gitter.im/ged/ruby-pg?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
@@ -84,8 +83,9 @@ README-Windows.rdoc を参照してください。
|
|
84
83
|
|
85
84
|
## 型変換
|
86
85
|
|
87
|
-
Pg
|
88
|
-
|
86
|
+
Pgでは任意でRubyと素のCコードにある結果の値やクエリ引数の型変換ができます。
|
87
|
+
こうすることでデータベースとのデータの往来を加速させられます。
|
88
|
+
なぜなら文字列のアロケーションが減り、(比較的遅い)Rubyのコードでの変換部分が省かれるからです。
|
89
89
|
|
90
90
|
とても基本的な型変換は次のようにできます。
|
91
91
|
```ruby
|
@@ -104,9 +104,13 @@ PgにはおまけとしてRubyとネイティブCコードにある結果の値
|
|
104
104
|
|
105
105
|
### エンコーダーとデコーダー (ext/pg_*coder.c, lib/pg/*coder.rb)
|
106
106
|
|
107
|
-
こちらはより低層で、DBMSへ転送するためにRuby
|
107
|
+
こちらはより低層で、DBMSへ転送するためにRubyのオブジェクトを変換するエンコーディングクラスと、取得してきたデータをRubyのオブジェクトに変換し戻すデコーディングクラスが含まれています。
|
108
|
+
クラスはそれぞれの形式によって名前空間 PG::TextEncoder, PG::TextDecoder, PG::BinaryEncoder, そして
|
109
|
+
PG::BinaryDecoder に分かれています。
|
108
110
|
|
109
|
-
エンコーダーないしデコーダーオブジェクトにOID
|
111
|
+
エンコーダーないしデコーダーオブジェクトにOIDデータ型や形式コード(テキストないしバイナリ)や任意で名前を割り当てることができます。
|
112
|
+
要素のエンコーダーないしデコーダーを割り当てることによって複合型を構築することもできます。
|
113
|
+
PG::Coder オブジェクトは PG::TypeMap をセットアップしたり、その代わりに単一の値と文字列表現とを相互に変換したりするのに使えます。
|
110
114
|
|
111
115
|
ruby-pgでは以下のPostgreSQLカラム型に対応しています(TE = Text Encoder、TD = Text Decoder、BE =
|
112
116
|
Binary Encoder、BD = Binary Decoder)。
|
@@ -137,14 +141,11 @@ Binary Encoder、BD = Binary Decoder)。
|
|
137
141
|
[現地時間](rdoc-ref:PG::TextEncoder::TimestampWithoutTimeZone)、[UTC](rdoc-ref:PG::TextEncoder::TimestampUtc)、[タイムゾーン付き](rdoc-ref:PG::TextEncoder::TimestampWithTimeZone)
|
138
142
|
* TD:
|
139
143
|
[現地時間](rdoc-ref:PG::TextDecoder::TimestampLocal)、[UTC](rdoc-ref:PG::TextDecoder::TimestampUtc)、[UTCから現地時間へ](rdoc-ref:PG::TextDecoder::TimestampUtcToLocal)
|
140
|
-
* BE:
|
141
|
-
[UTC](rdoc-ref:PG::BinaryEncoder::TimestampUtc)
|
144
|
+
* BE:
|
145
|
+
[現地時間](rdoc-ref:PG::BinaryEncoder::TimestampLocal)、[UTC](rdoc-ref:PG::BinaryEncoder::TimestampUtc)
|
142
146
|
* BD:
|
143
147
|
[現地時間](rdoc-ref:PG::BinaryDecoder::TimestampLocal)、[UTC](rdoc-ref:PG::BinaryDecoder::TimestampUtc)、[UTCから現地時間へ](rdoc-ref:PG::BinaryDecoder::TimestampUtcToLocal)
|
144
|
-
*
|
145
|
-
[TD](rdoc-ref:PG::TextDecoder::Date),
|
146
|
-
[BE](rdoc-ref:PG::BinaryEncoder::Date),
|
147
|
-
[BD](rdoc-ref:PG::BinaryDecoder::Date)
|
148
|
+
* 日付:[TE](rdoc-ref:PG::TextEncoder::Date)、[TD](rdoc-ref:PG::TextDecoder::Date)、[BE](rdoc-ref:PG::BinaryEncoder::Date)、[BD](rdoc-ref:PG::BinaryDecoder::Date)
|
148
149
|
* JSONとJSONB:
|
149
150
|
[TE](rdoc-ref:PG::TextEncoder::JSON)、[TD](rdoc-ref:PG::TextDecoder::JSON)
|
150
151
|
* Inet:
|
@@ -153,8 +154,7 @@ Binary Encoder、BD = Binary Decoder)。
|
|
153
154
|
[TE](rdoc-ref:PG::TextEncoder::Array)、[TD](rdoc-ref:PG::TextDecoder::Array)
|
154
155
|
* 複合型(「行」や「レコード」などとも言います):[TE](rdoc-ref:PG::TextEncoder::Record)、[TD](rdoc-ref:PG::TextDecoder::Record)
|
155
156
|
|
156
|
-
|
157
|
-
not used as column type:
|
157
|
+
カラム型として使われていませんが、以下のテキスト形式とバイナリ形式もエンコードできます。
|
158
158
|
|
159
159
|
* COPYの入出力データ:[TE](rdoc-ref:PG::TextEncoder::CopyRow)、[TD](rdoc-ref:PG::TextDecoder::CopyRow),
|
160
160
|
[BE](rdoc-ref:PG::BinaryEncoder::CopyRow),
|
@@ -163,11 +163,16 @@ not used as column type:
|
|
163
163
|
* SQLの識別子:
|
164
164
|
[TE](rdoc-ref:PG::TextEncoder::Identifier)、[TD](rdoc-ref:PG::TextDecoder::Identifier)
|
165
165
|
|
166
|
-
### PG::TypeMapとその派生 (ext/pg_type_map*.c, lib/pg/type_map*.rb)
|
166
|
+
### PG::TypeMap とその派生 (ext/pg_type_map*.c, lib/pg/type_map*.rb)
|
167
167
|
|
168
|
-
TypeMap
|
168
|
+
TypeMapはエンコーダーまたはデコーダーのどちらによってどの値を変換するかを定義します。
|
169
|
+
様々な型の対応付け戦略があるので、このクラスにはいくつかの派生が実装されています。
|
170
|
+
型変換の特有の需要に合わせてそれらの派生から選んで調整を加えることができます。
|
171
|
+
既定の型の対応付けは PG::TypeMapAllStrings です。
|
169
172
|
|
170
|
-
|
173
|
+
型の対応付けは、結果の集合それぞれに対し、接続毎ないしクエリ毎に割り当てることができます。
|
174
|
+
型の対応付けはCOPYの入出力データストリーミングでも使うことができます。
|
175
|
+
PG::Connection#copy_data を参照してください。
|
171
176
|
|
172
177
|
以下の基底となる型の対応付けが使えます。
|
173
178
|
|
@@ -177,19 +182,21 @@ TypeMapはエンコーダーまたはデコーダーのどちらによってど
|
|
177
182
|
* PG::TypeMapByOid - PostgreSQLのOIDデータ型によってデコーダーを選択します
|
178
183
|
* PG::TypeMapInRuby - Rubyで独自の型の対応付けを定義します
|
179
184
|
|
180
|
-
以下の型の対応付けはPG::BasicTypeRegistry由来の型の対応付けが入った状態になっています。
|
185
|
+
以下の型の対応付けは PG::BasicTypeRegistry 由来の型の対応付けが入った状態になっています。
|
181
186
|
|
182
|
-
* PG::BasicTypeMapForResults -
|
183
|
-
|
184
|
-
* PG::BasicTypeMapBasedOnResult -
|
185
|
-
|
186
|
-
* PG::BasicTypeMapForQueries -
|
187
|
-
|
187
|
+
* PG::BasicTypeMapForResults - PG::TypeMapByOid
|
188
|
+
によくあるPostgreSQLカラム型用にデコーダーが入った状態になっています
|
189
|
+
* PG::BasicTypeMapBasedOnResult - PG::TypeMapByOid
|
190
|
+
によくあるPostgreSQLカラム型用のエンコーダーが入った状態になっています
|
191
|
+
* PG::BasicTypeMapForQueries - PG::TypeMapByClass
|
192
|
+
によくあるRubyの値クラス用にエンコーダーが入った状態になっています
|
188
193
|
|
189
194
|
|
190
195
|
## スレッド対応
|
191
196
|
|
192
|
-
PGには個々のスレッドが別々のPG::Connection
|
197
|
+
PGには個々のスレッドが別々の PG::Connection オブジェクトを同時に使えるという点でスレッド安全性があります。
|
198
|
+
しかし1つ以上のスレッドから同時にPgのオブジェクトにアクセスすると安全ではありません。
|
199
|
+
そのため必ず、毎回新しいスレッドを作るときに新しいデータベースサーバー接続を開くか、スレッド安全性のある方法で接続を管理するActiveRecordのようなラッパーライブラリを使うようにしてください。
|
193
200
|
|
194
201
|
以下のようなメッセージが標準エラー出力に表示された場合、恐らく複数のスレッドが1つの接続を使っています。
|
195
202
|
|
@@ -202,13 +209,30 @@ PGには個々のスレッドが別々のPG::Connectionオブジェクトを同
|
|
202
209
|
|
203
210
|
## Fiber IOスケジューラー対応
|
204
211
|
|
205
|
-
PgはRuby-3.0で導入された`Fiber.scheduler
|
212
|
+
pg-1.3.0以降で、PgはRuby-3.0で導入された`Fiber.scheduler`に完全に対応しています。
|
213
|
+
Windowsでは、`Fiber.scheduler`対応はRuby-3.1以降で使えます。
|
214
|
+
`Fiber.scheduler`が走らせているスレッドに登録されている場合、起こりうる全てのブロッキングIO操作はそのスケジューラーを経由します。
|
215
|
+
同期的であったりブロックしたりするメソッド呼び出しについてもpgが内部的に非同期のlibpqインターフェースを使っているのはそれが理由です。
|
216
|
+
またlibpqの組み込み関数に代えてRubyのDNS解決を使っています。
|
206
217
|
|
207
|
-
内部的にPgは常にlibpq
|
218
|
+
内部的にPgは常にlibpqのノンブロッキング接続モードを使います。
|
219
|
+
それからブロッキングモードで走っているように振舞いますが、もし`Fiber.scheduler`が登録されていれば全てのブロッキングIOはそのスケジューラーを通じてRubyで制御されます。
|
220
|
+
`PG::Connection.setnonblocking(true)`が呼ばれたらノンブロッキング状態が有効になったままになりますが、それ以降のブロッキング状態の制御が無効になるので、呼び出しているプログラムはブロッキング状態を自力で制御しなければなりません。
|
208
221
|
|
209
222
|
この規則の1つの例外には、`PG::Connection#lo_create`や外部ライブラリを使う認証メソッド(GSSAPI認証など)のような、大きめのオブジェクト用のメソッドがあります。これらは`Fiber.scheduler`と互換性がないため、ブロッキング状態は登録されたIOスケジューラに渡されません。つまり操作は適切に実行されますが、IO待ち状態に別のIOを扱うFiberから使用を切り替えてくることができなくなります。
|
210
223
|
|
211
224
|
|
225
|
+
## Ractor対応
|
226
|
+
|
227
|
+
pg-1.5.0以降で、PgはRuby-3.0で導入されたRactorと完全な互換性があります。
|
228
|
+
型エンコーダーないしデコーダー、及び型の対応付けが`Ractor.make_shareable`により凍結されている場合、これらをractor間で共有できます。
|
229
|
+
また凍結された PG::Result と PG::Tuple オブジェクトも共有できます。
|
230
|
+
少なくとも全ての凍結されたオブジェクト(ただし PG::Connection
|
231
|
+
を除く)はPostgreSQLサーバーとのやり取りをしたり取得されたデータを読むのに使えます。
|
232
|
+
|
233
|
+
PG::Connection は共有できません。個々の接続を確立するために、それぞれのRactor内で作られなければなりません。
|
234
|
+
|
235
|
+
|
212
236
|
## 貢献
|
213
237
|
|
214
238
|
バグを報告したり機能を提案したりGitでソースをチェックアウトしたりするには[プロジェクトページをご確認ください](https://github.com/ged/ruby-pg)。
|
@@ -271,6 +295,6 @@ Portions copyright LAIKA, Inc.
|
|
271
295
|
|
272
296
|
## 謝辞
|
273
297
|
|
274
|
-
長年にわたって貢献してくださった方々についてはContributors.rdocを参照してください。
|
298
|
+
長年にわたって貢献してくださった方々については Contributors.rdoc を参照してください。
|
275
299
|
|
276
300
|
ruby-listとruby-devメーリングリストの方々に感謝します。またPostgreSQLを開発された方々へも謝意を表します。
|
data/Rakefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# -*- rake -*-
|
2
2
|
|
3
|
+
# Enable english error messages, as some specs depend on them
|
4
|
+
ENV["LANG"] = "C"
|
5
|
+
|
3
6
|
require 'rbconfig'
|
4
7
|
require 'pathname'
|
5
8
|
require 'tmpdir'
|
@@ -91,7 +94,7 @@ end
|
|
91
94
|
|
92
95
|
desc "Update list of server error codes"
|
93
96
|
task :update_error_codes do
|
94
|
-
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/
|
97
|
+
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_16_0"
|
95
98
|
|
96
99
|
ERRORCODES_TXT = "ext/errorcodes.txt"
|
97
100
|
sh "wget #{URL_ERRORCODES_TXT.inspect} -O #{ERRORCODES_TXT.inspect} || curl #{URL_ERRORCODES_TXT.inspect} -o #{ERRORCODES_TXT.inspect}"
|
data/Rakefile.cross
CHANGED
@@ -31,8 +31,8 @@ class CrossLibrary < OpenStruct
|
|
31
31
|
self.host_platform = toolchain
|
32
32
|
|
33
33
|
# Cross-compilation constants
|
34
|
-
self.openssl_version = ENV['OPENSSL_VERSION'] || '3.1
|
35
|
-
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '
|
34
|
+
self.openssl_version = ENV['OPENSSL_VERSION'] || '3.2.1'
|
35
|
+
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '16.2'
|
36
36
|
|
37
37
|
# Check if symlinks work in the current working directory.
|
38
38
|
# This fails, if rake-compiler-dock is running on a Windows box.
|
@@ -184,6 +184,7 @@ class CrossLibrary < OpenStruct
|
|
184
184
|
"--host=#{host_platform}",
|
185
185
|
'--with-openssl',
|
186
186
|
'--without-zlib',
|
187
|
+
'--without-icu',
|
187
188
|
]
|
188
189
|
|
189
190
|
chdir( static_postgresql_builddir ) do
|
@@ -290,7 +291,7 @@ CrossLibraries.each do |xlib|
|
|
290
291
|
RakeCompilerDock.sh <<-EOT, platform: platform
|
291
292
|
(cp build/gem/gem-*.pem ~/.gem/ || true) &&
|
292
293
|
bundle install --local &&
|
293
|
-
rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKE="make -j`nproc`" RUBY_CC_VERSION=3.2.0:3.1.0:3.0.0:2.7.0:2.6.0:2.5.0
|
294
|
+
rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKE="make -j`nproc`" RUBY_CC_VERSION=3.3.0:3.2.0:3.1.0:3.0.0:2.7.0:2.6.0:2.5.0
|
294
295
|
EOT
|
295
296
|
end
|
296
297
|
desc "Build the windows binary gems"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDLjCCAhagAwIBAgIBCzANBgkqhkiG9w0BAQsFADA9MQ4wDAYDVQQDDAVrYW5p
|
3
|
+
czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
|
4
|
+
Fw0yMzA0MjgwOTI0NDhaFw0yNDA0MjcwOTI0NDhaMD0xDjAMBgNVBAMMBWthbmlz
|
5
|
+
MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
|
6
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
|
7
|
+
HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
|
8
|
+
9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
|
9
|
+
lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
|
10
|
+
Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
|
11
|
+
L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
|
12
|
+
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUvgTdT7fe
|
13
|
+
x17ugO3IOsjEJwW7KP4wDQYJKoZIhvcNAQELBQADggEBACAxNXwfMGG7paZjnG/c
|
14
|
+
smdi/ocW2GmCNtILaSzDZqlD5LoA68MiO7u5vwWyBaDJ6giUB330VJoGRbWMxvxN
|
15
|
+
JU6Bnwa4yYp9YtF91wYIi7FXwIrCPKd9bk3bf4M5wECdsv+zvVceq2zRXqD7fci8
|
16
|
+
1LRG8ort/f4TgaT7B4aNwOaabA2UT6u0FGeglqxLkhir86MY3QQyBfJZUoTKWGkz
|
17
|
+
S9a7GXsYpe+8HMOaE4+SZp8SORKPgATND5m/4VdzuO59VXjE5UP7QpXigbxAt7H7
|
18
|
+
ciK5Du2ZDhowmWzZwNzR7VvVmfAK6RQJlRB03VkkQRWGld5yApOrYDne6WbD8kE0
|
19
|
+
uM8=
|
20
|
+
-----END CERTIFICATE-----
|
data/ext/errorcodes.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# errcodes.txt
|
3
3
|
# PostgreSQL error codes
|
4
4
|
#
|
5
|
-
# Copyright (c) 2003-
|
5
|
+
# Copyright (c) 2003-2023, PostgreSQL Global Development Group
|
6
6
|
#
|
7
7
|
# This list serves as the basis for generating source files containing error
|
8
8
|
# codes. It is kept in a common format to make sure all these source files have
|
data/ext/extconf.rb
CHANGED
@@ -60,6 +60,10 @@ else
|
|
60
60
|
if dlldir && RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
|
61
61
|
append_ldflags "-Wl,-rpath,#{dlldir.quote}"
|
62
62
|
end
|
63
|
+
|
64
|
+
if /mswin/ =~ RUBY_PLATFORM
|
65
|
+
$libs = append_library($libs, 'ws2_32')
|
66
|
+
end
|
63
67
|
end
|
64
68
|
|
65
69
|
$stderr.puts "Using libpq from #{dlldir}"
|
data/ext/pg.c
CHANGED
@@ -125,7 +125,7 @@ const char * const (pg_enc_pg2ruby_mapping[][2]) = {
|
|
125
125
|
* - returns NULL if the client encoding is 'SQL_ASCII'.
|
126
126
|
* - returns ASCII-8BIT if the client encoding is unknown.
|
127
127
|
*/
|
128
|
-
rb_encoding *
|
128
|
+
static rb_encoding *
|
129
129
|
pg_get_pg_encoding_as_rb_encoding( int enc_id )
|
130
130
|
{
|
131
131
|
const char *name = pg_encoding_to_char( enc_id );
|
data/ext/pg.h
CHANGED
@@ -369,7 +369,6 @@ pgresult_get_this( VALUE self )
|
|
369
369
|
}
|
370
370
|
|
371
371
|
|
372
|
-
rb_encoding * pg_get_pg_encoding_as_rb_encoding _(( int ));
|
373
372
|
rb_encoding * pg_get_pg_encname_as_rb_encoding _(( const char * ));
|
374
373
|
const char * pg_get_rb_encoding_as_pg_encoding _(( rb_encoding * ));
|
375
374
|
rb_encoding *pg_conn_enc_get _(( PGconn * ));
|
data/ext/pg_binary_encoder.c
CHANGED
@@ -185,7 +185,7 @@ pg_bin_enc_timestamp(t_pg_coder *this, VALUE value, char *out, VALUE *intermedia
|
|
185
185
|
ts = rb_time_timespec(*intermediate);
|
186
186
|
/* PostgreSQL's timestamp is based on year 2000 and Ruby's time is based on 1970.
|
187
187
|
* Adjust the 30 years difference. */
|
188
|
-
timestamp = (ts.tv_sec - 10957L * 24L * 3600L) * 1000000 + (ts.tv_nsec / 1000);
|
188
|
+
timestamp = ((int64_t)ts.tv_sec - 10957L * 24L * 3600L) * 1000000 + ((int64_t)ts.tv_nsec / 1000);
|
189
189
|
|
190
190
|
if( this->flags & PG_CODER_TIMESTAMP_DB_LOCAL ) {
|
191
191
|
/* send as local time */
|
data/ext/pg_connection.c
CHANGED
@@ -4171,16 +4171,23 @@ static VALUE
|
|
4171
4171
|
pgconn_set_default_encoding( VALUE self )
|
4172
4172
|
{
|
4173
4173
|
PGconn *conn = pg_get_pgconn( self );
|
4174
|
-
rb_encoding *
|
4175
|
-
const char *encname;
|
4174
|
+
rb_encoding *rb_enc;
|
4176
4175
|
|
4177
4176
|
rb_check_frozen(self);
|
4178
|
-
if ((
|
4179
|
-
|
4180
|
-
|
4181
|
-
|
4182
|
-
|
4183
|
-
|
4177
|
+
if (( rb_enc = rb_default_internal_encoding() )) {
|
4178
|
+
rb_encoding * conn_encoding = pg_conn_enc_get( conn );
|
4179
|
+
|
4180
|
+
/* Don't set the server encoding, if it's unnecessary.
|
4181
|
+
* This is important for connection proxies, who disallow configuration settings.
|
4182
|
+
*/
|
4183
|
+
if ( conn_encoding != rb_enc ) {
|
4184
|
+
const char *encname = pg_get_rb_encoding_as_pg_encoding( rb_enc );
|
4185
|
+
if ( pgconn_set_client_encoding_async(self, rb_str_new_cstr(encname)) != 0 )
|
4186
|
+
rb_warning( "Failed to set the default_internal encoding to %s: '%s'",
|
4187
|
+
encname, PQerrorMessage(conn) );
|
4188
|
+
}
|
4189
|
+
pgconn_set_internal_encoding_index( self );
|
4190
|
+
return rb_enc_from_encoding( rb_enc );
|
4184
4191
|
} else {
|
4185
4192
|
pgconn_set_internal_encoding_index( self );
|
4186
4193
|
return Qnil;
|
data/ext/pg_copy_coder.c
CHANGED
@@ -795,26 +795,26 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
|
|
795
795
|
cur_ptr = input_line;
|
796
796
|
line_end_ptr = input_line + len;
|
797
797
|
|
798
|
-
if (cur_ptr
|
798
|
+
if (line_end_ptr - cur_ptr >= 11 && memcmp(cur_ptr, BinarySignature, 11) == 0){
|
799
799
|
/* binary COPY header signature detected -> just drop it */
|
800
800
|
int ext_bytes;
|
801
801
|
cur_ptr += 11;
|
802
802
|
|
803
803
|
/* read flags */
|
804
|
-
if (cur_ptr
|
804
|
+
if (line_end_ptr - cur_ptr < 4 ) goto length_error;
|
805
805
|
cur_ptr += 4;
|
806
806
|
|
807
807
|
/* read header extensions */
|
808
|
-
if (cur_ptr
|
808
|
+
if (line_end_ptr - cur_ptr < 4 ) goto length_error;
|
809
809
|
ext_bytes = read_nbo32(cur_ptr);
|
810
810
|
if (ext_bytes < 0) goto length_error;
|
811
811
|
cur_ptr += 4;
|
812
|
-
if (cur_ptr
|
812
|
+
if (line_end_ptr - cur_ptr < ext_bytes ) goto length_error;
|
813
813
|
cur_ptr += ext_bytes;
|
814
814
|
}
|
815
815
|
|
816
816
|
/* read row header */
|
817
|
-
if (cur_ptr
|
817
|
+
if (line_end_ptr - cur_ptr < 2 ) goto length_error;
|
818
818
|
nfields = read_nbo16(cur_ptr);
|
819
819
|
cur_ptr += 2;
|
820
820
|
|
@@ -830,7 +830,7 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
|
|
830
830
|
VALUE field_value;
|
831
831
|
|
832
832
|
/* read field size */
|
833
|
-
if (cur_ptr
|
833
|
+
if (line_end_ptr - cur_ptr < 4 ) goto length_error;
|
834
834
|
input_len = read_nbo32(cur_ptr);
|
835
835
|
cur_ptr += 4;
|
836
836
|
|
@@ -839,7 +839,7 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
|
|
839
839
|
/* NULL indicator */
|
840
840
|
rb_ary_push(array, Qnil);
|
841
841
|
} else {
|
842
|
-
if (cur_ptr
|
842
|
+
if (line_end_ptr - cur_ptr < input_len ) goto length_error;
|
843
843
|
|
844
844
|
/* copy input data to field_str */
|
845
845
|
PG_RB_STR_ENSURE_CAPA( field_str, input_len, output_ptr, end_capa_ptr );
|
data/ext/pg_result.c
CHANGED
@@ -392,8 +392,8 @@ pg_result_clear(VALUE self)
|
|
392
392
|
* It also denies setting a type_map or field_name_type.
|
393
393
|
*
|
394
394
|
*/
|
395
|
-
VALUE
|
396
|
-
|
395
|
+
static VALUE
|
396
|
+
pg_result_freeze(VALUE self)
|
397
397
|
{
|
398
398
|
t_pg_result *this = pgresult_get_this(self);
|
399
399
|
|
data/lib/3.1/pg_ext.so
CHANGED
Binary file
|
data/lib/3.2/pg_ext.so
CHANGED
Binary file
|
data/lib/3.3/pg_ext.so
ADDED
Binary file
|
data/lib/pg/version.rb
CHANGED
Binary file
|
data/pg.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
25
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features|translation)/}) }
|
27
27
|
end
|
28
28
|
spec.extensions = ["ext/extconf.rb"]
|
29
29
|
spec.require_paths = ["lib"]
|
data.tar.gz.sig
CHANGED
Binary file
|