ibm_db 4.0.0 → 5.1.0
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 +5 -5
- data/README +2 -2
- data/ext/Makefile +266 -0
- data/ext/Makefile.nt32.191 +1 -1
- data/ext/extconf.rb +38 -7
- data/ext/gil_release_version.h +3 -0
- data/ext/ibm_db.c +387 -395
- data/ext/ibm_db.o +0 -0
- data/ext/ibm_db.so +0 -0
- data/ext/mkmf.log +103 -0
- data/ext/ruby_ibm_db.h +1 -1
- data/ext/ruby_ibm_db_cli.c +23 -23
- data/ext/ruby_ibm_db_cli.h +5 -5
- data/ext/ruby_ibm_db_cli.o +0 -0
- data/ext/unicode_support_version.h +3 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +348 -207
- data/test/cases/attribute_decorators_test.rb +2 -1
- data/test/cases/cache_key_test.rb +2 -1
- data/test/cases/comment_test.rb +4 -2
- data/test/cases/date_time_precision_test.rb +2 -1
- data/test/cases/defaults_test.rb +2 -1
- data/test/cases/migration/foreign_key_test.rb +4 -2
- data/test/cases/migration/helper.rb +1 -1
- data/test/cases/migration/references_foreign_key_test.rb +10 -5
- data/test/cases/migrator_test.rb +2 -1
- data/test/cases/schema_dumper_test.rb +3 -3
- data/test/cases/time_precision_test.rb +2 -1
- data/test/cases/transactions_test.rb +3 -2
- data/test/config.yml +154 -154
- data/test/connections/native_ibm_db/connection.rb +44 -0
- data/test/fixtures/admin/randomly_named_a9.yml +7 -7
- data/test/fixtures/admin/randomly_named_b0.yml +7 -7
- data/test/fixtures/developers.yml +1 -1
- data/test/fixtures/pirates.yml +0 -3
- data/test/fixtures/randomly_named_a9.yml +7 -7
- data/test/ibm_db_test.rb +24 -24
- data/test/models/admin.rb +1 -1
- data/test/models/admin/account.rb +1 -1
- data/test/models/admin/randomly_named_c1.rb +7 -7
- data/test/models/binary.rb +1 -1
- data/test/models/event.rb +1 -1
- data/test/models/guid.rb +1 -1
- data/test/models/randomly_named_c1.rb +3 -3
- data/test/models/ship_part.rb +1 -1
- data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
- data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
- data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
- data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
- metadata +27 -13
- data/test/fixtures/author_addresses.original +0 -11
- data/test/fixtures/authors.original +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 31e8f41e222f638241d0797fa0d898d0152372df6bf6479477299e3ef0f1accc
|
4
|
+
data.tar.gz: d8711fcf90d18465ad55a76c8661bdcd17a683652f0b08389fdbfcd578099fae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc300c1dace4fc524b5f6124dbe51d4000be3fb6a1556083dc3d5a5798ab62cfb058aa248db7f7b308bbcebc8705956c241bf606089f07e19f4b9b0f7dc00d71
|
7
|
+
data.tar.gz: 9c0ea6ac28a2ad48902ad4e539c952d294f461fc6ee391ea8df27278d21dc8b6c54a960778eb57db08a8752992b78335c83fe772948b58242ceb430f75b962b0
|
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=====================================================================
|
2
|
-
README for the IBM_DB Adapter (
|
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
|
|
@@ -113,7 +113,7 @@ here only for reference.
|
|
113
113
|
Build the driver:
|
114
114
|
- $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
|
115
115
|
- $ ruby extconf.rb
|
116
|
-
- $ make
|
116
|
+
- $ ridk exec make
|
117
117
|
|
118
118
|
Build the ibm_db gem
|
119
119
|
- $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
|
data/ext/Makefile
ADDED
@@ -0,0 +1,266 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
+
V = 0
|
6
|
+
Q1 = $(V:1=)
|
7
|
+
Q = $(Q1:0=@)
|
8
|
+
ECHO1 = $(V:1=@ :)
|
9
|
+
ECHO = $(ECHO1:0=@ echo)
|
10
|
+
NULLCMD = :
|
11
|
+
|
12
|
+
#### Start of system configuration section. ####
|
13
|
+
|
14
|
+
srcdir = .
|
15
|
+
topdir = /home/rakhil/ruby_exe/include/ruby-2.6.0
|
16
|
+
hdrdir = $(topdir)
|
17
|
+
arch_hdrdir = /home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux
|
18
|
+
PATH_SEPARATOR = :
|
19
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
+
prefix = $(DESTDIR)/home/rakhil/ruby_exe
|
21
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
|
+
exec_prefix = $(prefix)
|
25
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
|
+
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
+
sitedir = $(rubylibprefix)/site_ruby
|
37
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
38
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
|
+
sitearchincludedir = $(includedir)/$(sitearch)
|
40
|
+
archincludedir = $(includedir)/$(arch)
|
41
|
+
sitearchlibdir = $(libdir)/$(sitearch)
|
42
|
+
archlibdir = $(libdir)/$(arch)
|
43
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
+
mandir = $(datarootdir)/man
|
45
|
+
localedir = $(datarootdir)/locale
|
46
|
+
libdir = $(exec_prefix)/lib
|
47
|
+
psdir = $(docdir)
|
48
|
+
pdfdir = $(docdir)
|
49
|
+
dvidir = $(docdir)
|
50
|
+
htmldir = $(docdir)
|
51
|
+
infodir = $(datarootdir)/info
|
52
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
|
+
oldincludedir = $(DESTDIR)/usr/include
|
54
|
+
includedir = $(prefix)/include
|
55
|
+
runstatedir = $(localstatedir)/run
|
56
|
+
localstatedir = $(prefix)/var
|
57
|
+
sharedstatedir = $(prefix)/com
|
58
|
+
sysconfdir = $(prefix)/etc
|
59
|
+
datadir = $(datarootdir)
|
60
|
+
datarootdir = $(prefix)/share
|
61
|
+
libexecdir = $(exec_prefix)/libexec
|
62
|
+
sbindir = $(exec_prefix)/sbin
|
63
|
+
bindir = $(exec_prefix)/bin
|
64
|
+
archdir = $(rubyarchdir)
|
65
|
+
|
66
|
+
|
67
|
+
CC_WRAPPER =
|
68
|
+
CC = gcc
|
69
|
+
CXX = g++
|
70
|
+
LIBRUBY = $(LIBRUBY_A)
|
71
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
72
|
+
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir)
|
73
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static $(MAINLIBS)
|
74
|
+
empty =
|
75
|
+
OUTFLAG = -o $(empty)
|
76
|
+
COUTFLAG = -o $(empty)
|
77
|
+
CSRCFLAG = $(empty)
|
78
|
+
|
79
|
+
RUBY_EXTCONF_H = unicode_support_version.h
|
80
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
+
cxxflags = $(optflags) $(debugflags) $(warnflags)
|
82
|
+
optflags = -O3
|
83
|
+
debugflags = -ggdb3
|
84
|
+
warnflags = -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -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
|
+
cppflags =
|
86
|
+
CCDLFLAGS = -fPIC
|
87
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) $(ARCH_FLAG)
|
88
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
89
|
+
DEFS =
|
90
|
+
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/work/rakhil/ruby_5.1.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include $(DEFS) $(cppflags)
|
91
|
+
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
92
|
+
ldflags = -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic
|
93
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
94
|
+
ARCH_FLAG =
|
95
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
96
|
+
LDSHARED = $(CC) -shared
|
97
|
+
LDSHAREDXX = $(CXX) -shared
|
98
|
+
AR = ar
|
99
|
+
EXEEXT =
|
100
|
+
|
101
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
102
|
+
RUBY_SO_NAME = ruby
|
103
|
+
RUBYW_INSTALL_NAME =
|
104
|
+
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
105
|
+
RUBYW_BASE_NAME = rubyw
|
106
|
+
RUBY_BASE_NAME = ruby
|
107
|
+
|
108
|
+
arch = x86_64-linux
|
109
|
+
sitearch = $(arch)
|
110
|
+
ruby_version = 2.6.0
|
111
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
112
|
+
RUBY = $(ruby)
|
113
|
+
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)
|
114
|
+
|
115
|
+
RM = rm -f
|
116
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
117
|
+
RMDIRS = rmdir --ignore-fail-on-non-empty -p
|
118
|
+
MAKEDIRS = /bin/mkdir -p
|
119
|
+
INSTALL = /usr/bin/install -c
|
120
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
121
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
122
|
+
COPY = cp
|
123
|
+
TOUCH = exit >
|
124
|
+
|
125
|
+
#### End of system configuration section. ####
|
126
|
+
|
127
|
+
preload =
|
128
|
+
libpath = . $(libdir) /work/rakhil/ruby_5.1.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib
|
129
|
+
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir) -L/work/rakhil/ruby_5.1.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -Wl,-rpath,/work/rakhil/ruby_5.1.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib '-Wl,-R$$ORIGIN/clidriver/lib'
|
130
|
+
DEFFILE =
|
131
|
+
|
132
|
+
CLEANFILES = mkmf.log
|
133
|
+
DISTCLEANFILES =
|
134
|
+
DISTCLEANDIRS =
|
135
|
+
|
136
|
+
extout =
|
137
|
+
extout_prefix =
|
138
|
+
target_prefix =
|
139
|
+
LOCAL_LIBS =
|
140
|
+
LIBS = -ldb2 -lm -lc
|
141
|
+
ORIG_SRCS = ibm_db.c ruby_ibm_db_cli.c
|
142
|
+
SRCS = $(ORIG_SRCS)
|
143
|
+
OBJS = ibm_db.o ruby_ibm_db_cli.o
|
144
|
+
HDRS = $(srcdir)/unicode_support_version.h $(srcdir)/ruby_ibm_db.h $(srcdir)/gil_release_version.h $(srcdir)/ruby_ibm_db_cli.h
|
145
|
+
LOCAL_HDRS =
|
146
|
+
TARGET = ibm_db
|
147
|
+
TARGET_NAME = ibm_db
|
148
|
+
TARGET_ENTRY = Init_$(TARGET_NAME)
|
149
|
+
DLLIB = $(TARGET).so
|
150
|
+
EXTSTATIC =
|
151
|
+
STATIC_LIB =
|
152
|
+
|
153
|
+
TIMESTAMP_DIR = .
|
154
|
+
BINDIR = $(bindir)
|
155
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
156
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
157
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
158
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
159
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
160
|
+
TARGET_SO_DIR =
|
161
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
162
|
+
CLEANLIBS = $(TARGET_SO)
|
163
|
+
CLEANOBJS = *.o *.bak
|
164
|
+
|
165
|
+
all: $(DLLIB)
|
166
|
+
static: $(STATIC_LIB)
|
167
|
+
.PHONY: all install static install-so install-rb
|
168
|
+
.PHONY: clean clean-so clean-static clean-rb
|
169
|
+
|
170
|
+
clean-static::
|
171
|
+
clean-rb-default::
|
172
|
+
clean-rb::
|
173
|
+
clean-so::
|
174
|
+
clean: clean-so clean-static clean-rb-default clean-rb
|
175
|
+
-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
176
|
+
|
177
|
+
distclean-rb-default::
|
178
|
+
distclean-rb::
|
179
|
+
distclean-so::
|
180
|
+
distclean-static::
|
181
|
+
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
182
|
+
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
183
|
+
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
184
|
+
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
185
|
+
|
186
|
+
realclean: distclean
|
187
|
+
install: install-so install-rb
|
188
|
+
|
189
|
+
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
|
190
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
191
|
+
clean-static::
|
192
|
+
-$(Q)$(RM) $(STATIC_LIB)
|
193
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
194
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
195
|
+
pre-install-rb: Makefile
|
196
|
+
pre-install-rb-default: Makefile
|
197
|
+
do-install-rb:
|
198
|
+
do-install-rb-default:
|
199
|
+
pre-install-rb-default:
|
200
|
+
@$(NULLCMD)
|
201
|
+
$(TIMESTAMP_DIR)/.sitearchdir.time:
|
202
|
+
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
203
|
+
$(Q) $(TOUCH) $@
|
204
|
+
|
205
|
+
site-install: site-install-so site-install-rb
|
206
|
+
site-install-so: install-so
|
207
|
+
site-install-rb: install-rb
|
208
|
+
|
209
|
+
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
210
|
+
|
211
|
+
.cc.o:
|
212
|
+
$(ECHO) compiling $(<)
|
213
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
214
|
+
|
215
|
+
.cc.S:
|
216
|
+
$(ECHO) translating $(<)
|
217
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
218
|
+
|
219
|
+
.mm.o:
|
220
|
+
$(ECHO) compiling $(<)
|
221
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
222
|
+
|
223
|
+
.mm.S:
|
224
|
+
$(ECHO) translating $(<)
|
225
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
226
|
+
|
227
|
+
.cxx.o:
|
228
|
+
$(ECHO) compiling $(<)
|
229
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
230
|
+
|
231
|
+
.cxx.S:
|
232
|
+
$(ECHO) translating $(<)
|
233
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
234
|
+
|
235
|
+
.cpp.o:
|
236
|
+
$(ECHO) compiling $(<)
|
237
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
238
|
+
|
239
|
+
.cpp.S:
|
240
|
+
$(ECHO) translating $(<)
|
241
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
242
|
+
|
243
|
+
.c.o:
|
244
|
+
$(ECHO) compiling $(<)
|
245
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
246
|
+
|
247
|
+
.c.S:
|
248
|
+
$(ECHO) translating $(<)
|
249
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
250
|
+
|
251
|
+
.m.o:
|
252
|
+
$(ECHO) compiling $(<)
|
253
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
254
|
+
|
255
|
+
.m.S:
|
256
|
+
$(ECHO) translating $(<)
|
257
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
258
|
+
|
259
|
+
$(TARGET_SO): $(OBJS) Makefile
|
260
|
+
$(ECHO) linking shared-object $(DLLIB)
|
261
|
+
-$(Q)$(RM) $(@)
|
262
|
+
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
$(OBJS): $(HDRS) $(ruby_headers)
|
data/ext/Makefile.nt32.191
CHANGED
data/ext/extconf.rb
CHANGED
@@ -3,6 +3,7 @@ require 'net/http'
|
|
3
3
|
require 'open-uri'
|
4
4
|
require 'rubygems/package'
|
5
5
|
require 'zlib'
|
6
|
+
require 'zip'
|
6
7
|
require 'fileutils'
|
7
8
|
|
8
9
|
|
@@ -42,6 +43,7 @@ module Kernel
|
|
42
43
|
end
|
43
44
|
|
44
45
|
DOWNLOADLINK = ''
|
46
|
+
ZIP = false
|
45
47
|
|
46
48
|
if(RUBY_PLATFORM =~ /aix/i)
|
47
49
|
#AIX
|
@@ -94,6 +96,15 @@ elsif (RUBY_PLATFORM =~ /darwin/i)
|
|
94
96
|
else
|
95
97
|
puts "Mac OS 32 bit not supported. Please use an x64 architecture."
|
96
98
|
end
|
99
|
+
elsif (RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/)
|
100
|
+
ZIP = true
|
101
|
+
if(is64Bit)
|
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"
|
104
|
+
else
|
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"
|
107
|
+
end
|
97
108
|
end
|
98
109
|
|
99
110
|
def downloadCLIPackage(destination, link = nil)
|
@@ -104,7 +115,11 @@ def downloadCLIPackage(destination, link = nil)
|
|
104
115
|
end
|
105
116
|
|
106
117
|
uri = URI.parse(downloadLink)
|
107
|
-
|
118
|
+
if ZIP
|
119
|
+
filename = "#{destination}/clidriver.zip"
|
120
|
+
else
|
121
|
+
filename = "#{destination}/clidriver.tar.gz"
|
122
|
+
end
|
108
123
|
|
109
124
|
headers = {
|
110
125
|
'Accept-Encoding' => 'identity',
|
@@ -121,6 +136,18 @@ def downloadCLIPackage(destination, link = nil)
|
|
121
136
|
filename
|
122
137
|
end
|
123
138
|
|
139
|
+
def extract_zip(file, destination)
|
140
|
+
FileUtils.mkdir_p(destination)
|
141
|
+
|
142
|
+
Zip::File.open(file) do |zip_file|
|
143
|
+
zip_file.each do |f|
|
144
|
+
fpath = File.join(destination, f.name)
|
145
|
+
FileUtils.mkdir_p(File.dirname(fpath))
|
146
|
+
zip_file.extract(f, fpath) unless File.exist?(fpath)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
124
151
|
def untarCLIPackage(archive,destination)
|
125
152
|
Gem::Package::TarReader.new( Zlib::GzipReader.open(archive) ) do |tar|
|
126
153
|
tar.each do |entry|
|
@@ -157,8 +184,12 @@ if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
|
|
157
184
|
puts "Environment variable IBM_DB_HOME is not set. Downloading and setting up the DB2 client driver\n"
|
158
185
|
destination = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/../lib"
|
159
186
|
|
160
|
-
|
161
|
-
|
187
|
+
archive = downloadCLIPackage(destination)
|
188
|
+
if (ZIP)
|
189
|
+
extract_zip(archive, destination)
|
190
|
+
else
|
191
|
+
untarCLIPackage(archive,destination)
|
192
|
+
end
|
162
193
|
|
163
194
|
IBM_DB_HOME="#{destination}/clidriver"
|
164
195
|
|
@@ -212,8 +243,8 @@ def crash(str)
|
|
212
243
|
end
|
213
244
|
|
214
245
|
if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
|
215
|
-
create_header('gil_release_version')
|
216
|
-
create_header('unicode_support_version')
|
246
|
+
create_header('gil_release_version.h')
|
247
|
+
create_header('unicode_support_version.h')
|
217
248
|
end
|
218
249
|
|
219
250
|
unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
|
@@ -285,7 +316,7 @@ def libpathflag(libpath)
|
|
285
316
|
end
|
286
317
|
end
|
287
318
|
|
288
|
-
have_header('gil_release_version')
|
289
|
-
have_header('unicode_support_version')
|
319
|
+
have_header('gil_release_version.h')
|
320
|
+
have_header('unicode_support_version.h')
|
290
321
|
|
291
322
|
create_makefile('ibm_db')
|
data/ext/ibm_db.c
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
#include "ruby.h"
|
22
22
|
|
23
|
-
#ifdef
|
23
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
24
24
|
#include "ruby/encoding.h"
|
25
25
|
#endif
|
26
26
|
|
@@ -119,7 +119,7 @@ static VALUE id_id2name;
|
|
119
119
|
|
120
120
|
|
121
121
|
|
122
|
-
#ifdef
|
122
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
123
123
|
const int _check_i = 1;
|
124
124
|
#define arch_is_bigendian() ( (*(char*)&_check_i) == 0 ) /* returns 0 if the machine is of little endian architecture, 1 if the machine is of bigendian architecture*/
|
125
125
|
|
@@ -414,7 +414,7 @@ char *estrdup(char *data) {
|
|
414
414
|
return dup;
|
415
415
|
}
|
416
416
|
|
417
|
-
#ifdef
|
417
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
418
418
|
SQLWCHAR *esqlwchardup(SQLWCHAR *data, int len) {
|
419
419
|
SQLWCHAR *dup = ALLOC_N(SQLWCHAR, len + 1 );
|
420
420
|
memset(dup, '\0', (len * sizeof(SQLWCHAR)) + 2 );
|
@@ -435,7 +435,7 @@ char *estrndup(char *data, int max) {
|
|
435
435
|
}
|
436
436
|
|
437
437
|
void strtolower(char *data, int max) {
|
438
|
-
#ifdef
|
438
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
439
439
|
rb_encoding *enc;
|
440
440
|
|
441
441
|
if ( arch_is_bigendian() ){
|
@@ -447,7 +447,7 @@ void strtolower(char *data, int max) {
|
|
447
447
|
|
448
448
|
if( max > 0 ) {
|
449
449
|
while (max--) {
|
450
|
-
#ifdef
|
450
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
451
451
|
data[max] = rb_enc_tolower((int)data[max], enc);
|
452
452
|
#else
|
453
453
|
data[max] = tolower(data[max]);
|
@@ -457,7 +457,7 @@ void strtolower(char *data, int max) {
|
|
457
457
|
}
|
458
458
|
|
459
459
|
void strtoupper(char *data, int max) {
|
460
|
-
#ifdef
|
460
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
461
461
|
rb_encoding *enc;
|
462
462
|
|
463
463
|
if ( arch_is_bigendian() ){
|
@@ -468,7 +468,7 @@ void strtoupper(char *data, int max) {
|
|
468
468
|
#endif
|
469
469
|
if( max > 0 ) {
|
470
470
|
while (max--) {
|
471
|
-
#ifdef
|
471
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
472
472
|
data[max] = rb_enc_toupper((int)data[max], enc);
|
473
473
|
#else
|
474
474
|
data[max] = toupper(data[max]);
|
@@ -687,10 +687,9 @@ static void _ruby_ibm_db_mark_stmt_struct(stmt_handle *handle)
|
|
687
687
|
|
688
688
|
VALUE ibm_Ruby_Thread_Call(rb_blocking_function_t *func, void *data1, rb_unblock_function_t *ubf, void *data2)
|
689
689
|
{
|
690
|
-
#ifdef RUBY_API_VERSION_MAJOR
|
690
|
+
#ifdef RUBY_API_VERSION_MAJOR
|
691
691
|
if( RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >=2)
|
692
|
-
{
|
693
|
-
|
692
|
+
{
|
694
693
|
#ifdef _WIN32
|
695
694
|
void *(*f)(void*) = (void *(*)(void*))func;
|
696
695
|
return (VALUE)rb_thread_call_without_gvl(f, data1, ubf, data2);
|
@@ -698,7 +697,7 @@ VALUE ibm_Ruby_Thread_Call(rb_blocking_function_t *func, void *data1, rb_unblock
|
|
698
697
|
return rb_thread_call_without_gvl(func, data1, ubf, data2);
|
699
698
|
#else
|
700
699
|
rb_thread_call_without_gvl(func, data1, ubf, data2);
|
701
|
-
|
700
|
+
#endif
|
702
701
|
}
|
703
702
|
else
|
704
703
|
{
|
@@ -706,7 +705,7 @@ VALUE ibm_Ruby_Thread_Call(rb_blocking_function_t *func, void *data1, rb_unblock
|
|
706
705
|
}
|
707
706
|
#else
|
708
707
|
rb_thread_call_without_gvl(func, data1, ubf, data2);
|
709
|
-
#endif
|
708
|
+
#endif
|
710
709
|
}
|
711
710
|
|
712
711
|
|
@@ -739,7 +738,7 @@ static void _ruby_ibm_db_free_stmt_handle_and_resources(stmt_handle *handle)
|
|
739
738
|
|
740
739
|
/* static _ruby_ibm_db_free_stmt_struct */
|
741
740
|
static void _ruby_ibm_db_free_stmt_struct(stmt_handle *handle)
|
742
|
-
{
|
741
|
+
{
|
743
742
|
if ( handle != NULL ) {
|
744
743
|
_ruby_ibm_db_free_stmt_handle_and_resources( handle );
|
745
744
|
ruby_xfree( handle );
|
@@ -969,7 +968,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
969
968
|
SQLSMALLINT length;
|
970
969
|
SQLSMALLINT to_decrement = 0;
|
971
970
|
|
972
|
-
#ifdef
|
971
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
973
972
|
VALUE print_str = Qnil;
|
974
973
|
#else
|
975
974
|
char* print_str = NULL;
|
@@ -988,7 +987,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
988
987
|
stmt_res = (stmt_handle *) conn_or_stmt;
|
989
988
|
}
|
990
989
|
|
991
|
-
#ifdef
|
990
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
992
991
|
errMsg = ALLOC_N( SQLWCHAR, DB2_MAX_ERR_MSG_LEN );
|
993
992
|
memset(errMsg, '\0', DB2_MAX_ERR_MSG_LEN * sizeof(SQLWCHAR) );
|
994
993
|
|
@@ -1025,9 +1024,9 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1025
1024
|
|
1026
1025
|
if( release_gil == 1 ){
|
1027
1026
|
|
1028
|
-
#ifdef
|
1027
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1029
1028
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLGetDiagRec_helper, get_DiagRec_args,
|
1030
|
-
|
1029
|
+
RUBY_UBF_IO, NULL);
|
1031
1030
|
return_code =get_DiagRec_args->return_code;
|
1032
1031
|
#else
|
1033
1032
|
return_code = _ruby_ibm_db_SQLGetDiagRec_helper( get_DiagRec_args );
|
@@ -1045,7 +1044,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1045
1044
|
|
1046
1045
|
if ( return_code == SQL_SUCCESS) {
|
1047
1046
|
|
1048
|
-
#ifdef
|
1047
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1049
1048
|
while ((p = memchr( (char *)msg, '\n', length * sizeof(SQLWCHAR) ))) {
|
1050
1049
|
to_decrement = 1;
|
1051
1050
|
*p = '\0';
|
@@ -1087,7 +1086,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1087
1086
|
This copying into global should be removed once the deprecated methods
|
1088
1087
|
conn_errormsg and conn_error are removed
|
1089
1088
|
*/
|
1090
|
-
#ifdef
|
1089
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1091
1090
|
memset(IBM_DB_G( __ruby_conn_err_msg), '\0', DB2_MAX_ERR_MSG_LEN * sizeof(SQLWCHAR) );
|
1092
1091
|
memset(IBM_DB_G( __ruby_conn_err_state), '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1093
1092
|
|
@@ -1107,7 +1106,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1107
1106
|
conn_res->errorType = 1;
|
1108
1107
|
|
1109
1108
|
if( conn_res->ruby_error_state == NULL ) {
|
1110
|
-
#ifdef
|
1109
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1111
1110
|
conn_res->ruby_error_state = ALLOC_N( SQLWCHAR, SQL_SQLSTATE_SIZE + 1 );
|
1112
1111
|
#else
|
1113
1112
|
conn_res->ruby_error_state = ALLOC_N( char, SQL_SQLSTATE_SIZE + 1 );
|
@@ -1115,14 +1114,14 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1115
1114
|
}
|
1116
1115
|
|
1117
1116
|
if( conn_res->ruby_error_msg == NULL ) {
|
1118
|
-
#ifdef
|
1117
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1119
1118
|
conn_res->ruby_error_msg = ALLOC_N( SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
1120
1119
|
#else
|
1121
1120
|
conn_res->ruby_error_msg = ALLOC_N( char, DB2_MAX_ERR_MSG_LEN + 1 );
|
1122
1121
|
#endif
|
1123
1122
|
}
|
1124
1123
|
|
1125
|
-
#ifdef
|
1124
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1126
1125
|
memset( conn_res->ruby_error_state, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1127
1126
|
memset( conn_res->ruby_error_msg, '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
1128
1127
|
|
@@ -1148,7 +1147,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1148
1147
|
conn_res->errorType = 0;
|
1149
1148
|
|
1150
1149
|
if( conn_res->ruby_error_state == NULL ) {
|
1151
|
-
#ifdef
|
1150
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1152
1151
|
conn_res->ruby_error_state = ALLOC_N( SQLWCHAR, SQL_SQLSTATE_SIZE + 1 );
|
1153
1152
|
#else
|
1154
1153
|
conn_res->ruby_error_state = ALLOC_N(char, SQL_SQLSTATE_SIZE + 1 );
|
@@ -1156,14 +1155,14 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1156
1155
|
}
|
1157
1156
|
|
1158
1157
|
if( conn_res->ruby_error_msg == NULL ) {
|
1159
|
-
#ifdef
|
1158
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1160
1159
|
conn_res->ruby_error_msg = ALLOC_N( SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
1161
1160
|
#else
|
1162
1161
|
conn_res->ruby_error_msg = ALLOC_N( char, DB2_MAX_ERR_MSG_LEN + 1 );
|
1163
1162
|
#endif
|
1164
1163
|
}
|
1165
1164
|
|
1166
|
-
#ifdef
|
1165
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1167
1166
|
memset( conn_res->ruby_error_state, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1168
1167
|
memset( conn_res->ruby_error_msg, '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
1169
1168
|
|
@@ -1186,7 +1185,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1186
1185
|
}
|
1187
1186
|
|
1188
1187
|
if( stmt_res->ruby_stmt_err_state == NULL ) {
|
1189
|
-
#ifdef
|
1188
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1190
1189
|
stmt_res->ruby_stmt_err_state = ALLOC_N( SQLWCHAR, SQL_SQLSTATE_SIZE + 1 );
|
1191
1190
|
#else
|
1192
1191
|
stmt_res->ruby_stmt_err_state = ALLOC_N( char, SQL_SQLSTATE_SIZE + 1 );
|
@@ -1194,14 +1193,14 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1194
1193
|
}
|
1195
1194
|
|
1196
1195
|
if( stmt_res->ruby_stmt_err_msg == NULL ) {
|
1197
|
-
#ifdef
|
1196
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1198
1197
|
stmt_res->ruby_stmt_err_msg = ALLOC_N( SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
1199
1198
|
#else
|
1200
1199
|
stmt_res->ruby_stmt_err_msg = ALLOC_N( char, DB2_MAX_ERR_MSG_LEN + 1 );
|
1201
1200
|
#endif
|
1202
1201
|
}
|
1203
1202
|
|
1204
|
-
#ifdef
|
1203
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1205
1204
|
memset( stmt_res->ruby_stmt_err_state, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1206
1205
|
memset( stmt_res->ruby_stmt_err_msg, '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
1207
1206
|
|
@@ -1224,7 +1223,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1224
1223
|
This copying into global should be removed once the deprecated methods
|
1225
1224
|
conn_errormsg and conn_error are removed
|
1226
1225
|
*/
|
1227
|
-
#ifdef
|
1226
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1228
1227
|
memset( IBM_DB_G(__ruby_stmt_err_state), '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1229
1228
|
memset( IBM_DB_G(__ruby_stmt_err_msg), '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
1230
1229
|
|
@@ -1248,7 +1247,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1248
1247
|
switch (API) {
|
1249
1248
|
case DB_ERR_STATE:
|
1250
1249
|
if ( ret_str != NULL ) {
|
1251
|
-
#ifdef
|
1250
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1252
1251
|
memcpy( ret_str, sqlstate, (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
1253
1252
|
if( ret_str_len != NULL ) {
|
1254
1253
|
*ret_str_len = (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR);
|
@@ -1263,7 +1262,7 @@ static void _ruby_ibm_db_check_sql_errors( void *conn_or_stmt, int resourceType,
|
|
1263
1262
|
break;
|
1264
1263
|
case DB_ERRMSG:
|
1265
1264
|
if ( ret_str != NULL ) {
|
1266
|
-
#ifdef
|
1265
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1267
1266
|
memcpy( ret_str, msg, length );
|
1268
1267
|
#else
|
1269
1268
|
memcpy( ret_str, msg, length );
|
@@ -1311,7 +1310,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1311
1310
|
|
1312
1311
|
set_handle_attr_args *handleAttr_args = NULL;
|
1313
1312
|
|
1314
|
-
#ifdef
|
1313
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1315
1314
|
VALUE data_utf16 = Qnil;
|
1316
1315
|
#endif
|
1317
1316
|
|
@@ -1330,7 +1329,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1330
1329
|
((stmt_handle*)handle)->s_case_mode = CASE_NATURAL;
|
1331
1330
|
break;
|
1332
1331
|
default:
|
1333
|
-
#ifdef
|
1332
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1334
1333
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("ATTR_CASE attribute must be one of CASE_LOWER, CASE_UPPER, or CASE_NATURAL");
|
1335
1334
|
#else
|
1336
1335
|
*error = rb_str_new2("ATTR_CASE attribute must be one of CASE_LOWER, CASE_UPPER, or CASE_NATURAL");
|
@@ -1349,7 +1348,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1349
1348
|
((conn_handle*)handle)->c_case_mode = CASE_NATURAL;
|
1350
1349
|
break;
|
1351
1350
|
default:
|
1352
|
-
#ifdef
|
1351
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1353
1352
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("ATTR_CASE attribute must be one of CASE_LOWER, CASE_UPPER, or CASE_NATURAL");
|
1354
1353
|
#else
|
1355
1354
|
*error = rb_str_new2("ATTR_CASE attribute must be one of CASE_LOWER, CASE_UPPER, or CASE_NATURAL");
|
@@ -1357,7 +1356,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1357
1356
|
return Qfalse;
|
1358
1357
|
}
|
1359
1358
|
} else {
|
1360
|
-
#ifdef
|
1359
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1361
1360
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Connection or statement handle must be passed in");
|
1362
1361
|
#else
|
1363
1362
|
*error = rb_str_new2("Connection or statement handle must be passed in");
|
@@ -1373,7 +1372,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1373
1372
|
|
1374
1373
|
if (TYPE(data) == T_STRING) {
|
1375
1374
|
|
1376
|
-
#ifndef
|
1375
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
1377
1376
|
option_str = RSTRING_PTR(data);
|
1378
1377
|
#else
|
1379
1378
|
data_utf16 = _ruby_ibm_db_export_str_to_utf16(data);
|
@@ -1396,7 +1395,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1396
1395
|
ruby_xfree( handleAttr_args );
|
1397
1396
|
handleAttr_args = NULL;
|
1398
1397
|
if( handle != NULL && ((stmt_handle *)handle)->ruby_stmt_err_msg != NULL ) {
|
1399
|
-
#ifdef
|
1398
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1400
1399
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Setting of statement attribute failed: "),
|
1401
1400
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(((stmt_handle *)handle)->ruby_stmt_err_msg,
|
1402
1401
|
((stmt_handle *)handle)->ruby_stmt_err_msg_len)
|
@@ -1405,7 +1404,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1405
1404
|
*error = rb_str_cat2(rb_str_new2("Setting of statement attribute failed: "), ((stmt_handle *)handle)->ruby_stmt_err_msg);
|
1406
1405
|
#endif
|
1407
1406
|
} else {
|
1408
|
-
#ifdef
|
1407
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1409
1408
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Setting of statement attribute failed: <error message could not be retrieved>");
|
1410
1409
|
#else
|
1411
1410
|
*error = rb_str_new2("Setting of statement attribute failed: <error message could not be retrieved>");
|
@@ -1438,7 +1437,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1438
1437
|
ruby_xfree( handleAttr_args );
|
1439
1438
|
handleAttr_args = NULL;
|
1440
1439
|
if( handle != NULL && ((stmt_handle *)handle)->ruby_stmt_err_msg != NULL ) {
|
1441
|
-
#ifdef
|
1440
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1442
1441
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Setting of statement attribute failed: "),
|
1443
1442
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(((stmt_handle *)handle)->ruby_stmt_err_msg,
|
1444
1443
|
((stmt_handle *)handle)->ruby_stmt_err_msg_len)
|
@@ -1447,7 +1446,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1447
1446
|
*error = rb_str_cat2(rb_str_new2("Setting of statement attribute failed: "), ((stmt_handle *)handle)->ruby_stmt_err_msg);
|
1448
1447
|
#endif
|
1449
1448
|
} else {
|
1450
|
-
#ifdef
|
1449
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1451
1450
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Setting of statement attribute failed: <error message could not be retrieved>");
|
1452
1451
|
#else
|
1453
1452
|
*error = rb_str_new2("Setting of statement attribute failed: <error message could not be retrieved>");
|
@@ -1465,7 +1464,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1465
1464
|
handleAttr_args->attribute = opt_key;
|
1466
1465
|
|
1467
1466
|
if (TYPE(data) == T_STRING) {
|
1468
|
-
#ifndef
|
1467
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
1469
1468
|
option_str = RSTRING_PTR(data);
|
1470
1469
|
handleAttr_args->strLength = RSTRING_LEN(data);
|
1471
1470
|
#else
|
@@ -1488,7 +1487,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1488
1487
|
ruby_xfree( handleAttr_args );
|
1489
1488
|
handleAttr_args = NULL;
|
1490
1489
|
if( handle != NULL && ((conn_handle *)handle)->ruby_error_msg != NULL ) {
|
1491
|
-
#ifdef
|
1490
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1492
1491
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Setting of connection attribute failed: "),
|
1493
1492
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(((conn_handle *)handle)->ruby_error_msg,
|
1494
1493
|
((conn_handle *)handle)->ruby_error_msg_len)
|
@@ -1497,7 +1496,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1497
1496
|
*error = rb_str_cat2(rb_str_new2("Setting of connection attribute failed: "), ((conn_handle *)handle)->ruby_error_msg);
|
1498
1497
|
#endif
|
1499
1498
|
} else {
|
1500
|
-
#ifdef
|
1499
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1501
1500
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Setting of connection attribute failed: <error message could not be retrieved>");
|
1502
1501
|
#else
|
1503
1502
|
*error = rb_str_new2("Setting of connection attribute failed: <error message could not be retrieved>");
|
@@ -1521,7 +1520,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1521
1520
|
ruby_xfree( handleAttr_args );
|
1522
1521
|
handleAttr_args = NULL;
|
1523
1522
|
if( handle != NULL && ((conn_handle *)handle)->ruby_error_msg != NULL ) {
|
1524
|
-
#ifdef
|
1523
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1525
1524
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Setting of connection attribute failed: "),
|
1526
1525
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( ((stmt_handle *)handle)->ruby_stmt_err_msg,
|
1527
1526
|
((stmt_handle *)handle)->ruby_stmt_err_msg_len)
|
@@ -1530,7 +1529,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1530
1529
|
*error = rb_str_cat2(rb_str_new2("Setting of connection attribute failed: "), ((conn_handle *)handle)->ruby_error_msg);
|
1531
1530
|
#endif
|
1532
1531
|
} else {
|
1533
|
-
#ifdef
|
1532
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1534
1533
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Setting of connection attribute failed: <error message could not be retrieved>");
|
1535
1534
|
#else
|
1536
1535
|
*error = rb_str_new2("Setting of connection attribute failed: <error message could not be retrieved>");
|
@@ -1547,7 +1546,7 @@ static VALUE _ruby_ibm_db_assign_options( void *handle, int type, long opt_key,
|
|
1547
1546
|
}
|
1548
1547
|
}
|
1549
1548
|
} else {
|
1550
|
-
#ifdef
|
1549
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1551
1550
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Connection or statement handle must be passed in");
|
1552
1551
|
#else
|
1553
1552
|
*error = rb_str_new2("Connection or statement handle must be passed in");
|
@@ -1612,7 +1611,7 @@ static int _ruby_ibm_db_parse_options ( VALUE options, int type, void *handle, V
|
|
1612
1611
|
static int _ruby_ibm_db_get_result_set_info(stmt_handle *stmt_res)
|
1613
1612
|
{
|
1614
1613
|
int rc = -1, i;
|
1615
|
-
#ifdef
|
1614
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1616
1615
|
SQLWCHAR tmp_name[BUFSIZ];
|
1617
1616
|
#else
|
1618
1617
|
SQLCHAR tmp_name[BUFSIZ];
|
@@ -1653,7 +1652,7 @@ static int _ruby_ibm_db_get_result_set_info(stmt_handle *stmt_res)
|
|
1653
1652
|
stmt_res->column_info[i].loc_type = 0;
|
1654
1653
|
|
1655
1654
|
stmt_res->column_info[i].name = tmp_name;
|
1656
|
-
#ifdef
|
1655
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1657
1656
|
memset(stmt_res->column_info[i].name, '\0', BUFSIZ * sizeof(SQLWCHAR));
|
1658
1657
|
#else
|
1659
1658
|
memset(stmt_res->column_info[i].name, '\0', BUFSIZ);
|
@@ -1678,7 +1677,7 @@ static int _ruby_ibm_db_get_result_set_info(stmt_handle *stmt_res)
|
|
1678
1677
|
return -1;
|
1679
1678
|
}
|
1680
1679
|
if ( describecolargs->name_length <= 0 ) {
|
1681
|
-
#ifdef
|
1680
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1682
1681
|
stmt_res->column_info[i].name = esqlwchardup((SQLWCHAR*)"", 0);
|
1683
1682
|
stmt_res->column_info[i].name_length = 0;
|
1684
1683
|
#else
|
@@ -1687,7 +1686,7 @@ static int _ruby_ibm_db_get_result_set_info(stmt_handle *stmt_res)
|
|
1687
1686
|
} else if ( describecolargs->name_length >= BUFSIZ ) {
|
1688
1687
|
/* column name is longer than BUFSIZ, free the previously allocate memory and reallocate new*/
|
1689
1688
|
|
1690
|
-
#ifdef
|
1689
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1691
1690
|
stmt_res->column_info[i].name = (SQLWCHAR*)ALLOC_N(SQLWCHAR, describecolargs->name_length+1);
|
1692
1691
|
stmt_res->column_info[i].name_length = describecolargs->name_length ;
|
1693
1692
|
#else
|
@@ -1711,7 +1710,7 @@ static int _ruby_ibm_db_get_result_set_info(stmt_handle *stmt_res)
|
|
1711
1710
|
return -1;
|
1712
1711
|
}
|
1713
1712
|
} else {
|
1714
|
-
#ifdef
|
1713
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1715
1714
|
stmt_res->column_info[i].name = (SQLWCHAR*) esqlwchardup( tmp_name, describecolargs->name_length );
|
1716
1715
|
stmt_res->column_info[i].name_length = describecolargs->name_length;
|
1717
1716
|
#else
|
@@ -1771,7 +1770,7 @@ static int _ruby_ibm_db_bind_column_helper(stmt_handle *stmt_res)
|
|
1771
1770
|
case SQL_LONGVARCHAR:
|
1772
1771
|
case SQL_WLONGVARCHAR:
|
1773
1772
|
|
1774
|
-
#ifdef
|
1773
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
1775
1774
|
bindCol_args->TargetType = SQL_C_WCHAR;
|
1776
1775
|
bindCol_args->buff_length = (stmt_res->column_info[i].size+1) * sizeof(SQLWCHAR);
|
1777
1776
|
row_data->str_val = ALLOC_N(char, bindCol_args->buff_length);
|
@@ -2002,7 +2001,6 @@ static void _ruby_ibm_db_clear_stmt_err_cache()
|
|
2002
2001
|
/* static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data )
|
2003
2002
|
*/
|
2004
2003
|
static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
2005
|
-
|
2006
2004
|
SQLINTEGER conn_alive;
|
2007
2005
|
SQLINTEGER enable_numeric_literals = 1; /* Enable CLI numeric literals */
|
2008
2006
|
|
@@ -2017,7 +2015,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2017
2015
|
int reused = 0;
|
2018
2016
|
SQLSMALLINT out_length = 0;
|
2019
2017
|
VALUE entry = Qnil;
|
2020
|
-
#ifdef
|
2018
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2021
2019
|
SQLWCHAR *server = NULL;
|
2022
2020
|
VALUE iserver = Qnil;
|
2023
2021
|
VALUE idsserver = Qnil;
|
@@ -2089,7 +2087,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2089
2087
|
ruby_xfree( handleAttr_args );
|
2090
2088
|
handleAttr_args = NULL;
|
2091
2089
|
if( conn_res != NULL && conn_res->ruby_error_msg != NULL ) {
|
2092
|
-
#ifdef
|
2090
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2093
2091
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Allocation of environment handle failed: "),
|
2094
2092
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(conn_res->ruby_error_msg, conn_res->ruby_error_msg_len )
|
2095
2093
|
);
|
@@ -2097,7 +2095,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2097
2095
|
*error = rb_str_cat2(rb_str_new2("Allocation of environment handle failed: "), conn_res->ruby_error_msg);
|
2098
2096
|
#endif
|
2099
2097
|
} else {
|
2100
|
-
#ifdef
|
2098
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2101
2099
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Allocation of environment handle failed: <error message could not be retrieved>");
|
2102
2100
|
#else
|
2103
2101
|
*error = rb_str_new2("Allocation of environment handle failed: <error message could not be retrieved>");
|
@@ -2121,7 +2119,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2121
2119
|
if (rc != SQL_SUCCESS) {
|
2122
2120
|
_ruby_ibm_db_check_sql_errors( conn_res, DB_CONN, conn_res->henv, SQL_HANDLE_ENV, rc, 1, NULL, NULL, -1, 1, 0 );
|
2123
2121
|
if( conn_res != NULL && conn_res->ruby_error_msg != NULL ) {
|
2124
|
-
#ifdef
|
2122
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2125
2123
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Setting of Environemnt Attribute during connection failed: "),
|
2126
2124
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(conn_res->ruby_error_msg, conn_res->ruby_error_msg_len )
|
2127
2125
|
);
|
@@ -2129,7 +2127,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2129
2127
|
*error = rb_str_cat2(rb_str_new2("Setting of Environemnt Attribute during connection failed: "),conn_res->ruby_error_msg);
|
2130
2128
|
#endif
|
2131
2129
|
} else {
|
2132
|
-
#ifdef
|
2130
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2133
2131
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Setting of Environemnt Attribute during connection failed: <error message could not be retrieved>");
|
2134
2132
|
#else
|
2135
2133
|
*error = rb_str_new2("Setting of Environemnt Attribute during connection failed: <error message could not be retrieved>");
|
@@ -2149,14 +2147,14 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2149
2147
|
if (rc != SQL_SUCCESS) {
|
2150
2148
|
_ruby_ibm_db_check_sql_errors( conn_res, DB_CONN, conn_res->henv, SQL_HANDLE_ENV, rc, 1, NULL, NULL, -1, 1, 0 );
|
2151
2149
|
if( conn_res != NULL && conn_res->ruby_error_msg != NULL ) {
|
2152
|
-
#ifdef
|
2150
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2153
2151
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Allocation of connection handle failed: "),
|
2154
2152
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_msg, conn_res->ruby_error_msg_len) );
|
2155
2153
|
#else
|
2156
2154
|
*error = rb_str_cat2(rb_str_new2("Allocation of connection handle failed: "),conn_res->ruby_error_msg);
|
2157
2155
|
#endif
|
2158
2156
|
} else {
|
2159
|
-
#ifdef
|
2157
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2160
2158
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Allocation of connection handle failed: <error message could not be retrieved>");
|
2161
2159
|
#else
|
2162
2160
|
*error = rb_str_new2("Allocation of connection handle failed: <error message could not be retrieved>");
|
@@ -2232,14 +2230,14 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2232
2230
|
SQLFreeHandle( SQL_HANDLE_DBC, conn_res->hdbc );
|
2233
2231
|
SQLFreeHandle( SQL_HANDLE_ENV, conn_res->henv );
|
2234
2232
|
if( conn_res != NULL && conn_res->ruby_error_msg != NULL ) {
|
2235
|
-
#ifdef
|
2233
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2236
2234
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Connection failed: "),
|
2237
2235
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(conn_res->ruby_error_msg, conn_res->ruby_error_msg_len));
|
2238
2236
|
#else
|
2239
2237
|
*error = rb_str_cat2(rb_str_new2("Connection failed: "),conn_res->ruby_error_msg);
|
2240
2238
|
#endif
|
2241
2239
|
} else {
|
2242
|
-
#ifdef
|
2240
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2243
2241
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Connection failed: <error message could not be retrieved>");
|
2244
2242
|
#else
|
2245
2243
|
*error = rb_str_new2("Connection failed: <error message could not be retrieved>");
|
@@ -2268,14 +2266,14 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2268
2266
|
SQLFreeHandle( SQL_HANDLE_DBC, conn_res->hdbc );
|
2269
2267
|
SQLFreeHandle( SQL_HANDLE_ENV, conn_res->henv );
|
2270
2268
|
if( conn_res != NULL && conn_res->ruby_error_msg != NULL ) {
|
2271
|
-
#ifdef
|
2269
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2272
2270
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Failed to retrieve autocommit status during connection: "),
|
2273
2271
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(conn_res->ruby_error_msg, conn_res->ruby_error_msg_len));
|
2274
2272
|
#else
|
2275
2273
|
*error = rb_str_cat2(rb_str_new2("Connection failed: "),conn_res->ruby_error_msg);
|
2276
2274
|
#endif
|
2277
2275
|
} else {
|
2278
|
-
#ifdef
|
2276
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2279
2277
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Failed to retrieve autocommit status during connection: <error message could not be retrieved>");
|
2280
2278
|
#else
|
2281
2279
|
*error = rb_str_new2("Connection failed: <error message could not be retrieved>");
|
@@ -2299,7 +2297,7 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2299
2297
|
#endif
|
2300
2298
|
#endif
|
2301
2299
|
/* Get the server name */
|
2302
|
-
#ifdef
|
2300
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2303
2301
|
server = ALLOC_N(SQLWCHAR, 2048);
|
2304
2302
|
memset(server, 0, sizeof(server));
|
2305
2303
|
iserver = _ruby_ibm_db_export_char_to_utf16_rstr("AS");
|
@@ -2315,14 +2313,14 @@ static VALUE _ruby_ibm_db_connect_helper2( connect_helper_args *data ) {
|
|
2315
2313
|
getInfo_args->infoType = SQL_DBMS_NAME;
|
2316
2314
|
getInfo_args->infoValue = (SQLPOINTER)server;
|
2317
2315
|
|
2318
|
-
#ifdef
|
2316
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2319
2317
|
getInfo_args->buff_length = 2048 * sizeof(SQLWCHAR);
|
2320
2318
|
#else
|
2321
2319
|
getInfo_args->buff_length = 2048;
|
2322
2320
|
#endif
|
2323
2321
|
rc = _ruby_ibm_db_SQLGetInfo_helper( getInfo_args );
|
2324
2322
|
|
2325
|
-
#ifndef
|
2323
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
2326
2324
|
if (!strcmp((char *)server, "AS")) {
|
2327
2325
|
is_systemi = 1;
|
2328
2326
|
}
|
@@ -2445,7 +2443,7 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2445
2443
|
VALUE r_db, r_uid, r_passwd, options,return_value;
|
2446
2444
|
VALUE r_literal_replacement = Qnil;
|
2447
2445
|
|
2448
|
-
#ifdef
|
2446
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2449
2447
|
VALUE r_db_utf16, r_uid_utf16, r_passwd_utf16, r_db_ascii;
|
2450
2448
|
#endif
|
2451
2449
|
|
@@ -2459,7 +2457,7 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2459
2457
|
conn_args = ALLOC( connect_args );
|
2460
2458
|
memset(conn_args,'\0',sizeof(struct _ibm_db_connect_args_struct));
|
2461
2459
|
|
2462
|
-
#ifndef
|
2460
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
2463
2461
|
conn_args->database = (SQLCHAR *) RSTRING_PTR( r_db );
|
2464
2462
|
conn_args->database_len = (SQLSMALLINT) RSTRING_LEN( r_db );
|
2465
2463
|
|
@@ -2486,7 +2484,7 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2486
2484
|
#endif
|
2487
2485
|
|
2488
2486
|
/* If the string contains a =, set ctlg_conn = 0, to use SQLDriverConnect */
|
2489
|
-
#ifndef
|
2487
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
2490
2488
|
if ( strstr( (char *) conn_args->database, "=") != NULL ) {
|
2491
2489
|
#else
|
2492
2490
|
if ( RARRAY_LEN(rb_str_split(r_db_ascii,"=")) > 1) { /*There is no direct API like strstr, hence split string with delimiter as '=' if the returned RARRAY has more than 1 element then set ctlg_conn = 0*/
|
@@ -2508,7 +2506,7 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2508
2506
|
|
2509
2507
|
if( isPersistent ) {
|
2510
2508
|
/*If making a persistent connection calculate the hash key to cache the connection in persistence list*/
|
2511
|
-
#ifndef
|
2509
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
2512
2510
|
helper_args->hKey = rb_str_concat(rb_str_dup(r_uid), r_db); /*A duplicate of r_uid is made so that initial value is intact*/
|
2513
2511
|
helper_args->hKey = rb_str_concat(helper_args->hKey, r_passwd);
|
2514
2512
|
helper_args->hKey = rb_str_concat(rb_str_new2("__ibm_db_"),helper_args->hKey);
|
@@ -2526,9 +2524,8 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2526
2524
|
helper_args->literal_replacement = SET_QUOTED_LITERAL_REPLACEMENT_ON; /*QUOTED LITERAL replacemnt is ON by default*/
|
2527
2525
|
}
|
2528
2526
|
/* Call the function where the actual logic is being run*/
|
2529
|
-
#ifdef
|
2530
|
-
|
2531
|
-
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_connect_helper2, helper_args, (void *)_ruby_ibm_db_Connection_level_UBF, NULL);
|
2527
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2528
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_connect_helper2, helper_args, RUBY_UBF_IO, NULL);
|
2532
2529
|
|
2533
2530
|
|
2534
2531
|
conn_res = helper_args->conn_res;
|
@@ -2555,9 +2552,9 @@ static VALUE _ruby_ibm_db_connect_helper( int argc, VALUE *argv, int isPersisten
|
|
2555
2552
|
return_value = Data_Wrap_Struct(le_conn_struct, _ruby_ibm_db_mark_conn_struct, _ruby_ibm_db_free_conn_struct, conn_res);
|
2556
2553
|
}
|
2557
2554
|
}
|
2558
|
-
|
2555
|
+
#else
|
2559
2556
|
return_value = _ruby_ibm_db_connect_helper2( helper_args );
|
2560
|
-
|
2557
|
+
#endif
|
2561
2558
|
/* Free the memory allocated */
|
2562
2559
|
if(conn_args != NULL) {
|
2563
2560
|
/* Memory to structure elements of helper_args is not allocated explicitly hence it is automatically freed by Ruby.
|
@@ -2596,7 +2593,7 @@ static int _ruby_ibm_db_set_decfloat_rounding_mode_client_helper(_rounding_mode
|
|
2596
2593
|
exec_cum_prepare_args *exec_direct_args = NULL;
|
2597
2594
|
bind_col_args *bindCol_args = NULL;
|
2598
2595
|
fetch_data_args *fetch_args = NULL;
|
2599
|
-
#ifndef
|
2596
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
2600
2597
|
SQLCHAR *stmt = (SQLCHAR *)"values current decfloat rounding mode";
|
2601
2598
|
#else
|
2602
2599
|
VALUE stmt = Qnil;
|
@@ -2606,7 +2603,7 @@ static int _ruby_ibm_db_set_decfloat_rounding_mode_client_helper(_rounding_mode
|
|
2606
2603
|
exec_direct_args = ALLOC( exec_cum_prepare_args );
|
2607
2604
|
memset(exec_direct_args,'\0',sizeof(struct _ibm_db_exec_direct_args_struct));
|
2608
2605
|
|
2609
|
-
#ifdef
|
2606
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2610
2607
|
exec_direct_args->stmt_string = (SQLWCHAR *)RSTRING_PTR( stmt );
|
2611
2608
|
#else
|
2612
2609
|
exec_direct_args->stmt_string = stmt;
|
@@ -2826,10 +2823,8 @@ static void _ruby_ibm_db_clear_conn_err_cache()
|
|
2826
2823
|
*
|
2827
2824
|
*/
|
2828
2825
|
VALUE ibm_db_connect(int argc, VALUE *argv, VALUE self)
|
2829
|
-
{
|
2830
|
-
|
2826
|
+
{
|
2831
2827
|
_ruby_ibm_db_clear_conn_err_cache();
|
2832
|
-
|
2833
2828
|
return _ruby_ibm_db_connect_helper( argc, argv, 0 );
|
2834
2829
|
}
|
2835
2830
|
/* */
|
@@ -2902,7 +2897,7 @@ VALUE ruby_ibm_db_createDb_helper(VALUE connection, VALUE dbName, VALUE codeSet,
|
|
2902
2897
|
|
2903
2898
|
|
2904
2899
|
VALUE return_value = Qfalse;
|
2905
|
-
#ifdef
|
2900
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2906
2901
|
VALUE dbName_utf16 = Qnil;
|
2907
2902
|
VALUE codeSet_utf16 = Qnil;
|
2908
2903
|
VALUE mode_utf16 = Qnil;
|
@@ -2930,7 +2925,7 @@ VALUE ruby_ibm_db_createDb_helper(VALUE connection, VALUE dbName, VALUE codeSet,
|
|
2930
2925
|
create_db_args = ALLOC( create_drop_db_args );
|
2931
2926
|
memset(create_db_args,'\0',sizeof(struct _ibm_db_create_drop_db_args_struct));
|
2932
2927
|
|
2933
|
-
#ifdef
|
2928
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2934
2929
|
dbName_utf16 = _ruby_ibm_db_export_str_to_utf16(dbName);
|
2935
2930
|
|
2936
2931
|
create_db_args->dbName = (SQLWCHAR*)RSTRING_PTR(dbName_utf16);
|
@@ -2973,9 +2968,9 @@ VALUE ruby_ibm_db_createDb_helper(VALUE connection, VALUE dbName, VALUE codeSet,
|
|
2973
2968
|
|
2974
2969
|
_ruby_ibm_db_clear_conn_err_cache();
|
2975
2970
|
|
2976
|
-
#ifdef
|
2971
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2977
2972
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLCreateDB_helper, create_db_args,
|
2978
|
-
|
2973
|
+
RUBY_UBF_IO, NULL );
|
2979
2974
|
rc = create_db_args->rc;
|
2980
2975
|
#else
|
2981
2976
|
rc = _ruby_ibm_db_SQLCreateDB_helper( create_db_args );
|
@@ -2988,7 +2983,7 @@ VALUE ruby_ibm_db_createDb_helper(VALUE connection, VALUE dbName, VALUE codeSet,
|
|
2988
2983
|
if(conn_res->sqlcode == -1005 && 1 == createNX) {
|
2989
2984
|
return_value = Qtrue; /*Return true if database already exists and Create if not existing called*/
|
2990
2985
|
/*Clear the error messages*/
|
2991
|
-
#ifdef
|
2986
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
2992
2987
|
memset( conn_res->ruby_error_state, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
2993
2988
|
memset( conn_res->ruby_error_msg, '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
2994
2989
|
#else
|
@@ -3058,7 +3053,7 @@ VALUE ibm_db_createDB(int argc, VALUE *argv, VALUE self)
|
|
3058
3053
|
* DropDb helper
|
3059
3054
|
*/
|
3060
3055
|
VALUE ruby_ibm_db_dropDb_helper(VALUE connection, VALUE dbName) {
|
3061
|
-
#ifdef
|
3056
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3062
3057
|
VALUE dbName_utf16 = Qnil;
|
3063
3058
|
#endif
|
3064
3059
|
|
@@ -3086,7 +3081,7 @@ VALUE ruby_ibm_db_dropDb_helper(VALUE connection, VALUE dbName) {
|
|
3086
3081
|
drop_db_args = ALLOC( create_drop_db_args );
|
3087
3082
|
memset(drop_db_args,'\0',sizeof(struct _ibm_db_create_drop_db_args_struct));
|
3088
3083
|
|
3089
|
-
#ifdef
|
3084
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3090
3085
|
dbName_utf16 = _ruby_ibm_db_export_str_to_utf16(dbName);
|
3091
3086
|
|
3092
3087
|
drop_db_args->dbName = (SQLWCHAR*)RSTRING_PTR(dbName_utf16);
|
@@ -3103,9 +3098,9 @@ VALUE ruby_ibm_db_dropDb_helper(VALUE connection, VALUE dbName) {
|
|
3103
3098
|
|
3104
3099
|
_ruby_ibm_db_clear_conn_err_cache();
|
3105
3100
|
|
3106
|
-
#ifdef
|
3101
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3107
3102
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDropDB_helper, drop_db_args,
|
3108
|
-
|
3103
|
+
RUBY_UBF_IO, NULL );
|
3109
3104
|
rc = drop_db_args->rc;
|
3110
3105
|
#else
|
3111
3106
|
rc = _ruby_ibm_db_SQLDropDB_helper( drop_db_args );
|
@@ -3451,7 +3446,7 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3451
3446
|
|
3452
3447
|
int rc = 0;
|
3453
3448
|
VALUE return_value = Qtrue;
|
3454
|
-
#ifdef
|
3449
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3455
3450
|
char *err_str = NULL;
|
3456
3451
|
#endif
|
3457
3452
|
|
@@ -3460,10 +3455,9 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3460
3455
|
/* if argc == 3, then the default value for param_type will be used */
|
3461
3456
|
case 3:
|
3462
3457
|
param_type = SQL_PARAM_INPUT;
|
3463
|
-
|
3464
|
-
#ifdef
|
3465
|
-
|
3466
|
-
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDescribeParam_helper, data,
|
3458
|
+
|
3459
|
+
#ifdef UNICODE_SUPPORT_VERSIO
|
3460
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDescribeParam_helper, data,
|
3467
3461
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res);
|
3468
3462
|
rc = data->rc;
|
3469
3463
|
#else
|
@@ -3482,10 +3476,9 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3482
3476
|
break;
|
3483
3477
|
|
3484
3478
|
case 4:
|
3485
|
-
|
3486
|
-
#ifdef UNICODE_SUPPORT_VERSION
|
3479
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3487
3480
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDescribeParam_helper, data,
|
3488
|
-
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res);
|
3481
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
3489
3482
|
rc = data->rc;
|
3490
3483
|
#else
|
3491
3484
|
rc = _ruby_ibm_db_SQLDescribeParam_helper( data );
|
@@ -3503,8 +3496,7 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3503
3496
|
break;
|
3504
3497
|
|
3505
3498
|
case 5:
|
3506
|
-
|
3507
|
-
#ifdef UNICODE_SUPPORT_VERSION
|
3499
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3508
3500
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDescribeParam_helper, data,
|
3509
3501
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
3510
3502
|
rc = data->rc;
|
@@ -3525,10 +3517,9 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3525
3517
|
break;
|
3526
3518
|
|
3527
3519
|
case 6:
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3531
|
-
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
3520
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3521
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDescribeParam_helper, data,
|
3522
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
3532
3523
|
rc = data->rc;
|
3533
3524
|
#else
|
3534
3525
|
rc = _ruby_ibm_db_SQLDescribeParam_helper( data );
|
@@ -3568,7 +3559,7 @@ VALUE ibm_db_bind_param_helper(int argc, char * varname, long varname_len ,long
|
|
3568
3559
|
/* end Switch */
|
3569
3560
|
|
3570
3561
|
if( rc == SQL_ERROR ) {
|
3571
|
-
#ifdef
|
3562
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3572
3563
|
/*String in SQLWCHAR(utf16) format will contain '\0' due to which the err string will be printed wrong,
|
3573
3564
|
* hence convert it to utf8 format
|
3574
3565
|
*/
|
@@ -3656,7 +3647,7 @@ VALUE ibm_db_bind_param(int argc, VALUE *argv, VALUE self)
|
|
3656
3647
|
rb_scan_args(argc, argv, "35", &stmt, &r_param_no, &r_varname,
|
3657
3648
|
&r_param_type, &r_data_type, &r_precision, &r_scale, &r_size);
|
3658
3649
|
|
3659
|
-
#ifdef
|
3650
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3660
3651
|
varname = RSTRING_PTR(r_varname);
|
3661
3652
|
varname_len = RSTRING_LEN(r_varname);
|
3662
3653
|
#else
|
@@ -3761,9 +3752,9 @@ VALUE ibm_db_close(int argc, VALUE *argv, VALUE self)
|
|
3761
3752
|
end_X_args->handleType = SQL_HANDLE_DBC;
|
3762
3753
|
end_X_args->completionType = SQL_ROLLBACK; /*Remeber you are rolling back the transaction*/
|
3763
3754
|
|
3764
|
-
#ifdef
|
3755
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3765
3756
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLEndTran, end_X_args,
|
3766
|
-
|
3757
|
+
RUBY_UBF_IO, NULL);
|
3767
3758
|
rc = end_X_args->rc;
|
3768
3759
|
#else
|
3769
3760
|
rc = _ruby_ibm_db_SQLEndTran( end_X_args );
|
@@ -3780,9 +3771,9 @@ VALUE ibm_db_close(int argc, VALUE *argv, VALUE self)
|
|
3780
3771
|
}
|
3781
3772
|
}
|
3782
3773
|
|
3783
|
-
#ifdef
|
3774
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3784
3775
|
rc = ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLDisconnect_helper, &(conn_res->hdbc),
|
3785
|
-
|
3776
|
+
RUBY_UBF_IO, NULL);
|
3786
3777
|
#else
|
3787
3778
|
rc = _ruby_ibm_db_SQLDisconnect_helper( &(conn_res->hdbc) );
|
3788
3779
|
#endif
|
@@ -3868,7 +3859,7 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3868
3859
|
VALUE r_table_name = Qnil;
|
3869
3860
|
VALUE r_column_name = Qnil;
|
3870
3861
|
|
3871
|
-
#ifdef
|
3862
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3872
3863
|
VALUE r_qualifier_utf16 = Qnil;
|
3873
3864
|
VALUE r_owner_utf16 = Qnil;
|
3874
3865
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -3916,7 +3907,7 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3916
3907
|
return_value = Qfalse;
|
3917
3908
|
} else {
|
3918
3909
|
if (!NIL_P(r_qualifier)) {
|
3919
|
-
#ifdef
|
3910
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3920
3911
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
3921
3912
|
col_privileges_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
3922
3913
|
col_privileges_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -3926,7 +3917,7 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3926
3917
|
#endif
|
3927
3918
|
}
|
3928
3919
|
if (!NIL_P(r_owner)) {
|
3929
|
-
#ifdef
|
3920
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3930
3921
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
3931
3922
|
col_privileges_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
3932
3923
|
col_privileges_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -3936,7 +3927,7 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3936
3927
|
#endif
|
3937
3928
|
}
|
3938
3929
|
if (!NIL_P(r_table_name)) {
|
3939
|
-
#ifdef
|
3930
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3940
3931
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
3941
3932
|
col_privileges_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
3942
3933
|
col_privileges_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -3946,7 +3937,7 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3946
3937
|
#endif
|
3947
3938
|
}
|
3948
3939
|
if (!NIL_P(r_column_name)) {
|
3949
|
-
#ifdef
|
3940
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3950
3941
|
r_column_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_column_name );
|
3951
3942
|
col_privileges_args->column_name = (SQLWCHAR*) RSTRING_PTR( r_column_name_utf16 );
|
3952
3943
|
col_privileges_args->column_name_len = (SQLSMALLINT) RSTRING_LEN( r_column_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -3956,10 +3947,9 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
3956
3947
|
#endif
|
3957
3948
|
}
|
3958
3949
|
col_privileges_args->stmt_res = stmt_res;
|
3959
|
-
|
3960
|
-
#ifdef UNICODE_SUPPORT_VERSION
|
3950
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
3961
3951
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLColumnPrivileges_helper, col_privileges_args,
|
3962
|
-
|
3952
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
3963
3953
|
rc = col_privileges_args->rc;
|
3964
3954
|
#else
|
3965
3955
|
rc = _ruby_ibm_db_SQLColumnPrivileges_helper( col_privileges_args );
|
@@ -4048,7 +4038,7 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4048
4038
|
VALUE r_owner = Qnil;
|
4049
4039
|
VALUE r_table_name = Qnil;
|
4050
4040
|
VALUE r_column_name = Qnil;
|
4051
|
-
#ifdef
|
4041
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4052
4042
|
VALUE r_qualifier_utf16 = Qnil;
|
4053
4043
|
VALUE r_owner_utf16 = Qnil;
|
4054
4044
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -4096,7 +4086,7 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4096
4086
|
return_value = Qfalse;
|
4097
4087
|
} else {
|
4098
4088
|
if (!NIL_P(r_qualifier)) {
|
4099
|
-
#ifdef
|
4089
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4100
4090
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4101
4091
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4102
4092
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4106,7 +4096,7 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4106
4096
|
#endif
|
4107
4097
|
}
|
4108
4098
|
if (!NIL_P(r_owner)) {
|
4109
|
-
#ifdef
|
4099
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4110
4100
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4111
4101
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4112
4102
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4116,7 +4106,7 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4116
4106
|
#endif
|
4117
4107
|
}
|
4118
4108
|
if (!NIL_P(r_table_name)) {
|
4119
|
-
#ifdef
|
4109
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4120
4110
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
4121
4111
|
col_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
4122
4112
|
col_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4126,7 +4116,7 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4126
4116
|
#endif
|
4127
4117
|
}
|
4128
4118
|
if (!NIL_P(r_column_name)) {
|
4129
|
-
#ifdef
|
4119
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4130
4120
|
r_column_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_column_name );
|
4131
4121
|
col_metadata_args->column_name = (SQLWCHAR*) RSTRING_PTR( r_column_name_utf16 );
|
4132
4122
|
col_metadata_args->column_name_len = (SQLSMALLINT) RSTRING_LEN( r_column_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4137,8 +4127,8 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
4137
4127
|
}
|
4138
4128
|
col_metadata_args->stmt_res = stmt_res;
|
4139
4129
|
|
4140
|
-
#ifdef
|
4141
|
-
|
4130
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4131
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLColumns_helper, col_metadata_args,
|
4142
4132
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
4143
4133
|
rc = col_metadata_args->rc;
|
4144
4134
|
#else
|
@@ -4228,7 +4218,7 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
4228
4218
|
VALUE r_table_name = Qnil;
|
4229
4219
|
VALUE r_is_fk_table = Qfalse;
|
4230
4220
|
|
4231
|
-
#ifdef
|
4221
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4232
4222
|
VALUE r_qualifier_utf16 = Qnil;
|
4233
4223
|
VALUE r_owner_utf16 = Qnil;
|
4234
4224
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -4277,7 +4267,7 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
4277
4267
|
return_value = Qfalse;
|
4278
4268
|
} else {
|
4279
4269
|
if (!NIL_P(r_qualifier)) {
|
4280
|
-
#ifdef
|
4270
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4281
4271
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4282
4272
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4283
4273
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4287,7 +4277,7 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
4287
4277
|
#endif
|
4288
4278
|
}
|
4289
4279
|
if (!NIL_P(r_owner)) {
|
4290
|
-
#ifdef
|
4280
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4291
4281
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4292
4282
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4293
4283
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4297,7 +4287,7 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
4297
4287
|
#endif
|
4298
4288
|
}
|
4299
4289
|
if (!NIL_P(r_table_name)) {
|
4300
|
-
#ifdef
|
4290
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4301
4291
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
4302
4292
|
col_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
4303
4293
|
col_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4309,8 +4299,8 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
4309
4299
|
|
4310
4300
|
col_metadata_args->stmt_res = stmt_res;
|
4311
4301
|
|
4312
|
-
#ifdef
|
4313
|
-
|
4302
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4303
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLForeignKeys_helper, col_metadata_args,
|
4314
4304
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
4315
4305
|
rc = col_metadata_args->rc;
|
4316
4306
|
#else
|
@@ -4388,7 +4378,7 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
4388
4378
|
VALUE r_qualifier = Qnil;
|
4389
4379
|
VALUE r_owner = Qnil;
|
4390
4380
|
VALUE r_table_name = Qnil;
|
4391
|
-
#ifdef
|
4381
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4392
4382
|
VALUE r_qualifier_utf16 = Qnil;
|
4393
4383
|
VALUE r_owner_utf16 = Qnil;
|
4394
4384
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -4434,7 +4424,7 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
4434
4424
|
return_value = Qfalse;
|
4435
4425
|
} else {
|
4436
4426
|
if (!NIL_P(r_qualifier)) {
|
4437
|
-
#ifdef
|
4427
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4438
4428
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4439
4429
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4440
4430
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4444,7 +4434,7 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
4444
4434
|
#endif
|
4445
4435
|
}
|
4446
4436
|
if (!NIL_P(r_owner)) {
|
4447
|
-
#ifdef
|
4437
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4448
4438
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4449
4439
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4450
4440
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4454,7 +4444,7 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
4454
4444
|
#endif
|
4455
4445
|
}
|
4456
4446
|
if (!NIL_P(r_table_name)) {
|
4457
|
-
#ifdef
|
4447
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4458
4448
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
4459
4449
|
col_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
4460
4450
|
col_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4465,8 +4455,8 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
4465
4455
|
}
|
4466
4456
|
col_metadata_args->stmt_res = stmt_res;
|
4467
4457
|
|
4468
|
-
#ifdef
|
4469
|
-
|
4458
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4459
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLPrimaryKeys_helper, col_metadata_args,
|
4470
4460
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
4471
4461
|
rc = col_metadata_args->rc;
|
4472
4462
|
#else
|
@@ -4566,7 +4556,7 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4566
4556
|
VALUE r_proc_name = Qnil;
|
4567
4557
|
VALUE r_column_name = Qnil;
|
4568
4558
|
|
4569
|
-
#ifdef
|
4559
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4570
4560
|
VALUE r_qualifier_utf16 = Qnil;
|
4571
4561
|
VALUE r_owner_utf16 = Qnil;
|
4572
4562
|
VALUE r_proc_name_utf16 = Qnil;
|
@@ -4615,7 +4605,7 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4615
4605
|
return_value = Qfalse;
|
4616
4606
|
} else {
|
4617
4607
|
if (!NIL_P(r_qualifier)) {
|
4618
|
-
#ifdef
|
4608
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4619
4609
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4620
4610
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4621
4611
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4625,7 +4615,7 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4625
4615
|
#endif
|
4626
4616
|
}
|
4627
4617
|
if (!NIL_P(r_owner)) {
|
4628
|
-
#ifdef
|
4618
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4629
4619
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4630
4620
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4631
4621
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4635,7 +4625,7 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4635
4625
|
#endif
|
4636
4626
|
}
|
4637
4627
|
if (!NIL_P(r_proc_name)) {
|
4638
|
-
#ifdef
|
4628
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4639
4629
|
r_proc_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_proc_name );
|
4640
4630
|
col_metadata_args->proc_name = (SQLWCHAR*) RSTRING_PTR( r_proc_name_utf16 );
|
4641
4631
|
col_metadata_args->proc_name_len = (SQLSMALLINT) RSTRING_LEN( r_proc_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4645,7 +4635,7 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4645
4635
|
#endif
|
4646
4636
|
}
|
4647
4637
|
if (!NIL_P(r_column_name)) {
|
4648
|
-
#ifdef
|
4638
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4649
4639
|
r_column_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_column_name );
|
4650
4640
|
col_metadata_args->column_name = (SQLWCHAR*) RSTRING_PTR( r_column_name_utf16 );
|
4651
4641
|
col_metadata_args->column_name_len = (SQLSMALLINT) RSTRING_LEN( r_column_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4656,9 +4646,9 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
4656
4646
|
}
|
4657
4647
|
col_metadata_args->stmt_res = stmt_res;
|
4658
4648
|
|
4659
|
-
#ifdef
|
4660
|
-
|
4661
|
-
|
4649
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4650
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLProcedureColumns_helper, col_metadata_args,
|
4651
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
4662
4652
|
rc = col_metadata_args->rc;
|
4663
4653
|
#else
|
4664
4654
|
rc = _ruby_ibm_db_SQLProcedureColumns_helper( col_metadata_args );
|
@@ -4736,7 +4726,7 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
4736
4726
|
VALUE r_owner = Qnil;
|
4737
4727
|
VALUE r_proc_name = Qnil;
|
4738
4728
|
|
4739
|
-
#ifdef
|
4729
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4740
4730
|
VALUE r_qualifier_utf16 = Qnil;
|
4741
4731
|
VALUE r_owner_utf16 = Qnil;
|
4742
4732
|
VALUE r_proc_name_utf16 = Qnil;
|
@@ -4782,7 +4772,7 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
4782
4772
|
return_value = Qfalse;
|
4783
4773
|
} else {
|
4784
4774
|
if (!NIL_P(r_qualifier)) {
|
4785
|
-
#ifdef
|
4775
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4786
4776
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4787
4777
|
proc_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4788
4778
|
proc_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4792,7 +4782,7 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
4792
4782
|
#endif
|
4793
4783
|
}
|
4794
4784
|
if (!NIL_P(r_owner)) {
|
4795
|
-
#ifdef
|
4785
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4796
4786
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4797
4787
|
proc_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4798
4788
|
proc_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4802,7 +4792,7 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
4802
4792
|
#endif
|
4803
4793
|
}
|
4804
4794
|
if (!NIL_P(r_proc_name)) {
|
4805
|
-
#ifdef
|
4795
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4806
4796
|
r_proc_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_proc_name );
|
4807
4797
|
proc_metadata_args->proc_name = (SQLWCHAR*) RSTRING_PTR( r_proc_name_utf16 );
|
4808
4798
|
proc_metadata_args->proc_name_len = (SQLSMALLINT) RSTRING_LEN( r_proc_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4813,8 +4803,8 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
4813
4803
|
}
|
4814
4804
|
proc_metadata_args->stmt_res = stmt_res;
|
4815
4805
|
|
4816
|
-
#ifdef
|
4817
|
-
|
4806
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4807
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLProcedures_helper, proc_metadata_args,
|
4818
4808
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res);
|
4819
4809
|
rc = proc_metadata_args->rc;
|
4820
4810
|
#else
|
@@ -4908,7 +4898,7 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
4908
4898
|
VALUE r_qualifier = Qnil;
|
4909
4899
|
VALUE r_owner = Qnil;
|
4910
4900
|
VALUE r_table_name = Qnil;
|
4911
|
-
#ifdef
|
4901
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4912
4902
|
VALUE r_qualifier_utf16 = Qnil;
|
4913
4903
|
VALUE r_owner_utf16 = Qnil;
|
4914
4904
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -4956,7 +4946,7 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
4956
4946
|
return_value = Qfalse;
|
4957
4947
|
} else {
|
4958
4948
|
if (!NIL_P(r_qualifier)) {
|
4959
|
-
#ifdef
|
4949
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4960
4950
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
4961
4951
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
4962
4952
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -4966,7 +4956,7 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
4966
4956
|
#endif
|
4967
4957
|
}
|
4968
4958
|
if (!NIL_P(r_owner)) {
|
4969
|
-
#ifdef
|
4959
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4970
4960
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
4971
4961
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
4972
4962
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -4976,7 +4966,7 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
4976
4966
|
#endif
|
4977
4967
|
}
|
4978
4968
|
if (!NIL_P(r_table_name)) {
|
4979
|
-
#ifdef
|
4969
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4980
4970
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
4981
4971
|
col_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
4982
4972
|
col_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -4990,9 +4980,9 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
4990
4980
|
}
|
4991
4981
|
col_metadata_args->stmt_res = stmt_res;
|
4992
4982
|
|
4993
|
-
#ifdef
|
4994
|
-
|
4995
|
-
|
4983
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
4984
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLSpecialColumns_helper, col_metadata_args,
|
4985
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
4996
4986
|
rc = col_metadata_args->rc;
|
4997
4987
|
#else
|
4998
4988
|
rc = _ruby_ibm_db_SQLSpecialColumns_helper( col_metadata_args );
|
@@ -5106,7 +5096,7 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
5106
5096
|
VALUE r_owner = Qnil;
|
5107
5097
|
VALUE r_table_name = Qnil;
|
5108
5098
|
VALUE r_unique = Qnil;
|
5109
|
-
#ifdef
|
5099
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5110
5100
|
VALUE r_qualifier_utf16 = Qnil;
|
5111
5101
|
VALUE r_owner_utf16 = Qnil;
|
5112
5102
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -5152,7 +5142,7 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
5152
5142
|
return_value = Qfalse;
|
5153
5143
|
} else {
|
5154
5144
|
if (!NIL_P(r_qualifier)) {
|
5155
|
-
#ifdef
|
5145
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5156
5146
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
5157
5147
|
col_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
5158
5148
|
col_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -5162,7 +5152,7 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
5162
5152
|
#endif
|
5163
5153
|
}
|
5164
5154
|
if (!NIL_P(r_owner)) {
|
5165
|
-
#ifdef
|
5155
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5166
5156
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
5167
5157
|
col_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
5168
5158
|
col_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -5172,7 +5162,7 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
5172
5162
|
#endif
|
5173
5163
|
}
|
5174
5164
|
if (!NIL_P(r_table_name)) {
|
5175
|
-
#ifdef
|
5165
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5176
5166
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
5177
5167
|
col_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
5178
5168
|
col_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -5186,9 +5176,9 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
5186
5176
|
}
|
5187
5177
|
col_metadata_args->stmt_res = stmt_res;
|
5188
5178
|
|
5189
|
-
#ifdef
|
5179
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5190
5180
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLStatistics_helper, col_metadata_args,
|
5191
|
-
|
5181
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5192
5182
|
rc = col_metadata_args->rc;
|
5193
5183
|
#else
|
5194
5184
|
rc = _ruby_ibm_db_SQLStatistics_helper( col_metadata_args );
|
@@ -5268,7 +5258,7 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
5268
5258
|
VALUE r_qualifier = Qnil;
|
5269
5259
|
VALUE r_owner = Qnil;
|
5270
5260
|
VALUE r_table_name = Qnil;
|
5271
|
-
#ifdef
|
5261
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5272
5262
|
VALUE r_qualifier_utf16 = Qnil;
|
5273
5263
|
VALUE r_owner_utf16 = Qnil;
|
5274
5264
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -5313,7 +5303,7 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
5313
5303
|
return_value = Qfalse;
|
5314
5304
|
} else {
|
5315
5305
|
if (!NIL_P(r_qualifier)) {
|
5316
|
-
#ifdef
|
5306
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5317
5307
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
5318
5308
|
table_privileges_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
5319
5309
|
table_privileges_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -5323,7 +5313,7 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
5323
5313
|
#endif
|
5324
5314
|
}
|
5325
5315
|
if (!NIL_P(r_owner)) {
|
5326
|
-
#ifdef
|
5316
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5327
5317
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
5328
5318
|
table_privileges_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
5329
5319
|
table_privileges_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -5333,7 +5323,7 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
5333
5323
|
#endif
|
5334
5324
|
}
|
5335
5325
|
if (!NIL_P(r_table_name)) {
|
5336
|
-
#ifdef
|
5326
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5337
5327
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
5338
5328
|
table_privileges_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
5339
5329
|
table_privileges_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -5345,9 +5335,9 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
5345
5335
|
|
5346
5336
|
table_privileges_args->stmt_res = stmt_res;
|
5347
5337
|
|
5348
|
-
#ifdef
|
5349
|
-
|
5350
|
-
|
5338
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5339
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLTablePrivileges_helper, table_privileges_args,
|
5340
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5351
5341
|
rc = table_privileges_args->rc;
|
5352
5342
|
#else
|
5353
5343
|
rc = _ruby_ibm_db_SQLTablePrivileges_helper( table_privileges_args );
|
@@ -5428,7 +5418,7 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5428
5418
|
VALUE r_owner = Qnil;
|
5429
5419
|
VALUE r_table_name = Qnil;
|
5430
5420
|
VALUE r_table_type = Qnil;
|
5431
|
-
#ifdef
|
5421
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5432
5422
|
VALUE r_qualifier_utf16 = Qnil;
|
5433
5423
|
VALUE r_owner_utf16 = Qnil;
|
5434
5424
|
VALUE r_table_name_utf16 = Qnil;
|
@@ -5477,7 +5467,7 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5477
5467
|
return_value = Qfalse;
|
5478
5468
|
} else {
|
5479
5469
|
if (!NIL_P(r_qualifier)) {
|
5480
|
-
#ifdef
|
5470
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5481
5471
|
r_qualifier_utf16 = _ruby_ibm_db_export_str_to_utf16( r_qualifier );
|
5482
5472
|
table_metadata_args->qualifier = (SQLWCHAR*) RSTRING_PTR( r_qualifier_utf16 );
|
5483
5473
|
table_metadata_args->qualifier_len = (SQLSMALLINT) RSTRING_LEN( r_qualifier_utf16 )/sizeof(SQLWCHAR);
|
@@ -5487,7 +5477,7 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5487
5477
|
#endif
|
5488
5478
|
}
|
5489
5479
|
if (!NIL_P(r_owner)) {
|
5490
|
-
#ifdef
|
5480
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5491
5481
|
r_owner_utf16 = _ruby_ibm_db_export_str_to_utf16( r_owner );
|
5492
5482
|
table_metadata_args->owner = (SQLWCHAR*) RSTRING_PTR( r_owner_utf16 );
|
5493
5483
|
table_metadata_args->owner_len = (SQLSMALLINT) RSTRING_LEN( r_owner_utf16 )/sizeof(SQLWCHAR);
|
@@ -5497,7 +5487,7 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5497
5487
|
#endif
|
5498
5488
|
}
|
5499
5489
|
if (!NIL_P(r_table_name)) {
|
5500
|
-
#ifdef
|
5490
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5501
5491
|
r_table_name_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_name );
|
5502
5492
|
table_metadata_args->table_name = (SQLWCHAR*) RSTRING_PTR( r_table_name_utf16 );
|
5503
5493
|
table_metadata_args->table_name_len = (SQLSMALLINT) RSTRING_LEN( r_table_name_utf16 )/sizeof(SQLWCHAR);
|
@@ -5507,7 +5497,7 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5507
5497
|
#endif
|
5508
5498
|
}
|
5509
5499
|
if (!NIL_P(r_table_type)) {
|
5510
|
-
#ifdef
|
5500
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5511
5501
|
r_table_type_utf16 = _ruby_ibm_db_export_str_to_utf16( r_table_type );
|
5512
5502
|
table_metadata_args->table_type = (SQLWCHAR*) RSTRING_PTR( r_table_type_utf16 );
|
5513
5503
|
table_metadata_args->table_type_len = (SQLSMALLINT) RSTRING_LEN( r_table_type_utf16 )/sizeof(SQLWCHAR);
|
@@ -5519,8 +5509,8 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
5519
5509
|
|
5520
5510
|
table_metadata_args->stmt_res = stmt_res;
|
5521
5511
|
|
5522
|
-
#ifdef
|
5523
|
-
|
5512
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5513
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLTables_helper, table_metadata_args,
|
5524
5514
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5525
5515
|
rc = table_metadata_args->rc;
|
5526
5516
|
#else
|
@@ -5601,9 +5591,9 @@ VALUE ibm_db_commit(int argc, VALUE *argv, VALUE self)
|
|
5601
5591
|
end_X_args->handleType = SQL_HANDLE_DBC;
|
5602
5592
|
end_X_args->completionType = SQL_COMMIT; /*Remeber you are Commiting the transaction*/
|
5603
5593
|
|
5604
|
-
#ifdef
|
5594
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5605
5595
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLEndTran, end_X_args,
|
5606
|
-
|
5596
|
+
RUBY_UBF_IO, NULL);
|
5607
5597
|
rc = end_X_args->rc;
|
5608
5598
|
#else
|
5609
5599
|
rc = _ruby_ibm_db_SQLEndTran( end_X_args );
|
@@ -5637,7 +5627,7 @@ static int _ruby_ibm_db_do_prepare(conn_handle *conn_res, VALUE stmt, stmt_handl
|
|
5637
5627
|
|
5638
5628
|
VALUE error = Qnil;
|
5639
5629
|
|
5640
|
-
#ifdef
|
5630
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5641
5631
|
VALUE stmt_utf16 = Qnil;
|
5642
5632
|
#endif
|
5643
5633
|
|
@@ -5647,7 +5637,7 @@ static int _ruby_ibm_db_do_prepare(conn_handle *conn_res, VALUE stmt, stmt_handl
|
|
5647
5637
|
if ( !NIL_P(stmt) ) {
|
5648
5638
|
prepare_args = ALLOC( exec_cum_prepare_args );
|
5649
5639
|
memset(prepare_args,'\0',sizeof(struct _ibm_db_exec_direct_args_struct));
|
5650
|
-
#ifdef
|
5640
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5651
5641
|
stmt_utf16 = _ruby_ibm_db_export_str_to_utf16(stmt);
|
5652
5642
|
prepare_args->stmt_string = (SQLWCHAR*) RSTRING_PTR(stmt_utf16);
|
5653
5643
|
prepare_args->stmt_string_len = RSTRING_LEN(stmt_utf16)/sizeof(SQLWCHAR);
|
@@ -5681,9 +5671,9 @@ static int _ruby_ibm_db_do_prepare(conn_handle *conn_res, VALUE stmt, stmt_handl
|
|
5681
5671
|
prepare_args->stmt_res = stmt_res;
|
5682
5672
|
|
5683
5673
|
/* Prepare the stmt. The cursor type requested has already been set in _ruby_ibm_db_assign_options */
|
5684
|
-
#ifdef
|
5685
|
-
|
5686
|
-
|
5674
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5675
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLPrepare_helper, prepare_args,
|
5676
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5687
5677
|
rc = prepare_args->rc;
|
5688
5678
|
#else
|
5689
5679
|
rc = _ruby_ibm_db_SQLPrepare_helper( prepare_args );
|
@@ -5747,7 +5737,7 @@ static int _ruby_ibm_db_do_prepare(conn_handle *conn_res, VALUE stmt, stmt_handl
|
|
5747
5737
|
VALUE ibm_db_exec(int argc, VALUE *argv, VALUE self)
|
5748
5738
|
{
|
5749
5739
|
VALUE stmt = Qnil;
|
5750
|
-
#ifdef
|
5740
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5751
5741
|
VALUE stmt_utf16 = Qnil;
|
5752
5742
|
#endif
|
5753
5743
|
VALUE connection = Qnil;
|
@@ -5779,7 +5769,7 @@ VALUE ibm_db_exec(int argc, VALUE *argv, VALUE self)
|
|
5779
5769
|
exec_direct_args = ALLOC( exec_cum_prepare_args );
|
5780
5770
|
memset(exec_direct_args,'\0',sizeof(struct _ibm_db_exec_direct_args_struct));
|
5781
5771
|
|
5782
|
-
#ifdef
|
5772
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5783
5773
|
stmt_utf16 = _ruby_ibm_db_export_str_to_utf16(stmt);
|
5784
5774
|
exec_direct_args->stmt_string = (SQLWCHAR*)RSTRING_PTR(stmt_utf16);
|
5785
5775
|
exec_direct_args->stmt_string_len = RSTRING_LEN(stmt_utf16)/sizeof(SQLWCHAR); /*RSTRING_LEN returns number of bytes*/
|
@@ -5823,9 +5813,9 @@ VALUE ibm_db_exec(int argc, VALUE *argv, VALUE self)
|
|
5823
5813
|
exec_direct_args->stmt_res = stmt_res;
|
5824
5814
|
|
5825
5815
|
|
5826
|
-
#ifdef
|
5827
|
-
|
5828
|
-
|
5816
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5817
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLExecDirect_helper, exec_direct_args,
|
5818
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5829
5819
|
rc = exec_direct_args->rc;
|
5830
5820
|
#else
|
5831
5821
|
rc = _ruby_ibm_db_SQLExecDirect_helper( exec_direct_args );
|
@@ -5882,7 +5872,7 @@ VALUE ibm_db_free_result(int argc, VALUE *argv, VALUE self)
|
|
5882
5872
|
stmt_handle *stmt_res = NULL;
|
5883
5873
|
free_stmt_args *freeStmt_args = NULL;
|
5884
5874
|
|
5885
|
-
#ifdef
|
5875
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5886
5876
|
char *err_str = NULL;
|
5887
5877
|
#endif
|
5888
5878
|
|
@@ -5897,8 +5887,8 @@ VALUE ibm_db_free_result(int argc, VALUE *argv, VALUE self)
|
|
5897
5887
|
freeStmt_args->stmt_res = stmt_res;
|
5898
5888
|
freeStmt_args->option = SQL_CLOSE;
|
5899
5889
|
|
5900
|
-
#ifdef
|
5901
|
-
|
5890
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5891
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLFreeStmt_helper, freeStmt_args,
|
5902
5892
|
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
5903
5893
|
rc = freeStmt_args->rc;
|
5904
5894
|
#else
|
@@ -5910,7 +5900,7 @@ VALUE ibm_db_free_result(int argc, VALUE *argv, VALUE self)
|
|
5910
5900
|
|
5911
5901
|
if ( rc == SQL_ERROR ) {
|
5912
5902
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 1 );
|
5913
|
-
#ifdef
|
5903
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5914
5904
|
err_str = RSTRING_PTR(
|
5915
5905
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
5916
5906
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -5988,7 +5978,7 @@ VALUE ibm_db_prepare(int argc, VALUE *argv, VALUE self)
|
|
5988
5978
|
conn_handle *conn_res;
|
5989
5979
|
stmt_handle *stmt_res;
|
5990
5980
|
|
5991
|
-
#ifdef
|
5981
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
5992
5982
|
char *err_str = NULL;
|
5993
5983
|
#endif
|
5994
5984
|
|
@@ -6022,7 +6012,7 @@ VALUE ibm_db_prepare(int argc, VALUE *argv, VALUE self)
|
|
6022
6012
|
_ruby_ibm_db_free_stmt_struct(stmt_res);
|
6023
6013
|
stmt_res = NULL;
|
6024
6014
|
|
6025
|
-
#ifdef
|
6015
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6026
6016
|
err_str = RSTRING_PTR( _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_msg,
|
6027
6017
|
DB2_MAX_ERR_MSG_LEN * sizeof(SQLWCHAR) )
|
6028
6018
|
);
|
@@ -6088,13 +6078,13 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6088
6078
|
int rc;
|
6089
6079
|
int origlen = 0;
|
6090
6080
|
int is_known_type = 1;
|
6091
|
-
#ifdef
|
6081
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6092
6082
|
int is_binary = 0; /*Indicates if the column is either SQL_BLOB, SQL_BINARY, SQL_VARBINARY or SQL_LONGVARBINARY*/
|
6093
6083
|
#endif
|
6094
6084
|
|
6095
6085
|
SQLPOINTER tmp_str;
|
6096
6086
|
|
6097
|
-
#ifdef
|
6087
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6098
6088
|
VALUE bindData_utf16;
|
6099
6089
|
VALUE tmpBuff;
|
6100
6090
|
#endif
|
@@ -6116,7 +6106,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6116
6106
|
|
6117
6107
|
switch(TYPE(*bind_data)) {
|
6118
6108
|
case T_BIGNUM:
|
6119
|
-
#ifdef
|
6109
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6120
6110
|
tmpBuff = rb_big2str(*bind_data,10);
|
6121
6111
|
tmp_str = (SQLCHAR *) RSTRING_PTR(tmpBuff);
|
6122
6112
|
curr->ivalue = RSTRING_LEN(tmpBuff);
|
@@ -6196,7 +6186,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6196
6186
|
break;
|
6197
6187
|
|
6198
6188
|
case T_STRING:
|
6199
|
-
#ifdef
|
6189
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6200
6190
|
if( curr->data_type == SQL_BLOB || curr->data_type == SQL_LONGVARBINARY || curr->data_type == SQL_VARBINARY ||
|
6201
6191
|
curr->data_type == SQL_BINARY || curr->data_type == SQL_XML ){
|
6202
6192
|
is_binary = 1;
|
@@ -6223,7 +6213,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6223
6213
|
* given then use BUFSIZ to return the string.
|
6224
6214
|
*/
|
6225
6215
|
if ( curr->size <= 0 ) {
|
6226
|
-
#ifdef
|
6216
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6227
6217
|
if( is_binary ) {
|
6228
6218
|
if (curr->ivalue < curr->param_size ) {
|
6229
6219
|
curr->ivalue = curr->param_size;
|
@@ -6247,7 +6237,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6247
6237
|
#endif
|
6248
6238
|
} else {
|
6249
6239
|
if( curr->param_type == SQL_PARAM_INPUT_OUTPUT ) {
|
6250
|
-
#ifdef
|
6240
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6251
6241
|
if( is_binary ) {
|
6252
6242
|
if( curr->size > curr->ivalue ) {
|
6253
6243
|
curr->ivalue = curr->size + 1;
|
@@ -6269,7 +6259,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6269
6259
|
}
|
6270
6260
|
#endif
|
6271
6261
|
} else {
|
6272
|
-
#ifdef
|
6262
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6273
6263
|
if( is_binary ) {
|
6274
6264
|
curr->ivalue = curr->size + 1;
|
6275
6265
|
} else {
|
@@ -6288,7 +6278,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6288
6278
|
}
|
6289
6279
|
}
|
6290
6280
|
|
6291
|
-
#ifdef
|
6281
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6292
6282
|
if( is_binary ){
|
6293
6283
|
curr->svalue = (SQLCHAR *) ALLOC_N(SQLCHAR, curr->ivalue);
|
6294
6284
|
} else {
|
@@ -6320,7 +6310,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6320
6310
|
paramValuePtr = (SQLPOINTER)&(curr);
|
6321
6311
|
#endif
|
6322
6312
|
}
|
6323
|
-
#ifdef
|
6313
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6324
6314
|
valueType = SQL_C_WCHAR;
|
6325
6315
|
#else
|
6326
6316
|
valueType = SQL_C_CHAR;
|
@@ -6369,7 +6359,7 @@ static int _ruby_ibm_db_bind_parameter_helper(stmt_handle *stmt_res, param_node
|
|
6369
6359
|
}
|
6370
6360
|
}
|
6371
6361
|
bindParameter_args->buff_length = curr->ivalue;
|
6372
|
-
#ifdef
|
6362
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6373
6363
|
valueType = SQL_C_WCHAR;
|
6374
6364
|
#else
|
6375
6365
|
valueType = SQL_C_CHAR;
|
@@ -6431,7 +6421,7 @@ static int _ruby_ibm_db_bind_data( stmt_handle *stmt_res, param_node *curr, VALU
|
|
6431
6421
|
}
|
6432
6422
|
curr->bind_indicator = 0;
|
6433
6423
|
|
6434
|
-
#ifdef
|
6424
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6435
6425
|
curr->svalue = (SQLCHAR *) RSTRING_PTR(*bind_data);
|
6436
6426
|
curr->ivalue = RSTRING_LEN(*bind_data);
|
6437
6427
|
#else
|
@@ -6472,7 +6462,7 @@ static int _ruby_ibm_db_bind_param_list(stmt_handle *stmt_res, VALUE *error ) {
|
|
6472
6462
|
|
6473
6463
|
if ( rc == SQL_ERROR ) {
|
6474
6464
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6475
|
-
#ifdef
|
6465
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6476
6466
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 1: "),
|
6477
6467
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6478
6468
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6481,7 +6471,7 @@ static int _ruby_ibm_db_bind_param_list(stmt_handle *stmt_res, VALUE *error ) {
|
|
6481
6471
|
*error = rb_str_cat2(rb_str_new2("Binding Error 1: "), stmt_res->ruby_stmt_err_msg );
|
6482
6472
|
#endif
|
6483
6473
|
} else {
|
6484
|
-
#ifdef
|
6474
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6485
6475
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 1: <error message could not be retrieved>");
|
6486
6476
|
#else
|
6487
6477
|
*error = rb_str_new2("Binding Error 1: <error message could not be retrieved>");
|
@@ -6543,7 +6533,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6543
6533
|
if ( rc == SQL_ERROR ) {
|
6544
6534
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 0 );
|
6545
6535
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6546
|
-
#ifdef
|
6536
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6547
6537
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr( "Describe Param Failed: " ),
|
6548
6538
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6549
6539
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6552,7 +6542,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6552
6542
|
*error = rb_str_cat2(rb_str_new2("Describe Param Failed: "), stmt_res->ruby_stmt_err_msg );
|
6553
6543
|
#endif
|
6554
6544
|
} else {
|
6555
|
-
#ifdef
|
6545
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6556
6546
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Describe Param Failed: <error message could not be retrieved>");
|
6557
6547
|
#else
|
6558
6548
|
*error = rb_str_new2("Describe Param Failed: <error message could not be retrieved>");
|
@@ -6579,7 +6569,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6579
6569
|
|
6580
6570
|
if ( rc == SQL_ERROR ) {
|
6581
6571
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6582
|
-
#ifdef
|
6572
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6583
6573
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 2: "),
|
6584
6574
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6585
6575
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6588,7 +6578,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6588
6578
|
*error = rb_str_cat2(rb_str_new2("Binding Error 2: "), stmt_res->ruby_stmt_err_msg );
|
6589
6579
|
#endif
|
6590
6580
|
} else {
|
6591
|
-
#ifdef
|
6581
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6592
6582
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 2: <error message could not be retrieved>");
|
6593
6583
|
#else
|
6594
6584
|
*error = rb_str_new2("Binding Error 2: <error message could not be retrieved>");
|
@@ -6609,7 +6599,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6609
6599
|
|
6610
6600
|
if ( rc == SQL_ERROR ) {
|
6611
6601
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6612
|
-
#ifdef
|
6602
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6613
6603
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 2: "),
|
6614
6604
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6615
6605
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6618,7 +6608,7 @@ static int _ruby_ibm_db_execute_helper2(stmt_handle *stmt_res, VALUE *data, int
|
|
6618
6608
|
*error = rb_str_cat2(rb_str_new2("Binding Error 2: "), stmt_res->ruby_stmt_err_msg );
|
6619
6609
|
#endif
|
6620
6610
|
} else {
|
6621
|
-
#ifdef
|
6611
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6622
6612
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Binding Error 2: <error message could not be retrieved>");
|
6623
6613
|
#else
|
6624
6614
|
*error = rb_str_new2("Binding Error 2: <error message could not be retrieved>");
|
@@ -6649,7 +6639,7 @@ void var_assign(char *name, VALUE value) {
|
|
6649
6639
|
inspect = rb_intern("inspect");
|
6650
6640
|
value = rb_funcall(value, inspect, 0);
|
6651
6641
|
|
6652
|
-
#ifdef
|
6642
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6653
6643
|
expr = RSTRING_PTR(value);
|
6654
6644
|
expr_len = RSTRING_LEN(value);
|
6655
6645
|
#else
|
@@ -6687,7 +6677,7 @@ static VALUE _ruby_ibm_db_desc_and_bind_param_list(stmt_bind_array *bind_array,
|
|
6687
6677
|
numOpts = bind_array->num;
|
6688
6678
|
} else if (numOpts < bind_array->num) {
|
6689
6679
|
/* If there are less params passed in, than are present -- Error */
|
6690
|
-
#ifdef
|
6680
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6691
6681
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Number of params passed in are less than bound parameters");
|
6692
6682
|
#else
|
6693
6683
|
*error = rb_str_new2("Number of params passed in are less than bound parameters");
|
@@ -6757,7 +6747,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6757
6747
|
ruby_xfree( num_params_args );
|
6758
6748
|
num_params_args = NULL;
|
6759
6749
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6760
|
-
#ifdef
|
6750
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6761
6751
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Execute Failed due to: "),
|
6762
6752
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6763
6753
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6766,7 +6756,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6766
6756
|
*error = rb_str_cat2(rb_str_new2("Execute Failed due to: "), stmt_res->ruby_stmt_err_msg );
|
6767
6757
|
#endif
|
6768
6758
|
} else {
|
6769
|
-
#ifdef
|
6759
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6770
6760
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Execute Failed due to: <error message could not be retrieved>");
|
6771
6761
|
#else
|
6772
6762
|
*error = rb_str_new2("Execute Failed due to: <error message could not be retrieved>");
|
@@ -6790,7 +6780,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6790
6780
|
/* Make sure IBM_DB.bind_param has been called */
|
6791
6781
|
/* If the param list is NULL -- ERROR */
|
6792
6782
|
if (TYPE( *(bind_array->parameters_array) ) != T_ARRAY) {
|
6793
|
-
#ifdef
|
6783
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6794
6784
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Param is not an array");
|
6795
6785
|
#else
|
6796
6786
|
*error = rb_str_new2("Param is not an array");
|
@@ -6815,7 +6805,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6815
6805
|
/* No additional params passed in. Use values already bound. */
|
6816
6806
|
if ( num > stmt_res->num_params ) {
|
6817
6807
|
/* More parameters than we expected */
|
6818
|
-
#ifdef
|
6808
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6819
6809
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Number of params passed are more than bound parameters");
|
6820
6810
|
#else
|
6821
6811
|
*error = rb_str_new2("Number of params passed are more than bound parameters");
|
@@ -6824,7 +6814,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6824
6814
|
return Qnil;
|
6825
6815
|
} else if ( num < stmt_res->num_params ) {
|
6826
6816
|
/* Fewer parameters than we expected */
|
6827
|
-
#ifdef
|
6817
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6828
6818
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Number of params passed are less than bound parameters");
|
6829
6819
|
#else
|
6830
6820
|
*error = rb_str_new2("Number of params passed are less than bound parameters");
|
@@ -6835,7 +6825,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6835
6825
|
|
6836
6826
|
/* Param cache node list is empty -- No params bound */
|
6837
6827
|
if ( stmt_res->head_cache_list == NULL ) {
|
6838
|
-
#ifdef
|
6828
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6839
6829
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Parameters not bound");
|
6840
6830
|
#else
|
6841
6831
|
*error = rb_str_new2("Parameters not bound");
|
@@ -6862,7 +6852,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6862
6852
|
if ( rc == SQL_ERROR ) {
|
6863
6853
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 0 );
|
6864
6854
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6865
|
-
#ifdef
|
6855
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6866
6856
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Statement Execute Failed: "),
|
6867
6857
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6868
6858
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6871,7 +6861,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6871
6861
|
*error = rb_str_cat2(rb_str_new2("Statement Execute Failed: "), stmt_res->ruby_stmt_err_msg );
|
6872
6862
|
#endif
|
6873
6863
|
} else {
|
6874
|
-
#ifdef
|
6864
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6875
6865
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Statement Execute Failed: <error message could not be retrieved>");
|
6876
6866
|
#else
|
6877
6867
|
*error = rb_str_new2("Statement Execute Failed: <error message could not be retrieved>");
|
@@ -6897,7 +6887,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6897
6887
|
if ( rc == SQL_ERROR ) {
|
6898
6888
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 0 );
|
6899
6889
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6900
|
-
#ifdef
|
6890
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6901
6891
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr( "Sending data failed: "),
|
6902
6892
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6903
6893
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6906,7 +6896,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6906
6896
|
*error = rb_str_cat2(rb_str_new2("Sending data failed: "), stmt_res->ruby_stmt_err_msg );
|
6907
6897
|
#endif
|
6908
6898
|
} else {
|
6909
|
-
#ifdef
|
6899
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6910
6900
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Sending data failed: <error message could not be retrieved>");
|
6911
6901
|
#else
|
6912
6902
|
*error = rb_str_new2("Sending data failed: <error message could not be retrieved>");
|
@@ -6931,7 +6921,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6931
6921
|
if ( rc == SQL_ERROR ) {
|
6932
6922
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 0 );
|
6933
6923
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
6934
|
-
#ifdef
|
6924
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6935
6925
|
*error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr( "Sending data failed: "),
|
6936
6926
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
6937
6927
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -6940,7 +6930,7 @@ static VALUE _ruby_ibm_db_execute_helper(stmt_bind_array *bind_array) {
|
|
6940
6930
|
*error = rb_str_cat2(rb_str_new2("Sending data failed: "), stmt_res->ruby_stmt_err_msg );
|
6941
6931
|
#endif
|
6942
6932
|
} else {
|
6943
|
-
#ifdef
|
6933
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
6944
6934
|
*error = _ruby_ibm_db_export_char_to_utf8_rstr("Sending data failed: <error message could not be retrieved>");
|
6945
6935
|
#else
|
6946
6936
|
*error = rb_str_new2("Sending data failed: <error message could not be retrieved>");
|
@@ -7015,9 +7005,9 @@ VALUE ibm_db_execute(int argc, VALUE *argv, VALUE self)
|
|
7015
7005
|
bind_array->num = 0;
|
7016
7006
|
bind_array->error = &error;
|
7017
7007
|
|
7018
|
-
#ifdef
|
7019
|
-
|
7020
|
-
|
7008
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7009
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_execute_helper, bind_array,
|
7010
|
+
RUBY_UBF_IO, NULL );
|
7021
7011
|
ret_value = bind_array->return_value;
|
7022
7012
|
#else
|
7023
7013
|
ret_value = _ruby_ibm_db_execute_helper( bind_array );
|
@@ -7081,7 +7071,7 @@ VALUE ibm_db_execute(int argc, VALUE *argv, VALUE self)
|
|
7081
7071
|
var_assign(tmp_curr->varname, rb_float_new(tmp_curr->fvalue));
|
7082
7072
|
break;
|
7083
7073
|
case SQL_XML:
|
7084
|
-
#ifdef
|
7074
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7085
7075
|
var_assign(tmp_curr->varname,rb_str_new2((char *) "")); /*Ensure it is a string object*/
|
7086
7076
|
if( tmp_curr-> size > 0 && tmp_curr->bind_indicator > tmp_curr->size ){
|
7087
7077
|
rb_funcall(rb_eval_string(tmp_curr->varname), rb_intern("replace"), 1, _ruby_ibm_db_export_sqlchar_to_utf8_rstr( (SQLCHAR *) tmp_curr->svalue, tmp_curr->size ));
|
@@ -7103,7 +7093,7 @@ VALUE ibm_db_execute(int argc, VALUE *argv, VALUE self)
|
|
7103
7093
|
}
|
7104
7094
|
break;
|
7105
7095
|
default:
|
7106
|
-
#ifdef
|
7096
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7107
7097
|
var_assign(tmp_curr->varname,rb_str_new2((char *) "")); /*Ensure it is a string object*/
|
7108
7098
|
if( tmp_curr-> size > 0 && tmp_curr->bind_indicator > (tmp_curr->size * sizeof(SQLWCHAR))+ 2 ){
|
7109
7099
|
rb_funcall(rb_eval_string(tmp_curr->varname), rb_intern("replace"), 1, _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( (SQLWCHAR *) tmp_curr->svalue, (tmp_curr->size * sizeof(SQLWCHAR)) + 2 ));
|
@@ -7186,7 +7176,7 @@ VALUE ibm_db_conn_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7186
7176
|
return Qnil;
|
7187
7177
|
}
|
7188
7178
|
|
7189
|
-
#ifdef
|
7179
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7190
7180
|
return_str = ALLOC_N( SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
7191
7181
|
memset(return_str, '\0', (DB2_MAX_ERR_MSG_LEN + 1 ) * sizeof(SQLWCHAR) );
|
7192
7182
|
#else
|
@@ -7201,7 +7191,7 @@ VALUE ibm_db_conn_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7201
7191
|
|
7202
7192
|
conn_res->errormsg_recno_tracker++;
|
7203
7193
|
|
7204
|
-
#ifdef
|
7194
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7205
7195
|
ret_val = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( (SQLWCHAR *)return_str, return_str_len );
|
7206
7196
|
#else
|
7207
7197
|
ret_val = rb_str_new2(return_str);
|
@@ -7210,7 +7200,7 @@ VALUE ibm_db_conn_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7210
7200
|
|
7211
7201
|
return ret_val;
|
7212
7202
|
} else {
|
7213
|
-
#ifdef
|
7203
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7214
7204
|
return _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( IBM_DB_G(__ruby_conn_err_msg), DB2_MAX_ERR_MSG_LEN * sizeof(SQLWCHAR) );
|
7215
7205
|
#else
|
7216
7206
|
return rb_str_new2(IBM_DB_G(__ruby_conn_err_msg));
|
@@ -7256,7 +7246,7 @@ VALUE ibm_db_stmt_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7256
7246
|
if (!NIL_P(stmt)) {
|
7257
7247
|
Data_Get_Struct(stmt, stmt_handle, stmt_res);
|
7258
7248
|
|
7259
|
-
#ifdef
|
7249
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7260
7250
|
return_str = ALLOC_N(SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
7261
7251
|
memset(return_str, '\0', (DB2_MAX_ERR_MSG_LEN + 1 ) * sizeof(SQLWCHAR) );
|
7262
7252
|
#else
|
@@ -7272,7 +7262,7 @@ VALUE ibm_db_stmt_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7272
7262
|
|
7273
7263
|
stmt_res->errormsg_recno_tracker++;
|
7274
7264
|
|
7275
|
-
#ifdef
|
7265
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7276
7266
|
ret_val = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, return_str_len );
|
7277
7267
|
#else
|
7278
7268
|
ret_val = rb_str_new2( return_str );
|
@@ -7281,7 +7271,7 @@ VALUE ibm_db_stmt_errormsg(int argc, VALUE *argv, VALUE self)
|
|
7281
7271
|
|
7282
7272
|
return ret_val;
|
7283
7273
|
} else {
|
7284
|
-
#ifdef
|
7274
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7285
7275
|
return _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( IBM_DB_G(__ruby_stmt_err_msg), DB2_MAX_ERR_MSG_LEN * sizeof(SQLWCHAR) );
|
7286
7276
|
#else
|
7287
7277
|
return rb_str_new2(IBM_DB_G(__ruby_stmt_err_msg));
|
@@ -7340,7 +7330,7 @@ VALUE ibm_db_conn_error(int argc, VALUE *argv, VALUE self)
|
|
7340
7330
|
return Qnil;
|
7341
7331
|
}
|
7342
7332
|
|
7343
|
-
#ifdef
|
7333
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7344
7334
|
return_str = ALLOC_N(SQLWCHAR, SQL_SQLSTATE_SIZE + 1);
|
7345
7335
|
memset(return_str, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
7346
7336
|
#else
|
@@ -7357,7 +7347,7 @@ VALUE ibm_db_conn_error(int argc, VALUE *argv, VALUE self)
|
|
7357
7347
|
|
7358
7348
|
conn_res->error_recno_tracker++;
|
7359
7349
|
|
7360
|
-
#ifdef
|
7350
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7361
7351
|
ret_val = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR) );
|
7362
7352
|
#else
|
7363
7353
|
ret_val = rb_str_new2( return_str );
|
@@ -7366,7 +7356,7 @@ VALUE ibm_db_conn_error(int argc, VALUE *argv, VALUE self)
|
|
7366
7356
|
|
7367
7357
|
return ret_val;
|
7368
7358
|
} else {
|
7369
|
-
#ifdef
|
7359
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7370
7360
|
return _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( IBM_DB_G(__ruby_conn_err_state),
|
7371
7361
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7372
7362
|
);
|
@@ -7416,7 +7406,7 @@ VALUE ibm_db_stmt_error(int argc, VALUE *argv, VALUE self)
|
|
7416
7406
|
if (!NIL_P(stmt)) {
|
7417
7407
|
Data_Get_Struct(stmt, stmt_handle, stmt_res);
|
7418
7408
|
|
7419
|
-
#ifdef
|
7409
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7420
7410
|
return_str = ALLOC_N(SQLWCHAR, SQL_SQLSTATE_SIZE + 1);
|
7421
7411
|
memset(return_str, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
7422
7412
|
#else
|
@@ -7433,7 +7423,7 @@ VALUE ibm_db_stmt_error(int argc, VALUE *argv, VALUE self)
|
|
7433
7423
|
|
7434
7424
|
stmt_res->error_recno_tracker++;
|
7435
7425
|
|
7436
|
-
#ifdef
|
7426
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7437
7427
|
ret_val = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR) );
|
7438
7428
|
#else
|
7439
7429
|
ret_val = rb_str_new2( return_str );
|
@@ -7442,7 +7432,7 @@ VALUE ibm_db_stmt_error(int argc, VALUE *argv, VALUE self)
|
|
7442
7432
|
|
7443
7433
|
return ret_val;
|
7444
7434
|
} else {
|
7445
|
-
#ifdef
|
7435
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7446
7436
|
return _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( IBM_DB_G(__ruby_stmt_err_state),
|
7447
7437
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7448
7438
|
);
|
@@ -7508,7 +7498,7 @@ VALUE ibm_db_getErrormsg(int argc, VALUE *argv, VALUE self)
|
|
7508
7498
|
|
7509
7499
|
if( conn_res->errorType != 1 ) {
|
7510
7500
|
if( conn_res->ruby_error_msg != NULL ) {
|
7511
|
-
#ifdef
|
7501
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7512
7502
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_msg, conn_res->ruby_error_msg_len );
|
7513
7503
|
#else
|
7514
7504
|
return_value = rb_str_new2( conn_res->ruby_error_msg );
|
@@ -7519,13 +7509,13 @@ VALUE ibm_db_getErrormsg(int argc, VALUE *argv, VALUE self)
|
|
7519
7509
|
} else {
|
7520
7510
|
|
7521
7511
|
if( conn_res->errormsg_recno_tracker == 1 && conn_res->ruby_error_msg != NULL ) {
|
7522
|
-
#ifdef
|
7512
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7523
7513
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_msg, conn_res->ruby_error_msg_len );
|
7524
7514
|
#else
|
7525
7515
|
return_value = rb_str_new2( conn_res->ruby_error_msg );
|
7526
7516
|
#endif
|
7527
7517
|
} else {
|
7528
|
-
#ifdef
|
7518
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7529
7519
|
return_str = ALLOC_N(SQLWCHAR, DB2_MAX_ERR_MSG_LEN+1);
|
7530
7520
|
memset(return_str, '\0', (DB2_MAX_ERR_MSG_LEN + 1) * sizeof(SQLWCHAR) );
|
7531
7521
|
#else
|
@@ -7540,7 +7530,7 @@ VALUE ibm_db_getErrormsg(int argc, VALUE *argv, VALUE self)
|
|
7540
7530
|
conn_res->error_recno_tracker = conn_res->errormsg_recno_tracker;
|
7541
7531
|
}
|
7542
7532
|
|
7543
|
-
#ifdef
|
7533
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7544
7534
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, return_str_len );
|
7545
7535
|
#else
|
7546
7536
|
return_value = rb_str_new2( return_str );
|
@@ -7553,13 +7543,13 @@ VALUE ibm_db_getErrormsg(int argc, VALUE *argv, VALUE self)
|
|
7553
7543
|
Data_Get_Struct(conn_or_stmt, stmt_handle, stmt_res);
|
7554
7544
|
|
7555
7545
|
if( stmt_res->errormsg_recno_tracker == 1 && stmt_res->ruby_stmt_err_msg != NULL ) {
|
7556
|
-
#ifdef
|
7546
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7557
7547
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg, stmt_res->ruby_stmt_err_msg_len );
|
7558
7548
|
#else
|
7559
7549
|
return_value = rb_str_new2( stmt_res->ruby_stmt_err_msg );
|
7560
7550
|
#endif
|
7561
7551
|
} else {
|
7562
|
-
#ifdef
|
7552
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7563
7553
|
return_str = ALLOC_N(SQLWCHAR, DB2_MAX_ERR_MSG_LEN + 1 );
|
7564
7554
|
memset(return_str, '\0', (DB2_MAX_ERR_MSG_LEN + 1 ) * sizeof(SQLWCHAR) );
|
7565
7555
|
#else
|
@@ -7574,7 +7564,7 @@ VALUE ibm_db_getErrormsg(int argc, VALUE *argv, VALUE self)
|
|
7574
7564
|
stmt_res->error_recno_tracker = stmt_res->errormsg_recno_tracker;
|
7575
7565
|
}
|
7576
7566
|
|
7577
|
-
#ifdef
|
7567
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7578
7568
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, return_str_len );
|
7579
7569
|
#else
|
7580
7570
|
return_value = rb_str_new2( return_str );
|
@@ -7650,7 +7640,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7650
7640
|
|
7651
7641
|
if( conn_res->errorType != 1 ) {
|
7652
7642
|
if( conn_res->ruby_error_state != NULL ) {
|
7653
|
-
#ifdef
|
7643
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7654
7644
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_state,
|
7655
7645
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7656
7646
|
);
|
@@ -7663,7 +7653,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7663
7653
|
} else {
|
7664
7654
|
|
7665
7655
|
if( conn_res->error_recno_tracker == 1 && conn_res->ruby_error_state != NULL ) {
|
7666
|
-
#ifdef
|
7656
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7667
7657
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( conn_res->ruby_error_state,
|
7668
7658
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7669
7659
|
);
|
@@ -7672,7 +7662,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7672
7662
|
#endif
|
7673
7663
|
} else {
|
7674
7664
|
|
7675
|
-
#ifdef
|
7665
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7676
7666
|
return_str = ALLOC_N(SQLWCHAR, SQL_SQLSTATE_SIZE + 1 );
|
7677
7667
|
memset(return_str, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
7678
7668
|
#else
|
@@ -7687,7 +7677,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7687
7677
|
conn_res->errormsg_recno_tracker = conn_res->error_recno_tracker;
|
7688
7678
|
}
|
7689
7679
|
|
7690
|
-
#ifdef
|
7680
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7691
7681
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str, SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR) );
|
7692
7682
|
#else
|
7693
7683
|
return_value = rb_str_new2( return_str );
|
@@ -7700,7 +7690,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7700
7690
|
Data_Get_Struct(conn_or_stmt, stmt_handle, stmt_res);
|
7701
7691
|
|
7702
7692
|
if( stmt_res->error_recno_tracker == 1 && stmt_res->ruby_stmt_err_state != NULL ) {
|
7703
|
-
#ifdef
|
7693
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7704
7694
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_state,
|
7705
7695
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7706
7696
|
);
|
@@ -7709,7 +7699,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7709
7699
|
#endif
|
7710
7700
|
} else {
|
7711
7701
|
|
7712
|
-
#ifdef
|
7702
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7713
7703
|
return_str = ALLOC_N(SQLWCHAR, SQL_SQLSTATE_SIZE + 1 );
|
7714
7704
|
memset(return_str, '\0', (SQL_SQLSTATE_SIZE + 1) * sizeof(SQLWCHAR) );
|
7715
7705
|
#else
|
@@ -7723,7 +7713,7 @@ VALUE ibm_db_getErrorstate(int argc, VALUE *argv, VALUE self)
|
|
7723
7713
|
if(stmt_res->error_recno_tracker - stmt_res->errormsg_recno_tracker >= 1) {
|
7724
7714
|
stmt_res->errormsg_recno_tracker = stmt_res->error_recno_tracker;
|
7725
7715
|
}
|
7726
|
-
#ifdef
|
7716
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7727
7717
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr( return_str,
|
7728
7718
|
SQL_SQLSTATE_SIZE * sizeof(SQLWCHAR)
|
7729
7719
|
);
|
@@ -7801,9 +7791,9 @@ VALUE ibm_db_next_result(int argc, VALUE *argv, VALUE self)
|
|
7801
7791
|
nextresultparams->stmt_res = stmt_res;
|
7802
7792
|
nextresultparams->new_hstmt = &new_hstmt;
|
7803
7793
|
|
7804
|
-
#ifdef
|
7805
|
-
|
7806
|
-
|
7794
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7795
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLNextResult_helper, nextresultparams,
|
7796
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
7807
7797
|
rc = nextresultparams->rc;
|
7808
7798
|
#else
|
7809
7799
|
rc = _ruby_ibm_db_SQLNextResult_helper( nextresultparams );
|
@@ -7885,7 +7875,7 @@ VALUE ibm_db_num_fields(int argc, VALUE *argv, VALUE self)
|
|
7885
7875
|
stmt_handle *stmt_res;
|
7886
7876
|
int rc = 0;
|
7887
7877
|
|
7888
|
-
#ifdef
|
7878
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7889
7879
|
char *err_str = NULL;
|
7890
7880
|
#endif
|
7891
7881
|
|
@@ -7902,9 +7892,9 @@ VALUE ibm_db_num_fields(int argc, VALUE *argv, VALUE self)
|
|
7902
7892
|
result_cols_args->stmt_res = stmt_res;
|
7903
7893
|
result_cols_args->count = 0;
|
7904
7894
|
|
7905
|
-
#ifdef
|
7906
|
-
|
7907
|
-
|
7895
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7896
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLNumResultCols_helper, result_cols_args,
|
7897
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
7908
7898
|
rc = result_cols_args->rc;
|
7909
7899
|
#else
|
7910
7900
|
rc = _ruby_ibm_db_SQLNumResultCols_helper( result_cols_args );
|
@@ -7912,7 +7902,7 @@ VALUE ibm_db_num_fields(int argc, VALUE *argv, VALUE self)
|
|
7912
7902
|
|
7913
7903
|
if ( rc == SQL_ERROR ) {
|
7914
7904
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 1 );
|
7915
|
-
#ifdef
|
7905
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7916
7906
|
err_str = RSTRING_PTR( _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
|
7917
7907
|
stmt_res->ruby_stmt_err_msg_len )
|
7918
7908
|
);
|
@@ -7980,7 +7970,7 @@ VALUE ibm_db_num_rows(int argc, VALUE *argv, VALUE self)
|
|
7980
7970
|
|
7981
7971
|
sql_row_count_args *row_count_args = NULL;
|
7982
7972
|
|
7983
|
-
#ifdef
|
7973
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7984
7974
|
char *err_str = NULL;
|
7985
7975
|
#endif
|
7986
7976
|
|
@@ -7995,9 +7985,9 @@ VALUE ibm_db_num_rows(int argc, VALUE *argv, VALUE self)
|
|
7995
7985
|
row_count_args->stmt_res = stmt_res;
|
7996
7986
|
row_count_args->count = 0;
|
7997
7987
|
|
7998
|
-
#ifdef
|
7999
|
-
|
8000
|
-
|
7988
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
7989
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLRowCount_helper, row_count_args,
|
7990
|
+
RUBY_UBF_IO, NULL );
|
8001
7991
|
rc = row_count_args->rc;
|
8002
7992
|
#else
|
8003
7993
|
rc = _ruby_ibm_db_SQLRowCount_helper( row_count_args );
|
@@ -8006,7 +7996,7 @@ VALUE ibm_db_num_rows(int argc, VALUE *argv, VALUE self)
|
|
8006
7996
|
if ( rc == SQL_ERROR ) {
|
8007
7997
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 1 );
|
8008
7998
|
|
8009
|
-
#ifdef
|
7999
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8010
8000
|
err_str = RSTRING_PTR( _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
|
8011
8001
|
stmt_res->ruby_stmt_err_msg_len )
|
8012
8002
|
);
|
@@ -8041,7 +8031,7 @@ static int _ruby_ibm_db_get_column_by_name(stmt_handle *stmt_res, VALUE column,
|
|
8041
8031
|
int rc;
|
8042
8032
|
int index;
|
8043
8033
|
|
8044
|
-
#ifdef
|
8034
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8045
8035
|
VALUE col_name = Qnil;
|
8046
8036
|
#else
|
8047
8037
|
char *col_name = NULL;
|
@@ -8052,9 +8042,9 @@ static int _ruby_ibm_db_get_column_by_name(stmt_handle *stmt_res, VALUE column,
|
|
8052
8042
|
if ( stmt_res->column_info == NULL ) {
|
8053
8043
|
if ( release_gil == 1 ) {
|
8054
8044
|
|
8055
|
-
#ifdef
|
8056
|
-
|
8057
|
-
|
8045
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8046
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_get_result_set_info, stmt_res,
|
8047
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
8058
8048
|
rc = stmt_res->rc;
|
8059
8049
|
#else
|
8060
8050
|
rc = _ruby_ibm_db_get_result_set_info( stmt_res );
|
@@ -8072,14 +8062,14 @@ static int _ruby_ibm_db_get_column_by_name(stmt_handle *stmt_res, VALUE column,
|
|
8072
8062
|
if ( TYPE(column) == T_FIXNUM ) {
|
8073
8063
|
col = FIX2LONG( column );
|
8074
8064
|
} else if (RTEST( column )) {
|
8075
|
-
#ifdef
|
8065
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8076
8066
|
col_name = _ruby_ibm_db_export_str_to_utf16( column );
|
8077
8067
|
#else
|
8078
8068
|
col_name = STR2CSTR( column );
|
8079
8069
|
#endif
|
8080
8070
|
}
|
8081
8071
|
|
8082
|
-
#ifdef
|
8072
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8083
8073
|
if ( col_name == Qnil ) {
|
8084
8074
|
#else
|
8085
8075
|
if ( col_name == NULL ) {
|
@@ -8095,7 +8085,7 @@ static int _ruby_ibm_db_get_column_by_name(stmt_handle *stmt_res, VALUE column,
|
|
8095
8085
|
/* should start from 0 */
|
8096
8086
|
index = 0;
|
8097
8087
|
while (index < stmt_res->num_columns) {
|
8098
|
-
#ifdef
|
8088
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8099
8089
|
if ( rb_str_equal(_ruby_ibm_db_export_sqlwchar_to_utf16_rstr(stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR)), _ruby_ibm_db_export_str_to_utf16(col_name) ) ) {
|
8100
8090
|
#else
|
8101
8091
|
if (strcmp((char*)stmt_res->column_info[index].name,col_name) == 0) {
|
@@ -8151,7 +8141,7 @@ VALUE ibm_db_field_name(int argc, VALUE *argv, VALUE self)
|
|
8151
8141
|
if ( col < 0 ) {
|
8152
8142
|
return Qfalse;
|
8153
8143
|
}
|
8154
|
-
#ifdef
|
8144
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8155
8145
|
return _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->column_info[col].name, stmt_res->column_info[col].name_length * sizeof(SQLWCHAR));
|
8156
8146
|
#else
|
8157
8147
|
return rb_str_new2((char*)stmt_res->column_info[col].name);
|
@@ -8216,9 +8206,9 @@ VALUE ibm_db_field_display_size(int argc, VALUE *argv, VALUE self)
|
|
8216
8206
|
colattr_args->col_num = col+1;
|
8217
8207
|
colattr_args->FieldIdentifier = SQL_DESC_DISPLAY_SIZE;
|
8218
8208
|
|
8219
|
-
#ifdef
|
8220
|
-
|
8221
|
-
|
8209
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8210
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLColAttributes_helper, colattr_args,
|
8211
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
8222
8212
|
rc = colattr_args->rc;
|
8223
8213
|
#else
|
8224
8214
|
rc = _ruby_ibm_db_SQLColAttributes_helper( colattr_args );
|
@@ -8467,7 +8457,7 @@ VALUE ibm_db_field_type(int argc, VALUE *argv, VALUE self)
|
|
8467
8457
|
str_val = "string";
|
8468
8458
|
break;
|
8469
8459
|
}
|
8470
|
-
#ifdef
|
8460
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8471
8461
|
return _ruby_ibm_db_export_char_to_utf8_rstr(str_val);
|
8472
8462
|
#else
|
8473
8463
|
return rb_str_new2( str_val );
|
@@ -8537,9 +8527,9 @@ VALUE ibm_db_field_width(int argc, VALUE *argv, VALUE self)
|
|
8537
8527
|
colattr_args->col_num = col+1;
|
8538
8528
|
colattr_args->FieldIdentifier = SQL_DESC_LENGTH;
|
8539
8529
|
|
8540
|
-
#ifdef
|
8530
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8541
8531
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLColAttributes_helper, colattr_args,
|
8542
|
-
|
8532
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res);
|
8543
8533
|
rc = colattr_args->rc;
|
8544
8534
|
#else
|
8545
8535
|
rc = _ruby_ibm_db_SQLColAttributes_helper( colattr_args );
|
@@ -8639,9 +8629,9 @@ VALUE ibm_db_rollback(int argc, VALUE *argv, VALUE self)
|
|
8639
8629
|
end_X_args->hdbc = &(conn_res->hdbc);
|
8640
8630
|
end_X_args->handleType = SQL_HANDLE_DBC;
|
8641
8631
|
end_X_args->completionType = SQL_ROLLBACK; /*Remeber you are Rollingback the transaction*/
|
8642
|
-
#ifdef
|
8632
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8643
8633
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_SQLEndTran, end_X_args,
|
8644
|
-
|
8634
|
+
RUBY_UBF_IO, NULL);
|
8645
8635
|
rc = end_X_args->rc;
|
8646
8636
|
#else
|
8647
8637
|
rc = _ruby_ibm_db_SQLEndTran( end_X_args );
|
@@ -8833,7 +8823,7 @@ int isNullLOB(VALUE *return_value,int i,stmt_handle *stmt_res,int op)
|
|
8833
8823
|
VALUE colName;
|
8834
8824
|
if (stmt_res->column_info[i].loc_ind == SQL_NULL_DATA) {
|
8835
8825
|
if ( op & FETCH_ASSOC ) {
|
8836
|
-
#ifdef
|
8826
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8837
8827
|
colName = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->column_info[i].name, stmt_res->column_info[i].name_length * sizeof(SQLWCHAR) );
|
8838
8828
|
#else
|
8839
8829
|
colName = rb_str_new2( (char*)stmt_res->column_info[i].name );
|
@@ -8885,7 +8875,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8885
8875
|
if ( stmt_res->column_info == NULL ) {
|
8886
8876
|
if (_ruby_ibm_db_get_result_set_info(stmt_res)<0) {
|
8887
8877
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
8888
|
-
#ifdef
|
8878
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8889
8879
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: "),
|
8890
8880
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
8891
8881
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -8894,7 +8884,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8894
8884
|
*(data->error) = rb_str_cat2(rb_str_new2("Column information cannot be retrieved: "), stmt_res->ruby_stmt_err_msg );
|
8895
8885
|
#endif
|
8896
8886
|
} else {
|
8897
|
-
#ifdef
|
8887
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8898
8888
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: <error message could not be retrieved>");
|
8899
8889
|
#else
|
8900
8890
|
*(data->error) = rb_str_new2("Column information cannot be retrieved: <error message could not be retrieved>");
|
@@ -8906,7 +8896,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8906
8896
|
}
|
8907
8897
|
|
8908
8898
|
if(col_num < 0 || col_num >= stmt_res->num_columns) {
|
8909
|
-
#ifdef
|
8899
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8910
8900
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Column ordinal out of range" );
|
8911
8901
|
#else
|
8912
8902
|
*(data->error) = rb_str_new2("Column ordinal out of range" );
|
@@ -8930,7 +8920,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8930
8920
|
case SQL_WLONGVARCHAR:
|
8931
8921
|
in_length = stmt_res->column_info[col_num].size + 1;
|
8932
8922
|
|
8933
|
-
#ifdef
|
8923
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8934
8924
|
out_ptr = (SQLPOINTER)ALLOC_N(SQLWCHAR,in_length);
|
8935
8925
|
memset(out_ptr, '\0', in_length * sizeof(SQLWCHAR) );
|
8936
8926
|
#else
|
@@ -8959,7 +8949,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8959
8949
|
return Qnil;
|
8960
8950
|
}
|
8961
8951
|
|
8962
|
-
#ifdef
|
8952
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8963
8953
|
rc = _ruby_ibm_db_get_data(stmt_res, col_num+1, SQL_C_WCHAR, out_ptr, in_length * sizeof(SQLWCHAR) , &out_length);
|
8964
8954
|
#else
|
8965
8955
|
rc = _ruby_ibm_db_get_data(stmt_res, col_num+1, SQL_C_CHAR, out_ptr, in_length, &out_length);
|
@@ -8974,7 +8964,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
8974
8964
|
data->return_value = Qnil;
|
8975
8965
|
return Qnil;
|
8976
8966
|
} else {
|
8977
|
-
#ifdef
|
8967
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
8978
8968
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(out_ptr, out_length);
|
8979
8969
|
#else
|
8980
8970
|
return_value = rb_str_new((char*)out_ptr, out_length);
|
@@ -9076,7 +9066,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
9076
9066
|
return Qnil;
|
9077
9067
|
}
|
9078
9068
|
|
9079
|
-
#ifdef
|
9069
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9080
9070
|
out_ptr = (char*)ALLOC_N(SQLWCHAR,in_length+1);
|
9081
9071
|
memset(out_ptr, '\0', (in_length + 1) * sizeof(SQLWCHAR) );
|
9082
9072
|
#else
|
@@ -9090,7 +9080,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
9090
9080
|
return Qnil;
|
9091
9081
|
}
|
9092
9082
|
|
9093
|
-
#ifdef
|
9083
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9094
9084
|
rc = _ruby_ibm_db_get_data2(stmt_res, col_num+1, SQL_C_WCHAR, out_ptr, in_length, (in_length + 1) * sizeof(SQLWCHAR) , &out_length);
|
9095
9085
|
#else
|
9096
9086
|
rc = _ruby_ibm_db_get_data2(stmt_res, col_num+1, SQL_C_CHAR, (void*)out_ptr, in_length, in_length+1, &out_length);
|
@@ -9101,7 +9091,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
9101
9091
|
return Qfalse;
|
9102
9092
|
}
|
9103
9093
|
|
9104
|
-
#ifdef
|
9094
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9105
9095
|
return_value = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(out_ptr, out_length);
|
9106
9096
|
#else
|
9107
9097
|
return_value = rb_str_new2(out_ptr);
|
@@ -9201,7 +9191,7 @@ static VALUE _ruby_ibm_db_result_helper(ibm_db_result_args *data) {
|
|
9201
9191
|
return Qfalse;
|
9202
9192
|
}
|
9203
9193
|
|
9204
|
-
#ifdef
|
9194
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9205
9195
|
return_value = _ruby_ibm_db_export_sqlchar_to_utf8_rstr(out_ptr, out_length);
|
9206
9196
|
#else
|
9207
9197
|
return_value = rb_str_new((char*)out_ptr,out_length);
|
@@ -9261,9 +9251,9 @@ VALUE ibm_db_result(int argc, VALUE *argv, VALUE self)
|
|
9261
9251
|
if ( !NIL_P( stmt ) ) {
|
9262
9252
|
Data_Get_Struct(stmt, stmt_handle, result_args->stmt_res);
|
9263
9253
|
|
9264
|
-
#ifdef
|
9265
|
-
|
9266
|
-
|
9254
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9255
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_result_helper, result_args,
|
9256
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, result_args->stmt_res );
|
9267
9257
|
ret_val = result_args->return_value;
|
9268
9258
|
#else
|
9269
9259
|
ret_val = _ruby_ibm_db_result_helper( result_args );
|
@@ -9325,7 +9315,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9325
9315
|
if ( stmt_res->column_info == NULL ) {
|
9326
9316
|
if (_ruby_ibm_db_get_result_set_info(stmt_res)<0) {
|
9327
9317
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
9328
|
-
#ifdef
|
9318
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9329
9319
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: "),
|
9330
9320
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
|
9331
9321
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -9334,7 +9324,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9334
9324
|
*(data->error) = rb_str_cat2(rb_str_new2("Column information cannot be retrieved: "), stmt_res->ruby_stmt_err_msg );
|
9335
9325
|
#endif
|
9336
9326
|
} else {
|
9337
|
-
#ifdef
|
9327
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9338
9328
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: <error message could not be retrieved>");
|
9339
9329
|
#else
|
9340
9330
|
*(data->error) = rb_str_new2("Column information cannot be retrieved: <error message could not be retrieved>");
|
@@ -9350,7 +9340,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9350
9340
|
rc = _ruby_ibm_db_bind_column_helper(stmt_res);
|
9351
9341
|
if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
|
9352
9342
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
9353
|
-
#ifdef
|
9343
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9354
9344
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column binding cannot be done: "),
|
9355
9345
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
|
9356
9346
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -9359,7 +9349,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9359
9349
|
*(data->error) = rb_str_cat2(rb_str_new2("Column binding cannot be done: "), stmt_res->ruby_stmt_err_msg );
|
9360
9350
|
#endif
|
9361
9351
|
} else {
|
9362
|
-
#ifdef
|
9352
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9363
9353
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Column binding cannot be done: <error message could not be retrieved>");
|
9364
9354
|
#else
|
9365
9355
|
*(data->error) = rb_str_new2("Column binding cannot be done: <error message could not be retrieved>");
|
@@ -9410,7 +9400,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9410
9400
|
}
|
9411
9401
|
#endif /*PASE*/
|
9412
9402
|
} else if (data->arg_count == 2 && row_number < 0) {
|
9413
|
-
#ifdef
|
9403
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9414
9404
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Requested row number must be a positive value");
|
9415
9405
|
#else
|
9416
9406
|
*(data->error) = rb_str_new2("Requested row number must be a positive value");
|
@@ -9439,7 +9429,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9439
9429
|
} else if ( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
|
9440
9430
|
_ruby_ibm_db_check_sql_errors( stmt_res, DB_STMT, stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, NULL, -1, 1, 0 );
|
9441
9431
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
9442
|
-
#ifdef
|
9432
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9443
9433
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Fetch Failure: "),
|
9444
9434
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
9445
9435
|
stmt_res->ruby_stmt_err_msg_len )
|
@@ -9448,7 +9438,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9448
9438
|
*(data->error) = rb_str_cat2(rb_str_new2("Fetch Failure: "), stmt_res->ruby_stmt_err_msg );
|
9449
9439
|
#endif
|
9450
9440
|
} else {
|
9451
|
-
#ifdef
|
9441
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9452
9442
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Fetch Failure: <error message could not be retrieved>");
|
9453
9443
|
#else
|
9454
9444
|
*(data->error) = rb_str_new2("Fetch Failure: <error message could not be retrieved>");
|
@@ -9471,14 +9461,14 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9471
9461
|
|
9472
9462
|
switch(stmt_res->s_case_mode) {
|
9473
9463
|
case CASE_LOWER:
|
9474
|
-
#ifdef
|
9464
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9475
9465
|
strtolower((char*)stmt_res->column_info[i].name, stmt_res->column_info[i].name_length * sizeof(SQLWCHAR));
|
9476
9466
|
#else
|
9477
9467
|
strtolower((char*)stmt_res->column_info[i].name, strlen((char*)stmt_res->column_info[i].name));
|
9478
9468
|
#endif
|
9479
9469
|
break;
|
9480
9470
|
case CASE_UPPER:
|
9481
|
-
#ifdef
|
9471
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9482
9472
|
strtoupper((char*)stmt_res->column_info[i].name, stmt_res->column_info[i].name_length * sizeof(SQLWCHAR) );
|
9483
9473
|
#else
|
9484
9474
|
strtoupper((char*)stmt_res->column_info[i].name, strlen((char*)stmt_res->column_info[i].name));
|
@@ -9489,7 +9479,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9489
9479
|
break;
|
9490
9480
|
}
|
9491
9481
|
|
9492
|
-
#ifdef
|
9482
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9493
9483
|
colName = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->column_info[i].name, stmt_res->column_info[i].name_length * sizeof(SQLWCHAR) );
|
9494
9484
|
#else
|
9495
9485
|
colName = rb_str_new2((char*)stmt_res->column_info[i].name);
|
@@ -9516,20 +9506,20 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9516
9506
|
case SQL_LONGVARCHAR:
|
9517
9507
|
case SQL_WLONGVARCHAR:
|
9518
9508
|
if ( op & FETCH_ASSOC ) {
|
9519
|
-
#ifdef
|
9509
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9520
9510
|
rb_hash_aset(return_value, colName, _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(row_data->str_val, out_length ));
|
9521
9511
|
#else
|
9522
9512
|
rb_hash_aset(return_value, colName, rb_str_new((char *)row_data->str_val, out_length));
|
9523
9513
|
#endif
|
9524
9514
|
}
|
9525
9515
|
if ( op == FETCH_INDEX ) {
|
9526
|
-
#ifdef
|
9516
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9527
9517
|
rb_ary_store(return_value, i, _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(row_data->str_val, out_length ));
|
9528
9518
|
#else
|
9529
9519
|
rb_ary_store(return_value, i, rb_str_new((char *)row_data->str_val, out_length));
|
9530
9520
|
#endif
|
9531
9521
|
} else if ( op == FETCH_BOTH ) {
|
9532
|
-
#ifdef
|
9522
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9533
9523
|
rb_hash_aset(return_value, INT2NUM(i), _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(row_data->str_val, out_length ));
|
9534
9524
|
#else
|
9535
9525
|
rb_hash_aset(return_value, INT2NUM(i), rb_str_new((char *)row_data->str_val, out_length));
|
@@ -9600,7 +9590,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9600
9590
|
return Qnil;
|
9601
9591
|
}
|
9602
9592
|
|
9603
|
-
strcpy(tmpStr, "BigDecimal
|
9593
|
+
strcpy(tmpStr, "BigDecimal(\'");
|
9604
9594
|
strcat(tmpStr, row_data->str_val);
|
9605
9595
|
strcat(tmpStr, "\')");
|
9606
9596
|
|
@@ -9772,7 +9762,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9772
9762
|
|
9773
9763
|
if ( rc == SQL_ERROR ) {
|
9774
9764
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
9775
|
-
#ifdef
|
9765
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9776
9766
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Failed to Determine XML Size: "),
|
9777
9767
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
9778
9768
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -9781,7 +9771,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9781
9771
|
*(data->error) = rb_str_cat2(rb_str_new2("Failed to Determine XML Size: "), stmt_res->ruby_stmt_err_msg );
|
9782
9772
|
#endif
|
9783
9773
|
} else {
|
9784
|
-
#ifdef
|
9774
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9785
9775
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Failed to Determine XML Size: <error message could not be retrieved>");
|
9786
9776
|
#else
|
9787
9777
|
*(data->error) = rb_str_new2("Failed to Determine XML Size: <error message could not be retrieved>");
|
@@ -9820,20 +9810,20 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9820
9810
|
}
|
9821
9811
|
|
9822
9812
|
if ( op & FETCH_ASSOC ) {
|
9823
|
-
#ifdef
|
9813
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9824
9814
|
rb_hash_aset(return_value, colName, _ruby_ibm_db_export_sqlchar_to_utf8_rstr( (SQLCHAR *) out_ptr, out_length));
|
9825
9815
|
#else
|
9826
9816
|
rb_hash_aset(return_value, colName, rb_str_new((char *)out_ptr, out_length));
|
9827
9817
|
#endif
|
9828
9818
|
}
|
9829
9819
|
if ( op == FETCH_INDEX ) {
|
9830
|
-
#ifdef
|
9820
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9831
9821
|
rb_ary_store(return_value, i, _ruby_ibm_db_export_sqlchar_to_utf8_rstr( (SQLCHAR *) out_ptr, out_length));
|
9832
9822
|
#else
|
9833
9823
|
rb_ary_store(return_value, i, rb_str_new((char *)out_ptr, out_length));
|
9834
9824
|
#endif
|
9835
9825
|
} else if ( op == FETCH_BOTH ) {
|
9836
|
-
#ifdef
|
9826
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9837
9827
|
rb_hash_aset(return_value, INT2NUM(i), _ruby_ibm_db_export_sqlchar_to_utf8_rstr( (SQLCHAR *) out_ptr, out_length));
|
9838
9828
|
#else
|
9839
9829
|
rb_hash_aset(return_value, INT2NUM(i), rb_str_new((char *)out_ptr, out_length));
|
@@ -9866,7 +9856,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9866
9856
|
}
|
9867
9857
|
} else {
|
9868
9858
|
if (rc == SQL_ERROR) tmp_length = 0;
|
9869
|
-
#ifdef
|
9859
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9870
9860
|
out_ptr = (SQLPOINTER)ALLOC_N(SQLWCHAR, tmp_length + 1);
|
9871
9861
|
memset(out_ptr, '\0', (tmp_length+1) * sizeof(SQLWCHAR));
|
9872
9862
|
#else
|
@@ -9881,7 +9871,7 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9881
9871
|
return Qnil;
|
9882
9872
|
}
|
9883
9873
|
|
9884
|
-
#ifdef
|
9874
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9885
9875
|
rc = _ruby_ibm_db_get_data2(stmt_res, i+1, SQL_C_WCHAR, out_ptr, tmp_length , (tmp_length + 1) * sizeof(SQLWCHAR) , &out_length);
|
9886
9876
|
#else
|
9887
9877
|
rc = _ruby_ibm_db_get_data2(stmt_res, i+1, SQL_C_CHAR, out_ptr, tmp_length, tmp_length+1, &out_length);
|
@@ -9895,20 +9885,20 @@ static VALUE _ruby_ibm_db_bind_fetch_helper(ibm_db_fetch_helper_args *data)
|
|
9895
9885
|
}
|
9896
9886
|
|
9897
9887
|
if ( op & FETCH_ASSOC ) {
|
9898
|
-
#ifdef
|
9888
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9899
9889
|
rb_hash_aset(return_value, colName, _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(out_ptr, out_length));
|
9900
9890
|
#else
|
9901
9891
|
rb_hash_aset(return_value, colName, rb_str_new((char*)out_ptr, out_length));
|
9902
9892
|
#endif
|
9903
9893
|
}
|
9904
9894
|
if ( op == FETCH_INDEX ) {
|
9905
|
-
#ifdef
|
9895
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9906
9896
|
rb_ary_store(return_value, i, _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(out_ptr, out_length));
|
9907
9897
|
#else
|
9908
9898
|
rb_ary_store(return_value, i, rb_str_new((char*)out_ptr, out_length));
|
9909
9899
|
#endif
|
9910
9900
|
} else if ( op == FETCH_BOTH ) {
|
9911
|
-
#ifdef
|
9901
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9912
9902
|
rb_hash_aset(return_value, INT2NUM(i), _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(out_ptr, out_length));
|
9913
9903
|
#else
|
9914
9904
|
rb_hash_aset(return_value, INT2NUM(i), rb_str_new((char*)out_ptr, out_length));
|
@@ -9949,7 +9939,7 @@ static int _ruby_ibm_db_fetch_row_helper( ibm_db_fetch_helper_args *data) {
|
|
9949
9939
|
if ( stmt_res->column_info == NULL ) {
|
9950
9940
|
if (_ruby_ibm_db_get_result_set_info(stmt_res)<0) {
|
9951
9941
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
9952
|
-
#ifdef
|
9942
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9953
9943
|
*(data->error) = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: "),
|
9954
9944
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr( stmt_res->ruby_stmt_err_msg,
|
9955
9945
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -9958,7 +9948,7 @@ static int _ruby_ibm_db_fetch_row_helper( ibm_db_fetch_helper_args *data) {
|
|
9958
9948
|
*(data->error) = rb_str_cat2(rb_str_new2("Column information cannot be retrieved: "), stmt_res->ruby_stmt_err_msg );
|
9959
9949
|
#endif
|
9960
9950
|
} else {
|
9961
|
-
#ifdef
|
9951
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
9962
9952
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: <error message could not be retrieved>");
|
9963
9953
|
#else
|
9964
9954
|
*(data->error) = rb_str_new2("Column information cannot be retrieved: <error message could not be retrieved>");
|
@@ -9996,7 +9986,7 @@ static int _ruby_ibm_db_fetch_row_helper( ibm_db_fetch_helper_args *data) {
|
|
9996
9986
|
}
|
9997
9987
|
#endif /*PASE*/
|
9998
9988
|
} else if (data->arg_count == 2 && row_number < 0) {
|
9999
|
-
#ifdef
|
9989
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10000
9990
|
*(data->error) = _ruby_ibm_db_export_char_to_utf8_rstr("Requested row number must be a positive value");
|
10001
9991
|
#else
|
10002
9992
|
*(data->error) = rb_str_new2("Requested row number must be a positive value");
|
@@ -10082,9 +10072,9 @@ VALUE ibm_db_fetch_row(int argc, VALUE *argv, VALUE self)
|
|
10082
10072
|
helper_args->arg_count = argc;
|
10083
10073
|
helper_args->error = &error;
|
10084
10074
|
|
10085
|
-
#ifdef
|
10075
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10086
10076
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_fetch_row_helper, helper_args,
|
10087
|
-
|
10077
|
+
RUBY_UBF_IO, NULL );
|
10088
10078
|
ret_val = helper_args->return_value;
|
10089
10079
|
#else
|
10090
10080
|
ret_val = _ruby_ibm_db_fetch_row_helper( helper_args );
|
@@ -10145,7 +10135,7 @@ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self) {
|
|
10145
10135
|
if ( stmt_res->column_info == NULL ) {
|
10146
10136
|
if (_ruby_ibm_db_get_result_set_info(stmt_res)<0) {
|
10147
10137
|
if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
|
10148
|
-
#ifdef
|
10138
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10149
10139
|
error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: "),
|
10150
10140
|
_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
|
10151
10141
|
stmt_res->ruby_stmt_err_msg_len)
|
@@ -10154,7 +10144,7 @@ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self) {
|
|
10154
10144
|
error = rb_str_cat2(rb_str_new2("Column information cannot be retrieved: "), stmt_res->ruby_stmt_err_msg );
|
10155
10145
|
#endif
|
10156
10146
|
} else {
|
10157
|
-
#ifdef
|
10147
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10158
10148
|
error = _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: <error message could not be retrieved>");
|
10159
10149
|
#else
|
10160
10150
|
error = rb_str_new2("Column information cannot be retrieved: <error message could not be retrieved>");
|
@@ -10169,14 +10159,14 @@ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self) {
|
|
10169
10159
|
for (index=0; index<stmt_res->num_columns; index++) {
|
10170
10160
|
switch(stmt_res->s_case_mode) {
|
10171
10161
|
case CASE_LOWER:
|
10172
|
-
#ifdef
|
10162
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10173
10163
|
strtolower((char*)stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR));
|
10174
10164
|
#else
|
10175
10165
|
strtolower((char*)stmt_res->column_info[index].name, strlen((char*)stmt_res->column_info[index].name));
|
10176
10166
|
#endif
|
10177
10167
|
break;
|
10178
10168
|
case CASE_UPPER:
|
10179
|
-
#ifdef
|
10169
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10180
10170
|
strtoupper((char*)stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR) );
|
10181
10171
|
#else
|
10182
10172
|
strtoupper((char*)stmt_res->column_info[index].name, strlen((char*)stmt_res->column_info[index].name));
|
@@ -10186,7 +10176,7 @@ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self) {
|
|
10186
10176
|
default:
|
10187
10177
|
break;
|
10188
10178
|
}
|
10189
|
-
#ifdef
|
10179
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10190
10180
|
colName = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR) );
|
10191
10181
|
#else
|
10192
10182
|
colName = rb_str_new2((char*)stmt_res->column_info[index].name);
|
@@ -10251,9 +10241,9 @@ VALUE ibm_db_fetch_assoc(int argc, VALUE *argv, VALUE self) {
|
|
10251
10241
|
helper_args->error = &error;
|
10252
10242
|
helper_args->funcType = FETCH_ASSOC;
|
10253
10243
|
|
10254
|
-
#ifdef
|
10255
|
-
|
10256
|
-
|
10244
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10245
|
+
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_bind_fetch_helper, helper_args,
|
10246
|
+
RUBY_UBF_IO, NULL );
|
10257
10247
|
ret_val = helper_args->return_value;
|
10258
10248
|
|
10259
10249
|
#else
|
@@ -10340,9 +10330,9 @@ VALUE ibm_db_fetch_object(int argc, VALUE *argv, VALUE self)
|
|
10340
10330
|
helper_args->error = &error;
|
10341
10331
|
helper_args->funcType = FETCH_ASSOC;
|
10342
10332
|
|
10343
|
-
#ifdef
|
10333
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10344
10334
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_bind_fetch_helper, helper_args,
|
10345
|
-
|
10335
|
+
(void *)_ruby_ibm_db_Statement_level_UBF, stmt_res );
|
10346
10336
|
row_res->hash = helper_args->return_value;
|
10347
10337
|
#else
|
10348
10338
|
row_res->hash = _ruby_ibm_db_bind_fetch_helper( helper_args );
|
@@ -10422,17 +10412,15 @@ VALUE ibm_db_fetch_array(int argc, VALUE *argv, VALUE self)
|
|
10422
10412
|
helper_args->arg_count = argc;
|
10423
10413
|
helper_args->error = &error;
|
10424
10414
|
helper_args->funcType = FETCH_INDEX;
|
10425
|
-
|
10426
10415
|
//Call without thread API to avoid the Thread lock.
|
10427
10416
|
ret_val = _ruby_ibm_db_bind_fetch_helper( helper_args );
|
10428
|
-
|
10429
|
-
|
10430
|
-
|
10431
|
-
|
10432
|
-
|
10433
|
-
//
|
10417
|
+
//#ifdef UNICODE_SUPPORT_VERSION_H
|
10418
|
+
//ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_bind_fetch_helper, helper_args,
|
10419
|
+
// RUBY_UBF_IO, NULL );
|
10420
|
+
//ret_val = helper_args->return_value;
|
10421
|
+
|
10434
10422
|
//#else
|
10435
|
-
|
10423
|
+
//ret_val = _ruby_ibm_db_bind_fetch_helper( helper_args );
|
10436
10424
|
//#endif
|
10437
10425
|
|
10438
10426
|
/*Free Memory Allocated*/
|
@@ -10504,9 +10492,9 @@ VALUE ibm_db_fetch_both(int argc, VALUE *argv, VALUE self)
|
|
10504
10492
|
helper_args->error = &error;
|
10505
10493
|
helper_args->funcType = FETCH_BOTH;
|
10506
10494
|
|
10507
|
-
#ifdef
|
10495
|
+
#ifdef UNICODE_SUPPORT_VERSIO
|
10508
10496
|
ibm_Ruby_Thread_Call ( (void *)_ruby_ibm_db_bind_fetch_helper, helper_args,
|
10509
|
-
|
10497
|
+
RUBY_UBF_IO, NULL );
|
10510
10498
|
ret_val = helper_args->return_value;
|
10511
10499
|
#else
|
10512
10500
|
ret_val = _ruby_ibm_db_bind_fetch_helper( helper_args );
|
@@ -10604,7 +10592,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10604
10592
|
int rc = 0;
|
10605
10593
|
SQLSMALLINT out_length = 0;
|
10606
10594
|
|
10607
|
-
#ifndef
|
10595
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
10608
10596
|
char buffer11[11];
|
10609
10597
|
char buffer255[255];
|
10610
10598
|
char buffer3k[3072]; /*Informix server returns SQL_KEYWORDS data, which requires 2608*/
|
@@ -10637,7 +10625,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10637
10625
|
return Qfalse;
|
10638
10626
|
} else {
|
10639
10627
|
|
10640
|
-
#ifdef
|
10628
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10641
10629
|
rb_iv_set(return_value, "@DBMS_NAME", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
10642
10630
|
#else
|
10643
10631
|
rb_iv_set(return_value, "@DBMS_NAME", rb_str_new2(buffer255));
|
@@ -10657,7 +10645,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10657
10645
|
getInfo_args->return_value = Qfalse;
|
10658
10646
|
return Qfalse;
|
10659
10647
|
} else {
|
10660
|
-
#ifdef
|
10648
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10661
10649
|
rb_iv_set(return_value, "@DBMS_VER", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer11, out_length));
|
10662
10650
|
#else
|
10663
10651
|
rb_iv_set(return_value, "@DBMS_VER", rb_str_new2(buffer11));
|
@@ -10697,7 +10685,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10697
10685
|
getInfo_args->return_value = Qfalse;
|
10698
10686
|
return Qfalse;
|
10699
10687
|
} else {
|
10700
|
-
#ifdef
|
10688
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10701
10689
|
rb_iv_set(return_value, "@DB_NAME", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
10702
10690
|
#else
|
10703
10691
|
rb_iv_set(return_value, "@DB_NAME", rb_str_new2(buffer255));
|
@@ -10719,7 +10707,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10719
10707
|
getInfo_args->return_value = Qfalse;
|
10720
10708
|
return Qfalse;
|
10721
10709
|
} else {
|
10722
|
-
#ifdef
|
10710
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10723
10711
|
rb_iv_set(return_value, "@INST_NAME", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
10724
10712
|
#else
|
10725
10713
|
rb_iv_set(return_value, "@INST_NAME", rb_str_new2(buffer255));
|
@@ -10740,7 +10728,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10740
10728
|
getInfo_args->return_value = Qfalse;
|
10741
10729
|
return Qfalse;
|
10742
10730
|
} else {
|
10743
|
-
#ifdef
|
10731
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10744
10732
|
rb_iv_set(return_value, "@SPECIAL_CHARS", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
10745
10733
|
#else
|
10746
10734
|
rb_iv_set(return_value, "@SPECIAL_CHARS", rb_str_new2(buffer255));
|
@@ -10763,7 +10751,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10763
10751
|
return Qfalse;
|
10764
10752
|
} else {
|
10765
10753
|
VALUE keywordsStr, keywordsArray;
|
10766
|
-
#ifdef
|
10754
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10767
10755
|
keywordsStr = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer3k, out_length);
|
10768
10756
|
keywordsArray = rb_str_split(keywordsStr, RSTRING_PTR(_ruby_ibm_db_export_char_to_utf8_rstr(",")) );
|
10769
10757
|
#else
|
@@ -10789,35 +10777,35 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10789
10777
|
} else {
|
10790
10778
|
VALUE dft_isolation = Qnil;
|
10791
10779
|
if( bitmask & SQL_TXN_READ_UNCOMMITTED ) {
|
10792
|
-
#ifdef
|
10780
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10793
10781
|
dft_isolation = _ruby_ibm_db_export_char_to_utf8_rstr("UR");
|
10794
10782
|
#else
|
10795
10783
|
dft_isolation = rb_str_new2("UR");
|
10796
10784
|
#endif
|
10797
10785
|
}
|
10798
10786
|
if( bitmask & SQL_TXN_READ_COMMITTED ) {
|
10799
|
-
#ifdef
|
10787
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10800
10788
|
dft_isolation = _ruby_ibm_db_export_char_to_utf8_rstr("CS");
|
10801
10789
|
#else
|
10802
10790
|
dft_isolation = rb_str_new2("CS");
|
10803
10791
|
#endif
|
10804
10792
|
}
|
10805
10793
|
if( bitmask & SQL_TXN_REPEATABLE_READ ) {
|
10806
|
-
#ifdef
|
10794
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10807
10795
|
dft_isolation = _ruby_ibm_db_export_char_to_utf8_rstr("RS");
|
10808
10796
|
#else
|
10809
10797
|
dft_isolation = rb_str_new2("RS");
|
10810
10798
|
#endif
|
10811
10799
|
}
|
10812
10800
|
if( bitmask & SQL_TXN_SERIALIZABLE ) {
|
10813
|
-
#ifdef
|
10801
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10814
10802
|
dft_isolation = _ruby_ibm_db_export_char_to_utf8_rstr("RR");
|
10815
10803
|
#else
|
10816
10804
|
dft_isolation = rb_str_new2("RR");
|
10817
10805
|
#endif
|
10818
10806
|
}
|
10819
10807
|
if( bitmask & SQL_TXN_NOCOMMIT ) {
|
10820
|
-
#ifdef
|
10808
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10821
10809
|
dft_isolation = _ruby_ibm_db_export_char_to_utf8_rstr("NC");
|
10822
10810
|
#else
|
10823
10811
|
dft_isolation = rb_str_new2("NC");
|
@@ -10843,35 +10831,35 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10843
10831
|
|
10844
10832
|
array = rb_ary_new();
|
10845
10833
|
if( bitmask & SQL_TXN_READ_UNCOMMITTED ) {
|
10846
|
-
#ifdef
|
10834
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10847
10835
|
rb_ary_push(array, _ruby_ibm_db_export_char_to_utf8_rstr("UR"));
|
10848
10836
|
#else
|
10849
10837
|
rb_ary_push(array, rb_str_new2("UR"));
|
10850
10838
|
#endif
|
10851
10839
|
}
|
10852
10840
|
if( bitmask & SQL_TXN_READ_COMMITTED ) {
|
10853
|
-
#ifdef
|
10841
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10854
10842
|
rb_ary_push(array, _ruby_ibm_db_export_char_to_utf8_rstr("CS"));
|
10855
10843
|
#else
|
10856
10844
|
rb_ary_push(array, rb_str_new2("CS"));
|
10857
10845
|
#endif
|
10858
10846
|
}
|
10859
10847
|
if( bitmask & SQL_TXN_REPEATABLE_READ ) {
|
10860
|
-
#ifdef
|
10848
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10861
10849
|
rb_ary_push(array, _ruby_ibm_db_export_char_to_utf8_rstr("RS"));
|
10862
10850
|
#else
|
10863
10851
|
rb_ary_push(array, rb_str_new2("RS"));
|
10864
10852
|
#endif
|
10865
10853
|
}
|
10866
10854
|
if( bitmask & SQL_TXN_SERIALIZABLE ) {
|
10867
|
-
#ifdef
|
10855
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10868
10856
|
rb_ary_push(array, _ruby_ibm_db_export_char_to_utf8_rstr("RR"));
|
10869
10857
|
#else
|
10870
10858
|
rb_ary_push(array, rb_str_new2("RR"));
|
10871
10859
|
#endif
|
10872
10860
|
}
|
10873
10861
|
if( bitmask & SQL_TXN_NOCOMMIT ) {
|
10874
|
-
#ifdef
|
10862
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10875
10863
|
rb_ary_push(array, _ruby_ibm_db_export_char_to_utf8_rstr("NC"));
|
10876
10864
|
#else
|
10877
10865
|
rb_ary_push(array, rb_str_new2("NC"));
|
@@ -10897,28 +10885,28 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10897
10885
|
VALUE conformance = Qnil;
|
10898
10886
|
switch (bufferint32) {
|
10899
10887
|
case SQL_SC_SQL92_ENTRY:
|
10900
|
-
#ifdef
|
10888
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10901
10889
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("ENTRY");
|
10902
10890
|
#else
|
10903
10891
|
conformance = rb_str_new2("ENTRY");
|
10904
10892
|
#endif
|
10905
10893
|
break;
|
10906
10894
|
case SQL_SC_FIPS127_2_TRANSITIONAL:
|
10907
|
-
#ifdef
|
10895
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10908
10896
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("FIPS127");
|
10909
10897
|
#else
|
10910
10898
|
conformance = rb_str_new2("FIPS127");
|
10911
10899
|
#endif
|
10912
10900
|
break;
|
10913
10901
|
case SQL_SC_SQL92_FULL:
|
10914
|
-
#ifdef
|
10902
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10915
10903
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("FULL");
|
10916
10904
|
#else
|
10917
10905
|
conformance = rb_str_new2("FULL");
|
10918
10906
|
#endif
|
10919
10907
|
break;
|
10920
10908
|
case SQL_SC_SQL92_INTERMEDIATE:
|
10921
|
-
#ifdef
|
10909
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10922
10910
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("INTERMEDIATE");
|
10923
10911
|
#else
|
10924
10912
|
conformance = rb_str_new2("INTERMEDIATE");
|
@@ -10943,7 +10931,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10943
10931
|
getInfo_args->return_value = Qfalse;
|
10944
10932
|
return Qfalse;
|
10945
10933
|
} else {
|
10946
|
-
#ifdef
|
10934
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10947
10935
|
if( rb_str_equal(_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer11, out_length), _ruby_ibm_db_export_char_to_utf8_rstr("Y")) ) {
|
10948
10936
|
#else
|
10949
10937
|
if( strcmp((char *)buffer11, "Y") == 0 ) {
|
@@ -10967,7 +10955,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10967
10955
|
getInfo_args->return_value = Qfalse;
|
10968
10956
|
return Qfalse;
|
10969
10957
|
} else {
|
10970
|
-
#ifdef
|
10958
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10971
10959
|
rb_iv_set(return_value, "@IDENTIFIER_QUOTE_CHAR", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer11, out_length));
|
10972
10960
|
#else
|
10973
10961
|
rb_iv_set(return_value, "@IDENTIFIER_QUOTE_CHAR", rb_str_new2(buffer11));
|
@@ -10988,7 +10976,7 @@ static VALUE ibm_db_server_info_helper( get_info_args *getInfo_args ) {
|
|
10988
10976
|
getInfo_args->return_value = Qfalse;
|
10989
10977
|
return Qfalse;
|
10990
10978
|
} else {
|
10991
|
-
#ifdef
|
10979
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
10992
10980
|
if( rb_str_equal(_ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer11, out_length), _ruby_ibm_db_export_char_to_utf8_rstr("Y")) ) {
|
10993
10981
|
#else
|
10994
10982
|
if( strcmp(buffer11, "Y") == 0 ) {
|
@@ -11271,9 +11259,10 @@ VALUE ibm_db_server_info(int argc, VALUE *argv, VALUE self)
|
|
11271
11259
|
getInfo_args->infoType = 0;
|
11272
11260
|
getInfo_args->infoValue = NULL;
|
11273
11261
|
getInfo_args->buff_length = 0;
|
11274
|
-
#ifdef
|
11275
|
-
|
11276
|
-
|
11262
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11263
|
+
// Thread.current.report_on_exception = Qfalse;
|
11264
|
+
ibm_Ruby_Thread_Call ( (void *)ibm_db_server_info_helper, getInfo_args,
|
11265
|
+
RUBY_UBF_IO, NULL);
|
11277
11266
|
return_value = getInfo_args->return_value;
|
11278
11267
|
#else
|
11279
11268
|
return_value = ibm_db_server_info_helper( getInfo_args );
|
@@ -11298,7 +11287,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11298
11287
|
int rc = 0;
|
11299
11288
|
SQLSMALLINT out_length = 0;
|
11300
11289
|
|
11301
|
-
#ifndef
|
11290
|
+
#ifndef UNICODE_SUPPORT_VERSION_H
|
11302
11291
|
char buffer255[255];
|
11303
11292
|
#else
|
11304
11293
|
SQLWCHAR buffer255[255];
|
@@ -11325,7 +11314,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11325
11314
|
getInfo_args->return_value = Qfalse;
|
11326
11315
|
return Qfalse;
|
11327
11316
|
} else {
|
11328
|
-
#ifdef
|
11317
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11329
11318
|
rb_iv_set(return_value, "@DRIVER_NAME", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
11330
11319
|
#else
|
11331
11320
|
rb_iv_set(return_value, "@DRIVER_NAME", rb_str_new2(buffer255));
|
@@ -11346,7 +11335,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11346
11335
|
getInfo_args->return_value = Qfalse;
|
11347
11336
|
return Qfalse;
|
11348
11337
|
} else {
|
11349
|
-
#ifdef
|
11338
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11350
11339
|
rb_iv_set(return_value, "@DRIVER_VER", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
11351
11340
|
#else
|
11352
11341
|
rb_iv_set(return_value, "@DRIVER_VER", rb_str_new2(buffer255));
|
@@ -11367,7 +11356,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11367
11356
|
getInfo_args->return_value = Qfalse;
|
11368
11357
|
return Qfalse;
|
11369
11358
|
} else {
|
11370
|
-
#ifdef
|
11359
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11371
11360
|
rb_iv_set(return_value, "@DATA_SOURCE_NAME", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
11372
11361
|
#else
|
11373
11362
|
rb_iv_set(return_value, "@DATA_SOURCE_NAME", rb_str_new2(buffer255));
|
@@ -11388,7 +11377,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11388
11377
|
getInfo_args->return_value = Qfalse;
|
11389
11378
|
return Qfalse;
|
11390
11379
|
} else {
|
11391
|
-
#ifdef
|
11380
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11392
11381
|
rb_iv_set(return_value, "@DRIVER_ODBC_VER", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
11393
11382
|
#else
|
11394
11383
|
rb_iv_set(return_value, "@DRIVER_ODBC_VER", rb_str_new2(buffer255));
|
@@ -11410,7 +11399,7 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11410
11399
|
getInfo_args->return_value = Qfalse;
|
11411
11400
|
return Qfalse;
|
11412
11401
|
} else {
|
11413
|
-
#ifdef
|
11402
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11414
11403
|
rb_iv_set(return_value, "@ODBC_VER", _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(buffer255, out_length));
|
11415
11404
|
#else
|
11416
11405
|
rb_iv_set(return_value, "@ODBC_VER", rb_str_new2(buffer255));
|
@@ -11435,21 +11424,21 @@ static VALUE ibm_db_client_info_helper( get_info_args *getInfo_args) {
|
|
11435
11424
|
VALUE conformance = Qnil;
|
11436
11425
|
switch (bufferint16) {
|
11437
11426
|
case SQL_OSC_MINIMUM:
|
11438
|
-
#ifdef
|
11427
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11439
11428
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("MINIMUM");
|
11440
11429
|
#else
|
11441
11430
|
conformance = rb_str_new2("MINIMUM");
|
11442
11431
|
#endif
|
11443
11432
|
break;
|
11444
11433
|
case SQL_OSC_CORE:
|
11445
|
-
#ifdef
|
11434
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11446
11435
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("CORE");
|
11447
11436
|
#else
|
11448
11437
|
conformance = rb_str_new2("CORE");
|
11449
11438
|
#endif
|
11450
11439
|
break;
|
11451
11440
|
case SQL_OSC_EXTENDED:
|
11452
|
-
#ifdef
|
11441
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11453
11442
|
conformance = _ruby_ibm_db_export_char_to_utf8_rstr("EXTENDED");
|
11454
11443
|
#else
|
11455
11444
|
conformance = rb_str_new2("EXTENDED");
|
@@ -11567,10 +11556,10 @@ VALUE ibm_db_client_info(int argc, VALUE *argv, VALUE self)
|
|
11567
11556
|
getInfo_args->infoType = 0;
|
11568
11557
|
getInfo_args->infoValue = NULL;
|
11569
11558
|
getInfo_args->buff_length = 0;
|
11570
|
-
|
11571
|
-
#ifdef
|
11559
|
+
// using the default unblock funtion RUBY_UBF_IO instead of defined unblock function
|
11560
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11572
11561
|
ibm_Ruby_Thread_Call ( (void *)ibm_db_client_info_helper, getInfo_args,
|
11573
|
-
|
11562
|
+
RUBY_UBF_IO, NULL);
|
11574
11563
|
return_value = getInfo_args->return_value;
|
11575
11564
|
|
11576
11565
|
#else
|
@@ -11686,7 +11675,7 @@ VALUE ibm_db_get_option(int argc, VALUE *argv, VALUE self)
|
|
11686
11675
|
VALUE r_type = Qnil;
|
11687
11676
|
VALUE ret_val = Qnil;
|
11688
11677
|
|
11689
|
-
#ifdef
|
11678
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11690
11679
|
SQLWCHAR *value = NULL;
|
11691
11680
|
#else
|
11692
11681
|
SQLCHAR *value = NULL;
|
@@ -11722,7 +11711,7 @@ VALUE ibm_db_get_option(int argc, VALUE *argv, VALUE self)
|
|
11722
11711
|
if (!NIL_P(option)) {
|
11723
11712
|
op_integer=(SQLINTEGER)FIX2INT(option);
|
11724
11713
|
/* ACCTSTR_LEN is the largest possible length of the options to retrieve */
|
11725
|
-
#ifdef
|
11714
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11726
11715
|
value = (SQLWCHAR *)ALLOC_N(SQLWCHAR, ACCTSTR_LEN + 1);
|
11727
11716
|
memset(value,'\0', (ACCTSTR_LEN + 1)*sizeof(SQLWCHAR));
|
11728
11717
|
#else
|
@@ -11735,7 +11724,7 @@ VALUE ibm_db_get_option(int argc, VALUE *argv, VALUE self)
|
|
11735
11724
|
get_handleAttr_args->handle = &( conn_res->hdbc );
|
11736
11725
|
get_handleAttr_args->attribute = op_integer;
|
11737
11726
|
get_handleAttr_args->valuePtr = (SQLPOINTER)value;
|
11738
|
-
#ifdef
|
11727
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11739
11728
|
get_handleAttr_args->buff_length = (ACCTSTR_LEN+1)*sizeof(SQLWCHAR);
|
11740
11729
|
#else
|
11741
11730
|
get_handleAttr_args->buff_length = (ACCTSTR_LEN+1);
|
@@ -11749,7 +11738,7 @@ VALUE ibm_db_get_option(int argc, VALUE *argv, VALUE self)
|
|
11749
11738
|
_ruby_ibm_db_check_sql_errors( conn_res, DB_CONN, conn_res->hdbc, SQL_HANDLE_DBC, rc, 1, NULL, NULL, -1, 1, 1 );
|
11750
11739
|
ret_val = Qfalse;
|
11751
11740
|
} else {
|
11752
|
-
#ifdef
|
11741
|
+
#ifdef UNICODE_SUPPORT_VERSION_H
|
11753
11742
|
ret_val = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(value, out_length);
|
11754
11743
|
#else
|
11755
11744
|
ret_val = rb_str_new2((char *)value);
|
@@ -11885,3 +11874,6 @@ VALUE ibm_db_get_last_serial_value(int argc, VALUE *argv, VALUE self)
|
|
11885
11874
|
* vim600: noet sw=4 ts=4 fdm=marker
|
11886
11875
|
* vim<600: noet sw=4 ts=4
|
11887
11876
|
*/
|
11877
|
+
|
11878
|
+
/*
|
11879
|
+
+----------------------------------------------------------------------+*/
|