Skip to content

Commit 434eb31

Browse files
committed
Grab the wrapper only if it will be used for Encoding
1 parent cab7d2e commit 434eb31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/mysql2/statement.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ static void rb_raise_mysql2_stmt_error(VALUE self) {
5353
rb_encoding *conn_enc;
5454
#endif
5555
GET_STATEMENT(self);
56+
57+
#ifdef HAVE_RUBY_ENCODING_H
5658
{
5759
GET_CLIENT(stmt_wrapper->client);
58-
#ifdef HAVE_RUBY_ENCODING_H
5960
conn_enc = rb_to_encoding(wrapper->encoding);
60-
#endif
6161
}
62+
#endif
6263

6364
rb_raise_mysql2_stmt_error2(stmt_wrapper->stmt
6465
#ifdef HAVE_RUBY_ENCODING_H

0 commit comments

Comments
 (0)