pg 1.5.8 → 1.6.2

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 (72) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/{History.md → CHANGELOG.md} +76 -0
  4. data/Gemfile +7 -4
  5. data/README-Windows.rdoc +1 -1
  6. data/README.ja.md +4 -4
  7. data/README.md +60 -20
  8. data/Rakefile +92 -14
  9. data/ext/errorcodes.def +4 -5
  10. data/ext/errorcodes.txt +2 -5
  11. data/ext/extconf.rb +188 -15
  12. data/ext/gvl_wrappers.c +13 -2
  13. data/ext/gvl_wrappers.h +33 -0
  14. data/ext/pg.c +16 -5
  15. data/ext/pg.h +9 -9
  16. data/ext/pg_binary_decoder.c +151 -1
  17. data/ext/pg_binary_encoder.c +212 -9
  18. data/ext/pg_cancel_connection.c +360 -0
  19. data/ext/pg_coder.c +54 -5
  20. data/ext/pg_connection.c +368 -158
  21. data/ext/pg_copy_coder.c +2 -2
  22. data/ext/pg_record_coder.c +1 -1
  23. data/ext/pg_result.c +15 -17
  24. data/ext/pg_text_decoder.c +1 -1
  25. data/ext/pg_text_encoder.c +22 -9
  26. data/ext/pg_tuple.c +7 -7
  27. data/ext/pg_type_map.c +4 -2
  28. data/ext/pg_type_map_all_strings.c +1 -1
  29. data/ext/pg_type_map_by_class.c +1 -1
  30. data/ext/pg_type_map_by_column.c +2 -1
  31. data/ext/pg_type_map_by_mri_type.c +1 -1
  32. data/ext/pg_type_map_by_oid.c +3 -1
  33. data/ext/pg_type_map_in_ruby.c +1 -1
  34. data/ext/pg_util.c +2 -2
  35. data/ext/pg_util.h +2 -2
  36. data/lib/pg/basic_type_map_for_queries.rb +7 -3
  37. data/lib/pg/basic_type_registry.rb +2 -2
  38. data/lib/pg/cancel_connection.rb +53 -0
  39. data/lib/pg/coder.rb +4 -2
  40. data/lib/pg/connection.rb +259 -138
  41. data/lib/pg/version.rb +2 -1
  42. data/lib/pg.rb +156 -130
  43. data/misc/glibc/Dockerfile +20 -0
  44. data/misc/glibc/docker-compose.yml +9 -0
  45. data/misc/glibc/glibc_spec.rb +5 -0
  46. data/misc/yugabyte/Dockerfile +9 -0
  47. data/misc/yugabyte/docker-compose.yml +28 -0
  48. data/misc/yugabyte/pg-test.rb +45 -0
  49. data/pg.gemspec +8 -4
  50. data/ports/patches/krb5/1.22.1/0001-Allow-static-linking-krb5-library.patch +30 -0
  51. data/ports/patches/krb5/1.22.1/0002-unknown-command-line-option-on-clang.patch +12 -0
  52. data/ports/patches/openssl/3.5.2/0001-aarch64-mingw.patch +21 -0
  53. data/ports/patches/postgresql/17.6/0001-Use-workaround-of-__builtin_setjmp-only-on-MINGW-on-.patch +42 -0
  54. data/ports/patches/postgresql/17.6/0001-libpq-Process-buffered-SSL-read-bytes-to-support-rec.patch +52 -0
  55. data/rakelib/pg_gem_helper.rb +64 -0
  56. data.tar.gz.sig +0 -0
  57. metadata +36 -36
  58. metadata.gz.sig +0 -0
  59. data/.appveyor.yml +0 -42
  60. data/.gems +0 -6
  61. data/.gemtest +0 -0
  62. data/.github/workflows/binary-gems.yml +0 -117
  63. data/.github/workflows/source-gem.yml +0 -152
  64. data/.gitignore +0 -22
  65. data/.hgsigs +0 -34
  66. data/.hgtags +0 -41
  67. data/.irbrc +0 -23
  68. data/.pryrc +0 -23
  69. data/.tm_properties +0 -21
  70. data/.travis.yml +0 -49
  71. data/Manifest.txt +0 -72
  72. data/Rakefile.cross +0 -298
data/lib/pg.rb CHANGED
@@ -5,135 +5,161 @@
5
5
  # The top-level PG namespace.
6
6
  module PG
7
7
 
