diff --git a/include/ma_common.h b/include/ma_common.h index 8246eb00..b0229a26 100644 --- a/include/ma_common.h +++ b/include/ma_common.h @@ -78,7 +78,6 @@ struct st_mysql_options_extension { char *server_public_key; char *proxy_header; size_t proxy_header_len; - my_bool auto_local_infile; }; typedef struct st_connection_handler @@ -104,6 +103,7 @@ struct st_mariadb_extension { struct st_mariadb_session_state session_state[SESSION_TRACK_TYPES]; unsigned long mariadb_client_flag; /* MariaDB specific client flags */ unsigned long mariadb_server_capabilities; /* MariaDB specific server capabilities */ + my_bool auto_local_infile; }; #define OPT_EXT_VAL(a,key) \ diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index c1814e8f..971982a7 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -430,12 +430,12 @@ ma_simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg size_t length, my_bool skipp_check, void *opt_arg) { if ((mysql->options.client_flag & CLIENT_LOCAL_FILES) && - mysql->options.extension && mysql->options.extension->auto_local_infile == WAIT_FOR_QUERY && + mysql->options.extension && mysql->extension->auto_local_infile == WAIT_FOR_QUERY && arg && (*arg == 'l' || *arg == 'L') && command == COM_QUERY) { if (strncasecmp(arg, "load", 4) == 0) - mysql->options.extension->auto_local_infile= ACCEPT_FILE_REQUEST; + mysql->extension->auto_local_infile= ACCEPT_FILE_REQUEST; } return mysql->methods->db_command(mysql, command, arg, length, skipp_check, opt_arg); } @@ -1018,8 +1018,8 @@ mysql_init(MYSQL *mysql) if (ENABLED_LOCAL_INFILE != LOCAL_INFILE_MODE_OFF) mysql->options.client_flag|= CLIENT_LOCAL_FILES; - OPT_SET_EXTENDED_VALUE_INT(&mysql->options, auto_local_infile, ENABLED_LOCAL_INFILE == LOCAL_INFILE_MODE_AUTO - ? WAIT_FOR_QUERY : ALWAYS_ACCEPT); + mysql->extension->auto_local_infile= ENABLED_LOCAL_INFILE == LOCAL_INFILE_MODE_AUTO + ? WAIT_FOR_QUERY : ALWAYS_ACCEPT; mysql->options.reconnect= 0; return mysql; error: @@ -2123,10 +2123,10 @@ int mthd_my_read_query_result(MYSQL *mysql) ulong field_count; MYSQL_DATA *fields; ulong length; - my_bool can_local_infile= (mysql->options.extension) && (mysql->options.extension->auto_local_infile != WAIT_FOR_QUERY); + my_bool can_local_infile= (mysql->options.extension) && (mysql->extension->auto_local_infile != WAIT_FOR_QUERY); - if (mysql->options.extension && mysql->options.extension->auto_local_infile == ACCEPT_FILE_REQUEST) - mysql->options.extension->auto_local_infile= WAIT_FOR_QUERY; + if (mysql->options.extension && mysql->extension->auto_local_infile == ACCEPT_FILE_REQUEST) + mysql->extension->auto_local_infile= WAIT_FOR_QUERY; if (!mysql || (length = ma_net_safe_read(mysql)) == packet_error) { @@ -2685,8 +2685,8 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...) mysql->options.client_flag&= ~CLIENT_LOCAL_FILES; if (arg1) { CHECK_OPT_EXTENSION_SET(&mysql->options); - OPT_SET_EXTENDED_VALUE_INT(&mysql->options, auto_local_infile, *(uint*)arg1 == LOCAL_INFILE_MODE_AUTO - ? WAIT_FOR_QUERY : ALWAYS_ACCEPT); + mysql->extension->auto_local_infile= *(uint*)arg1 == LOCAL_INFILE_MODE_AUTO + ? WAIT_FOR_QUERY : ALWAYS_ACCEPT; } break; case MYSQL_INIT_COMMAND: