Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
The taint mechanism will be deprecated in Ruby 2.7 (brianmario#1083)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kamipo authored and Sneha Somwanshi committed Jan 21, 2020
1 parent bc73887 commit b659e11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/mysql2/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static void rb_mysql_client_mark(void * wrapper) {

static VALUE rb_raise_mysql2_error(mysql_client_wrapper *wrapper) {
VALUE rb_error_msg = rb_str_new2(mysql_error(wrapper->client));
VALUE rb_sql_state = rb_tainted_str_new2(mysql_sqlstate(wrapper->client));
VALUE rb_sql_state = rb_str_new2(mysql_sqlstate(wrapper->client));
VALUE e;

rb_enc_associate(rb_error_msg, rb_utf8_encoding());
Expand Down
2 changes: 1 addition & 1 deletion ext/mysql2/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void rb_raise_mysql2_stmt_error(mysql_stmt_wrapper *stmt_wrapper) {
VALUE e;
GET_CLIENT(stmt_wrapper->client);
VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt_wrapper->stmt));
VALUE rb_sql_state = rb_tainted_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));
VALUE rb_sql_state = rb_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));

rb_encoding *conn_enc;
conn_enc = rb_to_encoding(wrapper->encoding);
Expand Down

0 comments on commit b659e11

Please sign in to comment.