do_mysql 0.10.6-x86-mingw32 → 0.10.7-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.10.7 2011-10-13
2
+
3
+ * Ruby 1.9.3 compatibility
4
+
1
5
  ## 0.10.6 2011-05-22
2
6
 
3
7
  Bugfixes
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'pathname'
2
2
  require 'rubygems'
3
3
  require 'bundler'
4
+ require 'rubygems/package_task'
4
5
  Bundler::GemHelper.install_tasks
5
6
 
6
7
  require 'rake'
@@ -14,7 +15,7 @@ JRUBY = RUBY_PLATFORM =~ /java/
14
15
  IRONRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby'
15
16
  WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
16
17
  SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
17
- BINARY_VERSION = '5.1.56'
18
+ BINARY_VERSION = '5.1.60'
18
19
 
19
20
  CLEAN.include(%w[ {tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext/do_mysql/Makefile ext-java/target ])
20
21
 
@@ -53,9 +53,10 @@ VALUE data_objects_const_get(VALUE scope, const char *constant) {
53
53
  void data_objects_debug(VALUE connection, VALUE string, struct timeval *start) {
54
54
  struct timeval stop;
55
55
  VALUE message;
56
+ do_int64 duration;
56
57
 
57
58
  gettimeofday(&stop, NULL);
58
- do_int64 duration = (stop.tv_sec - start->tv_sec) * 1000000 + stop.tv_usec - start->tv_usec;
59
+ duration = (stop.tv_sec - start->tv_sec) * 1000000 + stop.tv_usec - start->tv_usec;
59
60
 
60
61
  message = rb_funcall(cDO_Logger_Message, ID_NEW, 3, string, rb_time_new(start->tv_sec, start->tv_usec), INT2NUM(duration));
61
62
 
@@ -65,6 +66,7 @@ void data_objects_debug(VALUE connection, VALUE string, struct timeval *start) {
65
66
  void data_objects_raise_error(VALUE self, const struct errcodes *errors, int errnum, const char *message, VALUE query, VALUE state) {
66
67
  const char *exception_type = "SQLError";
67
68
  const struct errcodes *e;
69
+ VALUE uri, exception;
68
70
 
69
71
  for (e = errors; e->error_name; e++) {
70
72
  if (e->error_no == errnum) {
@@ -74,9 +76,9 @@ void data_objects_raise_error(VALUE self, const struct errcodes *errors, int err
74
76
  }
75
77
  }
76
78
 
77
- VALUE uri = rb_funcall(rb_iv_get(self, "@connection"), rb_intern("to_s"), 0);
79
+ uri = rb_funcall(rb_iv_get(self, "@connection"), rb_intern("to_s"), 0);
78
80
 
79
- VALUE exception = rb_funcall(
81
+ exception = rb_funcall(
80
82
  data_objects_const_get(mDO, exception_type),
81
83
  ID_NEW,
82
84
  5,
@@ -116,8 +118,8 @@ void data_objects_assert_file_exists(char *file, const char *message) {
116
118
  }
117
119
 
118
120
  VALUE data_objects_build_query_from_args(VALUE klass, int count, VALUE *args) {
119
- VALUE array = rb_ary_new();
120
121
  int i;
122
+ VALUE array = rb_ary_new();
121
123
 
122
124
  for (i = 0; i < count; i++) {
123
125
  rb_ary_push(array, args[i]);
@@ -176,8 +178,6 @@ VALUE data_objects_timezone_to_offset(int hour_offset, int minute_offset) {
176
178
  VALUE data_objects_parse_date(const char *date) {
177
179
  static char const *const _fmt_date = "%4d-%2d-%2d";
178
180
  int year = 0, month = 0, day = 0;
179
- int jd, ajd;
180
- VALUE rational;
181
181
 
182
182
  switch (sscanf(date, _fmt_date, &year, &month, &day)) {
183
183
  case 0:
@@ -185,11 +185,7 @@ VALUE data_objects_parse_date(const char *date) {
185
185
  return Qnil;
186
186
  }
187
187
 
188
- jd = data_objects_jd_from_date(year, month, day);
189
- ajd = (jd * 2) - 1; // Math from Date.jd_to_ajd
190
- rational = rb_funcall(rb_mKernel, ID_RATIONAL, 2, INT2NUM(ajd), INT2NUM(2));
191
-
192
- return rb_funcall(rb_cDate, ID_NEW_DATE, 3, rational, INT2NUM(0), INT2NUM(2299161));
188
+ return rb_funcall(rb_cDate, ID_NEW, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
193
189
  }
194
190
 
195
191
  VALUE data_objects_parse_time(const char *date) {
@@ -219,10 +215,9 @@ VALUE data_objects_parse_date_time(const char *date) {
219
215
  int tokens_read;
220
216
  const char *fmt_datetime;
221
217
 
222
- VALUE ajd, offset;
218
+ VALUE offset;
223
219
 
224
- int year, month, day, hour, min, sec, hour_offset, minute_offset, jd;
225
- do_int64 num, den;
220
+ int year, month, day, hour, min, sec, hour_offset, minute_offset;
226
221
 
227
222
  struct tm timeinfo;
228
223
  time_t target_time;
@@ -299,34 +294,9 @@ VALUE data_objects_parse_date_time(const char *date) {
299
294
  rb_raise(eDataError, "Couldn't parse date: %s", date);
300
295
  }
301
296
 
302
- jd = data_objects_jd_from_date(year, month, day);
303
-
304
- /*
305
- * Generate ajd with fractional days for the time.
306
- * Extracted from Date#jd_to_ajd, Date#day_fraction_to_time, and Rational#+ and #-.
307
- *
308
- * TODO: These are 64bit numbers; is reduce() really necessary?
309
- */
310
-
311
- num = (hour * 1440) + (min * 24);
312
- num -= (hour_offset * 1440) + (minute_offset * 24);
313
- den = (24 * 1440);
314
- data_objects_reduce(&num, &den);
315
-
316
- num = (num * 86400) + (sec * den);
317
- den = den * 86400;
318
- data_objects_reduce(&num, &den);
319
-
320
- num += jd * den;
321
-
322
- num = (num * 2) - den;
323
- den *= 2;
324
- data_objects_reduce(&num, &den);
325
-
326
- ajd = rb_funcall(rb_mKernel, ID_RATIONAL, 2, rb_ull2inum(num), rb_ull2inum(den));
327
297
  offset = data_objects_timezone_to_offset(hour_offset, minute_offset);
328
-
329
- return rb_funcall(rb_cDateTime, ID_NEW_DATE, 3, ajd, offset, INT2NUM(2299161));
298
+ return rb_funcall(rb_cDateTime, ID_NEW, 7, INT2NUM(year), INT2NUM(month), INT2NUM(day),
299
+ INT2NUM(hour), INT2NUM(min), INT2NUM(sec), offset);
330
300
  }
331
301
 
332
302
  VALUE data_objects_cConnection_character_set(VALUE self) {
@@ -360,17 +330,15 @@ VALUE data_objects_cConnection_quote_date(VALUE self, VALUE value) {
360
330
  * into Ruby-strings so we can easily typecast later
361
331
  */
362
332
  VALUE data_objects_cCommand_set_types(int argc, VALUE *argv, VALUE self) {
333
+ VALUE entry, sub_entry;
334
+ int i, j;
363
335
  VALUE type_strings = rb_ary_new();
364
336
  VALUE array = rb_ary_new();
365
337
 
366
- int i, j;
367
-
368
338
  for (i = 0; i < argc; i++) {
369
339
  rb_ary_push(array, argv[i]);
370
340
  }
371
341
 
372
- VALUE entry, sub_entry;
373
-
374
342
  for (i = 0; i < RARRAY_LEN(array); i++) {
375
343
  entry = rb_ary_entry(array, i);
376
344
 
@@ -1,6 +1,7 @@
1
1
  ENV["RC_ARCHS"] = "" if RUBY_PLATFORM =~ /darwin/
2
2
 
3
3
  require 'mkmf'
4
+ require 'date'
4
5
 
5
6
  # Allow for custom compiler to be specified.
6
7
  RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
@@ -81,6 +82,10 @@ have_func 'mysql_set_character_set', 'mysql.h'
81
82
  have_func 'mysql_get_server_version', 'mysql.h'
82
83
  have_struct_member 'MYSQL_FIELD', 'charsetnr', 'mysql.h'
83
84
 
85
+ unless DateTime.respond_to?(:new!)
86
+ $CFLAGS << ' -DHAVE_NO_DATETIME_NEWBANG'
87
+ end
88
+
84
89
  $CFLAGS << ' -Wall '
85
90
 
86
91
  if RUBY_VERSION < '1.8.6'
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Mysql
3
- VERSION = '0.10.6'
3
+ VERSION = '0.10.7'
4
4
  end
5
5
  end
data/tasks/compile.rake CHANGED
@@ -56,7 +56,7 @@ begin
56
56
  ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar'
57
57
  ext.java_compiling do |gem|
58
58
  gem.add_dependency 'jdbc-mysql', '>=5.0.4'
59
- gem.add_dependency 'do_jdbc', '0.10.6'
59
+ gem.add_dependency 'do_jdbc', '0.10.7'
60
60
  end
61
61
  end
62
62
  rescue LoadError
data/tasks/spec.rake CHANGED
@@ -2,7 +2,6 @@ require 'rspec/core/rake_task'
2
2
 
3
3
  RSpec::Core::RakeTask.new(:spec => [:clean, :compile]) do |spec|
4
4
  spec.pattern = './spec/**/*_spec.rb'
5
- spec.skip_bundler = true
6
5
  end
7
6
 
8
7
  RSpec::Core::RakeTask.new(:rcov => [:clean, :compile]) do |rcov|
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do_mysql
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 10
9
- - 6
10
- version: 0.10.6
8
+ - 7
9
+ version: 0.10.7
11
10
  platform: x86-mingw32
12
11
  authors:
13
12
  - Dirkjan Bussink
@@ -19,51 +18,45 @@ date: 2011-03-29 00:00:00 +02:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
22
  type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
23
+ name: data_objects
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "="
27
27
  - !ruby/object:Gem::Version
28
- hash: 59
29
28
  segments:
30
29
  - 0
31
30
  - 10
32
- - 6
33
- version: 0.10.6
34
- name: data_objects
35
- version_requirements: *id001
36
- prerelease: false
31
+ - 7
32
+ version: 0.10.7
33
+ requirement: *id001
37
34
  - !ruby/object:Gem::Dependency
35
+ prerelease: false
38
36
  type: :development
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
37
+ name: rspec
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
39
  requirements:
42
40
  - - ~>
43
41
  - !ruby/object:Gem::Version
44
- hash: 9
45
42
  segments:
46
43
  - 2
47
44
  - 5
48
45
  version: "2.5"
49
- name: rspec
50
- version_requirements: *id002
51
- prerelease: false
46
+ requirement: *id002
52
47
  - !ruby/object:Gem::Dependency
48
+ prerelease: false
53
49
  type: :development
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
50
+ name: rake-compiler
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
52
  requirements:
57
53
  - - ~>
58
54
  - !ruby/object:Gem::Version
59
- hash: 5
60
55
  segments:
61
56
  - 0
62
57
  - 7
63
58
  version: "0.7"
64
- name: rake-compiler
65
- version_requirements: *id003
66
- prerelease: false
59
+ requirement: *id003
67
60
  description: Implements the DataObjects API for MySQL
68
61
  email: d.bussink@gmail.com
69
62
  executables: []
@@ -127,13 +120,13 @@ post_install_message: |+
127
120
  ======================================================================================================
128
121
 
129
122
  You've installed the binary version of do_mysql.
130
- It was built using MySQL version 5.1.56.
123
+ It was built using MySQL version 5.1.60.
131
124
  It's recommended to use the exact same version to avoid potential issues.
132
125
 
133
126
  At the time of building this gem, the necessary DLL files where available
134
127
  in the following download:
135
128
 
136
- http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-noinstall-5.1.56-win32.zip/from/pick
129
+ http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-noinstall-5.1.60-win32.zip/from/pick
137
130
 
138
131
  You can put the lib\opt\libmysql.dll available in this package in your Ruby bin
139
132
  directory, for example C:\Ruby\bin
@@ -145,27 +138,23 @@ rdoc_options: []
145
138
  require_paths:
146
139
  - lib
147
140
  required_ruby_version: !ruby/object:Gem::Requirement
148
- none: false
149
141
  requirements:
150
142
  - - ">="
151
143
  - !ruby/object:Gem::Version
152
- hash: 3
153
144
  segments:
154
145
  - 0
155
146
  version: "0"
156
147
  required_rubygems_version: !ruby/object:Gem::Requirement
157
- none: false
158
148
  requirements:
159
149
  - - ">="
160
150
  - !ruby/object:Gem::Version
161
- hash: 3
162
151
  segments:
163
152
  - 0
164
153
  version: "0"
165
154
  requirements: []
166
155
 
167
156
  rubyforge_project: dorb
168
- rubygems_version: 1.5.2
157
+ rubygems_version: 1.3.6
169
158
  signing_key:
170
159
  specification_version: 3
171
160
  summary: DataObjects MySQL Driver