ibm_db 5.3.2-x86-mingw32 → 5.4.1-x86-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f640e5df067163b9c3a38f6022ba7b6d4c5175d4f4bba95498e30630d5b307de
4
- data.tar.gz: 38dbb220869ee478f23cc2ed6a1a856d2edab22564c96b7fa6b78c0ac07cead2
3
+ metadata.gz: 2e62033e57a0d57fae397b74428536f126dce2a31a573b30df976ed902908e67
4
+ data.tar.gz: 54b78eda3f9937513228f38f1d2965ecf962fa8b28ac29d41ae32e7e45fd0d5c
5
5
  SHA512:
6
- metadata.gz: 5fac8a5cdbd2120b86cee60fae53142036e39fe731715192762ba535482281d8b9d54adf6add3905883efe41dc0418dc2386b32cffdb23fab3d7fe3e47473d12
7
- data.tar.gz: ceed221c76bccc86583ec4229f140b753e12517bfa00fb11b4035157012c62bd5bd70286fa459166be3a80ce04b748e8bfb3ece87157fd9e2c589c06d4a0180b
6
+ metadata.gz: 5abd34ebab746f0c4acf20e550db9ff61579f074f7a89e82e2802f9cb338457120687556b69c8f10cbe68875070d057115f1ed7470962a28149cd09a9d8b0842
7
+ data.tar.gz: 2c225a2ce903679a07745c0052ea1ff29dbd489eb11e55654dc102546c7735e6b2feee5733815cac4463b88ea6e205ef59d6cc3fb4dbe7c241effdedaaa1a749
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  Change Log
2
2
  ==============
3
+ 2023/03/29 (IBM_DB adapter 5.4.1, driver 3.1.0)
4
+ - Download clidriver issue fixed and replaced http links with https.
5
+
6
+ 2023/01/06 (IBM_DB adapter 5.4.0, driver 3.1.0)
7
+ - Support for Ruby 3.1 and Rails 7.0
3
8
 
4
9
  2022/10/06 (IBM_DB adapter 5.3.2, driver 3.0.6)
5
10
  - Allowed all rails versions < 6.2 in gemspec, replaced limit clause with FETCH FIRST n ROWS
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
  =====================================================================
2
- README for the IBM_DB Adapter (5.0.0) and Driver (3.0.5)
2
+ README for the IBM_DB Adapter >= 5.0.0 and Driver >= 3.0.5
3
3
  For ActiveRecord Version >= 5.0.7 (and Rails >= 5.0.7)
4
4
  =====================================================================
5
5
 
data/ext/Makefile CHANGED
@@ -3,6 +3,7 @@ SHELL = /bin/sh
3
3
 
4
4
  # V=0 quiet, V=1 verbose. other values don't work.
5
5
  V = 0
6
+ V0 = $(V:0=)
6
7
  Q1 = $(V:1=)
7
8
  Q = $(Q1:0=@)
8
9
  ECHO1 = $(V:1=@ :)
@@ -12,12 +13,12 @@ NULLCMD = :
12
13
  #### Start of system configuration section. ####
13
14
 
14
15
  srcdir = .
15
- topdir = /E/Ruby30/include/ruby-3.0.0
16
+ topdir = /C/Ruby31/include/ruby-3.1.0
16
17
  hdrdir = $(topdir)
17
- arch_hdrdir = E:/Ruby30/include/ruby-3.0.0/i386-mingw32
18
+ arch_hdrdir = /C/Ruby31/include/ruby-3.1.0/i386-mingw32
18
19
  PATH_SEPARATOR = :
19
20
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
- prefix = $(DESTDIR)/E/Ruby30
21
+ prefix = $(DESTDIR)/C/Ruby31
21
22
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
23
  rubyarchprefix = $(rubylibprefix)/$(arch)
23
24
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -52,6 +53,7 @@ infodir = $(datarootdir)/info
52
53
  docdir = $(datarootdir)/doc/$(PACKAGE)
53
54
  oldincludedir = $(DESTDIR)/usr/include
54
55
  includedir = $(prefix)/include
56
+ runstatedir = $(localstatedir)/run
55
57
  localstatedir = $(prefix)/var
56
58
  sharedstatedir = $(prefix)/com
57
59
  sysconfdir = $(DESTDIR)
@@ -64,8 +66,8 @@ archdir = $(rubyarchdir)
64
66
 
65
67
 
66
68
  CC_WRAPPER =
