do_mysql 0.10.7 → 0.10.8

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.8 2012-02-10
2
+
3
+ * Ruby 1.9.3 compatibility on Windows
4
+
1
5
  ## 0.10.7 2011-10-13
2
6
 
3
7
  * Ruby 1.9.3 compatibility
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ JRUBY = RUBY_PLATFORM =~ /java/
15
15
  IRONRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby'
16
16
  WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
17
17
  SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
18
- BINARY_VERSION = '5.1.56'
18
+ BINARY_VERSION = '5.1.60'
19
19
 
20
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 ])
21
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,16 +185,7 @@ VALUE data_objects_parse_date(const char *date) {
185
185
  return Qnil;
186
186
  }
187
187
 
188
- #ifdef HAVE_NO_DATETIME_NEWBANG
189
188
  return rb_funcall(rb_cDate, ID_NEW, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
190
- #else
191
-
192
- jd = data_objects_jd_from_date(year, month, day);
193
- ajd = (jd * 2) - 1; // Math from Date.jd_to_ajd
194
- rational = rb_funcall(rb_mKernel, ID_RATIONAL, 2, INT2NUM(ajd), INT2NUM(2));
195
-
196
- return rb_funcall(rb_cDate, ID_NEW_DATE, 3, rational, INT2NUM(0), INT2NUM(2299161));
197
- #endif
198
189
  }
199
190
 
200
191
  VALUE data_objects_parse_time(const char *date) {
@@ -224,10 +215,9 @@ VALUE data_objects_parse_date_time(const char *date) {
224
215
  int tokens_read;
225
216
  const char *fmt_datetime;
226
217
 
227
- VALUE ajd, offset;
218
+ VALUE offset;
228
219
 
229
- int year, month, day, hour, min, sec, hour_offset, minute_offset, jd;
230
- do_int64 num, den;
220
+ int year, month, day, hour, min, sec, hour_offset, minute_offset;
231
221
 
232
222
  struct tm timeinfo;
233
223
  time_t target_time;
@@ -304,40 +294,9 @@ VALUE data_objects_parse_date_time(const char *date) {
304
294
  rb_raise(eDataError, "Couldn't parse date: %s", date);
305
295
  }
306
296
 
307
- #ifdef HAVE_NO_DATETIME_NEWBANG
308
297
  offset = data_objects_timezone_to_offset(hour_offset, minute_offset);
309
298
  return rb_funcall(rb_cDateTime, ID_NEW, 7, INT2NUM(year), INT2NUM(month), INT2NUM(day),
310
299
  INT2NUM(hour), INT2NUM(min), INT2NUM(sec), offset);
311
- #else
312
- jd = data_objects_jd_from_date(year, month, day);
313
-
314
- /*
315
- * Generate ajd with fractional days for the time.
316
- * Extracted from Date#jd_to_ajd, Date#day_fraction_to_time, and Rational#+ and #-.
317
- *
318
- * TODO: These are 64bit numbers; is reduce() really necessary?
319
- */
320
-
321
- num = (hour * 1440) + (min * 24);
322
- num -= (hour_offset * 1440) + (minute_offset * 24);
323
- den = (24 * 1440);
324
- data_objects_reduce(&num, &den);
325
-
326
- num = (num * 86400) + (sec * den);
327
- den = den * 86400;
328
- data_objects_reduce(&num, &den);
329
-
330
- num += jd * den;
331
-
332
- num = (num * 2) - den;
333
- den *= 2;
334
- data_objects_reduce(&num, &den);
335
-
336
- ajd = rb_funcall(rb_mKernel, ID_RATIONAL, 2, rb_ull2inum(num), rb_ull2inum(den));
337
- offset = data_objects_timezone_to_offset(hour_offset, minute_offset);
338
-
339
- return rb_funcall(rb_cDateTime, ID_NEW_DATE, 3, ajd, offset, INT2NUM(2299161));
340
- #endif
341
300
  }
342
301
 
343
302
  VALUE data_objects_cConnection_character_set(VALUE self) {
@@ -371,17 +330,15 @@ VALUE data_objects_cConnection_quote_date(VALUE self, VALUE value) {
371
330
  * into Ruby-strings so we can easily typecast later
372
331
  */
373
332
  VALUE data_objects_cCommand_set_types(int argc, VALUE *argv, VALUE self) {
333
+ VALUE entry, sub_entry;
334
+ int i, j;
374
335
  VALUE type_strings = rb_ary_new();
375
336
  VALUE array = rb_ary_new();
376
337
 
377
- int i, j;
378
-
379
338
  for (i = 0; i < argc; i++) {
380
339
  rb_ary_push(array, argv[i]);
381
340
  }
382
341
 
383
- VALUE entry, sub_entry;
384
-
385
342
  for (i = 0; i < RARRAY_LEN(array); i++) {
386
343
  entry = rb_ary_entry(array, i);
387
344
 
@@ -497,7 +497,7 @@ VALUE do_mysql_cCommand_execute_reader(int argc, VALUE *argv, VALUE self) {
497
497
  VALUE mysql_connection = rb_iv_get(connection, "@connection");
498
498
 
499
499
  if (mysql_connection == Qnil) {
500
- rb_raise(eConnectionError, "This connection has already been closed.");
500
+ rb_raise(eConnectionError, "This result set has already been closed.");
501
501
  }
502
502
 
503
503
  VALUE query = data_objects_build_query_from_args(self, argc, argv);
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Mysql
3
- VERSION = '0.10.7'
3
+ VERSION = '0.10.8'
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.7'
59
+ gem.add_dependency 'do_jdbc', '0.10.8'
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,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do_mysql
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 39
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 10
9
- - 7
10
- version: 0.10.7
9
+ - 8
10
+ version: 0.10.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dirkjan Bussink
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - "="
27
27
  - !ruby/object:Gem::Version
28
- hash: 57
28
+ hash: 39
29
29
  segments:
30
30
  - 0
31
31
  - 10
32
- - 7
33
- version: 0.10.7
32
+ - 8
33
+ version: 0.10.8
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements: []
145
145
 
146
146
  rubyforge_project: dorb
147
- rubygems_version: 1.8.6
147
+ rubygems_version: 1.8.14
148
148
  signing_key:
149
149
  specification_version: 3
150
150
  summary: DataObjects MySQL Driver