8
- # Is this file part of a fat binary gem with bundled libpq?
9
- bundled_libpq_path = File.join(__dir__, RUBY_PLATFORM.gsub(/^i386-/, "x86-"))
10
- if File.exist?(bundled_libpq_path)
11
- POSTGRESQL_LIB_PATH = bundled_libpq_path
12
- else
13
- bundled_libpq_path = nil
14
- # Try to load libpq path as found by extconf.rb
15
- begin
16
- require "pg/postgresql_lib_path"
17
- rescue LoadError
18
- # rake-compiler doesn't use regular "make install", but uses it's own install tasks.
19
- # It therefore doesn't copy pg/postgresql_lib_path.rb in case of "rake compile".
20
- POSTGRESQL_LIB_PATH = false
21
- end
22
- end
23
-
24
- add_dll_path = proc do |path, &block|
25
- if RUBY_PLATFORM =~/(mswin|mingw)/i && path && File.exist?(path)
26
- begin
27
- require 'ruby_installer/runtime'
28
- RubyInstaller::Runtime.add_dll_directory(path, &block)
29
- rescue LoadError
30
- old_path = ENV['PATH']
31
- ENV['PATH'] = "#{path};#{old_path}"
32
- block.call
33
- ENV['PATH'] = old_path
34
- end
35
- else
36
- # No need to set a load path manually - it's set as library rpath.
37
- block.call
38
- end
39
- end
40
-
41
- # Add a load path to the one retrieved from pg_config
42
- add_dll_path.call(POSTGRESQL_LIB_PATH) do
43
- if bundled_libpq_path
44
- # It's a Windows binary gem, try the <major>.<minor> subdirectory
45
- major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
46
- raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
47
- require "#{major_minor}/pg_ext"
48
- else
49
- require 'pg_ext'
50
- end
51
- end
52
-
53
- # Get the PG library version.
54
- #
55
- # +include_buildnum+ is no longer used and any value passed will be ignored.
56
- def self.version_string( include_buildnum=nil )
57
- "%s %s" % [ self.name, VERSION ]
58
- end
59
-
60
-
61
- ### Convenience alias for PG::Connection.new.
62
- def self.connect( *args, &block )
63
- Connection.new( *args, &block )
64
- end
65
-
66
- if defined?(Ractor.make_shareable)
67
- def self.make_shareable(obj)
68
- Ractor.make_shareable(obj)
69
- end
70
- else
71
- def self.make_shareable(obj)
72
- obj.freeze
73
- end
74
- end
75
-
76
- module BinaryDecoder
77
- %i[ TimestampUtc TimestampUtcToLocal TimestampLocal ].each do |klass|
78
- autoload klass, 'pg/binary_decoder/timestamp'
79
- end
80
- autoload :Date, 'pg/binary_decoder/date'
81
- end
82
- module BinaryEncoder
83
- %i[ TimestampUtc TimestampLocal ].each do |klass|
84
- autoload klass, 'pg/binary_encoder/timestamp'
85
- end
86
- end
87
- module TextDecoder
88
- %i[ TimestampUtc TimestampUtcToLocal TimestampLocal TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
89
- autoload klass, 'pg/text_decoder/timestamp'
90
- end
91
- autoload :Date, 'pg/text_decoder/date'
92
- autoload :Inet, 'pg/text_decoder/inet'
93
- autoload :JSON, 'pg/text_decoder/json'
94
- autoload :Numeric, 'pg/text_decoder/numeric'
95
- end
96
- module TextEncoder
97
- %i[ TimestampUtc TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
98
- autoload klass, 'pg/text_encoder/timestamp'
99
- end
100
- autoload :Date, 'pg/text_encoder/date'
101
- autoload :Inet, 'pg/text_encoder/inet'
102
- autoload :JSON, 'pg/text_encoder/json'
103
- autoload :Numeric, 'pg/text_encoder/numeric'
104
- end
105
-
106
- autoload :BasicTypeMapBasedOnResult, 'pg/basic_type_map_based_on_result'
107
- autoload :BasicTypeMapForQueries, 'pg/basic_type_map_for_queries'
108
- autoload :BasicTypeMapForResults, 'pg/basic_type_map_for_results'
109
- autoload :BasicTypeRegistry, 'pg/basic_type_registry'
110
- require 'pg/exceptions'
111
- require 'pg/coder'
112
- require 'pg/type_map_by_column'
113
- require 'pg/connection'
114
- require 'pg/result'
115
- require 'pg/tuple'
116
- autoload :VERSION, 'pg/version'
117
-
118
-
119
- # Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1
120
- if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations)
121
- module TruffleFixWarn
122
- def warn(str, category=nil)
123
- super(str)
124
- end
125
- end
126
- Warning.extend(TruffleFixWarn)
127
- end
128
-
129
- # Ruby-3.4+ prints a warning, if bigdecimal is required but not in the Gemfile.
130
- # But it's a false positive, since we enable bigdecimal depending features only if it's available.
131
- # And most people don't need these features.
132
- def self.require_bigdecimal_without_warning
133
- oldverb, $VERBOSE = $VERBOSE, nil
134
- require "bigdecimal"
135
- ensure
136
- $VERBOSE = oldverb
137
- end
8
+ # Is this file part of a fat binary gem with bundled libpq?
9
+ # This path must be enabled by add_dll_directory on Windows.
10
+ gplat = Gem::Platform.local
11
+ bundled_libpq_path = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/lib", __dir__)].first
12
+ if bundled_libpq_path
13
+ POSTGRESQL_LIB_PATH = bundled_libpq_path
14
+ else
15
+ # Try to load libpq path as found by extconf.rb
16
+ begin
17
+ require "pg/postgresql_lib_path"
18
+ rescue LoadError
19
+ # rake-compiler doesn't use regular "make install", but uses it's own install tasks.
20
+ # It therefore doesn't copy pg/postgresql_lib_path.rb in case of "rake compile".
21
+ POSTGRESQL_LIB_PATH = false
22
+ end
23
+ end
24
+ POSTGRESQL_LIB_PATH.freeze
25
+
26
+ add_dll_path = proc do |path, &block|
27
+ if RUBY_PLATFORM =~/(mswin|mingw)/i && path
28
+ BUNDLED_LIBPQ_WITH_UNIXSOCKET = false
29
+ begin
30
+ require 'ruby_installer/runtime'
31
+ RubyInstaller::Runtime.add_dll_directory(path, &block)
32
+ rescue LoadError
33
+ old_path = ENV['PATH']
34
+ ENV['PATH'] = "#{path};#{old_path}"
35
+ block.call
36
+ ENV['PATH'] = old_path
37
+ end
38
+ else
39
+ # libpq is found by a relative rpath in the cross compiled extension dll
40
+ # or by the system library loader
41
+ block.call
42
+ BUNDLED_LIBPQ_WITH_UNIXSOCKET = RUBY_PLATFORM=~/linux/i && PG::IS_BINARY_GEM
43
+ end
44
+ end
45
+
46
+ # Add a load path to the one retrieved from pg_config
47
+ add_dll_path.call(POSTGRESQL_LIB_PATH) do
48
+ begin
49
+ # Try the <major>.<minor> subdirectory for fat binary gems
50
+ major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
51
+ raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
52
+ require "#{major_minor}/pg_ext"
53
+ rescue LoadError => error1
54
+ begin
55
+ require 'pg_ext'
56
+ rescue LoadError => error2
57
+ msg = <<~EOT
58
+ pg's C extension failed to load:
59
+ #{error1}
60
+ #{error2}
61
+ EOT
62
+ if msg =~ /GLIBC/
63
+ msg += <<~EOT
64
+
65
+ The GLIBC version of this system seems too old. Please use the source version of pg:
66
+ gem uninstall pg --all
67
+ gem install pg --platform ruby
68
+ or in your Gemfile:
69
+ gem "pg", force_ruby_platform: true
70
+ See also: https://deveiate.org/code/pg/README_md.html#label-Source+gem
71
+ EOT
72
+ end
73
+ raise error2, msg
74
+ end
75
+ end
76
+ end
77
+
78
+ # Get the PG library version.
79
+ #
80
+ # +include_buildnum+ is no longer used and any value passed will be ignored.
81
+ def self.version_string( include_buildnum=nil )
82
+ "%s %s" % [ self.name, VERSION ]
83
+ end
84
+
85
+
86
+ ### Convenience alias for PG::Connection.new.
87
+ def self.connect( *args, &block )
88
+ Connection.new( *args, &block )
89
+ end
90
+
91
+ if defined?(Ractor.make_shareable)
92
+ def self.make_shareable(obj)
93
+ Ractor.make_shareable(obj)
94
+ end
95
+ else
96
+ def self.make_shareable(obj)
97
+ obj.freeze
98
+ end
99
+ end
100
+
101
+ module BinaryDecoder
102
+ %i[ TimestampUtc TimestampUtcToLocal TimestampLocal ].each do |klass|
103
+ autoload klass, 'pg/binary_decoder/timestamp'
104
+ end
105
+ autoload :Date, 'pg/binary_decoder/date'
106
+ end
107
+ module BinaryEncoder
108
+ %i[ TimestampUtc TimestampLocal ].each do |klass|
109
+ autoload klass, 'pg/binary_encoder/timestamp'
110
+ end
111
+ end
112
+ module TextDecoder
113
+ %i[ TimestampUtc TimestampUtcToLocal TimestampLocal TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
114
+ autoload klass, 'pg/text_decoder/timestamp'
115
+ end
116
+ autoload :Date, 'pg/text_decoder/date'
117
+ autoload :Inet, 'pg/text_decoder/inet'
118
+ autoload :JSON, 'pg/text_decoder/json'
119
+ autoload :Numeric, 'pg/text_decoder/numeric'
120
+ end
121
+ module TextEncoder
122
+ %i[ TimestampUtc TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
123
+ autoload klass, 'pg/text_encoder/timestamp'
124
+ end
125
+ autoload :Date, 'pg/text_encoder/date'
126
+ autoload :Inet, 'pg/text_encoder/inet'
127
+ autoload :JSON, 'pg/text_encoder/json'
128
+ autoload :Numeric, 'pg/text_encoder/numeric'
129
+ end
130
+
131
+ autoload :BasicTypeMapBasedOnResult, 'pg/basic_type_map_based_on_result'
132
+ autoload :BasicTypeMapForQueries, 'pg/basic_type_map_for_queries'
133
+ autoload :BasicTypeMapForResults, 'pg/basic_type_map_for_results'
134
+ autoload :BasicTypeRegistry, 'pg/basic_type_registry'
135
+ require 'pg/exceptions'
136
+ require 'pg/coder'
137
+ require 'pg/type_map_by_column'
138
+ require 'pg/connection'
139
+ require 'pg/cancel_connection'
140
+ require 'pg/result'
141
+ require 'pg/tuple'
142
+ autoload :VERSION, 'pg/version'
143
+
144
+
145
+ # Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1
146
+ if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations)
147
+ module TruffleFixWarn
148
+ def warn(str, category=nil)
149
+ super(str)
150
+ end
151
+ end
152
+ Warning.extend(TruffleFixWarn)
153
+ end
154
+
155
+ # Ruby-3.4+ prints a warning, if bigdecimal is required but not in the Gemfile.
156
+ # But it's a false positive, since we enable bigdecimal depending features only if it's available.
157
+ # And most people don't need these features.
158
+ def self.require_bigdecimal_without_warning
159
+ oldverb, $VERBOSE = $VERBOSE, nil
160
+ require "bigdecimal"
161
+ ensure
162
+ $VERBOSE = oldverb
163
+ end
138
164
 
139
165
  end # module PG
@@ -0,0 +1,20 @@
1
+ FROM debian:10.13
2
+
3
+ WORKDIR /pg
4
+
5
+ # Debian 10.13 is EOL now:
6
+ RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
7
+
8
+ RUN apt-get update && apt-get install ruby git wget gcc make libz-dev libffi-dev libreadline-dev libyaml-dev libssl-dev -y
9
+
10
+ ENV RBENV_ROOT=/usr/local/rbenv
11
+
12
+ RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
13
+ git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
14
+ $RBENV_ROOT/bin/rbenv init
15
+
16
+ RUN $RBENV_ROOT/bin/rbenv install 3.3.9 -- --disable-install-doc
17
+ RUN /usr/local/rbenv/versions/3.3.9/bin/gem inst rspec
18
+
19
+ CMD /usr/local/rbenv/versions/3.3.9/bin/gem inst --local pg-*.gem && \
20
+ /usr/local/rbenv/versions/3.3.9/bin/rspec glibc_spec.rb
@@ -0,0 +1,9 @@
1
+ services:
2
+ pg:
3
+ build:
4
+ context: .
5
+ args:
6
+ - http_proxy
7
+ - https_proxy
8
+ volumes:
9
+ - .:/pg
@@ -0,0 +1,5 @@
1
+ RSpec.describe "require 'pg'" do
2
+ it "gives a descriptive error message when GLIBC is too old" do
3
+ expect { require "pg" }.to raise_error(/GLIBC.*gem install pg --platform ruby/m)
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ FROM yugabytedb/yugabyte:2024.1.0.0-b129
2
+
3
+ WORKDIR /app
4
+
5
+ RUN yugabyted cert generate_server_certs --hostnames=127.0.0.1 --base_dir=.
6
+
7
+ ENTRYPOINT ["yugabyted"]
8
+ CMD ["start", "--background", "false", "--ui", "false", "--tserver_flags", "use_client_to_server_encryption=true,cert_node_filename=127.0.0.1,certs_dir=/app/generated_certs/127.0.0.1"]
9
+ VOLUME /app
@@ -0,0 +1,28 @@
1
+ services:
2
+ yb:
3
+ build: .
4
+ container_name: yb
5
+ ports:
6
+ - "127.0.0.1:5433:5433"
7
+ volumes:
8
+ - certs:/app/generated_certs
9
+ healthcheck:
10
+ test: 'ysqlsh -h $$(hostname) -c \\conninfo || exit 1;'
11
+ interval: 2s
12
+ timeout: 30s
13
+ retries: 20
14
+ start_period: 10s
15
+
16
+ pg:
17
+ image: ruby:3.0
18
+ working_dir: /app
19
+ volumes:
20
+ - .:/app
21
+ - certs:/generated_certs
22
+ command: bash -c "gem inst pg-*.gem && ruby pg-test.rb"
23
+ depends_on:
24
+ yb:
25
+ condition: service_healthy
26
+
27
+ volumes:
28
+ certs:
@@ -0,0 +1,45 @@
1
+ require 'pg'
2
+
3
+ conn = PG.connect(
4
+ host: 'yb',
5
+ port: 5433,
6
+ user: 'yugabyte',
7
+ dbname: 'yugabyte',
8
+ sslmode: 'require',
9
+ sslrootcert: 'app/generated_certs/127.0.0.1/ca.crt',
10
+ sslcert: 'app/generated_certs/127.0.0.1/node.127.0.0.1.crt',
11
+ sslkey: 'app/generated_certs/127.0.0.1/node.127.0.0.1.key'
12
+ )
13
+
14
+ $stdout.sync = true
15
+ # fd = File.open("pg_trace.log", "a+")
16
+ # conn.trace(fd)
17
+
18
+ begin
19
+ # Validate connection is working
20
+ res = conn.exec("SELECT version();")
21
+ res.each_row do |row|
22
+ puts "You are connected to: #{row[0]}"
23
+ end
24
+ # 53*511
25
+ # 53*767
26
+ # 53*1023
27
+ # 53*1279
28
+ # 7*1817
29
+ # 11*1487
30
+ # 13*1363
31
+ # 16*1211
32
+ # 18*1128
33
+ # 22*1984
34
+ # 27*1723
35
+
36
+ (22..53).each do |m|
37
+ (1..2048).each do |l|
38
+ hanging_query = "SELECT lpad(''::text, #{m}, '0') FROM generate_series(1, #{l});"
39
+ puts "Executing hanging query: #{hanging_query}"
40
+ conn.exec(hanging_query)
41
+ end
42
+ end
43
+ ensure
44
+ conn.close if conn
45
+ end
data/pg.gemspec CHANGED
@@ -10,20 +10,24 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["ged@FaerieMUD.org", "lars@greiz-reinsdorf.de"]
11
11
 
12
12
  spec.summary = "Pg is the Ruby interface to the PostgreSQL RDBMS"
13
- spec.description = "Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL 9.3 and later."
13
+ spec.description = "Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL 10 and later."
14
14
  spec.homepage = "https://github.com/ged/ruby-pg"
15
15
  spec.license = "BSD-2-Clause"
16
- spec.required_ruby_version = ">= 2.5"
16
+ spec.required_ruby_version = ">= 2.7"
17
17
 
18
18
  spec.metadata["homepage_uri"] = spec.homepage
19
19
  spec.metadata["source_code_uri"] = "https://github.com/ged/ruby-pg"
20
- spec.metadata["changelog_uri"] = "https://github.com/ged/ruby-pg/blob/master/History.md"
20
+ spec.metadata["changelog_uri"] = "https://github.com/ged/ruby-pg/blob/master/CHANGELOG.md"
21
21
  spec.metadata["documentation_uri"] = "http://deveiate.org/code/pg"
22
+ # https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency
23
+ spec.metadata["msys2_mingw_dependencies"] = "postgresql"
22
24
 
23
25
  # Specify which files should be added to the gem when it is released.
24
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
27
  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|translation)/}) }
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ f.match(%r{\A(?:test|spec|features|translation|\.)})
30
+ end
27
31
  end
