ibm_db 5.0.2 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/ibm_db.o ADDED
Binary file
data/ext/ibm_db.so ADDED
Binary file
data/ext/mkmf.log CHANGED
@@ -1,32 +1,31 @@
1
- gil_release_version is:
1
+ gil_release_version.h is:
2
2
  /* begin */
3
- 1: #ifndef GIL_RELEASE_VERSION
4
- 2: #define GIL_RELEASE_VERSION
3
+ 1: #ifndef GIL_RELEASE_VERSION_H
4
+ 2: #define GIL_RELEASE_VERSION_H
5
5
  3: #endif
6
6
  /* end */
7
7
 
8
- unicode_support_version is:
8
+ unicode_support_version.h is:
9
9
  /* begin */
10
- 1: #ifndef UNICODE_SUPPORT_VERSION
11
- 2: #define UNICODE_SUPPORT_VERSION
10
+ 1: #ifndef UNICODE_SUPPORT_VERSION_H
11
+ 2: #define UNICODE_SUPPORT_VERSION_H
12
12
  3: #endif
13
13
  /* end */
14
14
 
15
15
  have_library: checking for SQLConnect() in -ldb2... -------------------- yes
16
16
 
17
- "gcc -o conftest -I/home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux -I/home/rakhil/ruby_exe/include/ruby-2.6.0/ruby/backward -I/home/rakhil/ruby_exe/include/ruby-2.6.0 -I. -I/home/rakhil/clidriver/include -O3 -ggdb3 -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 conftest.c -L. -L/home/rakhil/ruby_exe/lib -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/clidriver/lib -Wl,-rpath,/home/rakhil/clidriver/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/ruby_exe/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm -lm -lc"
18
- /home/rakhil/ruby_exe/lib/ruby/2.6.0/mkmf.rb:406: warning: Insecure world writable dir /work/rakhil in PATH, mode 040777
17
+ "gcc -o conftest -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -I/home/rakhil/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -Wl,-rpath,/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/home/rakhil/.rbenv/versions/3.0.0/lib -lruby -lm -lc"
19
18
  checked program was:
20
19
  /* begin */
21
20
  1: #include "ruby.h"
22
21
  2:
23
22
  3: int main(int argc, char **argv)
24
23
  4: {
25
- 5: return 0;
24
+ 5: return !!argv[argc];
26
25
  6: }
27
26
  /* end */
28
27
 
29
- "gcc -o conftest -I/home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux -I/home/rakhil/ruby_exe/include/ruby-2.6.0/ruby/backward -I/home/rakhil/ruby_exe/include/ruby-2.6.0 -I. -I/home/rakhil/clidriver/include -O3 -ggdb3 -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 conftest.c -L. -L/home/rakhil/ruby_exe/lib -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/clidriver/lib -Wl,-rpath,/home/rakhil/clidriver/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/ruby_exe/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm -ldb2 -lm -lc"
28
+ "gcc -o conftest -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -I/home/rakhil/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -Wl,-rpath,/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/home/rakhil/.rbenv/versions/3.0.0/lib -lruby -ldb2 -lm -lc"
30
29
  conftest.c: In function 't':
31
30
  conftest.c:14:57: error: 'SQLConnect' undeclared (first use in this function)
32
31
  int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
@@ -50,12 +49,12 @@ checked program was:
50
49
  9: printf("%d", (*tp)());
51
50
  10: }
52
51
  11:
53
- 12: return 0;
52
+ 12: return !!argv[argc];
54
53
  13: }
55
54
  14: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
56
55
  /* end */
57
56
 
