pg 0.18.4 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/BSDL +2 -2
  5. data/ChangeLog +0 -5911
  6. data/History.rdoc +240 -0
  7. data/Manifest.txt +8 -20
  8. data/README-Windows.rdoc +4 -4
  9. data/README.ja.rdoc +1 -2
  10. data/README.rdoc +64 -15
  11. data/Rakefile +20 -21
  12. data/Rakefile.cross +67 -69
  13. data/ext/errorcodes.def +101 -0
  14. data/ext/errorcodes.rb +1 -1
  15. data/ext/errorcodes.txt +33 -2
  16. data/ext/extconf.rb +26 -36
  17. data/ext/gvl_wrappers.c +4 -0
  18. data/ext/gvl_wrappers.h +27 -39
  19. data/ext/pg.c +156 -145
  20. data/ext/pg.h +74 -98
  21. data/ext/pg_binary_decoder.c +82 -15
  22. data/ext/pg_binary_encoder.c +20 -19
  23. data/ext/pg_coder.c +103 -21
  24. data/ext/pg_connection.c +917 -523
  25. data/ext/pg_copy_coder.c +50 -12
  26. data/ext/pg_record_coder.c +491 -0
  27. data/ext/pg_result.c +590 -208
  28. data/ext/pg_text_decoder.c +606 -40
  29. data/ext/pg_text_encoder.c +245 -94
  30. data/ext/pg_tuple.c +549 -0
  31. data/ext/pg_type_map.c +14 -7
  32. data/ext/pg_type_map_all_strings.c +4 -4
  33. data/ext/pg_type_map_by_class.c +9 -4
  34. data/ext/pg_type_map_by_column.c +7 -6
  35. data/ext/pg_type_map_by_mri_type.c +1 -1
  36. data/ext/pg_type_map_by_oid.c +3 -2
  37. data/ext/pg_type_map_in_ruby.c +1 -1
  38. data/ext/{util.c → pg_util.c} +10 -10
  39. data/ext/{util.h → pg_util.h} +2 -2
  40. data/lib/pg.rb +23 -13
  41. data/lib/pg/basic_type_mapping.rb +155 -32
  42. data/lib/pg/binary_decoder.rb +23 -0
  43. data/lib/pg/coder.rb +23 -2
  44. data/lib/pg/connection.rb +73 -13
  45. data/lib/pg/constants.rb +2 -1
  46. data/lib/pg/exceptions.rb +2 -1
  47. data/lib/pg/result.rb +24 -7
  48. data/lib/pg/text_decoder.rb +24 -22
  49. data/lib/pg/text_encoder.rb +40 -8
  50. data/lib/pg/tuple.rb +30 -0
  51. data/lib/pg/type_map_by_column.rb +3 -2
  52. data/spec/helpers.rb +61 -36
  53. data/spec/pg/basic_type_mapping_spec.rb +415 -36
  54. data/spec/pg/connection_spec.rb +732 -327
  55. data/spec/pg/connection_sync_spec.rb +41 -0
  56. data/spec/pg/result_spec.rb +253 -21
  57. data/spec/pg/tuple_spec.rb +333 -0
  58. data/spec/pg/type_map_by_class_spec.rb +4 -4
  59. data/spec/pg/type_map_by_column_spec.rb +6 -2
  60. data/spec/pg/type_map_by_mri_type_spec.rb +2 -2
  61. data/spec/pg/type_map_by_oid_spec.rb +3 -3
  62. data/spec/pg/type_map_in_ruby_spec.rb +1 -1
  63. data/spec/pg/type_map_spec.rb +1 -1
  64. data/spec/pg/type_spec.rb +446 -20
  65. data/spec/pg_spec.rb +2 -2
  66. metadata +63 -72
  67. metadata.gz.sig +0 -0
  68. data/sample/array_insert.rb +0 -20
  69. data/sample/async_api.rb +0 -106
  70. data/sample/async_copyto.rb +0 -39
  71. data/sample/async_mixed.rb +0 -56
  72. data/sample/check_conn.rb +0 -21
  73. data/sample/copyfrom.rb +0 -81
  74. data/sample/copyto.rb +0 -19
  75. data/sample/cursor.rb +0 -21
  76. data/sample/disk_usage_report.rb +0 -186
  77. data/sample/issue-119.rb +0 -94
  78. data/sample/losample.rb +0 -69
  79. data/sample/minimal-testcase.rb +0 -17
  80. data/sample/notify_wait.rb +0 -72
  81. data/sample/pg_statistics.rb +0 -294
  82. data/sample/replication_monitor.rb +0 -231
  83. data/sample/test_binary_values.rb +0 -33
  84. data/sample/wal_shipper.rb +0 -434
  85. data/sample/warehouse_partitions.rb +0 -320
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rake
1
+ # -*- rake -*-
2
2
 
