ibm_db 5.0.2-x86-mingw32 → 5.2.0-x86-mingw32

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,20 +1,20 @@
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 -ldb2cli... -------------------- yes
16
16
 
17
- "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby26/include/ruby-2.6.0/i386-mingw32 -IC:/Ruby26/include/ruby-2.6.0/ruby/backward -IC:/Ruby26/include/ruby-2.6.0 -I. -IC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/Ruby26/lib -LC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -lmsvcrt-ruby260 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
17
+ "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25/include/ruby-2.5.0/i386-mingw32 -IC:/Ruby25/include/ruby-2.5.0/ruby/backward -IC:/Ruby25/include/ruby-2.5.0 -I. -IC:\clidriver\32-bit\clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby25/lib -LC:\clidriver\32-bit\clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby250 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
18
18
  checked program was:
19
19
  /* begin */
20
20
  1: #include "ruby.h"
@@ -27,13 +27,13 @@ checked program was:
27
27
  8: }
28
28
  /* end */
29
29
 
30
- "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby26/include/ruby-2.6.0/i386-mingw32 -IC:/Ruby26/include/ruby-2.6.0/ruby/backward -IC:/Ruby26/include/ruby-2.6.0 -I. -IC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/Ruby26/lib -LC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -lmsvcrt-ruby260 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
30
+ "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25/include/ruby-2.5.0/i386-mingw32 -IC:/Ruby25/include/ruby-2.5.0/ruby/backward -IC:/Ruby25/include/ruby-2.5.0 -I. -IC:\clidriver\32-bit\clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby25/lib -LC:\clidriver\32-bit\clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby250 -ldb2cli -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
31
31
  conftest.c: In function 't':
32
- conftest.c:17:57: error: 'SQLConnect' undeclared (first use in this function); did you mean 'WSAConnect'?
33
- 17 | int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
32
+ conftest.c:16:57: error: 'SQLConnect' undeclared (first use in this function); did you mean 'WSAConnect'?
33
+ 16 | int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
34
34
  | ^~~~~~~~~~
35
35
  | WSAConnect
36
- conftest.c:17:57: note: each undeclared identifier is reported only once for each function it appears in
36
+ conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
37
37
  checked program was:
38
38
  /* begin */
39
39
  1: #include "ruby.h"
@@ -46,16 +46,15 @@ checked program was:
46
46
  8: int main(int argc, char **argv)
47
47
  9: {
48
48
  10: if (argc > 1000000) {
49
- 11: int (* volatile tp)(void)=(int (*)(void))&t;
50
- 12: printf("%d", (*tp)());
51
- 13: }
52
- 14:
53
- 15: return 0;
54
- 16: }
55
- 17: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
49
+ 11: printf("%p", &t);
50
+ 12: }
51
+ 13:
52
+ 14: return 0;
53
+ 15: }
54
+ 16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return !p; }
56
55
  /* end */
57
56
 
58
- "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby26/include/ruby-2.6.0/i386-mingw32 -IC:/Ruby26/include/ruby-2.6.0/ruby/backward -IC:/Ruby26/include/ruby-2.6.0 -I. -IC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/Ruby26/lib -LC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/lib -L. -pipe -s -lmsvcrt-ruby260 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
57
+ "i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25/include/ruby-2.5.0/i386-mingw32 -IC:/Ruby25/include/ruby-2.5.0/ruby/backward -IC:/Ruby25/include/ruby-2.5.0 -I. -IC:\clidriver\32-bit\clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby25/lib -LC:\clidriver\32-bit\clidriver/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby250 -ldb2cli -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
59
58
  checked program was:
60
59
  /* begin */
61
60
  1: #include "ruby.h"
@@ -68,42 +67,41 @@ checked program was:
68
67
  8: int main(int argc, char **argv)
69
68
  9: {
70
69
  10: if (argc > 1000000) {
71
- 11: int (* volatile tp)(void)=(int (*)(void))&t;
72
- 12: printf("%d", (*tp)());
73
- 13: }
74
- 14:
75
- 15: return 0;
76
- 16: }
77
- 17: extern void SQLConnect();
78
- 18: int t(void) { SQLConnect(); return 0; }
70
+ 11: printf("%p", &t);
71
+ 12: }
72
+ 13:
73
+ 14: return 0;
74
+ 15: }
75
+ 16: extern void SQLConnect();
76
+ 17: int t(void) { SQLConnect(); return 0; }
79
77
  /* end */
80
78
 
81
79
  --------------------
82
80
 
83
- have_header: checking for gil_release_version... -------------------- yes
81
+ have_header: checking for gil_release_version.h... -------------------- yes
84
82
 
85
- "i686-w64-mingw32-gcc -E -IC:/Ruby26/include/ruby-2.6.0/i386-mingw32 -IC:/Ruby26/include/ruby-2.6.0/ruby/backward -IC:/Ruby26/include/ruby-2.6.0 -I. -IC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -o conftest.i"
83
+ "i686-w64-mingw32-gcc -E -IC:/Ruby25/include/ruby-2.5.0/i386-mingw32 -IC:/Ruby25/include/ruby-2.5.0/ruby/backward -IC:/Ruby25/include/ruby-2.5.0 -I. -IC:\clidriver\32-bit\clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
86
84
  checked program was:
87
85
  /* begin */
88
86
  1: #include "ruby.h"
89
87
  2:
90
88
  3: #include <winsock2.h>
91
89
  4: #include <windows.h>
92
- 5: #include <gil_release_version>
90
+ 5: #include <gil_release_version.h>
93
91
  /* end */
94
92
 
95
93
  --------------------
96
94
 
97
- have_header: checking for unicode_support_version... -------------------- yes
95
+ have_header: checking for unicode_support_version.h... -------------------- yes
98
96
 
99
- "i686-w64-mingw32-gcc -E -IC:/Ruby26/include/ruby-2.6.0/i386-mingw32 -IC:/Ruby26/include/ruby-2.6.0/ruby/backward -IC:/Ruby26/include/ruby-2.6.0 -I. -IC:/Ruby_WORK/ruby-ibmdb/IBM_DB_Adapter/ibm_db/ext/../lib/clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -o conftest.i"
97
+ "i686-w64-mingw32-gcc -E -IC:/Ruby25/include/ruby-2.5.0/i386-mingw32 -IC:/Ruby25/include/ruby-2.5.0/ruby/backward -IC:/Ruby25/include/ruby-2.5.0 -I. -IC:\clidriver\32-bit\clidriver/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
100
98
  checked program was:
101
99
  /* begin */
102
100
  1: #include "ruby.h"
103
101
  2:
104
102
  3: #include <winsock2.h>
105
103
  4: #include <windows.h>
106
- 5: #include <unicode_support_version>
104
+ 5: #include <unicode_support_version.h>
107
105
  /* end */
108
106
 
109
107
  --------------------
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