58
- "gcc -o conftest -I/home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux -I/home/rakhil/ruby_exe/include/ruby-2.6.0/ruby/backward -I/home/rakhil/ruby_exe/include/ruby-2.6.0 -I. -I/home/rakhil/clidriver/include -O3 -ggdb3 -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 conftest.c -L. -L/home/rakhil/ruby_exe/lib -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/clidriver/lib -Wl,-rpath,/home/rakhil/clidriver/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/ruby_exe/lib -L/home/rakhil/ruby_exe/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm -ldb2 -lm -lc"
57
+ "gcc -o conftest -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -I/home/rakhil/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -Wl,-rpath,/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -L/home/rakhil/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/rakhil/.rbenv/versions/3.0.0/lib -L/home/rakhil/.rbenv/versions/3.0.0/lib -lruby -ldb2 -lm -lc"
59
58
  checked program was:
60
59
  /* begin */
61
60
  1: #include "ruby.h"
@@ -69,7 +68,7 @@ checked program was:
69
68
  9: printf("%d", (*tp)());
70
69
  10: }
71
70
  11:
72
- 12: return 0;
71
+ 12: return !!argv[argc];
73
72
  13: }
74
73
  14: extern void SQLConnect();
75
74
  15: int t(void) { SQLConnect(); return 0; }
@@ -77,26 +76,26 @@ checked program was:
77
76
 
78
77
  --------------------
79
78
 
80
- have_header: checking for gil_release_version... -------------------- yes
79
+ have_header: checking for gil_release_version.h... -------------------- yes
81
80
 
82
- "gcc -E -I/home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux -I/home/rakhil/ruby_exe/include/ruby-2.6.0/ruby/backward -I/home/rakhil/ruby_exe/include/ruby-2.6.0 -I. -I/home/rakhil/clidriver/include -O3 -ggdb3 -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 conftest.c -o conftest.i"
81
+ "gcc -E -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -I/home/rakhil/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -o conftest.i"
83
82
  checked program was:
84
83
  /* begin */
85
84
  1: #include "ruby.h"
86
85
  2:
87
- 3: #include <gil_release_version>
86
+ 3: #include <gil_release_version.h>
88
87
  /* end */
89
88
 
90
89
  --------------------
91
90
 
92
- have_header: checking for unicode_support_version... -------------------- yes
91
+ have_header: checking for unicode_support_version.h... -------------------- yes
93
92
 
94
- "gcc -E -I/home/rakhil/ruby_exe/include/ruby-2.6.0/x86_64-linux -I/home/rakhil/ruby_exe/include/ruby-2.6.0/ruby/backward -I/home/rakhil/ruby_exe/include/ruby-2.6.0 -I. -I/home/rakhil/clidriver/include -O3 -ggdb3 -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 conftest.c -o conftest.i"
93
+ "gcc -E -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/rakhil/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/work/rakhil/work_ruby/git_clone/5.2.0/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -I/home/rakhil/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -o conftest.i"
95
94
  checked program was:
96
95
  /* begin */
97
96
  1: #include "ruby.h"
98
97
  2:
99
- 3: #include <unicode_support_version>
98
+ 3: #include <unicode_support_version.h>
100
99
  /* end */
101
100
 
102
101
  --------------------
data/ext/ruby_ibm_db.h CHANGED
@@ -206,7 +206,7 @@ VALUE ibm_db_active(int argc, VALUE *argv, VALUE self);
206
206
  */
