  def get_records_group
    Log.add_info(request, params.inspect)

    where = ' where Research.status=' + Research::U_STATUS_COMMITTED.to_s

    unless params[:thetisBoxSelKeeper].nil?
      @group_id = params[:thetisBoxSelKeeper].split(':').last
      SqlHelper.validate_token([@group_id])

      group_cons = []

      if @group_id != '0'
        group_cons << SqlHelper.get_sql_like(['User.groups'], "|#{@group_id}|")

        where << ' and (Research.user_id = User.id)'
        where << ' and (' + group_cons.join(' or ') + ')'
      end
    end

    sql = 'select distinct Research.* from researches Research, users User' + where

    @researches = Research.find_by_sql(sql)

    q_hash = Research.get_config_yaml

    unless q_hash.nil? or q_hash.empty?
      @q_codes = q_hash.keys
      @q_codes.delete_if{ |q_code|
            !q_code.instance_of?(String) or q_code.match(/^q\d{2}_\d{2}$/).nil?
          }
      @q_codes.sort!
    end

    render(:partial => 'ajax_statistics_records', :layout => false)
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.