The problem is you're selecting more columns than you assign to variables.
For example
query_sql("SELECT `account_id`, `name` FROM `char`", .@ids, .@names$);
would not produce a warning, but
query_sql("SELECT `account_id`, `name` FROM `char`", .@ids);
will produce a warning as the number of variables does not match the number of columns selected.