207
207
  struct _ibm_db_globals {
208
208
  int bin_mode;
209
- #ifdef UNICODE_SUPPORT_VERSION
209
+ #ifdef UNICODE_SUPPORT_VERSION_H
210
210
  SQLWCHAR __ruby_conn_err_msg[DB2_MAX_ERR_MSG_LEN];
211
211
  SQLWCHAR __ruby_stmt_err_msg[DB2_MAX_ERR_MSG_LEN];
212
212
  SQLWCHAR __ruby_conn_err_state[SQL_SQLSTATE_SIZE + 1];
@@ -31,7 +31,7 @@
31
31
  */
32
32
  int _ruby_ibm_db_SQLConnect_helper(connect_args *data) {
33
33
  if(data->ctlg_conn == 1) {
34
- #ifndef UNICODE_SUPPORT_VERSION
34
+ #ifndef UNICODE_SUPPORT_VERSION_H
35
35
  return SQLConnect( (SQLHDBC)*(data->hdbc), (SQLCHAR *)data->database,
36
36
  (SQLSMALLINT)data->database_len, (SQLCHAR *)data->uid, (SQLSMALLINT)data->uid_len,
37
37
  (SQLCHAR *)data->password, (SQLSMALLINT)data->password_len );
@@ -41,7 +41,7 @@ int _ruby_ibm_db_SQLConnect_helper(connect_args *data) {
41
41
  data->password, data->password_len );
42
42
  #endif
43
43
  } else {
44
- #ifndef UNICODE_SUPPORT_VERSION
44
+ #ifndef UNICODE_SUPPORT_VERSION_H
45
45
  return SQLDriverConnect( (SQLHDBC) *(data->hdbc), (SQLHWND)NULL,
46
46
  (SQLCHAR*)data->database, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT );
47
47
  #else
@@ -100,7 +100,7 @@ int _ruby_ibm_db_SQLDescribeCol_helper(describecol_args *data) {
100
100
 
101
101
  data->stmt_res->is_executing = 1;
102
102
 
103
- #ifdef UNICODE_SUPPORT_VERSION
103
+ #ifdef UNICODE_SUPPORT_VERSION_H
104
104
  rc = SQLDescribeColW( (SQLHSTMT)data->stmt_res->hstmt, (SQLSMALLINT)(data->col_no),
105
105
  data->stmt_res->column_info[i].name, data->buff_length, &(data->name_length),
106
106
  &(data->stmt_res->column_info[i].type), &(data->stmt_res->column_info[i].size),
@@ -140,7 +140,7 @@ int _ruby_ibm_db_SQLColumnPrivileges_helper(metadata_args *data) {
140
140
 
141
141
  data->stmt_res->is_executing = 1;
142
142
 
143
- #ifndef UNICODE_SUPPORT_VERSION
143
+ #ifndef UNICODE_SUPPORT_VERSION_H
144
144
  rc = SQLColumnPrivileges( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
145
145
  data->owner, data->owner_len, data->table_name, data->table_name_len,
146
146
  data->column_name, data->column_name_len );
@@ -164,7 +164,7 @@ int _ruby_ibm_db_SQLColumns_helper(metadata_args *data) {
164
164
 
165
165
  data->stmt_res->is_executing = 1;
166
166
 
167
- #ifndef UNICODE_SUPPORT_VERSION
167
+ #ifndef UNICODE_SUPPORT_VERSION_H
168
168
  rc = SQLColumns( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
169
169
  data->owner, data->owner_len, data->table_name, data->table_name_len,
170
170
  data->column_name, data->column_name_len );
@@ -187,7 +187,7 @@ int _ruby_ibm_db_SQLPrimaryKeys_helper(metadata_args *data) {
187
187
 
188
188
  data->stmt_res->is_executing = 1;
189
189
 
190
- #ifndef UNICODE_SUPPORT_VERSION
190
+ #ifndef UNICODE_SUPPORT_VERSION_H
191
191
  rc = SQLPrimaryKeys( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
192
192
  data->owner, data->owner_len, data->table_name, data->table_name_len );
193
193
  #else
@@ -210,7 +210,7 @@ int _ruby_ibm_db_SQLForeignKeys_helper(metadata_args *data) {
210
210
 
211
211
  if(!NIL_P(data->table_type))
212
212
  {
213
- #ifndef UNICODE_SUPPORT_VERSION
213
+ #ifndef UNICODE_SUPPORT_VERSION_H
214
214
  rc = SQLForeignKeys( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
215
215
  data->owner, data->owner_len, NULL , SQL_NTS, NULL, SQL_NTS,
216
216
  NULL, SQL_NTS, data->table_name, data->table_name_len );
@@ -222,7 +222,7 @@ int _ruby_ibm_db_SQLForeignKeys_helper(metadata_args *data) {
222
222
  }
223
223
  else
224
224
  {
225
- #ifndef UNICODE_SUPPORT_VERSION
225
+ #ifndef UNICODE_SUPPORT_VERSION_H
226
226
  rc = SQLForeignKeys( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
227
227
  data->owner, data->owner_len, data->table_name , data->table_name_len, NULL, SQL_NTS,
228
228
  NULL, SQL_NTS, NULL, SQL_NTS );
@@ -247,7 +247,7 @@ int _ruby_ibm_db_SQLProcedureColumns_helper(metadata_args *data) {
247
247
 
248
248
  data->stmt_res->is_executing = 1;
249
249
 
250
- #ifndef UNICODE_SUPPORT_VERSION
250
+ #ifndef UNICODE_SUPPORT_VERSION_H
251
251
  rc = SQLProcedureColumns( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len, data->owner,
252
252
  data->owner_len, data->proc_name, data->proc_name_len, data->column_name, data->column_name_len );
253
253
  #else
@@ -269,7 +269,7 @@ int _ruby_ibm_db_SQLProcedures_helper(metadata_args *data) {
269
269
 
270
270
  data->stmt_res->is_executing = 1;
271
271
 
272
- #ifndef UNICODE_SUPPORT_VERSION
272
+ #ifndef UNICODE_SUPPORT_VERSION_H
273
273
  rc = SQLProcedures( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len, data->owner,
274
274
  data->owner_len, data->proc_name, data->proc_name_len );
275
275
  #else
@@ -291,7 +291,7 @@ int _ruby_ibm_db_SQLSpecialColumns_helper(metadata_args *data) {
291
291
 
292
292
  data->stmt_res->is_executing = 1;
293
293
 
294
- #ifndef UNICODE_SUPPORT_VERSION
294
+ #ifndef UNICODE_SUPPORT_VERSION_H
295
295
  rc = SQLSpecialColumns( (SQLHSTMT) data->stmt_res->hstmt, SQL_BEST_ROWID, data->qualifier, data->qualifier_len,
296
296
  data->owner, data->owner_len, data->table_name, data->table_name_len,
297
297
  (SQLUSMALLINT)data->scope, SQL_NULLABLE );
@@ -314,7 +314,7 @@ int _ruby_ibm_db_SQLStatistics_helper(metadata_args *data) {
314
314
 
315
315
  data->stmt_res->is_executing = 1;
316
316
 
317
- #ifndef UNICODE_SUPPORT_VERSION
317
+ #ifndef UNICODE_SUPPORT_VERSION_H
318
318
  rc = SQLStatistics( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len, data->owner,
319
319
  data->owner_len, data->table_name, data->table_name_len, (SQLUSMALLINT)data->unique, SQL_QUICK );
320
320
  #else
@@ -336,7 +336,7 @@ int _ruby_ibm_db_SQLTablePrivileges_helper(metadata_args *data) {
336
336
 
337
337
  data->stmt_res->is_executing = 1;
338
338
 
339
- #ifndef UNICODE_SUPPORT_VERSION
339
+ #ifndef UNICODE_SUPPORT_VERSION_H
340
340
  rc = SQLTablePrivileges( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len,
341
341
  data->owner, data->owner_len, data->table_name, data->table_name_len );
342
342
  #else
@@ -358,7 +358,7 @@ int _ruby_ibm_db_SQLTables_helper(metadata_args *data) {
358
358
 
359
359
  data->stmt_res->is_executing = 1;
360
360
 
361
- #ifndef UNICODE_SUPPORT_VERSION
361
+ #ifndef UNICODE_SUPPORT_VERSION_H
362
362
  rc = SQLTables( (SQLHSTMT) data->stmt_res->hstmt, data->qualifier, data->qualifier_len, data->owner,
363
363
  data->owner_len, data->table_name, data->table_name_len, data->table_type, data->table_type_len );
364
364
  #else
@@ -379,7 +379,7 @@ int _ruby_ibm_db_SQLExecDirect_helper(exec_cum_prepare_args *data) {
379
379
 
380
380
  data->stmt_res->is_executing = 1;
381
381
 
382
- #ifndef UNICODE_SUPPORT_VERSION
382
+ #ifndef UNICODE_SUPPORT_VERSION_H
383
383
  rc = SQLExecDirect( (SQLHSTMT) data->stmt_res->hstmt, data->stmt_string, (SQLINTEGER)data->stmt_string_len );
384
384
  #else
385
385
  rc = SQLExecDirectW( (SQLHSTMT) data->stmt_res->hstmt, data->stmt_string, (SQLINTEGER)data->stmt_string_len );
@@ -395,7 +395,7 @@ int _ruby_ibm_db_SQLExecDirect_helper(exec_cum_prepare_args *data) {
395
395
  */
396
396
  int _ruby_ibm_db_SQLCreateDB_helper(create_drop_db_args *data) {
397
397
  int rc = 0;
398
- #ifndef UNICODE_SUPPORT_VERSION
398
+ #ifndef UNICODE_SUPPORT_VERSION_H
399
399
  #ifdef _WIN32
400
400
  HINSTANCE cliLib = NULL;
401
401
  FARPROC sqlcreatedb;
@@ -450,7 +450,7 @@ int _ruby_ibm_db_SQLCreateDB_helper(create_drop_db_args *data) {
450
450
  */
451
451
  int _ruby_ibm_db_SQLDropDB_helper(create_drop_db_args *data) {
452
452
  int rc = 0;
453
- #ifndef UNICODE_SUPPORT_VERSION
453
+ #ifndef UNICODE_SUPPORT_VERSION_H
454
454
  #ifdef _WIN32
455
455
  HINSTANCE cliLib = NULL;
456
456
  FARPROC sqldropdb;
@@ -506,7 +506,7 @@ int _ruby_ibm_db_SQLPrepare_helper(exec_cum_prepare_args *data) {
506
506
 
507
507
  data->stmt_res->is_executing = 1;
508
508
 
509
- #ifndef UNICODE_SUPPORT_VERSION
509
+ #ifndef UNICODE_SUPPORT_VERSION_H
510
510
  rc = SQLPrepare( (SQLHSTMT) data->stmt_res->hstmt, data->stmt_string, (SQLINTEGER)data->stmt_string_len );
511
511
  #else
512
512
  rc = SQLPrepareW( (SQLHSTMT) data->stmt_res->hstmt, data->stmt_string, (SQLINTEGER)data->stmt_string_len );
@@ -742,7 +742,7 @@ int _ruby_ibm_db_SQLRowCount_helper(sql_row_count_args *data) {
742
742
  This function calls SQLGetInfo cli call to get general information about DBMS, which the app is connected to
743
743
  */
744
744
  int _ruby_ibm_db_SQLGetInfo_helper(get_info_args *data) {
745
- #ifndef UNICODE_SUPPORT_VERSION
745
+ #ifndef UNICODE_SUPPORT_VERSION_H
746
746
  return SQLGetInfo( data->conn_res->hdbc, data->infoType, data->infoValue, data->buff_length, data->out_length);
747
747
  #else
748
748
  return SQLGetInfoW( data->conn_res->hdbc, data->infoType, data->infoValue, data->buff_length, data->out_length);
@@ -753,7 +753,7 @@ int _ruby_ibm_db_SQLGetInfo_helper(get_info_args *data) {
753
753
  This function calls SQLGetDiagRec cli call to get the current values of a diagnostic record that contains error
754
754
  */
755
755
  int _ruby_ibm_db_SQLGetDiagRec_helper(get_diagRec_args *data) {
756
- #ifdef UNICODE_SUPPORT_VERSION
756
+ #ifdef UNICODE_SUPPORT_VERSION_H
757
757
  int rc= SQLGetDiagRecW( data->hType, data->handle, data->recNum, data->SQLState, data->NativeErrorPtr,
758
758
  data->msgText, data->buff_length, data->text_length_ptr );
759
759
  data->return_code=rc;
@@ -768,7 +768,7 @@ int _ruby_ibm_db_SQLGetDiagRec_helper(get_diagRec_args *data) {
768
768
  This function calls SQLSetStmtAttr cli call to set attributes related to a statement
769
769
  */
770
770
  int _ruby_ibm_db_SQLSetStmtAttr_helper(set_handle_attr_args *data) {
771
- #ifndef UNICODE_SUPPORT_VERSION
771
+ #ifndef UNICODE_SUPPORT_VERSION_H
772
772
  return SQLSetStmtAttr( (SQLHSTMT) *(data->handle), data->attribute, data->valuePtr, data->strLength );
773
773
  #else
774
774
  return SQLSetStmtAttrW( (SQLHSTMT) *(data->handle), data->attribute, data->valuePtr, data->strLength );
@@ -779,7 +779,7 @@ int _ruby_ibm_db_SQLSetStmtAttr_helper(set_handle_attr_args *data) {
779
779
  This function calls SQLSetConnectAttr cli call to set attributes that govern aspects of connections
780
780
  */
781
781
  int _ruby_ibm_db_SQLSetConnectAttr_helper(set_handle_attr_args *data) {
782
- #ifndef UNICODE_SUPPORT_VERSION
782
+ #ifndef UNICODE_SUPPORT_VERSION_H
783
783
  return SQLSetConnectAttr( (SQLHDBC) *(data->handle), data->attribute, data->valuePtr, data->strLength );
784
784
  #else
785
785
  return SQLSetConnectAttrW( (SQLHDBC) *(data->handle), data->attribute, data->valuePtr, data->strLength );
@@ -809,7 +809,7 @@ int _ruby_ibm_db_SQLGetStmtAttr_helper(get_handle_attr_args *data) {
809
809
  This function calls SQLGetConnectAttr cli call to set an environment attribute
810
810
  */
811
811
  int _ruby_ibm_db_SQLGetConnectAttr_helper(get_handle_attr_args *data) {
812
- #ifndef UNICODE_SUPPORT_VERSION
812
+ #ifndef UNICODE_SUPPORT_VERSION_H
813
813
  return SQLGetConnectAttr( (SQLHDBC) *(data->handle), data->attribute, data->valuePtr,
814
814
  data->buff_length, data->out_length);
815
815
  #else
@@ -105,7 +105,7 @@ typedef struct {
105
105
  } ibm_db_row_type;
106
106
 
107
107
  typedef struct _ibm_db_result_set_info_struct {
108
- #ifdef UNICODE_SUPPORT_VERSION
108
+ #ifdef UNICODE_SUPPORT_VERSION_H
109
109
  SQLWCHAR *name;
110
110
  long name_length;
111
111
  #else
@@ -157,7 +157,7 @@ typedef struct _stmt_handle_struct {
157
157
  Structure holding the data to be passed to SQLConnect or SQLDriverConnect CLI call
158
158
  */
159
159
  typedef struct _ibm_db_connect_args_struct {
160
- #ifdef UNICODE_SUPPORT_VERSION
160
+ #ifdef UNICODE_SUPPORT_VERSION_H
161
161
  SQLWCHAR *database;
162
162
  SQLWCHAR *uid;
163
163
  SQLWCHAR *password;
@@ -211,7 +211,7 @@ typedef struct _ibm_db_describecol_args_struct {
211
211
  */
212
212
  typedef struct _ibm_db_metadata_args_struct {
213
213
  stmt_handle *stmt_res;
214
- #ifdef UNICODE_SUPPORT_VERSION
214
+ #ifdef UNICODE_SUPPORT_VERSION_H
215
215
  SQLWCHAR *qualifier;
216
216
  SQLWCHAR *owner;
217
217
  SQLWCHAR *table_name;
@@ -243,7 +243,7 @@ typedef struct _ibm_db_metadata_args_struct {
243
243
  */
244
244
  typedef struct _ibm_db_exec_direct_args_struct {
245
245
  stmt_handle *stmt_res;
246
- #ifdef UNICODE_SUPPORT_VERSION
246
+ #ifdef UNICODE_SUPPORT_VERSION_H
247
247
  SQLWCHAR *stmt_string;
248
248
  #else
249
249
  SQLCHAR *stmt_string;
@@ -257,7 +257,7 @@ typedef struct _ibm_db_exec_direct_args_struct {
257
257
  */
258
258
  typedef struct _ibm_db_create_drop_db_args_struct {
259
259
  conn_handle *conn_res;
260
- #ifdef UNICODE_SUPPORT_VERSION
260
+ #ifdef UNICODE_SUPPORT_VERSION_H
261
261
  SQLWCHAR *dbName;
262
262
  SQLWCHAR *codeSet;
263
263
  SQLWCHAR *mode;
Binary file
@@ -0,0 +1,3 @@
1
+ #ifndef UNICODE_SUPPORT_VERSION_H
2
+ #define UNICODE_SUPPORT_VERSION_H
3
+ #endif
@@ -800,6 +800,10 @@ module ActiveRecord
800
800
  @servertype = IBM_DB2_ZOS.new(self, @isAr3)
801
801
  when /10/
802
802
  @servertype = IBM_DB2_ZOS.new(self, @isAr3)
803
+ when /11/
804
+ @servertype = IBM_DB2_ZOS.new(self, @isAr3)
805
+ when /12/
806
+ @servertype = IBM_DB2_ZOS.new(self, @isAr3)
803
807
  when /08/ # DB2 for zOS version 8
804
808
  @servertype = IBM_DB2_ZOS_8.new(self, @isAr3)
805
809
  else # DB2 for zOS version 7
@@ -1739,8 +1743,8 @@ module ActiveRecord
1739
1743
  :char => { :name => "char" },
1740
1744
  :double => { :name => @servertype.get_double_mapping },
1741
1745
  :decfloat => { :name => "decfloat"},
1742
- :graphic => { :name => "graphic", :limit => 1},
1743
- :vargraphic => { :name => "vargraphic", :limit => 1},
1746
+ :graphic => { :name => "graphic"},
1747
+ :vargraphic => { :name => "vargraphic"},
1744
1748
  :bigint => { :name => "bigint"}
1745
1749
  }
1746
1750
  end
@@ -1841,6 +1845,46 @@ module ActiveRecord
1841
1845
  return sql_segment
1842
1846
  end
1843
1847
 
1848
+ if type.to_sym == :vargraphic
1849
+ sql_segment = native_database_types[type.to_sym][:name].to_s
1850
+ if limit.class == Hash
1851
+ if limit.has_key?("limit".to_sym)
1852
+ limit1 = limit[:limit]
1853
+ sql_segment << "(#{limit1})"
1854
+ else
1855
+ return "vargraphic(1)"
1856
+ end
1857
+ else
1858
+ if limit != nil
1859
+ sql_segment << "(#{limit})"
1860
+ else
1861
+ return "vargraphic(1)"
1862
+ end
1863
+ end
1864
+ return sql_segment
1865
+ end
1866
+
1867
+ if type.to_sym == :graphic
1868
+ sql_segment = native_database_types[type.to_sym][:name].to_s
1869
+ if limit.class == Hash
1870
+ if limit.has_key?("limit".to_sym)
1871
+ limit1 = limit[:limit]
1872
+ sql_segment << "(#{limit1})"
1873
+ else
1874
+ return "graphic(1)"
1875
+ end
1876
+ else
1877
+ if limit != nil
1878
+ sql_segment << "(#{limit})"
1879
+ else
1880
+ return "graphic(1)"
1881
+ end
1882
+ end
1883
+ return sql_segment
1884
+ end
1885
+
1886
+
1887
+
1844
1888
  if limit.class == Hash
1845
1889
  return super if limit.has_key?("limit".to_sym).nil?
1846
1890
  else
@@ -3447,7 +3491,9 @@ end
3447
3491
 
3448
3492
 
3449
3493
  def visit_Arel_Nodes_Limit o,collector
3494
+ collector << " FETCH FIRST "
3450
3495
  visit o.expr, collector
3496
+ collector << " ROWS ONLY "
3451
3497
  end
3452
3498
 
3453
3499
  def visit_Arel_Nodes_Offset o,collector
@@ -3492,40 +3538,54 @@ end
3492
3538
  end
3493
3539
 
3494
3540
 
3495
- if o.limit
3496
- limcoll = Arel::Collectors::SQLString.new
3497
- visit(o.limit,limcoll)
3498
- limit = limcoll.value.to_i
3499
- else
3500
- limit = nil
3501
- end
3502
-
3503
- if o.offset
3504
- offcoll = Arel::Collectors::SQLString.new
3505
- visit(o.offset,offcoll)
3506
- offset = offcoll.value.to_i
3507
- else
3508
- offset = nil
3509
- end
3510
-
3511
- limOffClause = @connection.get_limit_offset_clauses(limit,offset)
3512
-
3513
- if( !limOffClause["startSegment"].empty? )
3514
- #collector.changeFirstSegment(limOffClause["startSegment"])
3515
- collector.value.prepend(limOffClause["startSegment"])
3516
- end
3517
-
3518
- if( !limOffClause["endSegment"].empty? )
3519
- #collector.changeEndSegment(limOffClause["endSegment"])
3520
- collector << " "
3521
- collector << limOffClause["endSegment"]
3522
- end
3541
+ # if o.limit
3542
+ # limcoll = Arel::Collectors::SQLString.new
3543
+ # visit(o.limit,limcoll)
3544
+ # limit = limcoll.value.to_i
3545
+ # else
3546
+ # limit = nil
3547
+ # end
3548
+ #
3549
+ # if o.offset
3550
+ # offcoll = Arel::Collectors::SQLString.new
3551
+ # visit(o.offset,offcoll)
3552
+ # offset = offcoll.value.to_i
3553
+ # else
3554
+ # offset = nil
3555
+ # end
3556
+ #
3557
+ # limOffClause = @connection.get_limit_offset_clauses(limit,offset)
3558
+ #
3559
+ # if( !limOffClause["startSegment"].empty? )
3560
+ # #collector.changeFirstSegment(limOffClause["startSegment"])
3561
+ # collector.value.prepend(limOffClause["startSegment"])
3562
+ # end
3563
+ #
3564
+ # if( !limOffClause["endSegment"].empty? )
3565
+ # #collector.changeEndSegment(limOffClause["endSegment"])
3566
+ # collector << " "
3567
+ # collector << limOffClause["endSegment"]
3568
+ # end
3523
3569
 
3524
3570
  #Initialize a new Collector and set its value to the sql string built so far with any limit and ofset modifications
3525
3571
  #collector.reset(sql)
3526
-
3527
- collector = maybe_visit o.lock, collector
3528
- return collector
3572
+ if (o.limit && o.offset.nil?)
3573
+ visit(o.limit, collector)
3574
+ end
3575
+ if (o.offset && o.limit.nil?)
3576
+ collector.value.prepend(" SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( ")
3577
+ collector << (" ) AS I) AS O WHERE sys_row_num > ")
3578
+ visit(o.offset, collector)
3579
+ end
3580
+
3581
+ if (o.offset && o.limit)
3582
+ collector.value.prepend(" SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( ")
3583
+ collector << (" ) AS I) AS O WHERE sys_row_num > ")
3584
+ visit(o.offset, collector)
3585
+ visit(o.limit, collector)
3586
+ end
3587
+ collector = maybe_visit o.lock, collector
3588
+ return collector
3529
3589
  end
3530
3590
 
3531
3591
  end