debian/0000755000000000000000000000000012261117532007166 5ustar debian/mysql-2.8.2.gemspec0000644000000000000000000000273712133040011012337 0ustar # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "mysql" s.version = "2.8.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["TOMITA Masahiro"] s.date = "2009-08-21" s.description = "This is the MySQL API module for Ruby. It provides the same functions for Ruby\nprograms that the MySQL C API provides for C programs.\n\nThis is a conversion of tmtm's original extension into a proper RubyGems." s.email = ["tommy@tmtm.org"] s.extensions = ["extconf.rb"] s.extra_rdoc_files = ["README.html"] s.files = ["mysql.c", "README_ja.html", "COPYING", "README.html", "tommy.css", "test.rb", "extconf.rb", "COPYING.ja"] s.homepage = "http://mysql-win.rubyforge.org" s.rdoc_options = ["--main", "README.txt"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.6") s.rubygems_version = "1.8.23" s.summary = "This is the MySQL API module for Ruby" s.test_files = ["test/test_mysql.rb"] if s.respond_to? :specification_version then s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_development_dependency(%q, ["~> 0.5"]) s.add_development_dependency(%q, [">= 2.3.3"]) else s.add_dependency(%q, ["~> 0.5"]) s.add_dependency(%q, [">= 2.3.3"]) end else s.add_dependency(%q, ["~> 0.5"]) s.add_dependency(%q, [">= 2.3.3"]) end end debian/copyright0000644000000000000000000000747412152655505011143 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: MySQL/Ruby Source: http://www.tmtm.org/downloads/mysql/ruby/ Files: * Copyright: Copyright (C) 1999 by TOMITA MASAHIRO License: Ruby or GPL-2 Files: debian/* Copyright: Copyright 2003-2011 Dmitry Borodaenko License: GPL-2+ License: Ruby Ruby is copyrighted free software by Yukihiro Matsumoto . You can redistribute it and/or modify it under either the terms of the GPL (see the file GPL), or the conditions below: . 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or binary form, provided that you do at least ONE of the following: . a) distribute the binaries and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under these terms. . For the list of those files and their copying conditions, see the file LEGAL. . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. License: GPL-2 The files hereby included are free software; you can distribute them under the terms of the GNU General Public License as published by the Free Software Foundation; under version 2 of the License as published in June 1991. . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: GPL-2+ The files hereby included are free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/rules0000755000000000000000000000071712133040011010234 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) export DH_RUBY_GEMSPEC=debian/mysql-2.8.2.gemspec %: dh $@ --buildsystem=ruby --with ruby debian/source/0000755000000000000000000000000012261116772010473 5ustar debian/source/format0000644000000000000000000000001412133040011011655 0ustar 3.0 (quilt) debian/ruby-mysql.docs0000644000000000000000000000004512133040011012144 0ustar README.html README_ja.html tommy.css debian/control0000644000000000000000000000146712261116706010603 0ustar Source: ruby-mysql Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Dmitry Borodaenko Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~), libmysqlclient-dev Standards-Version: 3.9.5 Homepage: http://www.tmtm.org/en/mysql/ XS-Ruby-Versions: all Package: ruby-mysql Architecture: any XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Description: MySQL module for Ruby This is an API module that allows Ruby programs to interface with MySQL databases. Usually, it will be pulled in automatically by packages providing Ruby programs which need this capability, you only need to install it directly if you intend to write such programs yourself. debian/watch0000644000000000000000000000015612133040011010202 0ustar version=3 opts=dversionmangle=s/\+gem2deb// \ http://tmtm.org/downloads/mysql/ruby/mysql-ruby-(.*)\.tar\.gz debian/changelog0000644000000000000000000002544512261117515011053 0ustar ruby-mysql (2.8.2+gem2deb-4) unstable; urgency=medium * Team upload. [ Cédric Boutillier ] * debian/control: remove obsolete DM-Upload-Allowed flag * debian/copyright: use DEP5 copyright-format/1.0 official URL for Format field [ Christian Hofstaedtler ] * Remove transitional packages * Bump Standards-Version to 3.9.5 (no changes) * Rebuild, to pick up ruby2.0 support. -- Christian Hofstaedtler Thu, 02 Jan 2014 00:00:53 +0100 ruby-mysql (2.8.2+gem2deb-3) unstable; urgency=low * Team upload. * debian/patches/add-basic-encoding-awareness-logic.patch: convert all string data to the default external encoding. This makes it possible to use the mysql bindings with RUby 1.9 and UTF-8 (Closes: #678515) -- Antonio Terceiro Sat, 11 Aug 2012 22:09:35 -0300 ruby-mysql (2.8.2+gem2deb-2) unstable; urgency=low * Team upload. * Bump build dependency on gem2deb to >= 0.3.0~. * Add gemspec extracted from rubygems.org -- Antonio Terceiro Sat, 30 Jun 2012 08:29:40 -0300 ruby-mysql (2.8.2+gem2deb-1) unstable; urgency=low * Switch to gem2deb-based packaging: - source and binary packages renamed to ruby-mysql - transitional packages added - source format changed to 3.0 (quilt). -- Dmitry Borodaenko Wed, 07 Sep 2011 18:30:53 +0300 mysql-ruby (2.8.2-1) unstable; urgency=low * New upstream version. * Acknowledged NMU by Lucas Nussbaum. Closes: #565846. * Standards-Version updated to 3.8.4: - changed Section from interpreters to ruby - debhelper compat level upgraded to 5. * Build against libmysqlclient-dev. -- Dmitry Borodaenko Sun, 28 Feb 2010 13:42:04 +0200 mysql-ruby (2.8.1-1.1) unstable; urgency=low * Non-maintainer upload. * Switch from Ruby 1.9 to 1.9.1. Closes: #565846. -- Lucas Nussbaum Sat, 13 Feb 2010 11:03:54 +0100 mysql-ruby (2.8.1-1) unstable; urgency=low * New upstream version. * Upload to unstable. -- Dmitry Borodaenko Sat, 21 Feb 2009 12:17:31 +0200 mysql-ruby (2.8~pre4-2) experimental; urgency=low * Add build-depends on ruby1.9 and ruby1.9-dev (Closes: #489744). -- Dmitry Borodaenko Tue, 08 Jul 2008 14:35:10 +0300 mysql-ruby (2.8~pre4-1) experimental; urgency=low * New upstream version. * Updated to Standards-Version 3.8.0: - Homepage: field added to control file. * Build a Ruby 1.9 module in libmysql-ruby1.9. -- Dmitry Borodaenko Thu, 03 Jul 2008 14:23:58 +0300 mysql-ruby (2.7.4-1) unstable; urgency=low * New upstream version. -- Dmitry Borodaenko Sun, 25 Nov 2007 12:47:52 +0000 mysql-ruby (2.7.3-1) unstable; urgency=low * New upstream version (Closes: #404327). -- Dmitry Borodaenko Sun, 24 Dec 2006 14:33:48 +0000 mysql-ruby (2.7.1-1) unstable; urgency=low * New upstream version: - unit tests updated, more upstream tests fixed (Closes: #369972). * Put test.rb in examples in binary package. * Acknowledging NMU, thanks Matej Vela. Closes: #356580. * Bumped Standards-Version to 3.7.2. -- Dmitry Borodaenko Mon, 04 Sep 2006 16:31:29 +0100 mysql-ruby (2.7-1.1) unstable; urgency=medium * Non-maintainer upload. * Build against libmysqlclient15. Closes: #356580. -- Matej Vela Tue, 21 Mar 2006 13:50:11 +0100 mysql-ruby (2.7-1) unstable; urgency=low * New upstream version. * Build against libmysqlclient14-dev (same reason as 2.4.5-6.1). Closes: #328048. * Updated debian/watch file. -- Dmitry Borodaenko Thu, 06 Oct 2005 19:54:22 +0300 mysql-ruby (2.6.3-1) unstable; urgency=low * New upstream version. Closes: #276719. * Acknowledged NMU by Steve Langasek. Closes: #299166. * Removed ruby1.6 version of the library due to pending removal of ruby1.6. * Fixed a glitch in copyright file. * Removed obsolete examples and tomito-extconf.rb patch. -- Dmitry Borodaenko Fri, 19 Aug 2005 14:50:10 +0300 mysql-ruby (2.4.5-6.1) unstable; urgency=high * Non-maintainer upload. * High-urgency upload for sarge-targetted RC bugfix. * Rebuild against libmysqlclient12-dev instead of libmysqlclient10-dev, for compatibility with newer servers and to avoid segfaults when other mysql-using apache modules are loaded together with mod-ruby (closes: #299166). -- Steve Langasek Fri, 18 Mar 2005 01:43:13 -0800 mysql-ruby (2.4.5-6) unstable; urgency=low * Minor connection setting bugfix by Andres Salomon. Closes: #277361. -- Dmitry Borodaenko Thu, 21 Oct 2004 14:40:27 +0300 mysql-ruby (2.4.5-5) unstable; urgency=low * Acknowledged NMU by Andres Salomon. Closes: #268249. * Updated debian/watch file. -- Dmitry Borodaenko Fri, 3 Sep 2004 15:36:08 +0300 mysql-ruby (2.4.5-4.1) unstable; urgency=high * NMU * Link against libmysqlclient10 instead of libmysqlclient12, since libmysqlclient12 has unresolved license issues that are forcing us to stay w/ the older version for now (closes: #268249). -- Andres Salomon Thu, 26 Aug 2004 17:07:09 -0400 mysql-ruby (2.4.5-4) unstable; urgency=low * Build architecture-independent packages (dummy libmysql-ruby) in binary-indep target of debian/rules. Closes: #214609 -- Dmitry Borodaenko Tue, 7 Oct 2003 21:25:53 +0300 mysql-ruby (2.4.5-3) unstable; urgency=low * Updated libmysql-ruby to depend on libmysql-ruby1.8, since Ruby 1.8 is now the default. * Updated debian/copyright to include text of the Ruby license, since mysql-ruby is under Ruby license, not only under GPL. -- Dmitry Borodaenko Tue, 7 Oct 2003 12:35:05 +0300 mysql-ruby (2.4.5-2) unstable; urgency=low * New maintainer. * Adapted to the Debian Ruby Policy. * Removed binary dependency on ruby (DRP 2.2). * Reshuffled debian/rules to build separate packages for Ruby 1.6 and Ruby 1.8; build-depend on ruby1.6, ruby1.6-dev, ruby1.8, and ruby1.8-dev. Closes: #210493 * Removed redundant build-depends on perl and zlib1g-dev (pulled in by debhelper and libmysqlclient-dev). * Expanded description. * Remove generated files on clean. -- Dmitry Borodaenko Fri, 12 Sep 2003 14:54:20 +0300 mysql-ruby (2.4.5-1) unstable; urgency=low * New upstream release (needed for MySQL 4.1, I think) * Enlarged package description. Closes: #209812 * Rebuild against Ruby-1.8. -- Christian Hammers Thu, 11 Sep 2003 19:03:07 +0200 mysql-ruby (2.4.4-2) unstable; urgency=low * Recompiled against sarge due to suboptimal sid dependencies. -- Christian Hammers Mon, 17 Feb 2003 19:57:03 +0100 mysql-ruby (2.4.4-1) unstable; urgency=low * New upstream version. -- Christian Hammers Sat, 1 Feb 2003 00:24:41 +0100 mysql-ruby (2.4.3-2) unstable; urgency=low * Upstream author send me a fix for the annoying "already initialized" warnings. Closes: #164445 -- Christian Hammers Thu, 7 Nov 2002 10:07:08 +0100 mysql-ruby (2.4.3-1) unstable; urgency=low * New upstream release -- Christian Hammers Tue, 17 Sep 2002 21:58:02 +0200 mysql-ruby (2.4.2a-1) unstable; urgency=low * New upstream release * Corrected examples directory name. Closes: #151140 -- Christian Hammers Sun, 30 Jun 2002 18:17:31 +0200 mysql-ruby (2.3.1-2) unstable; urgency=low * Added builddep for zlib1g-dev. Closes: #123747 -- Christian Hammers Thu, 13 Dec 2001 21:57:06 +0100 mysql-ruby (2.3.1-1) unstable; urgency=low * New upstream release * Now works with ruby-1.6. Closes: #89143 -- Christian Hammers Sat, 10 Mar 2001 16:39:25 +0100 mysql-ruby (2.2.0-7) unstable; urgency=low * Changed architecture to all. Thanks for the help, chris@debian.org! -- Christian Hammers Wed, 18 Oct 2000 10:18:04 +0200 mysql-ruby (2.2.0-6) unstable; urgency=low * Recompiled against libmysqlclient10. -- Christian Hammers Tue, 17 Oct 2000 12:00:04 +0200 mysql-ruby (2.2.0-5) unstable; urgency=low * Recompiled for libmysqlclient9. * Added build dependencies. -- Christian Hammers Sun, 30 Jul 2000 17:00:44 +0200 mysql-ruby (2.2.0-4) unstable; urgency=low * Added some example scripts. -- Christian Hammers Mon, 10 Jan 2000 22:20:04 +0100 mysql-ruby (2.2.0-3) unstable; urgency=low * This package was debianized by Murakami Takeshi of the Debian-JP project. As he is not yet an approved Debian maintainer I will upload his packages after reviewing and appoval. -- Christian Hammers Mon, 10 Jan 2000 22:19:59 +0100 mysql-ruby (2.2.0-2) unstable; urgency=low * add ruby to Depends: * fixed: forgot README.jp -- Takeshi Murakami Tue, 19 Oct 1999 09:26:06 +0900 mysql-ruby (2.2.0-1) unstable; urgency=low * new upstream -- takeshi Sat, 16 Oct 1999 13:28:24 +0900 mysql-ruby (2.1.6-1) unstable; urgency=low * potato, ruby-1.4.2 -- takeshi Fri, 24 Sep 1999 11:19:36 +0900 mysql-ruby (2.1.6-0bo) unstable; urgency=low * Sorry, name is crossed. * CHANGE name to libmysql-ruby * compile with ruby-1.4.2 & mysql-3.22.26a -- takeshi Tue, 21 Sep 1999 11:19:36 +0900 mysql-ruby (2.1.6-0bo) unstable; urgency=low * upstream * CHANGE name to libruby-mysql * compile with ruby-1.4.0 & mysql-3.22.25 -- takeshi Thu, 9 Sep 1999 11:19:36 +0900 ruby-mysql (2.1.2-0bo) unstable; urgency=low * upstream * compile with ruby-1.2.2 & mysql-3.22.15 -- takeshi Mon, 1 Feb 1999 11:19:36 +0900 ruby-mysql (2.1.1-0bo) unstable; urgency=low * upstream * compile with ruby-1.2.2 & mysql-3.22.14 -- takeshi Mon, 25 Jan 1999 11:19:36 +0900 ruby-mysql (2.1-0bo) unstable; urgency=low * upstream * compile with ruby-1.2.1 & mysql-3.22.14 -- takeshi Mon, 18 Jan 1999 11:19:36 +0900 ruby-mysql (2.0-0bo.1) unstable; urgency=low * compile with ruby-1.2.1 & mysql-3.22.14 -- takeshi Tue, 17 Nov 1998 11:19:36 +0900 ruby-mysql (2.0-0bo) unstable; urgency=low * Newupstream -- takeshi Tue, 17 Nov 1998 11:19:36 +0900 ruby-mysql (1.0-0bo.2) unstable; urgency=low * link MySQL-3.22.10-beta libmysqlclient.a -- takeshi Fri, 13 Nov 1998 11:19:36 +0900 ruby-mysql (1.0-0bo.1) unstable; urgency=low * Initial Release. -- takeshi Mon, 21 Sep 1998 11:19:36 +0900 debian/compat0000644000000000000000000000000212133040011010345 0ustar 7 debian/patches/0000755000000000000000000000000012133040011010576 5ustar debian/patches/add-basic-encoding-awareness-logic.patch0000644000000000000000000002412212133040011020274 0ustar Description: Add basic encoding aware logic Convert all data to default external encoding . This patch has been adapted for the ruby-mysql Debian package by Antonio Terceiro Author: Loren Segal --- Origin: https://github.com/lsegal/mysql-ruby/commit/b7e4613559f0a741935ad375f07f9411c2107bb7 Bug-Debian: http://bugs.debian.org/678515 Reviewed-By: Antonio Terceiro Last-Update: 2012-08-05 --- ruby-mysql-2.8.2+gem2deb.orig/mysql.c +++ ruby-mysql-2.8.2+gem2deb/mysql.c @@ -42,6 +42,32 @@ #define GetMysqlRes(obj) (Check_Type(obj, T_DATA), ((struct mysql_res*)DATA_PTR(obj))->res) #define GetMysqlStmt(obj) (Check_Type(obj, T_DATA), ((struct mysql_stmt*)DATA_PTR(obj))->stmt) +#ifdef RUBY19 +#include +#define DEFAULT_ENCODING (rb_enc_get(rb_enc_default_external())) +#else +#define DEFAULT_ENCODING NULL +#define rb_enc_str_new(ptr, len, enc) rb_str_new(ptr, len) +#endif + +VALUE +rb_mysql_enc_tainted_str_new(const char *ptr, long len) +{ + VALUE str = rb_enc_str_new(ptr, len, DEFAULT_ENCODING); + + OBJ_TAINT(str); + return str; +} + +VALUE +rb_mysql_enc_tainted_str_new2(const char *ptr) +{ + VALUE str = rb_enc_str_new(ptr, strlen(ptr), DEFAULT_ENCODING); + + OBJ_TAINT(str); + return str; +} + VALUE cMysql; VALUE cMysqlRes; VALUE cMysqlField; @@ -170,7 +196,7 @@ static void mysql_raise(MYSQL* m) VALUE e = rb_exc_new2(eMysql, mysql_error(m)); rb_iv_set(e, "errno", INT2FIX(mysql_errno(m))); #if MYSQL_VERSION_ID >= 40101 - rb_iv_set(e, "sqlstate", rb_tainted_str_new2(mysql_sqlstate(m))); + rb_iv_set(e, "sqlstate", rb_mysql_enc_tainted_str_new2(mysql_sqlstate(m))); #endif rb_exc_raise(e); } @@ -197,9 +223,9 @@ static VALUE make_field_obj(MYSQL_FIELD* if (f == NULL) return Qnil; obj = rb_obj_alloc(cMysqlField); - rb_iv_set(obj, "name", f->name? rb_str_freeze(rb_tainted_str_new2(f->name)): Qnil); - rb_iv_set(obj, "table", f->table? rb_str_freeze(rb_tainted_str_new2(f->table)): Qnil); - rb_iv_set(obj, "def", f->def? rb_str_freeze(rb_tainted_str_new2(f->def)): Qnil); + rb_iv_set(obj, "name", f->name? rb_str_freeze(rb_mysql_enc_tainted_str_new2(f->name)): Qnil); + rb_iv_set(obj, "table", f->table? rb_str_freeze(rb_mysql_enc_tainted_str_new2(f->table)): Qnil); + rb_iv_set(obj, "def", f->def? rb_str_freeze(rb_mysql_enc_tainted_str_new2(f->def)): Qnil); rb_iv_set(obj, "type", INT2NUM(f->type)); rb_iv_set(obj, "length", INT2NUM(f->length)); rb_iv_set(obj, "max_length", INT2NUM(f->max_length)); @@ -286,7 +312,7 @@ static VALUE escape_string(VALUE klass, { VALUE ret; Check_Type(str, T_STRING); - ret = rb_str_new(0, (RSTRING_LEN(str))*2+1); + ret = rb_enc_str_new(0, (RSTRING_LEN(str))*2+1, DEFAULT_ENCODING); rb_str_set_len(ret, mysql_escape_string(RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str))); return ret; } @@ -294,7 +320,7 @@ static VALUE escape_string(VALUE klass, /* client_info() */ static VALUE client_info(VALUE klass) { - return rb_tainted_str_new2(mysql_get_client_info()); + return rb_mysql_enc_tainted_str_new2(mysql_get_client_info()); } #if MYSQL_VERSION_ID >= 32332 @@ -430,7 +456,7 @@ static VALUE real_escape_string(VALUE ob MYSQL* m = GetHandler(obj); VALUE ret; Check_Type(str, T_STRING); - ret = rb_str_new(0, (RSTRING_LEN(str))*2+1); + ret = rb_enc_str_new(0, (RSTRING_LEN(str))*2+1, DEFAULT_ENCODING); rb_str_set_len(ret, mysql_real_escape_string(m, RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str))); return ret; } @@ -469,7 +495,7 @@ static VALUE change_user(int argc, VALUE /* character_set_name() */ static VALUE character_set_name(VALUE obj) { - return rb_tainted_str_new2(mysql_character_set_name(GetHandler(obj))); + return rb_mysql_enc_tainted_str_new2(mysql_character_set_name(GetHandler(obj))); } #endif @@ -534,7 +560,7 @@ static VALUE field_count(VALUE obj) /* host_info() */ static VALUE host_info(VALUE obj) { - return rb_tainted_str_new2(mysql_get_host_info(GetHandler(obj))); + return rb_mysql_enc_tainted_str_new2(mysql_get_host_info(GetHandler(obj))); } /* proto_info() */ @@ -546,14 +572,14 @@ static VALUE proto_info(VALUE obj) /* server_info() */ static VALUE server_info(VALUE obj) { - return rb_tainted_str_new2(mysql_get_server_info(GetHandler(obj))); + return rb_mysql_enc_tainted_str_new2(mysql_get_server_info(GetHandler(obj))); } /* info() */ static VALUE info(VALUE obj) { const char* p = mysql_info(GetHandler(obj)); - return p? rb_tainted_str_new2(p): Qnil; + return p? rb_mysql_enc_tainted_str_new2(p): Qnil; } /* insert_id() */ @@ -588,7 +614,7 @@ static VALUE list_dbs(int argc, VALUE* a n = mysql_num_rows(res); ret = rb_ary_new2(n); for (i=0; i", RSTRING_PTR(n)); return s; } @@ -1257,7 +1283,7 @@ static void mysql_stmt_raise(MYSQL_STMT* { VALUE e = rb_exc_new2(eMysql, mysql_stmt_error(s)); rb_iv_set(e, "errno", INT2FIX(mysql_stmt_errno(s))); - rb_iv_set(e, "sqlstate", rb_tainted_str_new2(mysql_stmt_sqlstate(s))); + rb_iv_set(e, "sqlstate", rb_mysql_enc_tainted_str_new2(mysql_stmt_sqlstate(s))); rb_exc_raise(e); } @@ -1573,7 +1599,7 @@ static VALUE stmt_fetch(VALUE obj) case MYSQL_TYPE_NEWDECIMAL: case MYSQL_TYPE_BIT: #endif - v = rb_tainted_str_new(s->result.bind[i].buffer, s->result.length[i]); + v = rb_mysql_enc_tainted_str_new(s->result.bind[i].buffer, s->result.length[i]); break; default: rb_raise(rb_eTypeError, "unknown buffer_type: %d", s->result.bind[i].buffer_type); @@ -1762,7 +1788,7 @@ static VALUE stmt_send_long_data(VALUE o static VALUE stmt_sqlstate(VALUE obj) { struct mysql_stmt* s = DATA_PTR(obj); - return rb_tainted_str_new2(mysql_stmt_sqlstate(s->stmt)); + return rb_mysql_enc_tainted_str_new2(mysql_stmt_sqlstate(s->stmt)); } /*------------------------------- --- ruby-mysql-2.8.2+gem2deb.orig/test.rb +++ ruby-mysql-2.8.2+gem2deb/test.rb @@ -2,7 +2,7 @@ # $Id: test.rb 250 2010-02-11 10:42:54Z tommy $ require "test/unit" -require "./mysql.o" +require "mysql" class TC_Mysql < Test::Unit::TestCase def setup() @@ -1196,7 +1196,9 @@ class TC_MysqlStmt2 < Test::Unit::TestCa @s.execute assert_equal([nil], @s.fetch) assert_equal([""], @s.fetch) - assert_equal(["abc"], @s.fetch) + row = @s.fetch + assert_equal(Encoding.default_external, row[0].encoding) if RUBY_VERSION =~ /1.9/ + assert_equal(["abc"], row) assert_equal(["def"], @s.fetch) assert_equal(["abc"], @s.fetch) assert_equal(["def"], @s.fetch) @@ -1233,6 +1235,7 @@ class TC_MysqlStmt2 < Test::Unit::TestCa case c when 0 assert_equal([1,"abc",Mysql::Time.new(1970,12,24,23,59,05)], a) + assert_equal(Encoding.default_external, a[1].encoding) if RUBY_VERSION =~ /1.9/ when 1 assert_equal([2,"def",Mysql::Time.new(2112,9,3,12,34,56)], a) when 2 --- ruby-mysql-2.8.2+gem2deb.orig/extconf.rb +++ ruby-mysql-2.8.2+gem2deb/extconf.rb @@ -68,4 +68,6 @@ File.open('error_const.h', 'w') do |f| end end +$CPPFLAGS += " -DRUBY19" if RUBY_VERSION =~ /1.9/ + create_makefile("mysql") debian/patches/series0000644000000000000000000000005112133040011012007 0ustar add-basic-encoding-awareness-logic.patch debian/ruby-test-files.yaml0000644000000000000000000000001012133040011013060 0ustar --- []