67
- CC = i686-w64-mingw32-gcc
68
- CXX = i686-w64-mingw32-g++
69
+ CC = gcc
70
+ CXX = g++
69
71
  LIBRUBY = lib$(RUBY_SO_NAME).dll.a
70
72
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
71
73
  LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
@@ -78,18 +80,18 @@ CSRCFLAG = $(empty)
78
80
  RUBY_EXTCONF_H = unicode_support_version.h
79
81
  cflags = $(optflags) $(debugflags) $(warnflags)
80
82
  cxxflags =
81
- optflags = -O3 -fno-omit-frame-pointer
83
+ optflags = -O3 -fno-omit-frame-pointer -fno-fast-math
82
84
  debugflags = -ggdb3
83
- warnflags = -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable
85
+ warnflags = -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef
84
86
  cppflags =
85
87
  CCDLFLAGS =
86
88
  CFLAGS = $(CCDLFLAGS) -O3 -fno-fast-math -fstack-protector-strong $(ARCH_FLAG)
87
89
  INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
88
90
  DEFS = -D_FILE_OFFSET_BITS=64
89
91
  CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT $(DEFS) $(cppflags)
90
- CXXFLAGS = $(CCDLFLAGS) -march=i686 -mtune=generic -O2 -pipe $(ARCH_FLAG)
91
- ldflags = -L. -pipe -s -fstack-protector-strong
92
- dldflags = -pipe -s -fstack-protector-strong -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)
92
+ CXXFLAGS = $(CCDLFLAGS) -march=pentium4 -mtune=generic -O2 -pipe $(ARCH_FLAG)
93
+ ldflags = -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed
94
+ dldflags = -pipe -s -fstack-protector-strong -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)
93
95
  ARCH_FLAG =
94
96
  DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
95
97
  LDSHARED = $(CC) -shared
@@ -98,7 +100,7 @@ AR = i686-w64-mingw32-gcc-ar
98
100
  EXEEXT = .exe
99
101
 
100
102
  RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
101
- RUBY_SO_NAME = msvcrt-ruby300
103
+ RUBY_SO_NAME = msvcrt-ruby310
102
104
  RUBYW_INSTALL_NAME = $(RUBYW_BASE_NAME)
103
105
  RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
104
106
  RUBYW_BASE_NAME = rubyw
@@ -106,13 +108,13 @@ RUBY_BASE_NAME = ruby
106
108
 
107
109
  arch = i386-mingw32
108
110
  sitearch = i386-msvcrt
109
- ruby_version = 3.0.0
111
+ ruby_version = 3.1.0
110
112
  ruby = $(bindir)/$(RUBY_BASE_NAME)
111
113
  RUBY = $(ruby)
112
114
  ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
113
115
 
114
116
  RM = rm -f
115
- RM_RF = $(RUBY) -run -e rm -- -rf
117
+ RM_RF = rm -fr
116
118
  RMDIRS = rmdir --ignore-fail-on-non-empty -p
117
119
  MAKEDIRS = /usr/bin/mkdir -p
118
120
  INSTALL = /usr/bin/install -c
@@ -136,7 +138,7 @@ extout =
136
138
  extout_prefix =
137
139
  target_prefix =
138
140
  LOCAL_LIBS =
139
- LIBS = $(LIBRUBYARG_SHARED) -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi
141
+ LIBS = $(LIBRUBYARG_SHARED) -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt
140
142
  ORIG_SRCS = ibm_db.c ruby_ibm_db_cli.c
141
143
  SRCS = $(ORIG_SRCS)
142
144
  OBJS = ibm_db.o ruby_ibm_db_cli.o
@@ -154,11 +156,11 @@ BINDIR = $(bindir)
154
156
  RUBYCOMMONDIR = $(sitedir)$(target_prefix)
155
157
  RUBYLIBDIR = $(sitelibdir)$(target_prefix)
156
158
  RUBYARCHDIR = $(sitearchdir)$(target_prefix)
157
- HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
158
- ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
159
+ HDRDIR = $(sitehdrdir)$(target_prefix)
160
+ ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
159
161
  TARGET_SO_DIR =
160
162
  TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
161
- CLEANLIBS = $(TARGET_SO)
163
+ CLEANLIBS = $(TARGET_SO) false
162
164
  CLEANOBJS = *.o *.bak
163
165
 
164
166
  all: $(DLLIB)
@@ -171,7 +173,7 @@ clean-rb-default::
171
173
  clean-rb::
172
174
  clean-so::
173
175
  clean: clean-so clean-static clean-rb-default clean-rb
174
- -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
176
+ -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
175
177
 
