From 0f5cb7f673f729d3074fad5a4a97f4b697b0a47f Mon Sep 17 00:00:00 2001 From: aredridel Date: Tue, 27 Sep 2005 00:28:18 +0000 Subject: [PATCH] - added Changed files: mysql-ruby-amd64.patch -> 1.1 --- mysql-ruby-amd64.patch | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 mysql-ruby-amd64.patch diff --git a/mysql-ruby-amd64.patch b/mysql-ruby-amd64.patch new file mode 100644 index 0000000..23f9591 --- /dev/null +++ b/mysql-ruby-amd64.patch @@ -0,0 +1,67 @@ +Index: mysql.c.in +=================================================================== +--- mysql.c.in.orig ++++ mysql.c.in +@@ -1362,6 +1362,7 @@ static VALUE stmt_execute(int argc, VALU + t.day = FIX2INT(RARRAY(a)->ptr[3]); + t.month = FIX2INT(RARRAY(a)->ptr[4]); + t.year = FIX2INT(RARRAY(a)->ptr[5]); ++ t.time_type = MYSQL_TYPE_DATETIME; + *(MYSQL_TIME*)&(s->param.buffer[i]) = t; + } else if (CLASS_OF(argv[i]) == cMysqlTime) { + MYSQL_TIME t; +@@ -1375,6 +1376,7 @@ static VALUE stmt_execute(int argc, VALU + t.day = NUM2INT(rb_iv_get(argv[i], "day")); + t.month = NUM2INT(rb_iv_get(argv[i], "month")); + t.year = NUM2INT(rb_iv_get(argv[i], "year")); ++ t.time_type = MYSQL_TYPE_DATETIME; + *(MYSQL_TIME*)&(s->param.buffer[i]) = t; + } else + rb_raise(rb_eTypeError, "unsupported type: %d", TYPE(argv[i])); +@@ -1700,31 +1702,32 @@ static VALUE time_initialize(int argc, V + rb_iv_set(obj, "second", NILorFIXvalue(second)); + rb_iv_set(obj, "neg", (neg == Qnil || neg == Qfalse) ? Qfalse : Qtrue); + rb_iv_set(obj, "second_part", NILorFIXvalue(second_part)); ++ return obj; + } + + static VALUE time_inspect(VALUE obj) + { + char buf[36]; +- sprintf(buf, "#", +- NUM2INT(rb_iv_get(obj, "year")), +- NUM2INT(rb_iv_get(obj, "month")), +- NUM2INT(rb_iv_get(obj, "day")), +- NUM2INT(rb_iv_get(obj, "hour")), +- NUM2INT(rb_iv_get(obj, "minute")), +- NUM2INT(rb_iv_get(obj, "second"))); ++ sprintf(buf, "#", ++ NUM2LONG(rb_iv_get(obj, "year")), ++ NUM2LONG(rb_iv_get(obj, "month")), ++ NUM2LONG(rb_iv_get(obj, "day")), ++ NUM2LONG(rb_iv_get(obj, "hour")), ++ NUM2LONG(rb_iv_get(obj, "minute")), ++ NUM2LONG(rb_iv_get(obj, "second"))); + return rb_str_new2(buf); + } + + static VALUE time_to_s(VALUE obj) + { + char buf[20]; +- sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d", +- NUM2INT(rb_iv_get(obj, "year")), +- NUM2INT(rb_iv_get(obj, "month")), +- NUM2INT(rb_iv_get(obj, "day")), +- NUM2INT(rb_iv_get(obj, "hour")), +- NUM2INT(rb_iv_get(obj, "minute")), +- NUM2INT(rb_iv_get(obj, "second"))); ++ sprintf(buf, "%04ld-%02ld-%02ld %02ld:%02ld:%02ld", ++ NUM2LONG(rb_iv_get(obj, "year")), ++ NUM2LONG(rb_iv_get(obj, "month")), ++ NUM2LONG(rb_iv_get(obj, "day")), ++ NUM2LONG(rb_iv_get(obj, "hour")), ++ NUM2LONG(rb_iv_get(obj, "minute")), ++ NUM2LONG(rb_iv_get(obj, "second"))); + return rb_str_new2(buf); + } + -- 2.44.0