[DRE-commits] [ruby-mysql] 04/08: add-basic-encoding-awareness-logic.patch: rebase
Antonio Terceiro
terceiro at moszumanska.debian.org
Mon Oct 6 11:54:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-mysql.
commit cc473d28cb30289ffabba1793b223aec2f8a2bc8
Author: Antonio Terceiro <terceiro at debian.org>
Date: Mon Oct 6 07:29:31 2014 -0300
add-basic-encoding-awareness-logic.patch: rebase
---
debian/changelog | 2 +
.../add-basic-encoding-awareness-logic.patch | 77 ++++++++--------------
2 files changed, 29 insertions(+), 50 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 9a2b2b3..763a68a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ ruby-mysql (2.9.1-1) UNRELEASED; urgency=medium
* Team upload.
* New upstream release.
+ * debian/patches/add-basic-encoding-awareness-logic.patch: rebase against
+ latest upstream code.
-- Antonio Terceiro <terceiro at debian.org> Sun, 05 Oct 2014 16:04:40 -0300
diff --git a/debian/patches/add-basic-encoding-awareness-logic.patch b/debian/patches/add-basic-encoding-awareness-logic.patch
index 1ca4922..41b7287 100644
--- a/debian/patches/add-basic-encoding-awareness-logic.patch
+++ b/debian/patches/add-basic-encoding-awareness-logic.patch
@@ -12,19 +12,14 @@ Bug-Debian: http://bugs.debian.org/678515
Reviewed-By: Antonio Terceiro <terceiro at debian.org>
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 @@
+--- a/ext/mysql_api/mysql.c
++++ b/ext/mysql_api/mysql.c
+@@ -42,6 +42,27 @@
#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 <ruby/encoding.h>
+#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)
@@ -47,7 +42,7 @@ Last-Update: 2012-08-05
VALUE cMysql;
VALUE cMysqlRes;
VALUE cMysqlField;
-@@ -170,7 +196,7 @@ static void mysql_raise(MYSQL* m)
+@@ -170,7 +191,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
@@ -56,7 +51,7 @@ Last-Update: 2012-08-05
#endif
rb_exc_raise(e);
}
-@@ -197,9 +223,9 @@ static VALUE make_field_obj(MYSQL_FIELD*
+@@ -197,9 +218,9 @@ static VALUE make_field_obj(MYSQL_FIELD*
if (f == NULL)
return Qnil;
obj = rb_obj_alloc(cMysqlField);
@@ -69,7 +64,7 @@ Last-Update: 2012-08-05
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,
+@@ -286,7 +307,7 @@ static VALUE escape_string(VALUE klass,
{
VALUE ret;
Check_Type(str, T_STRING);
@@ -78,7 +73,7 @@ Last-Update: 2012-08-05
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,
+@@ -294,7 +315,7 @@ static VALUE escape_string(VALUE klass,
/* client_info() */
static VALUE client_info(VALUE klass)
{
@@ -87,7 +82,7 @@ Last-Update: 2012-08-05
}
#if MYSQL_VERSION_ID >= 32332
-@@ -430,7 +456,7 @@ static VALUE real_escape_string(VALUE ob
+@@ -430,7 +451,7 @@ static VALUE real_escape_string(VALUE ob
MYSQL* m = GetHandler(obj);
VALUE ret;
Check_Type(str, T_STRING);
@@ -96,7 +91,7 @@ Last-Update: 2012-08-05
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
+@@ -469,7 +490,7 @@ static VALUE change_user(int argc, VALUE
/* character_set_name() */
static VALUE character_set_name(VALUE obj)
{
@@ -105,7 +100,7 @@ Last-Update: 2012-08-05
}
#endif
-@@ -534,7 +560,7 @@ static VALUE field_count(VALUE obj)
+@@ -534,7 +555,7 @@ static VALUE field_count(VALUE obj)
/* host_info() */
static VALUE host_info(VALUE obj)
{
@@ -114,7 +109,7 @@ Last-Update: 2012-08-05
}
/* proto_info() */
-@@ -546,14 +572,14 @@ static VALUE proto_info(VALUE obj)
+@@ -546,14 +567,14 @@ static VALUE proto_info(VALUE obj)
/* server_info() */
static VALUE server_info(VALUE obj)
{
@@ -131,7 +126,7 @@ Last-Update: 2012-08-05
}
/* insert_id() */
-@@ -588,7 +614,7 @@ static VALUE list_dbs(int argc, VALUE* a
+@@ -588,7 +609,7 @@ static VALUE list_dbs(int argc, VALUE* a
n = mysql_num_rows(res);
ret = rb_ary_new2(n);
for (i=0; i<n; i++)
@@ -140,7 +135,7 @@ Last-Update: 2012-08-05
mysql_free_result(res);
return ret;
}
-@@ -633,7 +659,7 @@ static VALUE list_tables(int argc, VALUE
+@@ -633,7 +654,7 @@ static VALUE list_tables(int argc, VALUE
n = mysql_num_rows(res);
ret = rb_ary_new2(n);
for (i=0; i<n; i++)
@@ -149,7 +144,7 @@ Last-Update: 2012-08-05
mysql_free_result(res);
return ret;
}
-@@ -697,7 +723,7 @@ static VALUE my_stat(VALUE obj)
+@@ -697,7 +718,7 @@ static VALUE my_stat(VALUE obj)
const char* s = mysql_stat(m);
if (s == NULL)
mysql_raise(m);
@@ -158,7 +153,7 @@ Last-Update: 2012-08-05
}
/* store_result() */
-@@ -864,7 +890,7 @@ static VALUE set_server_option(VALUE obj
+@@ -864,7 +885,7 @@ static VALUE set_server_option(VALUE obj
static VALUE sqlstate(VALUE obj)
{
MYSQL *m = GetHandler(obj);
@@ -167,7 +162,7 @@ Last-Update: 2012-08-05
}
#endif
-@@ -1029,7 +1055,7 @@ static VALUE fetch_row(VALUE obj)
+@@ -1029,7 +1050,7 @@ static VALUE fetch_row(VALUE obj)
return Qnil;
ary = rb_ary_new2(n);
for (i=0; i<n; i++)
@@ -176,7 +171,7 @@ Last-Update: 2012-08-05
return ary;
}
-@@ -1053,7 +1079,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
+@@ -1053,7 +1074,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
if (colname == Qnil) {
colname = rb_ary_new2(n);
for (i=0; i<n; i++) {
@@ -185,7 +180,7 @@ Last-Update: 2012-08-05
rb_obj_freeze(s);
rb_ary_store(colname, i, s);
}
-@@ -1066,7 +1092,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
+@@ -1066,7 +1087,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
colname = rb_ary_new2(n);
for (i=0; i<n; i++) {
int len = strlen(fields[i].table)+strlen(fields[i].name)+1;
@@ -194,7 +189,7 @@ Last-Update: 2012-08-05
snprintf(RSTRING_PTR(s), len+1, "%s.%s", fields[i].table, fields[i].name);
rb_obj_freeze(s);
rb_ary_store(colname, i, s);
-@@ -1076,7 +1102,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
+@@ -1076,7 +1097,7 @@ static VALUE fetch_hash2(VALUE obj, VALU
}
}
for (i=0; i<n; i++) {
@@ -203,7 +198,7 @@ Last-Update: 2012-08-05
}
return hash;
}
-@@ -1198,7 +1224,7 @@ static VALUE field_hash(VALUE obj)
+@@ -1198,7 +1219,7 @@ static VALUE field_hash(VALUE obj)
static VALUE field_inspect(VALUE obj)
{
VALUE n = rb_iv_get(obj, "name");
@@ -212,7 +207,7 @@ Last-Update: 2012-08-05
sprintf(RSTRING_PTR(s), "#<Mysql::Field:%s>", RSTRING_PTR(n));
return s;
}
-@@ -1257,7 +1283,7 @@ static void mysql_stmt_raise(MYSQL_STMT*
+@@ -1257,7 +1278,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)));
@@ -221,7 +216,7 @@ Last-Update: 2012-08-05
rb_exc_raise(e);
}
-@@ -1573,7 +1599,7 @@ static VALUE stmt_fetch(VALUE obj)
+@@ -1573,7 +1594,7 @@ static VALUE stmt_fetch(VALUE obj)
case MYSQL_TYPE_NEWDECIMAL:
case MYSQL_TYPE_BIT:
#endif
@@ -230,7 +225,7 @@ Last-Update: 2012-08-05
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
+@@ -1762,7 +1783,7 @@ static VALUE stmt_send_long_data(VALUE o
static VALUE stmt_sqlstate(VALUE obj)
{
struct mysql_stmt* s = DATA_PTR(obj);
@@ -239,18 +234,9 @@ Last-Update: 2012-08-05
}
/*-------------------------------
---- 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
+--- a/test/test_mysql.rb
++++ b/test/test_mysql.rb
+@@ -1234,7 +1234,9 @@ class TC_MysqlStmt2 < Test::Unit::TestCa
@s.execute
assert_equal([nil], @s.fetch)
assert_equal([""], @s.fetch)
@@ -261,7 +247,7 @@ Last-Update: 2012-08-05
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
+@@ -1271,6 +1273,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)
@@ -269,12 +255,3 @@ Last-Update: 2012-08-05
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")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-mysql.git
More information about the Pkg-ruby-extras-commits
mailing list