176
178
  distclean-rb-default::
177
179
  distclean-rb::
data/ext/extconf.rb CHANGED
@@ -5,7 +5,7 @@ require 'rubygems/package'
5
5
  require 'zlib'
6
6
  require 'zip'
7
7
  require 'fileutils'
8
-
8
+ require 'down'
9
9
 
10
10
  # +----------------------------------------------------------------------+
11
11
  # | Licensed Materials - Property of IBM |
@@ -49,50 +49,50 @@ if(RUBY_PLATFORM =~ /aix/i)
49
49
  #AIX
50
50
  if(is64Bit)
51
51
  puts "Detected platform - aix 64"
52
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
52
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
53
53
  else
54
54
  puts "Detected platform - aix 32"
55
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
55
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
56
56
  end
57
57
  elsif (RUBY_PLATFORM =~ /powerpc/ || RUBY_PLATFORM =~ /ppc/)
58
58
  #PPC
59
59
  if(is64Bit)
60
60
  puts "Detected platform - ppc linux 64"
61
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
61
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
62
62
  else
63
63
  puts "Detected platform - ppc linux 64"
64
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
64
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
65
65
  end
66
66
  elsif (RUBY_PLATFORM =~ /linux/)
67
67
  #x86
68
68
  if(is64Bit)
69
69
  puts "Detected platform - linux x86 64"
70
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
70
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
71
71
  else
72
72
  puts "Detected platform - linux 32"
73
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
73
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
74
74
  end
75
75
  elsif (RUBY_PLATFORM =~ /sparc/i)
76
76
  #Solaris
77
77
  if(is64Bit)
78
78
  puts "Detected platform - sun sparc64"
79
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
79
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
80
80
  else
81
81
  puts "Detected platform - sun sparc32"
82
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
82
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
83
83
  end
84
84
  elsif (RUBY_PLATFORM =~ /solaris/i)
85
85
  if(is64Bit)
86
86
  puts "Detected platform - sun amd64"
87
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
87
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
88
88
  else
89
89
  puts "Detected platform - sun amd32"
90
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
90
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
91
91
  end
92
92
  elsif (RUBY_PLATFORM =~ /darwin/i)
93
93
  if(is64Bit)
94
94
  puts "Detected platform - MacOS darwin64"
95
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz"
95
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz"
96
96
  else
97
97
  puts "Mac OS 32 bit not supported. Please use an x64 architecture."
98
98
  end
@@ -100,10 +100,10 @@ elsif (RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/)
100
100
  ZIP = true
101
101
  if(is64Bit)
102
102
  puts "Detected platform - windows 64"
103
- DOWNLOADLINK= "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip"
103
+ DOWNLOADLINK= "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip"
104
104
  else
105
105
  puts "Detected platform - windows 32"
106
- DOWNLOADLINK= "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip"
106
+ DOWNLOADLINK= "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip"
107
107
  end
108
108
  end
109
109
 
@@ -114,24 +114,13 @@ def downloadCLIPackage(destination, link = nil)
114
114
  downloadLink = link
115
115
  end
116
116
 
117
- uri = URI.parse(downloadLink)
118
117
  if ZIP
119
118
  filename = "#{destination}/clidriver.zip"
120
119
  else
121
120
  filename = "#{destination}/clidriver.tar.gz"
122
121
  end
123
-
124
- headers = {
125
- 'Accept-Encoding' => 'identity',
126
- }
127
-
128
- request = Net::HTTP::Get.new(uri.request_uri, headers)
129
- http = Net::HTTP.new(uri.host, uri.port)
130
- response = http.request(request)
131
-
132
- f = open(filename, 'wb')
133
- f.write(response.body)
134
- f.close()
122
+
123
+ Down.download(downloadLink, destination: filename, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE)
135
124
 
136
125
  filename
137
126
  end
data/ext/ibm_db.c CHANGED
@@ -12,7 +12,7 @@
12
12
  +----------------------------------------------------------------------+
13
13
  */
14
14
 
15
- #define MODULE_RELEASE "3.0.6"
15
+ #define MODULE_RELEASE "3.1.0"
16
16
 
17
17
  #ifdef HAVE_CONFIG_H
18
18
  #include "config.h"
@@ -2507,8 +2507,7 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
2507
2507
  }
2508
2508
  /* Call the function where the actual logic is being run*/
2509
2509
  #ifdef UNICODE_SUPPORT_VERSION_H