3
3
  require 'rbconfig'
4
4
  require 'pathname'
@@ -35,6 +35,8 @@ TEST_DIRECTORY = BASEDIR + "tmp_test_specs"
35
35
 
36
36
  CLOBBER.include( TEST_DIRECTORY.to_s )
37
37
  CLEAN.include( PKGDIR.to_s, TMPDIR.to_s )
38
+ CLEAN.include "lib/*/libpq.dll"
39
+ CLEAN.include "lib/pg_ext.*"
38
40
 
39
41
  # Set up Hoe plugins
40
42
  Hoe.plugin :mercurial
@@ -55,22 +57,21 @@ $hoespec = Hoe.spec 'pg' do
55
57
  self.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
56
58
  self.extra_rdoc_files.include( 'POSTGRES', 'LICENSE' )
57
59
  self.extra_rdoc_files.include( 'ext/*.c' )
58
- self.license :BSD
60
+ self.license 'BSD-2-Clause'
59
61
 
60
62
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
61
63
  self.developer 'Lars Kanis', 'lars@greiz-reinsdorf.de'
62
64
 
63
- self.dependency 'rake-compiler', '~> 0.9', :developer
64
- self.dependency 'rake-compiler-dock', '~> 0.3', :developer
65
- self.dependency 'hoe', '~> 3.12', :developer
66
- self.dependency 'hoe-deveiate', '~> 0.6', :developer
65
+ self.dependency 'rake-compiler', '~> 1.0', :developer
66
+ self.dependency 'rake-compiler-dock', ['~> 1.0'], :developer
67
+ self.dependency 'hoe-deveiate', '~> 0.9', :developer
67
68
  self.dependency 'hoe-bundler', '~> 1.0', :developer
68
- self.dependency 'rspec', '~> 3.0', :developer
69
+ self.dependency 'rspec', '~> 3.5', :developer
70
+ self.dependency 'rdoc', '~> 5.1', :developer
69
71
 
70
- self.spec_extras[:licenses] = ['BSD', 'Ruby', 'GPL']
71
72
  self.spec_extras[:extensions] = [ 'ext/extconf.rb' ]
72
73
 
73
- self.require_ruby_version( '>= 1.9.3' )
74
+ self.require_ruby_version( '>= 2.2' )
74
75
 
75
76
  self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
76
77
  self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
@@ -81,7 +82,7 @@ end
81
82
  ENV['VERSION'] ||= $hoespec.spec.version.to_s
82
83
 
83
84
  # Tests should pass before checking in
84
- task 'hg:precheckin' => [ :check_history, :check_manifest, :spec ]
85
+ task 'hg:precheckin' => [ :check_history, :check_manifest, :spec, :gemspec ]
85
86
 
86
87
  # Support for 'rvm specs'
87
88
  task :specs => :spec
@@ -97,7 +98,7 @@ task :test do
97
98
  # the installed gem dir. So we clear the task rake-compiler set up
98
99
  # to break the dependency between :spec and :compile when running under
99
100
  # rubygems-test, and then run :spec.
100
- Rake::Task[ EXT.to_s ].clear
101
+ Rake::Task[ EXT.to_s ].clear if File.exist?(EXT.to_s)
101
102
  Rake::Task[ :spec ].execute
102
103
  end
103
104
 
@@ -106,8 +107,6 @@ task :maint do
106
107
  ENV['MAINTAINER_MODE'] = 'yes'
107
108
  end
108
109
 
109
- ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.2:2.0.0'
110
-
111
110
  # Rake-compiler task
112
111
  Rake::ExtensionTask.new do |ext|
113
112
  ext.name = 'pg_ext'
@@ -116,7 +115,7 @@ Rake::ExtensionTask.new do |ext|
116
115
  ext.lib_dir = 'lib'
117
116
  ext.source_pattern = "*.{c,h}"
118
117
  ext.cross_compile = true
