Skip to content

Commit 785969f

Browse files
kamiposodabrew
authored andcommitted
The taint mechanism will be deprecated in Ruby 2.7 (#1083)
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7 and will remove that in Ruby 3. https://bugs.ruby-lang.org/issues/16131 ruby/ruby#2476 In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related functions in the C-API no longer have an effect (all objects are always considered untainted), and are now warned deprecation message.
1 parent db6733a commit 785969f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/mysql2/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static void rb_mysql_client_mark(void * wrapper) {
175175

176176
static VALUE rb_raise_mysql2_error(mysql_client_wrapper *wrapper) {
177177
VALUE rb_error_msg = rb_str_new2(mysql_error(wrapper->client));
178-
VALUE rb_sql_state = rb_tainted_str_new2(mysql_sqlstate(wrapper->client));
178+
VALUE rb_sql_state = rb_str_new2(mysql_sqlstate(wrapper->client));
179179
VALUE e;
180180

181181
rb_enc_associate(rb_error_msg, rb_utf8_encoding());

ext/mysql2/statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void rb_raise_mysql2_stmt_error(mysql_stmt_wrapper *stmt_wrapper) {
4646
VALUE e;
4747
GET_CLIENT(stmt_wrapper->client);
4848
VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt_wrapper->stmt));
49-
VALUE rb_sql_state = rb_tainted_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));
49+
VALUE rb_sql_state = rb_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));
5050

5151
rb_encoding *conn_enc;
5252
conn_enc = rb_to_encoding(wrapper->encoding);

0 commit comments

Comments
 (0)