28
32
  spec.extensions = ["ext/extconf.rb"]
29
33
  spec.require_paths = ["lib"]
@@ -0,0 +1,30 @@
1
+ From e82c1b395162ea71279ea2170259383082e41ab0 Mon Sep 17 00:00:00 2001
2
+ From: Lars Kanis <lars@greiz-reinsdorf.de>
3
+ Date: Sat, 12 Jul 2025 10:55:17 +0200
4
+ Subject: [PATCH] Allow static linking krb5 library
5
+
6
+ Otherwise it fails with:
7
+ Undefined symbols for architecture arm64:
8
+ "_krb5int_c_mit_des_zeroblock", referenced from:
9
+ _krb5int_des3_cbc_encrypt in libk5crypto.a(d3_aead.o)
10
+ _krb5int_des3_cbc_decrypt in libk5crypto.a(d3_aead.o)
11
+ ---
12
+ src/lib/crypto/builtin/des/des_int.h | 2 +-
13
+ 1 file changed, 1 insertion(+), 1 deletion(-)
14
+
15
+ diff --git a/src/lib/crypto/builtin/des/des_int.h b/src/lib/crypto/builtin/des/des_int.h
16
+ index 46fed7dbd..114e48ebd 100644
17
+ --- a/lib/crypto/builtin/des/des_int.h
18
+ +++ b/lib/crypto/builtin/des/des_int.h
19
+ @@ -159,7 +159,7 @@ mit_des_cbc_encrypt(const mit_des_cblock *in, mit_des_cblock *out,
20
+ const mit_des_cblock ivec, int enc);
21
+
22
+ #define mit_des_zeroblock krb5int_c_mit_des_zeroblock
23
+ -extern const mit_des_cblock mit_des_zeroblock;
24
+ +const mit_des_cblock mit_des_zeroblock;
25
+
26
+ /* fin_rndkey.c */
27
+ krb5_error_code mit_des_finish_random_key(const krb5_encrypt_block *,
28
+ --
29
+ 2.43.0
30
+
@@ -0,0 +1,12 @@
1
+ diff --git a/src/lib/krb5/krb/deltat.c b/src/lib/krb5/krb/deltat.c
2
+ index 03145c854..34cdf969e 100644
3
+ --- a/lib/krb5/krb/deltat.c
4
+ +++ b/lib/krb5/krb/deltat.c
5
+ @@ -44,7 +44,6 @@
6
+ #ifdef __GNUC__
7
+ #pragma GCC diagnostic push
8
+ #pragma GCC diagnostic ignored "-Wuninitialized"
9
+ -#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
10
+ #endif
11
+
12
+ #include "k5-int.h"
@@ -0,0 +1,21 @@
1
+ --- a/Configurations/10-main.conf
2
+ +++ b/Configurations/10-main.conf
3
+ @@ -1603,6 +1603,18 @@
4
+ multilib => "64",
5
+ },
6
+
7
+ + "mingwarm64" => {
8
+ + inherit_from => [ "mingw-common" ],
9
+ + cflags => "",
10
+ + sys_id => "MINGWARM64",
11
+ + bn_ops => add("SIXTY_FOUR_BIT"),
12
+ + asm_arch => 'aarch64',
13
+ + uplink_arch => 'armv8',
14
+ + perlasm_scheme => "win64",
15
+ + shared_rcflag => "",
16
+ + multilib => "-arm64",
17
+ + },
18
+ +
19
+ #### UEFI
20
+ "UEFI" => {
21
+ inherit_from => [ "BASE_unix" ],
@@ -0,0 +1,42 @@
1
+ From 746e8e250b265c40d9706f26560e02e8623f123f Mon Sep 17 00:00:00 2001
2
+ From: Lars Kanis <lars@greiz-reinsdorf.de>
3
+ Date: Fri, 31 Jan 2025 21:58:00 +0100
4
+ Subject: [PATCH] Use workaround of __builtin_setjmp only on MINGW on MSVCRT
5
+
6
+ Because it is not present on ARM64 on Windows and not necessary on any UCRT based toolchain.
7
+ ---
8
+ src/include/c.h | 10 +++++-----
9
+ 1 file changed, 5 insertions(+), 5 deletions(-)
10
+
11
+ diff --git a/src/include/c.h b/src/include/c.h
12
+ index a14c631516..33792c860c 100644
13
+ --- a/src/include/c.h
14
+ +++ b/src/include/c.h
15
+ @@ -1312,19 +1312,19 @@ extern int fdatasync(int fildes);
16
+ /*
17
+ * When there is no sigsetjmp, its functionality is provided by plain
18
+ * setjmp. We now support the case only on Windows. However, it seems
19
+ - * that MinGW-64 has some longstanding issues in its setjmp support,
20
+ - * so on that toolchain we cheat and use gcc's builtins.
21
+ + * that MinGW-64 on x86_64 has some longstanding issues in its setjmp
22
+ + * support, so on that toolchain we cheat and use gcc's builtins.
23
+ */
24
+ #ifdef WIN32
25
+ -#ifdef __MINGW64__
26
+ +#if defined(__MINGW64__) && !defined(_UCRT)
27
+ typedef intptr_t sigjmp_buf[5];
28
+ #define sigsetjmp(x,y) __builtin_setjmp(x)
29
+ #define siglongjmp __builtin_longjmp
30
+ -#else /* !__MINGW64__ */
31
+ +#else /* !defined(__MINGW64__) || defined(_UCRT) */
32
+ #define sigjmp_buf jmp_buf
33
+ #define sigsetjmp(x,y) setjmp(x)
34
+ #define siglongjmp longjmp
35
+ -#endif /* __MINGW64__ */
36
+ +#endif /* defined(__MINGW64__) && !defined(_UCRT) */
37
+ #endif /* WIN32 */
38
+
39
+ /* /port compatibility functions */
40
+ --
41
+ 2.43.0
42
+
@@ -0,0 +1,52 @@
1
+ From ab793829a4ce473f1cc2bbc0e2a6f6753553255d Mon Sep 17 00:00:00 2001
2
+ From: Lars Kanis <lars@greiz-reinsdorf.de>
3
+ Date: Sun, 8 Sep 2024 13:59:05 +0200
4
+ Subject: [PATCH] libpq: Process buffered SSL read bytes to support records
5
+ >8kB on async API
6
+
7
+ The async API of libpq doesn't support SSL record sizes >8kB so far.
8
+ This size isn't exceeded by vanilla PostgreSQL, but by other products using
9
+ the postgres wire protocol 3.
10
+ PQconsumeInput() reads all data readable from the socket, so that the read
11
+ condition is cleared.
12
+ But it doesn't process all the data that is pending on the SSL layer.
13
+ Also a subsequent call to PQisBusy() doesn't process it, so that the client
14
+ is triggered to wait for more readable data on the socket.
15
+ But this never arrives, so that the connection blocks infinitely.
16
+
17
+ To fix this issue call pqReadData() repeatedly until there is no buffered
18
+ SSL data left to be read.
19
+
20
+ The synchronous libpq API isn't affected, since it supports arbitrary SSL
21
+ record sizes already.
22
+ ---
23
+ src/interfaces/libpq/fe-exec.c | 13 +++++++++++++
24
+ 1 file changed, 13 insertions(+)
25
+
26
+ diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
27
+ index 0d224a852..637894ee1 100644
28
+ --- a/src/interfaces/libpq/fe-exec.c
29
+ +++ b/src/interfaces/libpq/fe-exec.c
30
+ @@ -2006,6 +2006,19 @@ PQconsumeInput(PGconn *conn)
31
+ if (pqReadData(conn) < 0)
32
+ return 0;
33
+
34
+ + #ifdef USE_SSL
35
+ + /*
36
+ + * Ensure all buffered read bytes in the SSL library are processed,
37
+ + * which might be not the case, if the SSL record size exceeds 8k.
38
+ + * Otherwise parseInput can't process the data.
39
+ + */
40
+ + while (conn->ssl_in_use && pgtls_read_pending(conn))
41
+ + {
42
+ + if (pqReadData(conn) < 0)
43
+ + return 0;
44
+ + }
45
+ + #endif
46
+ +
47
+ /* Parsing of the data waits till later. */
48
+ return 1;
49
+ }
50
+ --
51
+ 2.43.0
52
+