2510
- ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_connect_helper2, helper_args, RUBY_UBF_IO, NULL);
2511
-
2510
+ _ruby_ibm_db_connect_helper2( helper_args );
2512
2511
 
2513
2512
  conn_res = helper_args->conn_res;
2514
2513
 
@@ -6988,8 +6987,7 @@ VALUE ibm_db_execute(int argc, VALUE *argv, VALUE self)
6988
6987
  bind_array->error = &error;
6989
6988
 
6990
6989
  #ifdef UNICODE_SUPPORT_VERSION_H
6991
- ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_execute_helper, bind_array,
6992
- RUBY_UBF_IO, NULL );
6990
+ _ruby_ibm_db_execute_helper( bind_array );
6993
6991
  ret_value = bind_array->return_value;
6994
6992
  #else
6995
6993
  ret_value = _ruby_ibm_db_execute_helper( bind_array );
@@ -10078,8 +10076,7 @@ VALUE ibm_db_fetch_row(int argc, VALUE *argv, VALUE self)
10078
10076
  helper_args->error = &error;
10079
10077
 
10080
10078
  #ifdef UNICODE_SUPPORT_VERSION_H
10081
- ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_fetch_row_helper, helper_args,
10082
- RUBY_UBF_IO, NULL );
10079
+ _ruby_ibm_db_fetch_row_helper( helper_args );
10083
10080
  ret_val = helper_args->return_value;
10084
10081
  #else
10085
10082
  ret_val = _ruby_ibm_db_fetch_row_helper( helper_args );
@@ -10247,8 +10244,7 @@ VALUE ibm_db_fetch_assoc(int argc, VALUE *argv, VALUE self) {
10247
10244
  helper_args->funcType = FETCH_ASSOC;
10248
10245
 
10249
10246
  #ifdef UNICODE_SUPPORT_VERSION_H
10250
- ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_bind_fetch_helper, helper_args,
10251
- RUBY_UBF_IO, NULL );
10247
+ _ruby_ibm_db_bind_fetch_helper( helper_args );
10252
10248
  ret_val = helper_args->return_value;
10253
10249
 
10254
10250
  #else
data/ext/ibm_db.o CHANGED
Binary file
data/ext/ibm_db.so CHANGED
Binary file
data/ext/mkmf.log CHANGED
@@ -14,7 +14,7 @@ unicode_support_version.h is:
14
14
 
15
15
  have_library: checking for SQLConnect() in -ldb2cli... -------------------- yes
16
16
 
17
- "i686-w64-mingw32-gcc -o conftest.exe -IE:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IE:/Ruby30/include/ruby-3.0.0/ruby/backward -IE:/Ruby30/include/ruby-3.0.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LE:/Ruby30/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby300 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
17
+ PATH=".;C:/Ruby31/lib;C:\Users\pnarayanappa\Python\Python310\Scripts\;C:\Users\pnarayanappa\Python\Python310\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\Java\jre1.8.0_231\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\OpenSSH-Win64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\pnarayanappa\AppData\Roaming\Python\Python37\Scripts\;C:\Users\pnarayanappa\eclipse-workspace-git-Dj-3_2_9_Py-3_10_5\myvenv\Lib\site-packages;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Ruby31\bin;C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\Users\pnarayanappa\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pnarayanappa\.dotnet\tools" "gcc -o conftest.exe -IC:/Ruby31/include/ruby-3.1.0/i386-mingw32 -IC:/Ruby31/include/ruby-3.1.0/ruby/backward -IC:/Ruby31/include/ruby-3.1.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby31/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed -lmsvcrt-ruby310 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt "
18
18
  checked program was:
19
19
  /* begin */
20
20
  1: #include "ruby.h"
@@ -27,7 +27,7 @@ checked program was:
27
27
  8: }
28
28
  /* end */
29
29
 
30
- "i686-w64-mingw32-gcc -o conftest.exe -IE:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IE:/Ruby30/include/ruby-3.0.0/ruby/backward -IE:/Ruby30/include/ruby-3.0.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LE:/Ruby30/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby300 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
30
+ PATH=".;C:/Ruby31/lib;C:\Users\pnarayanappa\Python\Python310\Scripts\;C:\Users\pnarayanappa\Python\Python310\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\Java\jre1.8.0_231\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\OpenSSH-Win64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\pnarayanappa\AppData\Roaming\Python\Python37\Scripts\;C:\Users\pnarayanappa\eclipse-workspace-git-Dj-3_2_9_Py-3_10_5\myvenv\Lib\site-packages;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Ruby31\bin;C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\Users\pnarayanappa\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pnarayanappa\.dotnet\tools" "gcc -o conftest.exe -IC:/Ruby31/include/ruby-3.1.0/i386-mingw32 -IC:/Ruby31/include/ruby-3.1.0/ruby/backward -IC:/Ruby31/include/ruby-3.1.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby31/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed -lmsvcrt-ruby310 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt "
31
31
  conftest.c: In function 't':