119
- ext.cross_platform = CrossLibraries.map &:for_platform
118
+ ext.cross_platform = CrossLibraries.map(&:for_platform)
120
119
 
121
120
  ext.cross_config_options += CrossLibraries.map do |lib|
122
121
  {
@@ -132,8 +131,7 @@ Rake::ExtensionTask.new do |ext|
132
131
 
133
132
  # Add libpq.dll to windows binary gemspec
134
133
  ext.cross_compiling do |spec|
135
- # mingw32-platform strings differ (RUBY_PLATFORM=i386-mingw32 vs. x86-mingw32 for rubygems)
136
- spec.files << "lib/#{spec.platform.to_s.gsub(/^x86-/, "i386-")}/libpq.dll"
134
+ spec.files << "lib/#{spec.platform}/libpq.dll"
137
135
  end
138
136
  end
139
137
 
@@ -157,6 +155,7 @@ end
157
155
  file '.hg/branch' do
158
156
  warn "WARNING: You need the Mercurial repo to update the ChangeLog"
159
157
  end
158
+ Rake::Task["ChangeLog"].clear
160
159
  file 'ChangeLog' do |task|
161
160
  if File.exist?('.hg/branch')
162
161
  $stderr.puts "Updating the changelog..."
@@ -187,13 +186,11 @@ end
187
186
 
188
187
  desc "Update list of server error codes"
189
188
  task :update_error_codes do
190
- URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=HEAD"
189
+ URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_12_0"
191
190
 
192
191
  ERRORCODES_TXT = "ext/errorcodes.txt"
193
192
  sh "wget #{URL_ERRORCODES_TXT.inspect} -O #{ERRORCODES_TXT.inspect} || curl #{URL_ERRORCODES_TXT.inspect} -o #{ERRORCODES_TXT.inspect}"
194
- end
195
193
 
196
- file 'ext/errorcodes.def' => ['ext/errorcodes.rb', 'ext/errorcodes.txt'] do
197
194
  ruby 'ext/errorcodes.rb', 'ext/errorcodes.txt', 'ext/errorcodes.def'
198
195
  end
199
196
 
@@ -207,12 +204,14 @@ file GEMSPEC => __FILE__
207
204
  task GEMSPEC do |task|
208
205
  spec = $hoespec.spec
209
206
  spec.files.delete( '.gemtest' )
210
- spec.version = "#{spec.version}.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
207
+ spec.signing_key = nil
208
+ spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
209
+ spec.cert_chain = [ 'certs/ged.pem' ]
211
210
  File.open( task.name, 'w' ) do |fh|
212
211
  fh.write( spec.to_ruby )
213
212
  end
214
213
  end
215
214
 
216
- CLOBBER.include( GEMSPEC.to_s )
215
+ CLOBBER.include( '*.gemspec' )
217
216
  task :default => :gemspec
218
217
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rake
1
+ # -*- rake -*-
2
2
 
3
3
  require 'uri'
4
4
  require 'tempfile'
@@ -29,15 +29,15 @@ class CrossLibrary < OpenStruct
29
29
  self.host_platform = toolchain
30
30
 
31
31
  # Cross-compilation constants
32
- self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.2d'
33
- self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.4.4'
32
+ self.openssl_version = ENV['OPENSSL_VERSION'] || '1.1.1d'
33
+ self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '12.1'
34
34
 
35
35
  # Check if symlinks work in the current working directory.
36
36
  # This fails, if rake-compiler-dock is running on a Windows box.
37
37
  begin
38
38
  FileUtils.rm_f '.test_symlink'
39
39
  FileUtils.ln_s '/', '.test_symlink'
40
- rescue SystemCallError
40
+ rescue NotImplementedError, SystemCallError
41
41
  # Symlinks don't work -> use home directory instead
42
42
  self.compile_home = Pathname( "~/.ruby-pg-build" ).expand_path
43
43
  else
@@ -45,6 +45,8 @@ class CrossLibrary < OpenStruct
45
45
  end
46
46
  self.static_sourcesdir = compile_home + 'sources'
47
47
  self.static_builddir = compile_home + 'builds' + for_platform
48
+ CLOBBER.include( static_sourcesdir )
49
+ CLEAN.include( static_builddir )
48
50
 
49
51
  # Static OpenSSL build vars
50
52
  self.static_openssl_builddir = static_builddir + "openssl-#{openssl_version}"
@@ -54,8 +56,8 @@ class CrossLibrary < OpenStruct
54
56
  self.openssl_tarball = static_sourcesdir + File.basename( openssl_source_uri.path )
55
57
  self.openssl_makefile = static_openssl_builddir + 'Makefile'
56
58
 
57
- self.libssleay32 = static_openssl_builddir + 'libssleay32.a'
58
- self.libeay32 = static_openssl_builddir + 'libeay32.a'
59
+ self.libssl = static_openssl_builddir + 'libssl.a'
60
+ self.libcrypto = static_openssl_builddir + 'libcrypto.a'
59
61
 
60
62
  self.openssl_patches = Rake::FileList[ (MISCDIR + "openssl-#{openssl_version}.*.patch").to_s ]
61
63
 
@@ -81,19 +83,6 @@ class CrossLibrary < OpenStruct
81
83
  # clean intermediate files and folders
82
84
  CLEAN.include( static_builddir.to_s )
83
85
 
84
-
85
- ENV['RUBY_CC_VERSION'] ||= '1.9.3:2.0.0'
86
-
87
- def download(url, save_to)
88
- part = save_to+".part"
89
- sh "wget #{url.to_s.inspect} -O #{part.inspect} || curl #{url.to_s.inspect} -o #{part.inspect}"
90
- FileUtils.mv part, save_to
91
- end
92
-
93
- def run(*args)
94
- sh *args
95
- end
96
-
97
86
  #####################################################################
98
87
  ### C R O S S - C O M P I L A T I O N - T A S K S
99
88
  #####################################################################
@@ -126,11 +115,9 @@ class CrossLibrary < OpenStruct
126
115
  end
127
116
 
128
117
  self.cmd_prelude = [
129
- 'env',
130
- "CC=#{host_platform}-gcc",
118
+ "env",
119
+ "CROSS_COMPILE=#{host_platform}-",
131
120
  "CFLAGS=-DDSO_WIN32",
132
- "AR=#{host_platform}-ar",
133
- "RANLIB=#{host_platform}-ranlib"
134
121
  ]
135
122
 
136
123
 
@@ -145,9 +132,9 @@ class CrossLibrary < OpenStruct
145
132
  end
146
133
 
147
134
  desc "compile static openssl libraries"
148
- task :openssl_libs => [ libssleay32, libeay32 ]
135
+ task "openssl_libs:#{for_platform}" => [ libssl, libcrypto ]
149
136
 
150
- task :compile_static_openssl => openssl_makefile do |t|
137
+ task "compile_static_openssl:#{for_platform}" => openssl_makefile do |t|
151
138
  chdir( static_openssl_builddir ) do
152
139
  cmd = cmd_prelude.dup
153
140
  cmd << 'make' << "-j#{NUM_CPUS}" << 'build_libs'
@@ -156,14 +143,14 @@ class CrossLibrary < OpenStruct
156
143
  end
157
144
  end
158
145
 
159
- desc "compile static #{libeay32}"
160
- file libeay32 => :compile_static_openssl do |t|
161
- FileUtils.cp( static_openssl_builddir + 'libcrypto.a', libeay32.to_s )
146
+ desc "compile static #{libssl}"
147
+ file libssl => "compile_static_openssl:#{for_platform}" do |t|
148
+ rm t.name.gsub(/\.a$/, ".dll.a")
162
149
  end
163
150
 
164
- desc "compile static #{libssleay32}"
165
- file libssleay32 => :compile_static_openssl do |t|
166
- FileUtils.cp( static_openssl_builddir + 'libssl.a', libssleay32.to_s )
151
+ desc "compile static #{libcrypto}"
152
+ file libcrypto => "compile_static_openssl:#{for_platform}" do |t|
153
+ rm t.name.gsub(/\.a$/, ".dll.a")
167
154
  end
168
155
 
169
156
 
@@ -193,7 +180,7 @@ class CrossLibrary < OpenStruct
193
180
  end
194
181
 
195
182
  # generate the makefile in a clean build location
196
- file postgresql_global_makefile => [ static_postgresql_builddir, :openssl_libs ] do |t|
183
+ file postgresql_global_makefile => [ static_postgresql_builddir, "openssl_libs:#{for_platform}" ] do |t|
197
184
  options = [
198
185
  "--target=#{host_platform}",
199
186
  "--host=#{host_platform}",
@@ -207,7 +194,7 @@ class CrossLibrary < OpenStruct
207
194
  cmd << "CFLAGS=-L#{static_openssl_builddir}"
208
195
  cmd << "LDFLAGS=-L#{static_openssl_builddir}"
209
196
  cmd << "LDFLAGS_SL=-L#{static_openssl_builddir}"
210
- cmd << "LIBS=-lwsock32 -lgdi32"
197
+ cmd << "LIBS=-lwsock32 -lgdi32 -lws2_32"
211
198
  cmd << "CPPFLAGS=-I#{static_openssl_builddir}/include"
212
199
 
213
200
  run( *cmd )
@@ -221,18 +208,21 @@ class CrossLibrary < OpenStruct
221
208
  chdir( static_postgresql_srcdir + "common" ) do
222
209
  sh 'make', "-j#{NUM_CPUS}"
223
210
  end
211
+ chdir( static_postgresql_srcdir + "port" ) do
212
+ sh 'make', "-j#{NUM_CPUS}"
213
+ end
224
214
 
225
215
  chdir( postgresql_lib.dirname ) do
226
216
  sh 'make',
227
217
  "-j#{NUM_CPUS}",
228
218
  postgresql_lib.basename.to_s,
229
- 'SHLIB_LINK=-lssleay32 -leay32 -lcrypt32 -lgdi32 -lsecur32 -lwsock32 -lws2_32'
219
+ 'SHLIB_LINK=-lssl -lcrypto -lcrypt32 -lgdi32 -lsecur32 -lwsock32 -lws2_32'
230
220
  end
231
221
  end
232
222
 
233
223
 
234
224
  #desc 'compile libpg.a'
235
- task :libpq => postgresql_lib
225
+ task "native:#{for_platform}" => postgresql_lib
236
226
 
237
227
  # copy libpq.dll to lib dir
238
228
  dest_libpq = "lib/#{for_platform}/#{postgresql_lib.basename}"
@@ -247,22 +237,27 @@ class CrossLibrary < OpenStruct
247
237
  cp postgresql_lib, stage_libpq
248
238
  end
249
239
  end
250
- end
251
240
 
252
- if File.exist?(File.expand_path("~/.rake-compiler/config.yml"))
253
- CrossLibraries = [
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
241
+ def download(url, save_to)
242
+ part = save_to+".part"
243
+ sh "wget #{url.to_s.inspect} -O #{part.inspect} || curl #{url.to_s.inspect} -o #{part.inspect}"
244
+ FileUtils.mv part, save_to
245
+ end
246
+
247
+ def run(*args)
248
+ sh(*args)
258
249
  end
259
- else
260
- $stderr.puts "Cross-compilation disabled -- rake-compiler not properly installed"
261
- CrossLibraries = []
250
+ end
251
+
252
+ CrossLibraries = [
253
+ ['x86-mingw32', 'mingw', 'i686-w64-mingw32'],
254
+ ['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'],
255
+ ].map do |platform, openssl_config, toolchain|
256
+ CrossLibrary.new platform, openssl_config, toolchain
262
257
  end
263
258
 
264
259
  desc 'cross compile pg for win32'
265
- task :cross => [ :mingw32, :libpq ]
260
+ task :cross => [ :mingw32 ]
266
261
 
267
262
  task :mingw32 do
268
263
  # Use Rake::ExtensionCompiler helpers to find the proper host
@@ -273,29 +268,32 @@ task :mingw32 do
273
268
  end
274
269
  end
275
270
 
276
- # To reduce the gem file size strip mingw32 dlls before packaging
277
- ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
278
- task "tmp/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so" do |t|
279
- sh "i686-w64-mingw32-strip -S tmp/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so"
280
- end
281
-
282
- task "tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so" do |t|
283
- sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so"
284
- end
271
+ task 'gem:windows:prepare' do
272
+ require 'io/console'
273
+ require 'rake_compiler_dock'
274
+
275
+ # Copy gem signing key and certs to be accessable from the docker container
276
+ mkdir_p 'build/gem'
277
+ sh "cp ~/.gem/gem-*.pem build/gem/ || true"
278
+ sh "bundle package"
279
+ begin
280
+ OpenSSL::PKey.read(File.read(File.expand_path("~/.gem/gem-private_key.pem")), ENV["GEM_PRIVATE_KEY_PASSPHRASE"] || "")
281
+ rescue OpenSSL::PKey::PKeyError
282
+ ENV["GEM_PRIVATE_KEY_PASSPHRASE"] = STDIN.getpass("Enter passphrase of gem signature key: ")
283
+ retry
284
+ end
285
285
  end
286
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
287
+ CrossLibraries.each do |xlib|
288
+ platform = xlib.for_platform
289
+ desc "Build fat binary gem for platform #{platform}"
290
+ task "gem:windows:#{platform}" => ['ChangeLog', 'gem:windows:prepare', xlib.openssl_tarball, xlib.postgresql_tarball] do
291
+ RakeCompilerDock.sh <<-EOT, platform: platform
292
+ (cp build/gem/gem-*.pem ~/.gem/ || true) &&
293
+ bundle install --local &&
294
+ rake native:#{platform} pkg/#{$hoespec.spec.full_name}-#{platform}.gem MAKE="make -j`nproc`"
295
+ EOT
296
+ end
297
+ desc "Build the windows binary gems"
298
+ multitask 'gem:windows' => "gem:windows:#{platform}"
301
299
  end
@@ -186,6 +186,10 @@
186
186
  VALUE klass = define_error_class( "InvalidParameterValue", "22" );
187
187
  register_error_class( "22023", klass );
188
188
  }
189
+ {
190
+ VALUE klass = define_error_class( "InvalidPrecedingOrFollowingSize", "22" );
191
+ register_error_class( "22013", klass );
192
+ }
189
193
  {
190
194
  VALUE klass = define_error_class( "InvalidRegularExpression", "22" );
191
195
  register_error_class( "2201B", klass );
@@ -198,6 +202,14 @@
198
202
  VALUE klass = define_error_class( "InvalidRowCountInResultOffsetClause", "22" );
199
203
  register_error_class( "2201X", klass );
200
204
  }
205
+ {
206
+ VALUE klass = define_error_class( "InvalidTablesampleArgument", "22" );
207
+ register_error_class( "2202H", klass );
208
+ }
209
+ {
210
+ VALUE klass = define_error_class( "InvalidTablesampleRepeat", "22" );
211
+ register_error_class( "2202G", klass );
212
+ }
201
213
  {
202
214
  VALUE klass = define_error_class( "InvalidTimeZoneDisplacementValue", "22" );
203
215
  register_error_class( "22009", klass );
@@ -222,6 +234,10 @@
222
234
  VALUE klass = define_error_class( "NumericValueOutOfRange", "22" );
223
235
  register_error_class( "22003", klass );
224
236
  }
237
+ {
238
+ VALUE klass = define_error_class( "SequenceGeneratorLimitExceeded", "22" );
239
+ register_error_class( "2200H", klass );
240
+ }
225
241
  {
226
242
  VALUE klass = define_error_class( "StringDataLengthMismatch", "22" );
227
243
  register_error_class( "22026", klass );
@@ -286,6 +302,66 @@
286
302
  VALUE klass = define_error_class( "InvalidXmlProcessingInstruction", "22" );
287
303
  register_error_class( "2200T", klass );
288
304
  }
305
+ {
306
+ VALUE klass = define_error_class( "DuplicateJsonObjectKeyValue", "22" );
307
+ register_error_class( "22030", klass );
308
+ }
309
+ {
310
+ VALUE klass = define_error_class( "InvalidJsonText", "22" );
311
+ register_error_class( "22032", klass );
312
+ }
313
+ {
314
+ VALUE klass = define_error_class( "InvalidSqlJsonSubscript", "22" );
315
+ register_error_class( "22033", klass );
316
+ }
317
+ {
318
+ VALUE klass = define_error_class( "MoreThanOneSqlJsonItem", "22" );
319
+ register_error_class( "22034", klass );
320
+ }
321
+ {
322
+ VALUE klass = define_error_class( "NoSqlJsonItem", "22" );
323
+ register_error_class( "22035", klass );
324
+ }
325
+ {
326
+ VALUE klass = define_error_class( "NonNumericSqlJsonItem", "22" );
327
+ register_error_class( "22036", klass );
328
+ }
329
+ {
330
+ VALUE klass = define_error_class( "NonUniqueKeysInAJsonObject", "22" );
331
+ register_error_class( "22037", klass );
332
+ }
333
+ {
334
+ VALUE klass = define_error_class( "SingletonSqlJsonItemRequired", "22" );
335
+ register_error_class( "22038", klass );
336
+ }
337
+ {
338
+ VALUE klass = define_error_class( "SqlJsonArrayNotFound", "22" );
339
+ register_error_class( "22039", klass );
340
+ }
341
+ {
342
+ VALUE klass = define_error_class( "SqlJsonMemberNotFound", "22" );
343
+ register_error_class( "2203A", klass );
344
+ }
345
+ {
346
+ VALUE klass = define_error_class( "SqlJsonNumberNotFound", "22" );
347
+ register_error_class( "2203B", klass );
348
+ }
349
+ {
350
+ VALUE klass = define_error_class( "SqlJsonObjectNotFound", "22" );
351
+ register_error_class( "2203C", klass );
352
+ }
353
+ {
354
+ VALUE klass = define_error_class( "TooManyJsonArrayElements", "22" );
355
+ register_error_class( "2203D", klass );
356
+ }
357
+ {
358
+ VALUE klass = define_error_class( "TooManyJsonObjectMembers", "22" );
359
+ register_error_class( "2203E", klass );
360
+ }
361
+ {
362
+ VALUE klass = define_error_class( "SqlJsonScalarRequired", "22" );
363
+ register_error_class( "2203F", klass );
364
+ }
289
365
  {
290
366
  VALUE klass = define_error_class( "IntegrityConstraintViolation", NULL );
291
367
  register_error_class( "23000", klass );
@@ -365,6 +441,10 @@
365
441
  VALUE klass = define_error_class( "InFailedSqlTransaction", "25" );
366
442
  register_error_class( "25P02", klass );
367
443
  }
444
+ {
445
+ VALUE klass = define_error_class( "IdleInTransactionSessionTimeout", "25" );
446
+ register_error_class( "25P03", klass );
447
+ }
368
448
  {
369
449
  VALUE klass = define_error_class( "InvalidSqlStatementName", NULL );
370
450
  register_error_class( "26000", klass );
@@ -466,6 +546,10 @@
466
546
  VALUE klass = define_error_class( "ERIESrfProtocolViolated", "39" );
467
547
  register_error_class( "39P02", klass );
468
548
  }
549
+ {
550
+ VALUE klass = define_error_class( "ERIEEventTriggerProtocolViolated", "39" );
551
+ register_error_class( "39P03", klass );
552
+ }
469
553
  {
470
554
  VALUE klass = define_error_class( "SavepointException", NULL );
471
555
  register_error_class( "3B000", klass );
@@ -571,6 +655,10 @@
571
655
  VALUE klass = define_error_class( "WrongObjectType", "42" );
572
656
  register_error_class( "42809", klass );
573
657
  }
658
+ {
659
+ VALUE klass = define_error_class( "GeneratedAlways", "42" );
660
+ register_error_class( "428C9", klass );
661
+ }
574
662
  {
575
663
  VALUE klass = define_error_class( "UndefinedColumn", "42" );
576
664
  register_error_class( "42703", klass );
@@ -739,6 +827,10 @@
739
827
  VALUE klass = define_error_class( "LockNotAvailable", "55" );
740
828
  register_error_class( "55P03", klass );
741
829
  }
830
+ {
831
+ VALUE klass = define_error_class( "UnsafeNewEnumValueUsage", "55" );
832
+ register_error_class( "55P04", klass );
833
+ }
742
834
  {
743
835
  VALUE klass = define_error_class( "OperatorIntervention", NULL );
744
836
  register_error_class( "57000", klass );
@@ -781,6 +873,11 @@
781
873
  VALUE klass = define_error_class( "DuplicateFile", "58" );
782
874
  register_error_class( "58P02", klass );
783
875
  }
876
+ {
877
+ VALUE klass = define_error_class( "SnapshotTooOld", NULL );
878
+ register_error_class( "72000", klass );
879
+ register_error_class( "72", klass );
880
+ }
784
881
  {
785
882
  VALUE klass = define_error_class( "ConfigFileError", NULL );
786
883
  register_error_class( "F0000", klass );
@@ -916,6 +1013,10 @@
916
1013
  VALUE klass = define_error_class( "TooManyRows", "P0" );
917
1014
  register_error_class( "P0003", klass );
918
1015
  }
1016
+ {
1017
+ VALUE klass = define_error_class( "AssertFailure", "P0" );
1018
+ register_error_class( "P0004", klass );
1019
+ }
919
1020
  {
920
1021
  VALUE klass = define_error_class( "InternalError", NULL );
921
1022
  register_error_class( "XX000", klass );