32
32
  conftest.c:17:57: error: 'SQLConnect' undeclared (first use in this function); did you mean 'WSAConnect'?
33
33
  int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
@@ -55,7 +55,7 @@ checked program was:
55
55
  17: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
56
56
  /* end */
57
57
 
58
- "i686-w64-mingw32-gcc -o conftest.exe -IE:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IE:/Ruby30/include/ruby-3.0.0/ruby/backward -IE:/Ruby30/include/ruby-3.0.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LE:/Ruby30/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby300 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
58
+ PATH=".;C:/Ruby31/lib;C:\Users\pnarayanappa\Python\Python310\Scripts\;C:\Users\pnarayanappa\Python\Python310\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\Java\jre1.8.0_231\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\OpenSSH-Win64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\pnarayanappa\AppData\Roaming\Python\Python37\Scripts\;C:\Users\pnarayanappa\eclipse-workspace-git-Dj-3_2_9_Py-3_10_5\myvenv\Lib\site-packages;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Ruby31\bin;C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\Users\pnarayanappa\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pnarayanappa\.dotnet\tools" "gcc -o conftest.exe -IC:/Ruby31/include/ruby-3.1.0/i386-mingw32 -IC:/Ruby31/include/ruby-3.1.0/ruby/backward -IC:/Ruby31/include/ruby-3.1.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby31/lib -LC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed -lmsvcrt-ruby310 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt "
59
59
  checked program was:
60
60
  /* begin */
61
61
  1: #include "ruby.h"
@@ -82,7 +82,7 @@ checked program was:
82
82
 
83
83
  have_header: checking for gil_release_version.h... -------------------- yes
84
84
 
85
- "i686-w64-mingw32-gcc -E -IE:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IE:/Ruby30/include/ruby-3.0.0/ruby/backward -IE:/Ruby30/include/ruby-3.0.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
85
+ PATH=".;C:/Ruby31/lib;C:\Users\pnarayanappa\Python\Python310\Scripts\;C:\Users\pnarayanappa\Python\Python310\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\Java\jre1.8.0_231\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\OpenSSH-Win64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\pnarayanappa\AppData\Roaming\Python\Python37\Scripts\;C:\Users\pnarayanappa\eclipse-workspace-git-Dj-3_2_9_Py-3_10_5\myvenv\Lib\site-packages;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Ruby31\bin;C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\Users\pnarayanappa\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pnarayanappa\.dotnet\tools" "gcc -IC:/Ruby31/include/ruby-3.1.0/i386-mingw32 -IC:/Ruby31/include/ruby-3.1.0/ruby/backward -IC:/Ruby31/include/ruby-3.1.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong -c conftest.c"
86
86
  checked program was:
87
87
  /* begin */
88
88
  1: #include "ruby.h"
@@ -96,7 +96,7 @@ checked program was:
96
96
 
97
97
  have_header: checking for unicode_support_version.h... -------------------- yes
98
98
 
99
- "i686-w64-mingw32-gcc -E -IE:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IE:/Ruby30/include/ruby-3.0.0/ruby/backward -IE:/Ruby30/include/ruby-3.0.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
99
+ PATH=".;C:/Ruby31/lib;C:\Users\pnarayanappa\Python\Python310\Scripts\;C:\Users\pnarayanappa\Python\Python310\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\Java\jre1.8.0_231\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\OpenSSH-Win64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\pnarayanappa\AppData\Roaming\Python\Python37\Scripts\;C:\Users\pnarayanappa\eclipse-workspace-git-Dj-3_2_9_Py-3_10_5\myvenv\Lib\site-packages;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Ruby31\bin;C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\Users\pnarayanappa\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pnarayanappa\.dotnet\tools" "gcc -IC:/Ruby31/include/ruby-3.1.0/i386-mingw32 -IC:/Ruby31/include/ruby-3.1.0/ruby/backward -IC:/Ruby31/include/ruby-3.1.0 -I. -IC:/Users/pnarayanappa/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong -c conftest.c"
100
100
  checked program was:
101
101
  /* begin */
102
102
  1: #include "ruby.h"
Binary file
@@ -51,6 +51,12 @@ module ActiveRecord
51
51
  module ConnectionAdapters
52
52
  class SchemaDumper
53
53
  private
54
+ def header(stream)
55
+ stream.puts <<~HEADER
56
+ ActiveRecord::Schema[#{ActiveRecord::Migration.current_version}].define(#{define_params}) do
57
+ HEADER
58
+ end
59
+
54
60
  def default_primary_key?(column)
55
61
  schema_type(column) == :integer
56
62
  end
@@ -75,11 +81,11 @@ module ActiveRecord
75
81
  end
76
82
 
77
83
  if supports_foreign_keys?
78
- statements.concat(o.foreign_keys.map { |to_table, options| foreign_key_in_create(o.name, to_table, options) })
84
+ statements.concat(o.foreign_keys.map { |fk| accept fk })
79
85
  end
80
86
 
81
87
  if supports_check_constraints?
82
- statements.concat(o.check_constraints.map { |expression, options| check_constraint_in_create(o.name, expression, options) })
88
+ statements.concat(o.check_constraints.map { |chk| accept chk })
83
89
  end
84
90
 
85
91
  create_sql << "(#{statements.join(', ')})" if statements.present?
@@ -423,7 +429,7 @@ module ActiveRecord
423
429
  end
424
430
 
425
431
  def drop_table(table_name, options={})
426
- puts_log "drop_table"
432
+ puts_log "drop_table - #{table_name}"
427
433
  if options[:if_exists]
428
434
  execute("DROP TABLE IF EXISTS #{quote_table_name(table_name)}")
429
435
  else
@@ -833,7 +839,9 @@ module ActiveRecord
833
839
 
834
840
  def prepared_statements?
835
841
  puts_log "prepared_statements?"
836
- @prepared_statements && !prepared_statements_disabled_cache.include?(object_id)
842
+ prepare = @prepared_statements && !prepared_statements_disabled_cache.include?(object_id)
843
+ puts_log "prepare = #{prepare}"
844
+ prepare
837
845
  end
838
846
  alias :prepared_statements :prepared_statements?
839
847
 
@@ -1112,8 +1120,10 @@ module ActiveRecord
1112
1120
  end
1113
1121
  end
1114
1122
 
1115
- def select(sql, name = nil, binds = [])
1123
+ def select(sql, name = nil, binds = [], prepare: false, async: false)
1116
1124
  puts_log "select #{sql}"
1125
+ puts_log "prepare = #{prepare}"
1126
+
1117
1127
  # Replaces {"= NULL" with " IS NULL"} OR {"IN (NULL)" with " IS NULL"
1118
1128
  begin
1119
1129
  sql.gsub( /(=\s*NULL|IN\s*\(NULL\))/i, " IS NULL" )
@@ -1121,12 +1131,32 @@ module ActiveRecord
1121
1131
  # ...
1122
1132
  end
1123
1133
 
1134
+ if async && async_enabled?
1135
+ if current_transaction.joinable?
1136
+ raise AsynchronousQueryInsideTransactionError, "Asynchronous queries are not allowed inside transactions"
1137
+ end
1138
+
1139
+ future_result = async.new(
1140
+ pool,
1141
+ sql,
1142
+ name,
1143
+ binds,
1144
+ prepare: prepare,
1145
+ )
1146
+ if supports_concurrent_connections? && current_transaction.closed?
1147
+ future_result.schedule!(ActiveRecord::Base.asynchronous_queries_session)
1148
+ else
1149
+ future_result.execute!(self)
1150
+ end
1151
+ return future_result
1152
+ end
1153
+
1124
1154
  results = []
1125
1155
 
1126
1156
  if(binds.nil? || binds.empty?)
1127
1157
  stmt = execute(sql, name)
1128
1158
  else
1129
- stmt = exec_query_ret_stmt(sql, name, binds, prepare = false)
1159
+ stmt = exec_query_ret_stmt(sql, name, binds, prepare)
1130
1160
  end
1131
1161
 
1132
1162
  cols = IBM_DB.resultCols(stmt)
@@ -1452,7 +1482,8 @@ module ActiveRecord
1452
1482
  # the executed +sql+ statement.
1453
1483
  # Here prepare argument is not used, by default this method creates prepared statment and execute.
1454
1484
  def exec_query_ret_stmt(sql, name = 'SQL', binds = [], prepare = false)
1455
- puts_log "exec_query_ret_stmt"
1485
+ puts_log "exec_query_ret_stmt #{sql}"
1486
+ sql = transform_query(sql)
1456
1487
  check_if_write_query(sql)
1457
1488
  materialize_transactions
1458
1489
  mark_transaction_written_if_write(sql)
@@ -1461,6 +1492,8 @@ module ActiveRecord
1461
1492
  puts_log "Binds = #{binds}"
1462
1493
  param_array = type_casted_binds(binds)
1463
1494
  puts_log "Param array = #{param_array}"
1495
+ puts_log "Prepare flag = #{prepare}"
1496
+ puts_log "#{caller}"
1464
1497
 
1465
1498
  stmt = @servertype.prepare(sql, name)
1466
1499
  if prepare
@@ -1526,6 +1559,7 @@ module ActiveRecord
1526
1559
  #sql='INSERT INTO ar_internal_metadata (key, value, created_at, updated_at) VALUES ('10', '10', '10', '10')
1527
1560
  puts_log "execute"
1528
1561
  puts_log "#{sql}"
1562
+ sql = transform_query(sql)
1529
1563
  check_if_write_query(sql)
1530
1564
  materialize_transactions
1531
1565
  mark_transaction_written_if_write(sql)
@@ -1725,6 +1759,9 @@ module ActiveRecord
1725
1759
 
1726
1760
  def quote_table_name(name)
1727
1761
  puts_log "quote_table_name"
1762
+ if name.start_with?'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
1763
+ name = "\"#{name}\""
1764
+ end
1728
1765
  name
1729
1766
  #@servertype.check_reserved_words(name).gsub('"', '').gsub("'",'')
1730
1767
  end
@@ -2378,7 +2415,9 @@ module ActiveRecord
2378
2415
  column_nullable = (col["nullable"] == 1) ? true : false
2379
2416
  # Make sure the hidden column (db2_generated_rowid_for_lobs) in DB2 z/OS isn't added to the list
2380
2417
  if !(column_name.match(/db2_generated_rowid_for_lobs/i))
2418
+ puts_log "Column type = #{column_type}"
2381
2419
  ruby_type = simplified_type(column_type)
2420
+ puts_log "Ruby type after = #{ruby_type}"
2382
2421
  precision = extract_precision(ruby_type)
2383
2422
 
2384
2423
  if column_type.match(/timestamp|integer|bigint|date|time|blob/i)
@@ -2429,7 +2468,7 @@ module ActiveRecord
2429
2468
  else
2430
2469
  error_msg = "An unexpected error occurred during retrieval of column metadata"
2431
2470
  error_msg = error_msg + ": #{fetch_error.message}" if !fetch_error.message.empty?
2432
- raise error_msg
2471
+ # raise error_msg
2433
2472
  end
2434
2473
  ensure # Free resources associated with the statement
2435
2474
  IBM_DB.free_stmt(stmt) if stmt
@@ -2447,6 +2486,10 @@ module ActiveRecord
2447
2486
  return columns
2448
2487
  end
2449
2488
 
2489
+ def extract_precision(sql_type)
2490
+ $1.to_i if sql_type =~ /\((\d+)(,\d+)?\)/
2491
+ end
2492
+
2450
2493
  def extract_default_function(default_value, default)
2451
2494
  default if has_default_function?(default_value, default)
2452
2495
  end
@@ -2491,7 +2534,7 @@ module ActiveRecord
2491
2534
  else
2492
2535
  error_msg = "An unexpected error occurred during retrieval of foreign key metadata"
2493
2536
  error_msg = error_msg + ": #{fetch_error.message}" if !fetch_error.message.empty?
2494
- raise error_msg
2537
+ # raise error_msg
2495
2538
  end
2496
2539
  ensure # Free resources associated with the statement
2497
2540
  IBM_DB.free_stmt(stmt) if stmt
@@ -2578,6 +2621,7 @@ module ActiveRecord
2578
2621
  puts_log "add_column"
2579
2622
  clear_cache!
2580
2623
  puts_log "add_column info #{table_name}, #{column_name}, #{type}, #{options}"
2624
+ puts_log caller
2581
2625
  if (!type.nil? && type.to_s == "primary_key") or (options.key?(:primary_key) and options[:primary_key] == true)
2582
2626
  if !type.nil? and type.to_s != "primary_key"
2583
2627
  execute "ALTER TABLE #{table_name} ADD COLUMN #{column_name} #{type} NOT NULL DEFAULT 0"
@@ -2685,6 +2729,15 @@ module ActiveRecord
2685
2729
  end
2686
2730
  end
2687
2731
 
2732
+ def remove_columns(table_name, *column_names, type: nil, **options)
2733
+ if column_names.empty?
2734
+ raise ArgumentError.new("You must specify at least one column name. Example: remove_columns(:people, :first_name)")
2735
+ end
2736
+
2737
+ remove_column_fragments = remove_columns_for_alter(table_name, *column_names, type: type, **options)
2738
+ execute "ALTER TABLE #{quote_table_name(table_name)} #{remove_column_fragments.join(' ')}"
2739
+ end
2740
+
2688
2741
  # Renames a table.
2689
2742
  # ==== Example
2690
2743
  # rename_table('octopuses', 'octopi')
@@ -2782,7 +2835,7 @@ module ActiveRecord
2782
2835
  puts_log "add_foreign_keyList = #{table_name}, #{column_name}, #{fkey_list}"
2783
2836
  fkey_list.each do |fkey|
2784
2837
  if fkey.options[:column] == column_name
2785
- add_foreign_key(table_name, fkey.to_table, column: new_column_name)
2838
+ add_foreign_key(table_name, strip_table_name_prefix_and_suffix(fkey.to_table), column: new_column_name)
2786
2839
  end
2787
2840
  end
2788
2841
  end
@@ -2917,6 +2970,7 @@ module ActiveRecord
2917
2970
 
2918
2971
  class SchemaDumper < ConnectionAdapters::SchemaDumper
2919
2972
  def dump(stream) # Like in abstract class, we no need to call header() & trailer().
2973
+ header(stream)
2920
2974
  extensions(stream)
2921
2975
  tables(stream)
2922
2976
  stream
@@ -3724,7 +3778,7 @@ module Arel
3724
3778
  row.each_with_index do |value, k|
3725
3779
  collector << ", " unless k == 0
3726
3780
  case value
3727
- when Nodes::SqlLiteral, Nodes::BindParam
3781
+ when Nodes::SqlLiteral, Nodes::BindParam, ActiveModel::Attribute
3728
3782
  collector = visit(value, collector)
3729
3783
  #collector << quote(value).to_s
3730
3784
  else
@@ -59,9 +59,9 @@ if(needToDownloadedCLIPackage == true)
59
59
 
60
60
  if (RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/)
61
61
  if(is64Bit)
62
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip"
62
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip"
63
63
  else
64
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip"
64
+ DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip"
65
65
  end
66
66
  end
67
67
 
@@ -87,8 +87,10 @@ machine_bits = ['ibm'].pack('p').size * 8
87
87
  if machine_bits == 64
88
88
  raise NotImplementedError, "ibm_db with Ruby 64-bit on Windows platform is not supported. Refer to README for more details"
89
89
  else
90
- if (RUBY_VERSION =~ /3/)
90
+ if (RUBY_VERSION =~ /3.0/)
91
91
  require 'rb3x/i386/ruby30/ibm_db.so'
92
+ elsif (RUBY_VERSION =~ /3.1/)
93
+ require 'rb3x/i386/ruby31/ibm_db.so'
92
94
  elsif (RUBY_VERSION =~ /2.7/)
93
95
  require 'rb2x/i386/ruby27/ibm_db.so'
94
96
  elsif (RUBY_VERSION =~ /2.6/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.2
4
+ version: 5.4.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - IBM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-10 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zip
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: down
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: activerecord
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "<"
32
46
  - !ruby/object:Gem::Version
33
- version: '6.2'
47
+ version: '7.1'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "<"
39
53
  - !ruby/object:Gem::Version
40
- version: '6.2'
54
+ version: '7.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: archive-zip
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +108,7 @@ files:
94
108
  - lib/mswin32/rb2x/i386/ruby26/ibm_db.so
95
109
  - lib/mswin32/rb2x/i386/ruby27/ibm_db.so
96
110
  - lib/mswin32/rb3x/i386/ruby30/ibm_db.so
111
+ - lib/mswin32/rb3x/i386/ruby31/ibm_db.so
97
112
  - test/active_record/connection_adapters/fake_adapter.rb
98
113
  - test/activejob/destroy_association_async_test.rb
99
114
  - test/activejob/destroy_async_job_not_present_test.rb
@@ -847,8 +862,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
847
862
  - !ruby/object:Gem::Version
848
863
  version: '0'
849
864
  requirements:
850
- - ActiveRecord, at least 6.1
851
- rubygems_version: 3.2.3
865
+ - ActiveRecord, at least 7.0
866
+ rubygems_version: 3.3.3
852
867
  signing_key:
853
868
  specification_version: 4
854
869
  summary: 'Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows,